Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#870 - Add PivotTableRenderer to bold #876

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
wagnerbsantos marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Export Button is missing here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exporting the table will be done in another issue.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/PivotTable/Droppable/Droppable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ export function Droppable<T extends object>(props: DroppableProps<T>) {
)
}
}),
[keyState, accept, filter, keyMapping, name, onKeyNav, deleteByKey]
// eslint-disable-next-line react-hooks/exhaustive-deps
zDudaHang marked this conversation as resolved.
Show resolved Hide resolved
[keyState, accept, keyMapping, name, filter, onKeyNav, deleteByKey]
)

const hasKeys = keyState.length > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const AllTypes = () => {
]

return (
<PivotTableProvider value={{ maxValue, suffix: '' }}>
<PivotTableProvider maxValue={maxValue} suffix={''}>
wagnerbsantos marked this conversation as resolved.
Show resolved Hide resolved
<HFlow hSpacing={0}>
{cellsTypeAndContent.map(({ type, content }, idx) => {
const types = new Set([type])
Expand Down Expand Up @@ -63,7 +63,7 @@ export const EditableType = () => {
const typeEnumValue = select('type', Object.keys(PivotTableCellType), PivotTableCellType.VALUE)

return (
<PivotTableProvider value={{ maxValue, suffix: text('suffix', suffix) }}>
<PivotTableProvider maxValue={maxValue} suffix={text('suffix', suffix)}>
<HFlow hSpacing={0}>
<PivotTableCell
types={new Set([PivotTableCellType[typeEnumValue]])}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PivotTableCellType } from './model'

const createComponent = ({ maxValue, suffix }: PivotTableContextType, props: PivotTableCellProps) => {
return (
<PivotTableProvider value={{ maxValue, suffix }}>
<PivotTableProvider maxValue={maxValue} suffix={suffix}>
<PivotTableCell {...props} />
</PivotTableProvider>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ export interface PivotTableContextType {
suffix?: string
}

interface PivotTableProvider {
value: PivotTableContextType
interface PivotTableProvider extends PivotTableContextType {
children: React.ReactNode
}

export const PivotTableContext = React.createContext<PivotTableContextType>(undefined)

export const PivotTableProvider = (props: PivotTableProvider) => {
const { children, value } = props
const { children, maxValue, suffix } = props

return <PivotTableContext.Provider value={value}>{children}</PivotTableContext.Provider>
return (
<PivotTableContext.Provider value={{ maxValue: maxValue, suffix: suffix }}>{children}</PivotTableContext.Provider>
wagnerbsantos marked this conversation as resolved.
Show resolved Hide resolved
)
}
Loading
Loading