Repository navigation
feat(xlsx): data validation lists: a dropdown at the cell, other values refused - #67
Alex-Citeroni wants to merge 2 commits into
Conversation
…tside the list refused when typed, set from a dialog, saved - the file's <dataValidations> are read, all of them; a list is understood: values typed in the rule, a range (also of another sheet), a defined name or a formula that gives one, read through the calc engine. The other kinds (whole, decimal, date, time, textLength, custom) are kept as read and written back, not enforced - the selected cell shows a button that opens its list (Alt+Down too: arrows, Enter, Escape); the value picked goes in as one typed does, a date or a percentage showing as one - `xlsx.set` takes `validate: true`, which the view gives for what is typed (in the cell, in the formula bar, Ctrl+Enter): a value outside a list that stops fails with the file's message, nothing changed. Without it every value goes in, as before: a paste, a fill and a replace are not checked. `xlsx.refused` asks without setting, `xlsx.listValues` is the list - `validate` sheet operation and its dialog (toolbar, context menu): a list for the selected cells, edited or taken away. One step of Undo; in a room one operation, which follows the rows and columns moved meanwhile, its source too, and whose Undo leaves the validations others set on other cells - the rules follow rows and columns, also those of the sheet that holds the values, and sheets renamed or deleted - saved in the order of the schema; what a newer Excel keeps in the extension list stays as it is - an operation refused here leaves no step of Undo in a room (a sort over merged cells did) - `XlsxToolbar` takes `onValidation`, optional: without it, it has no Data validation button Not here: enforcing the other kinds, the input message of a rule, a validation copied with its cells, the lists of the extension list, INDIRECT of a defined name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for this, @Alex-Citeroni. It is careful work. I traced these paths and they hold:
One thing has to be fixed before this goes in, and three smaller ones are worth a look. I read the code. I have not run it, and I have not opened a saved file in Excel. To fix before mergeWriting
Two ways to fix it: keep the attribute names as the file wrote them (or write only the attributes Smaller, not blocking
#66 changes eight of the same files, so whichever of the two lands second needs the rebase you mentioned. |
…as them; a refused value stays in its cell - a rule keeps its own element when rows or columns move: the attributes of a newer Excel, rules that do not read - a value the list does not take is back in its cell, to be put right - in a room, what is refused or changes nothing leaves Undo and Redo as they were Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, this was a real one: I reproduced the invalid To fix before merge I took your second option. A rule that was not edited keeps its own XML element, and only its Smaller
The unit suite passes. I still have not opened a saved file in desktop Excel. I will rebase whichever of the two lands second. |
A cell with a list of allowed values (
<dataValidation type="list">) was edited like any other: no dropdown, and any value went in. The selected cell now shows its list, and a value outside it is refused when typed, if the file says so.What it does
<dataValidations>are read. A list can come from values typed in the rule, a range (also of another sheet), a defined name, or a formula that gives a range.xlsx.settakesvalidate: true, which the view gives for what is typed. A value outside a list that stops fails with the file's own message, and nothing changes. Without the option every value goes in, as before.validateis one step of Undo, and one operation in a room. The rules follow rows and columns, also those of the sheet that holds the values, and sheets renamed or deleted.It also fixes a small thing in rooms: an operation refused locally (a sort over merged cells) left a step of Undo that did nothing. Undo and Redo now stay as they were.
XlsxToolbartakesonValidation, optional: without it, it has no Data validation button.Limits
INDIRECTof a defined name, common for dependent dropdowns, gives an empty list and refuses nothing, because the formula engine does not read it.INDIRECTof a cell address works.Tests
Unit tests for reading, refusing, undo, collaboration and the saved XML, and an e2e spec for the dropdown and the dialog. Typecheck and the unit suite (1785) pass. The xlsx e2e suite (65, run with both PRs merged) passes. N1-014 is flaky there, as it is on
mainwithout this change. I have not opened a saved file in desktop Excel.The strings are in English and German. The filter by values is a separate PR. The two are independent, but they touch some of the same files: I will rebase whichever lands second.
🤖 Generated with Claude Code