aboutsummaryrefslogtreecommitdiff
path: root/static/ts/components.ts
diff options
context:
space:
mode:
Diffstat (limited to 'static/ts/components.ts')
-rw-r--r--static/ts/components.ts60
1 files changed, 60 insertions, 0 deletions
diff --git a/static/ts/components.ts b/static/ts/components.ts
new file mode 100644
index 00000000..c78b5753
--- /dev/null
+++ b/static/ts/components.ts
@@ -0,0 +1,60 @@
+/**
+ Actuall creation of all web components.
+
+ More text
+
+ @category Web Components
+ @module components
+ */
+
+import { ComponentDescription } from './components/vevent-description'
+import { ComponentEdit } from './components/vevent-edit'
+import { VEventDL } from './components/vevent-dl'
+import { ComponentBlock } from './components/vevent-block'
+import { DateTimeInput } from './components/date-time-input'
+import { PopupElement } from './components/popup-element'
+import { InputList } from './components/input-list'
+import { EditRRule } from './components/edit-rrule'
+import { TabGroupElement } from './components/tab-group-element'
+import { VEventChangelog } from './components/changelog'
+import { SliderInput } from './components/slider'
+import { DateJump } from './components/date-jump'
+
+export { initialize_components }
+
+/**
+ Create web components from all our components.
+
+ The reason each components module doesn't simply initialize its own component
+ is due to some components needing to be initialized AFTER some global
+ variables (see inline comments).
+
+ @TODO
+ Fix the initialization order dependency
+
+ @TODO
+ or otherwise have a static field on each component specifying it's desired name.
+ */
+function initialize_components() {
+ /* These MUST be created AFTER vcal_objcets and event_calendar_mapping are
+ inistialized, since their constructors assume that that piece of global
+ state is available */
+ customElements.define('vevent-description', ComponentDescription);
+ customElements.define('vevent-edit', ComponentEdit);
+ customElements.define('vevent-dl', VEventDL);
+ customElements.define('vevent-block', ComponentBlock);
+ customElements.define('vevent-edit-rrule', EditRRule);
+
+ /* date-time-input should be instansiatable any time, but we do it here
+ becouse why not */
+
+ customElements.define('date-time-input', DateTimeInput /*, { extends: 'input' } */)
+ customElements.define('input-list', InputList);
+ customElements.define('slider-input', SliderInput);
+ customElements.define('date-jump', DateJump);
+
+ /* These maybe also require that the global maps are initialized */
+ customElements.define('popup-element', PopupElement)
+ customElements.define('tab-group', TabGroupElement)
+ customElements.define('vevent-changelog', VEventChangelog);
+}