Closed Fluglow closed 3 months ago
Here is my opinion on this and why I think this is problematic:
cellData
Sheet
containing SheetHolder
when the hierarchy should be the other way around.SheetHolder
holding cellData
when we expect it to hold Sheet
.SheetHolder
holding LightSheet
when we expect to hold Sheet
.Sheet
and SheetHolder
while SheetHolder
should only be necessary when evaluating expression.My suggestion, would be to go back to something similar to the structure we agreed on:
sheetHolder
holding sheet EvaluationContext
which a LightSheet
level object that encapsulate expressionHandler
and the logic of evaluating math, and contains sheetHolder
I know this might be a big change from what you did, but I have to give my opinion.
@Yousif-FJ
I think your proposals should be implementable from this. I chose this easier route since separating logic from Sheet
proved to be quite tricky, but it should be easier from this stage. The main issue was that we want to keep most methods private in Sheet
, and separating logic easily leads to having to call these internal methods from elsewhere.
SheetHolder
containing cellData
is akin to the structure of having a separate DataManager
, but they are just combined now. I again see the benefit of holding cellData
separate from Sheet
, since cell information doesn't need to be indexed by anything else (holding it in Sheet
is essentially indexing by SheetKey
). Cell
objects are also cross-sheet by nature as they can hold keys from multiple different sheets, so having them in a broader context seems more correct.
This excellent work @Fluglow
When i try to refer to a sheet that does not exist. it show show an error just like in excel. instead it is clearing the field
Closes #101
SheetHolder
SheetHolder
as a singleton stored in the window objectLightsheet
objects inSheetHolder
-> don't allowSheet
objects to exist withoutLightsheet
SheetHolder
would otherwise need to track bothLightsheet
objects and "unattached"Sheet
objectsSheet / ExpressionHandler
=SheetName!A1
)SheetKey
and add it to types used in expression parsing and cell reference handlingSheet
, thatSheet
is responsible for updating all otherSheet
objectscellData
toSheetHolder
CellKeys
are independentLightsheet
LightsheetOptions
, default null data to[]
Lightsheet
to be instantiated without UIRefactoring
{ columnPosition, rowPosition }
shared asCoordinate
inutils/common.types.ts
utils
folder undersrc