norma-library 0.6.89 → 0.6.91
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/dist/esm/components/Accordion.js +2 -3
- package/dist/esm/components/Accordion.js.map +1 -1
- package/dist/esm/components/ProgressBar.js +6 -7
- package/dist/esm/components/ProgressBar.js.map +1 -1
- package/dist/esm/components/StatusModal/StatusModal.d.ts +2 -2
- package/dist/esm/components/StatusModal/StatusModal.js.map +1 -1
- package/dist/esm/components/Svgs.js +3 -4
- package/dist/esm/components/Svgs.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.d.ts +4 -0
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.js +120 -0
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.style.d.ts +14 -0
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.style.js +22 -0
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.style.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.d.ts +13 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.js +43 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.style.d.ts +13 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.style.js +9 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.style.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.d.ts +15 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.js +49 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.styles.d.ts +4 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.styles.js +8 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.styles.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/index.d.ts +4 -3
- package/dist/esm/components/UncontrolledTable/components/index.js +4 -3
- package/dist/esm/components/UncontrolledTable/components/index.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.d.ts +11 -0
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.js +18 -0
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.styles.d.ts +1 -0
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.styles.js +5 -0
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.styles.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/row/DraggableRow.js +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/DraggableRow.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/SimpleRow.js +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/SimpleRow.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/styles.d.ts +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/styles.js +2 -8
- package/dist/esm/components/UncontrolledTable/components/row/styles.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/interface.d.ts +30 -13
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabs.d.ts +1 -0
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabs.js +3 -3
- package/dist/esm/components/UncontrolledTabs/UncontrolledTabs.js.map +1 -1
- package/dist/esm/hooks/useClickOutside.js.map +1 -1
- package/dist/esm/hooks/useOutsideScreen.d.ts +7 -0
- package/dist/esm/hooks/useOutsideScreen.js +30 -0
- package/dist/esm/hooks/useOutsideScreen.js.map +1 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Accordion.tsx +19 -15
- package/src/components/ProgressBar.tsx +28 -28
- package/src/components/StatusModal/StatusModal.tsx +2 -2
- package/src/components/Svgs.tsx +1 -5
- package/src/components/UncontrolledTable/{styles.tsx → UncontrolledTable.style.tsx} +2 -1
- package/src/components/UncontrolledTable/{index.tsx → UncontrolledTable.tsx} +76 -88
- package/src/components/UncontrolledTable/components/TableButton/TableButton.style.tsx +49 -0
- package/src/components/UncontrolledTable/components/TableButton/TableButton.tsx +83 -0
- package/src/components/UncontrolledTable/components/header/header.styles.tsx +26 -0
- package/src/components/UncontrolledTable/components/header/header.tsx +85 -0
- package/src/components/UncontrolledTable/components/index.tsx +6 -3
- package/src/components/UncontrolledTable/components/pagination/{index.tsx → pagination.tsx} +1 -1
- package/src/components/UncontrolledTable/components/row/DraggableRow.tsx +11 -11
- package/src/components/UncontrolledTable/components/row/SimpleRow.tsx +7 -8
- package/src/components/UncontrolledTable/components/row/styles.tsx +5 -15
- package/src/components/UncontrolledTable/interface.ts +58 -38
- package/src/components/UncontrolledTabs/UncontrolledTabs.tsx +5 -3
- package/src/hooks/useClickOutside.tsx +9 -9
- package/src/hooks/useOutsideScreen.tsx +35 -0
- package/src/index.ts +1 -1
- package/src/stories/ModalStatus.stories.tsx +8 -0
- package/src/stories/ProductCard.stories.tsx +1 -1
- package/src/stories/UncontrolledTable.stories.tsx +322 -20
- package/src/stories/UncontrolledTabs.stories.tsx +19 -1
- package/src/components/UncontrolledTable/components/header/index.tsx +0 -89
- package/src/components/UncontrolledTable/components/header/styles.tsx +0 -67
- /package/src/components/UncontrolledTable/components/pagination/{styles.tsx → pagination.styles.tsx} +0 -0
|
@@ -1,49 +1,69 @@
|
|
|
1
|
-
import { ColumnDef } from '@tanstack/react-table'
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table'
|
|
2
|
+
import { JSX } from 'react'
|
|
2
3
|
|
|
3
4
|
type Labels = {
|
|
4
|
-
orderAsc: string
|
|
5
|
-
orderDesc: string
|
|
6
|
-
filter: string
|
|
7
|
-
clearFilter: string
|
|
8
|
-
|
|
5
|
+
orderAsc: string
|
|
6
|
+
orderDesc: string
|
|
7
|
+
filter: string
|
|
8
|
+
clearFilter: string
|
|
9
|
+
columns: string
|
|
10
|
+
}
|
|
9
11
|
|
|
10
12
|
interface Pagination {
|
|
11
|
-
pageIndex: number
|
|
12
|
-
pageSize: number
|
|
13
|
+
pageIndex: number
|
|
14
|
+
pageSize: number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Sticky {
|
|
18
|
+
enabled: boolean
|
|
19
|
+
top: number
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface TableList {
|
|
23
|
+
id: string
|
|
24
|
+
label: string
|
|
25
|
+
onClick?: (id: string) => void
|
|
26
|
+
checked?: () => boolean | boolean
|
|
27
|
+
disabled?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface TableButton {
|
|
31
|
+
render: () => JSX.Element
|
|
32
|
+
list?: {
|
|
33
|
+
options: TableList[]
|
|
34
|
+
toggleableList?: boolean
|
|
35
|
+
}
|
|
36
|
+
toggleableList?: boolean
|
|
37
|
+
onClick?: () => void
|
|
13
38
|
}
|
|
14
39
|
|
|
15
40
|
export interface UncontrolledTableProps {
|
|
16
|
-
data: any
|
|
17
|
-
columns: ColumnDef<ColumnsTable>[]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onClearFieldsClick?: () => void;
|
|
36
|
-
onFilterClick?: (column: string) => void;
|
|
37
|
-
onSortClick?: (column: string, direction: string) => void;
|
|
38
|
-
onColumnVisibilityChange?: (columnId: string, isVisible: boolean) => void;
|
|
39
|
-
onDragEnd?: (data: any[]) => void;
|
|
41
|
+
data: any
|
|
42
|
+
columns: ColumnDef<ColumnsTable>[]
|
|
43
|
+
pagination?: Pagination
|
|
44
|
+
totalPages: number
|
|
45
|
+
labels?: Labels
|
|
46
|
+
tableClassName?: string
|
|
47
|
+
sticky?: Sticky
|
|
48
|
+
draggable?: boolean
|
|
49
|
+
buttons?: TableButton[]
|
|
50
|
+
configs?: TableButton[]
|
|
51
|
+
hideColumns?: string[]
|
|
52
|
+
onClick?: () => void
|
|
53
|
+
onMouseOver?: () => void
|
|
54
|
+
onMouseOut?: () => void
|
|
55
|
+
onColumnVisibilityChange?: (column: string, value: boolean) => void
|
|
56
|
+
onChangePage: (pagination: Pagination) => void
|
|
57
|
+
onFilterClick?: (column: string) => void
|
|
58
|
+
onSortClick?: (column: string, direction: string) => void
|
|
59
|
+
onDragEnd?: (data: any[]) => void
|
|
40
60
|
}
|
|
41
61
|
|
|
42
62
|
export interface ColumnsTable {
|
|
43
|
-
header: string
|
|
44
|
-
accessorKey: string
|
|
45
|
-
type: string
|
|
46
|
-
enableColumnFilter: boolean
|
|
47
|
-
filterFn: string
|
|
48
|
-
nofilter?: boolean
|
|
63
|
+
header: string
|
|
64
|
+
accessorKey: string
|
|
65
|
+
type: string
|
|
66
|
+
enableColumnFilter: boolean
|
|
67
|
+
filterFn: string
|
|
68
|
+
nofilter?: boolean
|
|
49
69
|
}
|
|
@@ -13,16 +13,18 @@ interface Props extends MuiTabsBaseProps {
|
|
|
13
13
|
color?: ColorVariant;
|
|
14
14
|
variant?: TabsVariant;
|
|
15
15
|
info?: React.ReactNode;
|
|
16
|
+
tabPanelSx?: SxProps<Theme>;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
interface TabPanelProps {
|
|
19
20
|
children?: React.ReactNode;
|
|
20
21
|
index: number;
|
|
21
22
|
value: number;
|
|
23
|
+
sx?: SxProps<Theme>;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
function TabPanel(props: TabPanelProps) {
|
|
25
|
-
const { children, value, index, ...other } = props;
|
|
27
|
+
const { children, value, index, sx, ...other } = props;
|
|
26
28
|
|
|
27
29
|
return (
|
|
28
30
|
<div
|
|
@@ -32,7 +34,7 @@ function TabPanel(props: TabPanelProps) {
|
|
|
32
34
|
aria-labelledby={`simple-tab-${index}`}
|
|
33
35
|
{...other}
|
|
34
36
|
>
|
|
35
|
-
{value === index && <Box sx={{ p: 3 }}>{children}</Box>}
|
|
37
|
+
{value === index && <Box sx={{ p: 3, ...sx }}>{children}</Box>}
|
|
36
38
|
</div>
|
|
37
39
|
);
|
|
38
40
|
}
|
|
@@ -60,7 +62,7 @@ const UncontrolledTabs = ({ tabs, tab, color = 'primary', onTabChange, info, ...
|
|
|
60
62
|
</NormaTabs>
|
|
61
63
|
</Box>
|
|
62
64
|
{tabs.map((item, key) => (
|
|
63
|
-
<TabPanel {...item.tabPanel?.props} key={key} value={tab} index={key}>
|
|
65
|
+
<TabPanel {...item.tabPanel?.props} key={key} value={tab} index={key} sx={props.tabPanelSx}>
|
|
64
66
|
{item.children}
|
|
65
67
|
</TabPanel>
|
|
66
68
|
))}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useEffect } from 'react'
|
|
1
|
+
import { useEffect } from 'react'
|
|
2
2
|
|
|
3
3
|
const useClickOutside = (ref: React.RefObject<HTMLElement | null>, callback: () => void) => {
|
|
4
4
|
const handleClickOutside = (event: MouseEvent) => {
|
|
5
5
|
if (ref.current && !ref.current.contains(event.target as Node)) {
|
|
6
|
-
callback()
|
|
6
|
+
callback()
|
|
7
7
|
}
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
|
|
10
10
|
useEffect(() => {
|
|
11
|
-
document.addEventListener('mousedown', handleClickOutside)
|
|
11
|
+
document.addEventListener('mousedown', handleClickOutside)
|
|
12
12
|
return () => {
|
|
13
|
-
document.removeEventListener('mousedown', handleClickOutside)
|
|
14
|
-
}
|
|
15
|
-
}, [ref, callback])
|
|
16
|
-
}
|
|
13
|
+
document.removeEventListener('mousedown', handleClickOutside)
|
|
14
|
+
}
|
|
15
|
+
}, [ref, callback])
|
|
16
|
+
}
|
|
17
17
|
|
|
18
|
-
export default useClickOutside
|
|
18
|
+
export default useClickOutside
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState, useEffect, RefObject } from 'react'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook that detects when an element is partially visible in the viewport
|
|
5
|
+
* @param elementRef - Reference to the DOM element to observe
|
|
6
|
+
* @returns boolean indicating if the element is partially visible in the viewport
|
|
7
|
+
*/
|
|
8
|
+
export const usePartiallyVisible = (elementRef: RefObject<HTMLElement | null>): boolean => {
|
|
9
|
+
const [isPartiallyVisible, setIsPartiallyVisible] = useState<boolean>(false)
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const element = elementRef.current
|
|
13
|
+
if (!element) return
|
|
14
|
+
|
|
15
|
+
const observer = new IntersectionObserver(
|
|
16
|
+
([entry]) => {
|
|
17
|
+
// Element is partially visible if it's intersecting but not completely visible
|
|
18
|
+
const isPartial = entry.isIntersecting && entry.intersectionRatio < 1.0
|
|
19
|
+
setIsPartiallyVisible(isPartial)
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
root: null, // Use the viewport as the root
|
|
23
|
+
threshold: [0, 1.0], // Check at these thresholds to determine partial visibility
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
observer.observe(element)
|
|
28
|
+
|
|
29
|
+
return () => {
|
|
30
|
+
if (element) observer.unobserve(element)
|
|
31
|
+
}
|
|
32
|
+
}, [elementRef])
|
|
33
|
+
|
|
34
|
+
return isPartiallyVisible
|
|
35
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ import MultiSelectInput from './components/MultiSelectInput';
|
|
|
25
25
|
import { Title, Text } from './components/Typography';
|
|
26
26
|
import TextInput from './components/TextInput';
|
|
27
27
|
import Table from './components/Table';
|
|
28
|
-
import UncontrolledTable from './components/UncontrolledTable';
|
|
28
|
+
import UncontrolledTable from './components/UncontrolledTable/UncontrolledTable';
|
|
29
29
|
import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
|
|
30
30
|
import { TimeLine, TimeLineData } from './components/TimeLine/TimeLine';
|
|
31
31
|
import { ModalStatus } from './components/StatusModal/StatusModal';
|
|
@@ -61,3 +61,11 @@ export const ModalInfo = () => {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
ModalInfo.storyName = 'Modal Info'
|
|
64
|
+
|
|
65
|
+
export const ModalTextElement = () => {
|
|
66
|
+
return (
|
|
67
|
+
<ModalStatus title="Título" text={<p>Isso é um elemento P dentro da prop text</p>} type="info" actions={actions} />
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
ModalInfo.ModalTextElement = 'Modal Text Element'
|
|
@@ -126,7 +126,7 @@ export const ProductCardGroup = () => (
|
|
|
126
126
|
description="Novas possibilidades de análise de desempenho operacional, elasticidade e segurança."
|
|
127
127
|
color="#FDF6E3"
|
|
128
128
|
icon={{
|
|
129
|
-
iconName: '
|
|
129
|
+
iconName: 'olosJourneyX',
|
|
130
130
|
iconColor: '#B16E4B',
|
|
131
131
|
bgColor: '#F6F07F',
|
|
132
132
|
scale: 'medium',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import UncontrolledTable from '../components/UncontrolledTable'
|
|
3
2
|
import { Button } from '../components/Button'
|
|
4
3
|
import { format } from 'date-fns'
|
|
5
4
|
import CodeIcon from '@mui/icons-material/Code'
|
|
6
5
|
import CreateIcon from '@mui/icons-material/Create'
|
|
6
|
+
import UncontrolledTable from '../components/UncontrolledTable/UncontrolledTable'
|
|
7
|
+
import { TableButton } from '../components/UncontrolledTable/interface'
|
|
7
8
|
|
|
8
9
|
const Template = (args) => {
|
|
9
10
|
return <UncontrolledTable {...args} />
|
|
@@ -379,7 +380,6 @@ export const Default = (args) => {
|
|
|
379
380
|
|
|
380
381
|
localStorage.setItem('hiddenColumns', JSON.stringify(updatedHiddenColumns))
|
|
381
382
|
|
|
382
|
-
console.log('Colunas escondidas:::', updatedHiddenColumns)
|
|
383
383
|
return updatedHiddenColumns
|
|
384
384
|
})
|
|
385
385
|
}
|
|
@@ -393,38 +393,31 @@ export const Default = (args) => {
|
|
|
393
393
|
<UncontrolledTable
|
|
394
394
|
data={data}
|
|
395
395
|
columns={columns}
|
|
396
|
-
showTotalResults
|
|
397
|
-
showSettings
|
|
398
|
-
customIcons={[
|
|
399
|
-
<div key="1" onClick={() => alert('Ícone 1 clicado')}>
|
|
400
|
-
<CodeIcon sx={{ fontSize: 18, color: '#DE8B50' }} />
|
|
401
|
-
</div>,
|
|
402
|
-
<div key="2" onClick={() => alert('Ícone 2 clicado')}>
|
|
403
|
-
<CreateIcon sx={{ fontSize: 18, color: '#DE8B50' }} />
|
|
404
|
-
</div>,
|
|
405
|
-
]}
|
|
406
396
|
onClick={(value) => console.log('onClick line:', value)}
|
|
407
397
|
onMouseOver={(value) => console.log('onMouseOver line:', value)}
|
|
408
398
|
onMouseOut={(value) => console.log('onMouseOut line:', value)}
|
|
409
|
-
onClearFieldsClick={() => console.log('onClearFieldsClick')}
|
|
410
|
-
onFilterClick={(column) => console.log('onFilterClick', column)}
|
|
411
|
-
onChangePage={(pagination) => console.log('onChangePage', pagination)}
|
|
412
|
-
onSortClick={(column, direction) => console.log('onSortClick', column, direction)}
|
|
413
399
|
pagination={{
|
|
414
400
|
pageIndex: 1,
|
|
415
401
|
pageSize: 10,
|
|
416
402
|
}}
|
|
417
403
|
totalPages={10}
|
|
418
|
-
showClearFields
|
|
419
|
-
hideColumns={hiddenColumns}
|
|
420
|
-
onColumnVisibilityChange={handleColumnVisibilityChange}
|
|
421
404
|
labels={{
|
|
422
405
|
orderAsc: 'orderAsc',
|
|
423
406
|
orderDesc: 'orderDesc',
|
|
424
407
|
filter: 'filter',
|
|
425
408
|
clearFilter: 'clearFilter',
|
|
409
|
+
columns: 'Colunas 1',
|
|
426
410
|
}}
|
|
427
|
-
|
|
411
|
+
tableClassName="table"
|
|
412
|
+
sticky={{
|
|
413
|
+
enabled: true,
|
|
414
|
+
top: 0,
|
|
415
|
+
}}
|
|
416
|
+
hideColumns={hiddenColumns}
|
|
417
|
+
onColumnVisibilityChange={handleColumnVisibilityChange}
|
|
418
|
+
onChangePage={(pagination) => console.log('onChangePage', pagination)}
|
|
419
|
+
onFilterClick={(column) => console.log('onFilterClick', column)}
|
|
420
|
+
onSortClick={(column, direction) => console.log('onSortClick', column, direction)}
|
|
428
421
|
{...args}
|
|
429
422
|
/>
|
|
430
423
|
</>
|
|
@@ -724,3 +717,312 @@ export const RowDnd = (args) => {
|
|
|
724
717
|
}
|
|
725
718
|
|
|
726
719
|
RowDnd.args = {}
|
|
720
|
+
|
|
721
|
+
export const ExtraMenu = (args) => {
|
|
722
|
+
const data = [
|
|
723
|
+
{
|
|
724
|
+
date: format(new Date('8-14-2023 21:29'), 'dd/MM/yyyy'),
|
|
725
|
+
duration: 60,
|
|
726
|
+
campaign: 'Campaign 10',
|
|
727
|
+
agent: 'Maggie Leach',
|
|
728
|
+
dnis: 'dnis',
|
|
729
|
+
disposition: 'Disposition 1',
|
|
730
|
+
origin: 'origin',
|
|
731
|
+
id: '1',
|
|
732
|
+
action: (
|
|
733
|
+
<Button
|
|
734
|
+
color="primary"
|
|
735
|
+
disableElevation
|
|
736
|
+
variant="text"
|
|
737
|
+
onClick={() => console.log('click')}
|
|
738
|
+
>
|
|
739
|
+
Editar
|
|
740
|
+
</Button>
|
|
741
|
+
),
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
date: format(new Date('8-13-2023 21:29'), 'dd/MM/yyyy'),
|
|
745
|
+
duration: 60,
|
|
746
|
+
campaign: 'Campaign 2',
|
|
747
|
+
agent: 'Christina Harris',
|
|
748
|
+
ani: 'ani',
|
|
749
|
+
dnis: 'dnis',
|
|
750
|
+
disposition: 'Disposition 2',
|
|
751
|
+
origin: 'origin',
|
|
752
|
+
id: '2',
|
|
753
|
+
action: (
|
|
754
|
+
<Button
|
|
755
|
+
color="primary"
|
|
756
|
+
disableElevation
|
|
757
|
+
variant="text"
|
|
758
|
+
onClick={() => console.log('click')}
|
|
759
|
+
>
|
|
760
|
+
Editar
|
|
761
|
+
</Button>
|
|
762
|
+
),
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
date: format(new Date('8-12-2023 21:29'), 'dd/MM/yyyy'),
|
|
766
|
+
duration: 60,
|
|
767
|
+
campaign: 'Campaign 3',
|
|
768
|
+
agent: 'Alexia Crawford',
|
|
769
|
+
ani: 'ani',
|
|
770
|
+
dnis: 'dnis',
|
|
771
|
+
disposition: 'Disposition 3',
|
|
772
|
+
origin: 'origin',
|
|
773
|
+
id: '3',
|
|
774
|
+
action: (
|
|
775
|
+
<Button
|
|
776
|
+
color="primary"
|
|
777
|
+
disableElevation
|
|
778
|
+
variant="text"
|
|
779
|
+
onClick={() => console.log('click')}
|
|
780
|
+
>
|
|
781
|
+
Editar
|
|
782
|
+
</Button>
|
|
783
|
+
),
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
date: format(new Date('8-11-2023 21:29'), 'dd/MM/yyyy'),
|
|
787
|
+
duration: 60,
|
|
788
|
+
campaign: 'Campaign 4',
|
|
789
|
+
agent: 'Robyn Phillips',
|
|
790
|
+
ani: 'ani',
|
|
791
|
+
dnis: 'dnis',
|
|
792
|
+
disposition: 'Disposition 4',
|
|
793
|
+
origin: 'origin',
|
|
794
|
+
id: '4',
|
|
795
|
+
action: (
|
|
796
|
+
<Button
|
|
797
|
+
color="primary"
|
|
798
|
+
disableElevation
|
|
799
|
+
variant="text"
|
|
800
|
+
onClick={() => console.log('click')}
|
|
801
|
+
>
|
|
802
|
+
Editar
|
|
803
|
+
</Button>
|
|
804
|
+
),
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
date: format(new Date('8-10-2023 21:29'), 'dd/MM/yyyy'),
|
|
808
|
+
duration: 60,
|
|
809
|
+
campaign: 'Campaign 5',
|
|
810
|
+
agent: 'Bruce Robinson',
|
|
811
|
+
ani: 'ani',
|
|
812
|
+
dnis: 'dnis',
|
|
813
|
+
disposition: 'Disposition 5',
|
|
814
|
+
origin: 'origin',
|
|
815
|
+
id: '5',
|
|
816
|
+
action: (
|
|
817
|
+
<Button
|
|
818
|
+
color="primary"
|
|
819
|
+
disableElevation
|
|
820
|
+
variant="text"
|
|
821
|
+
onClick={() => console.log('click')}
|
|
822
|
+
>
|
|
823
|
+
Editar
|
|
824
|
+
</Button>
|
|
825
|
+
),
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
date: format(new Date('8-9-2023 21:29'), 'dd/MM/yyyy'),
|
|
829
|
+
duration: 60,
|
|
830
|
+
campaign: 'Campaign 6',
|
|
831
|
+
agent: 'Sophia Fletcher',
|
|
832
|
+
ani: 'ani',
|
|
833
|
+
dnis: 'dnis',
|
|
834
|
+
disposition: 'Disposition 6',
|
|
835
|
+
origin: 'origin',
|
|
836
|
+
id: '6',
|
|
837
|
+
action: (
|
|
838
|
+
<Button
|
|
839
|
+
color="primary"
|
|
840
|
+
disableElevation
|
|
841
|
+
variant="text"
|
|
842
|
+
onClick={() => console.log('click')}
|
|
843
|
+
>
|
|
844
|
+
Editar
|
|
845
|
+
</Button>
|
|
846
|
+
),
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
date: format(new Date('8-8-2023 21:29'), 'dd/MM/yyyy'),
|
|
850
|
+
duration: 60,
|
|
851
|
+
campaign: 'Campaign 7',
|
|
852
|
+
agent: 'Blanca Roberts',
|
|
853
|
+
ani: 'ani',
|
|
854
|
+
dnis: 'dnis',
|
|
855
|
+
disposition: 'Disposition 7',
|
|
856
|
+
origin: 'origin',
|
|
857
|
+
id: '7',
|
|
858
|
+
action: (
|
|
859
|
+
<Button
|
|
860
|
+
color="primary"
|
|
861
|
+
disableElevation
|
|
862
|
+
variant="text"
|
|
863
|
+
onClick={() => console.log('click')}
|
|
864
|
+
>
|
|
865
|
+
Editar
|
|
866
|
+
</Button>
|
|
867
|
+
),
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
date: format(new Date('8-7-2023 21:29'), 'dd/MM/yyyy'),
|
|
871
|
+
duration: 60,
|
|
872
|
+
campaign: 'Campaign 8',
|
|
873
|
+
agent: 'Peter Warburton',
|
|
874
|
+
ani: 'ani',
|
|
875
|
+
dnis: 'dnis',
|
|
876
|
+
disposition: 'Disposition 8',
|
|
877
|
+
origin: 'origin',
|
|
878
|
+
id: '8',
|
|
879
|
+
action: (
|
|
880
|
+
<Button
|
|
881
|
+
color="primary"
|
|
882
|
+
disableElevation
|
|
883
|
+
variant="text"
|
|
884
|
+
onClick={() => console.log('click')}
|
|
885
|
+
>
|
|
886
|
+
Editar
|
|
887
|
+
</Button>
|
|
888
|
+
),
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
date: format(new Date('8-7-2023 21:29'), 'dd/MM/yyyy'),
|
|
892
|
+
duration: 60,
|
|
893
|
+
campaign: 'Campaign 8',
|
|
894
|
+
agent: 'Peter Warburton',
|
|
895
|
+
ani: 'ani',
|
|
896
|
+
dnis: 'dnis',
|
|
897
|
+
disposition: 'Disposition 8',
|
|
898
|
+
origin: 'origin',
|
|
899
|
+
id: '8',
|
|
900
|
+
action: (
|
|
901
|
+
<Button
|
|
902
|
+
color="primary"
|
|
903
|
+
disableElevation
|
|
904
|
+
variant="text"
|
|
905
|
+
onClick={() => console.log('click')}
|
|
906
|
+
>
|
|
907
|
+
Editar
|
|
908
|
+
</Button>
|
|
909
|
+
),
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
date: format(new Date('8-7-2023 21:29'), 'dd/MM/yyyy'),
|
|
913
|
+
duration: 60,
|
|
914
|
+
campaign: 'Campaign 8',
|
|
915
|
+
agent: 'Peter Warburton',
|
|
916
|
+
ani: 'ani',
|
|
917
|
+
dnis: 'dnis',
|
|
918
|
+
disposition: 'Disposition 8',
|
|
919
|
+
origin: 'origin',
|
|
920
|
+
id: '8',
|
|
921
|
+
action: (
|
|
922
|
+
<Button
|
|
923
|
+
color="primary"
|
|
924
|
+
disableElevation
|
|
925
|
+
variant="text"
|
|
926
|
+
onClick={() => console.log('click')}
|
|
927
|
+
>
|
|
928
|
+
Editar
|
|
929
|
+
</Button>
|
|
930
|
+
),
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
date: format(new Date('8-7-2023 21:29'), 'dd/MM/yyyy'),
|
|
934
|
+
duration: 60,
|
|
935
|
+
campaign: 'Campaign 8',
|
|
936
|
+
agent: 'Peter Warburton',
|
|
937
|
+
ani: 'ani',
|
|
938
|
+
dnis: 'dnis',
|
|
939
|
+
disposition: 'Disposition 8',
|
|
940
|
+
origin: 'origin',
|
|
941
|
+
id: '8',
|
|
942
|
+
action: (
|
|
943
|
+
<Button
|
|
944
|
+
color="primary"
|
|
945
|
+
disableElevation
|
|
946
|
+
variant="text"
|
|
947
|
+
onClick={() => console.log('click')}
|
|
948
|
+
>
|
|
949
|
+
Editar
|
|
950
|
+
</Button>
|
|
951
|
+
),
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
date: format(new Date('8-7-2023 21:29'), 'dd/MM/yyyy'),
|
|
955
|
+
duration: 60,
|
|
956
|
+
campaign: 'Campaign 8',
|
|
957
|
+
agent: 'Peter Warburton',
|
|
958
|
+
ani: 'ani',
|
|
959
|
+
dnis: 'dnis',
|
|
960
|
+
disposition: 'Disposition 8',
|
|
961
|
+
origin: 'origin',
|
|
962
|
+
id: '8',
|
|
963
|
+
action: (
|
|
964
|
+
<Button
|
|
965
|
+
color="primary"
|
|
966
|
+
disableElevation
|
|
967
|
+
variant="text"
|
|
968
|
+
onClick={() => console.log('click')}
|
|
969
|
+
>
|
|
970
|
+
Editar
|
|
971
|
+
</Button>
|
|
972
|
+
),
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
date: format(new Date('8-7-2023 21:29'), 'dd/MM/yyyy'),
|
|
976
|
+
duration: 60,
|
|
977
|
+
campaign: 'Campaign 8',
|
|
978
|
+
agent: 'Peter Warburton',
|
|
979
|
+
ani: 'ani',
|
|
980
|
+
dnis: 'dnis',
|
|
981
|
+
disposition: 'Disposition 8',
|
|
982
|
+
origin: 'origin',
|
|
983
|
+
id: '8',
|
|
984
|
+
action: (
|
|
985
|
+
<Button
|
|
986
|
+
color="primary"
|
|
987
|
+
disableElevation
|
|
988
|
+
variant="text"
|
|
989
|
+
onClick={() => console.log('click')}
|
|
990
|
+
>
|
|
991
|
+
Editar
|
|
992
|
+
</Button>
|
|
993
|
+
),
|
|
994
|
+
},
|
|
995
|
+
]
|
|
996
|
+
|
|
997
|
+
const menus: TableButton[] = [
|
|
998
|
+
{
|
|
999
|
+
render: () => <span>Menu</span>,
|
|
1000
|
+
onClick: () => console.log('Menu clicked'),
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
render: () => <span>Agrupar</span>,
|
|
1004
|
+
list: {
|
|
1005
|
+
options: [
|
|
1006
|
+
{
|
|
1007
|
+
id: 'groupByCampaign',
|
|
1008
|
+
label: 'Agrupar por campanha',
|
|
1009
|
+
onClick: (id) => console.log('Agrupar por campanha', id),
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
id: 'groupByDate',
|
|
1013
|
+
label: 'Agrupar por data',
|
|
1014
|
+
onClick: (id) => console.log('Agrupar por data', id),
|
|
1015
|
+
},
|
|
1016
|
+
],
|
|
1017
|
+
},
|
|
1018
|
+
},
|
|
1019
|
+
]
|
|
1020
|
+
|
|
1021
|
+
return (
|
|
1022
|
+
<>
|
|
1023
|
+
<UncontrolledTable data={data} columns={columns} buttons={menus} configs={menus} />
|
|
1024
|
+
</>
|
|
1025
|
+
)
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
ExtraMenu.args = {}
|
|
@@ -76,4 +76,22 @@ export const UncontrolledTabsInfo = () => {
|
|
|
76
76
|
)
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
UncontrolledTabsInfo.storyName = 'Uncontrolled Tabs With Info'
|
|
79
|
+
UncontrolledTabsInfo.storyName = 'Uncontrolled Tabs With Info';
|
|
80
|
+
|
|
81
|
+
export const UncontrolledTabsAndTabPanelSx = () => {
|
|
82
|
+
const [tab, setTab] = useState(0);
|
|
83
|
+
return (
|
|
84
|
+
<div style={{ width: '480px', marginBottom: 30 }}>
|
|
85
|
+
<UncontrolledTabs
|
|
86
|
+
info={<div>tabPanelSx permite estilizar a tab</div>}
|
|
87
|
+
tab={tab}
|
|
88
|
+
tabs={data}
|
|
89
|
+
onTabChange={(evt, tab) => setTab(tab)}
|
|
90
|
+
tabPanelSx={{ backgroundColor: 'gray', color: 'orange', p: 0 }}
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
UncontrolledTabsAndTabPanelSx.storyName = 'Uncontrolled Tabs With Info and tabPanelSx';
|
|
97
|
+
|