Commit graph

36 commits

Author SHA1 Message Date
Xon
00a328196b Fix remote data e2e test 2024-08-19 10:02:47 +08:00
Xon
7dc8bd168c Notices are trusted and any user data is escaped, simplify notice rendering code, and fix inconsistency in rendering the "press enter to add X" notice. 2024-08-19 09:17:28 +08:00
Xon
5a100e6d7f Prefix build flags with CHOICES_, setup canUseDom to be setable via enviromental variables 2024-08-19 09:06:37 +08:00
Xon
ac88d83381 Use querySelector<HTMLElement>/querySelectorAll<HTMLElement> to type hint the return type as expected 2024-08-19 06:30:38 +08:00
Xon
687895f54c Fix unit tests no supplying the template renderer with the context they are expecting 2024-08-17 20:43:14 +08:00
Xon
fc6f905432 JSDOM support 'ch' character widths 2024-08-17 20:27:52 +08:00
Xon
6733bfc1b8 Fix unit tests 2024-08-17 19:11:49 +08:00
Xon
362d0e5ffc Switch from string literal type to effectively valueOf<NoticeTypes> to intern strings 2024-08-17 02:10:54 +08:00
Xon
0f9e6bc501 Update unit tests 2024-08-16 19:38:43 +08:00
Xon
72528442c7 Rationalize input handling (_onEnterKey/_onInput/_handleChoiceAction). Improve consistancy about when a dropdown is shown, ie have a notice or select items to show. Enter toggles the dropdown open/closed consistantly across different backing element modes 2024-08-16 08:59:32 +08:00
Xon
f66b89a04a typescript is used to type checking 2024-08-15 21:23:11 +08:00
Xon
b92b36d459 Move notice handling into it's own set of functions instead of being spread over the rendering loop, and various input handlers on what leaves a notice around 2024-08-15 21:23:07 +08:00
Xon
5bee41d7ff Remove low-usage functions to byte-shave bundle & other byte-shaving 2024-08-15 20:42:36 +08:00
Xon
f8de8cac44 Bundle byte-shaving 2024-08-15 19:21:21 +08:00
Xon
b4055ec65c Update template unit tests, and groupId being set to "empty" 2024-08-15 17:53:28 +08:00
Xon
00433d200d It isn't the 1990s where 1080p monitors were exotic 2024-08-14 19:53:48 +08:00
Xon
d65a471b67 Fix resetting the store inside a transaction did not defer the listener notification 2024-08-12 18:23:26 +08:00
Xon
88db9639b0 Remove redux store in replace for hand-rolled replacement design for in-place updates of the state. Avoids a lot of data copying, and reduces bundle size 2024-08-12 17:36:17 +08:00
Xon
a335dfcf11 Update tests 2024-08-12 15:26:58 +08:00
Xon
328be8485c Rename txn test 2024-08-12 15:13:40 +08:00
Xon
79eab4c9cb Remove bad test 2024-08-12 14:13:22 +08:00
Xon
4fc4bc44c0 Rename 'loading' state to 'txn' to better match what it is 2024-08-12 14:06:23 +08:00
Xon
3efc69f27c Improve performance of search/filtering with large number of choices by re-using the search index for each character typed.
- The stateless nature of reducers and store listeners being all-or-nothing makes integrating stateful search a poor match
2024-08-12 07:03:39 +08:00
Xon
062b744b64 Fix search results could be unexpectedly unstable, and that fuseOptions.sortFn was effectively ignored #1106 2024-08-12 05:28:05 +08:00
Xon
fa9c3412c5 Fix mutation APIs setChoiceByValue/setChoices/setValue now throw an error the Choices instance was not initialized or multiple choices instances where initialized on the same element. Prevents bad internal states from triggering unexpected errors #1129 2024-08-11 01:19:22 +08:00
Xon
54f1a27162 Update unit tests for search 2024-08-08 17:48:33 +08:00
Xon
9db0c2e672 Update addChoices unit test 2024-08-08 10:30:05 +08:00
Xon
43a9cfb8a3 Update highlightItem/unhighlightItem tests 2024-08-08 10:22:58 +08:00
Xon
8e1f99500d Remove console.log statements, and minor code cleanup 2024-08-08 09:42:43 +08:00
Xon
f6273d10bd Refactor remove choice API and add tests 2024-08-08 09:38:46 +08:00
Xon
c2c3abf76f Update more tests due to internal data shape changes 2024-08-08 00:42:48 +08:00
Xon
2c1d70647e Update various tests to match changed functionality 2024-08-07 23:00:39 +08:00
Xon
7bce16d75e Update various tests, and ensure the seed state can't be modified 2024-08-07 21:59:46 +08:00
Xon
9cba1d96ea Use to.deep.equal for object comparisons 2024-08-07 21:49:42 +08:00
Xon
60f39a48fa Update tests for vitests 2024-08-07 19:02:17 +08:00
Xon
a2f5632829 Remove tests types from distribution files 2024-08-07 15:07:51 +08:00