Recreation of wesbos Javascript30 in React with Typescript.
add header alignment
make easel extend mini-cache
clean up styles
args: Pick<BaseDrawArgs, "rect" | "ctx" | "theme">,
data: string,
contentAlign?: BaseGridCell["contentAlign"],
allowWrapping?: boolean,
hyperWrapping?: boolean
)```
Here are the props for drawTextCell. It's exported to use, but it's somewhat difficult to type args.
BaseDrawArgs isn't exported, but I tried using it anyways and I can't get my args to match. Can you create a type def for args and export it?
Thank you
I can make an example if needed but wanted to get this posted since I found it a week ago.
If you zoom the browser over 100%, header drawing scaling is messed up by a factor of 2 in several dimensions.
Here is my adjustment code:
const { x, y, width, height } = rect;
const zoomed = window.devicePixelRatio > 1;
const zoomFactor = zoomed ? 2 : 1;
const stateSet = stateHistory.find((state) => state.key === id);
const isSorted = stateSet !== undefined;
const sortState = stateSet?.state || SORT_STATES.initial;
const image = getHeaderSortImage({
isSorted,
sortState,
backgroundColor: headerThemePriority(headerProps),
fillColor: theme.textHeaderSelected,
zoomed,
});
const pos = positioner({
containerWidth: width,
containerHeight: zoomFactor * height,
itemWidth: image.width,
itemHeight: image.height,
position: 'midRight',
padding: theme.cellHorizontalPadding,
});
ctx.putImageData(image, zoomFactor * (pos.x + x), pos.y + y);
If const zoomed = window.devicePixelRatio > 1;
is true, then I have to multiply my container height by 2 and change my draw x position by a factor of 2.
This happens every 100% increase, so when you hit 210%, the factor is off again. I've only compensated for 110-200.
Let me know if you need a demo created.
adjust types
adjust cell types and setup onItemClicked
refactor column generation
add extends object to generics
add extends object to generics
add getRow to page-manager
Remove row cache again
remove row-cache from grid-manager for now
commet row-cache
Add page manager
add filter types/utils
split sort map back out
set up filter generation and filter-manager
add filters
more filter work
more column management stuff into Columns
move functionality back into cell-cache
move functionality back into table-sorter
setup toggle columns
setup toggle columns
setup toggle columns
checkpoint
remove row-cache
add data swapping+adding
make SortStateMachine take StateHistory array in constructor
Refactor example
Add mini cache
fix sorting on filtered column headers
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
simplify row manager
make hidden columns work
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
get column filtering+sorting working
remove use-sort-state-machine
remove hook
move statemachine into rows
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
checkpoint
finish refactoring into rows
remove use-sort
Checkpoint
Revert "Checkpoint"
This reverts commit dd4f0abc8a60ef7b77e8be1a38d38d6b701893e9.
finish translator refactor
add rows class
checkpoint
checkpoint
finish translator refactor