Commit Graph

16 Commits

Author SHA1 Message Date
KernelDeimos 124596058a feat(ui): allow component-based settings tabs 2024-05-30 16:14:32 -04:00
KernelDeimos f8780d032b fix(ui): improve Component base class
The following improvements were made:
- do not require empty object in constructor
- allow components to override render mode based on constructor values
- improve error handling in get()
- allow array of property names in on_ready()->listen()
- allow components to be attached to shadow roots
2024-05-30 16:07:16 -04:00
KernelDeimos e050506a05 Add class registry (second pass)
ExportService gets removed and instead a global class registry is added.
The `init.js` file is split into `init_sync.js` and `init_async.js`
so that synchronous code that isn't dependent on imports is guarenteed
to run before initgui.js. The globalThis scope and service-script API
now expose `def`, a function for registering class definitions, and
`use`, a function for obtaining registered classes.
2024-05-28 19:06:00 -04:00
KernelDeimos 51bac4486f Add class registry (first pass)
In the first pass I add a `register` method and update `defineComponent`
so it calls `register` as well. This made it possible to create a
proof-of-concept for registered classes. Additionally ExportService was
added to expose registered classes to service scripts. This first pass
works, but it would be better if all types of classes (components or
otherwise) were registered via the same method.
2024-05-27 21:16:50 -04:00
Sam Atkins 5b43358219 fix: Only run Component initialization functions once
If the Component gets removed from the DOM and then re-added, it already
has contents, and we don't need to create them again. It also has
already had on_ready called, so that doesn't need to happen again
either.

This fix stops Components duplicating their content elements and
listener callbacks whenever they're moved around the document.
2024-05-10 17:41:01 +01:00
Sam Atkins 1b2608d6ee refactor: Replace component definition boilerplate with a function
Also, we can ask the CustomElementRegistry if it has an entry with a
given name, instead of polluting the window object.
2024-05-08 14:46:58 +01:00
KernelDeimos adbefb4622 Cleanup log messages 2024-05-06 16:44:23 -04:00
KernelDeimos 1592bc44fc Fix spinner getting stuck 2024-05-06 01:30:32 -04:00
KernelDeimos a95fcc96be Add text components and styling 2024-05-06 00:02:46 -04:00
KernelDeimos f9c5a688b1 Fix code entry focus on init 2024-05-06 00:02:46 -04:00
KernelDeimos 3e380ba844 Add otp test endpoint and next wizard step 2024-05-06 00:02:46 -04:00
KernelDeimos 22234ad1c1 Add the wizardy behaviour 2024-05-06 00:02:46 -04:00
KernelDeimos 662fd13548 Add code entry to 2FA wizard 2024-05-06 00:02:46 -04:00
KernelDeimos 0baa678c8b Add Flexer 2024-05-06 00:02:46 -04:00
KernelDeimos c99747d7f2 Make using web components easier 2024-05-06 00:02:46 -04:00
KernelDeimos abc12bd407 Add otp input at login 2024-05-06 00:02:46 -04:00