From 5e4aa8e9aba34bb101923685c23f0f6681a12812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 12 Dec 2021 23:29:06 +0100 Subject: Add documenttation for javascript rewrite. --- doc/ref/javascript/components/changelog.texi | 10 +++++ doc/ref/javascript/components/date_time_input.texi | 34 ++++++++++++++++ doc/ref/javascript/components/edit_rrule.texi | 10 +++++ doc/ref/javascript/components/input_list.texi | 16 ++++++++ doc/ref/javascript/components/popup_element.texi | 40 +++++++++++++++++++ .../javascript/components/tab_group_element.texi | 46 ++++++++++++++++++++++ doc/ref/javascript/components/vevent.texi | 23 +++++++++++ doc/ref/javascript/components/vevent_block.texi | 10 +++++ .../javascript/components/vevent_description.texi | 10 +++++ doc/ref/javascript/components/vevent_dl.texi | 11 ++++++ doc/ref/javascript/components/vevent_edit.texi | 9 +++++ 11 files changed, 219 insertions(+) create mode 100644 doc/ref/javascript/components/changelog.texi create mode 100644 doc/ref/javascript/components/date_time_input.texi create mode 100644 doc/ref/javascript/components/edit_rrule.texi create mode 100644 doc/ref/javascript/components/input_list.texi create mode 100644 doc/ref/javascript/components/popup_element.texi create mode 100644 doc/ref/javascript/components/tab_group_element.texi create mode 100644 doc/ref/javascript/components/vevent.texi create mode 100644 doc/ref/javascript/components/vevent_block.texi create mode 100644 doc/ref/javascript/components/vevent_description.texi create mode 100644 doc/ref/javascript/components/vevent_dl.texi create mode 100644 doc/ref/javascript/components/vevent_edit.texi (limited to 'doc/ref/javascript/components') diff --git a/doc/ref/javascript/components/changelog.texi b/doc/ref/javascript/components/changelog.texi new file mode 100644 index 00000000..d14fb84e --- /dev/null +++ b/doc/ref/javascript/components/changelog.texi @@ -0,0 +1,10 @@ +@subsection Changelog + +@deftp {Web Component for VEvent} VEventChangelog +@wcindex +@wcindex vevent-changelog +@anchor{VEventChangelog} +@code{} + +Display of a VEvents changelog. @ref{ChangeLogEntry} +@end deftp diff --git a/doc/ref/javascript/components/date_time_input.texi b/doc/ref/javascript/components/date_time_input.texi new file mode 100644 index 00000000..f26627d2 --- /dev/null +++ b/doc/ref/javascript/components/date_time_input.texi @@ -0,0 +1,34 @@ +@subsection date-time-input + +@deftp {Web Component} DateTimeInput +@wcindex +@wcindex date-time-input +@code {} + +An element for input for date-times. Similar to +@example + + +@end example +But as a single unit. + +@deftypeivar DateTimeInput boolean dateonly +Setting this to true disabled the time part of the input, and makes +any output only have date components (alternativly, the time component +set to zero). +@end deftypeivar + +@defcv {Attribute} DateTimeInput dateonly +Same data as the field dateonly, but as an attribute. Present means +true, absent means false. +@end defcv + +@deftypeivar DateTimeInput Date value +Returns current value as a Date object. +@end deftypeivar + +@deftypeivar DateTimeInput string stringValue +Returns current value as an ISO-8601 formatted string. +@end deftypeivar + +@end deftp diff --git a/doc/ref/javascript/components/edit_rrule.texi b/doc/ref/javascript/components/edit_rrule.texi new file mode 100644 index 00000000..21437863 --- /dev/null +++ b/doc/ref/javascript/components/edit_rrule.texi @@ -0,0 +1,10 @@ +@subsection Edit RRule + +@deftp {Web Component for VEvent} EditRRule +@wcindex +@wcindex vevent-edit-rrule +@code{} + +An edit form for a recurrence rule. Searches its template for elements +with @code{[name="<>"]}, and binds to those. +@end deftp diff --git a/doc/ref/javascript/components/input_list.texi b/doc/ref/javascript/components/input_list.texi new file mode 100644 index 00000000..bdc00ecb --- /dev/null +++ b/doc/ref/javascript/components/input_list.texi @@ -0,0 +1,16 @@ +@subsection input_list.js + +@deftp {Web Component} InputList +@wcindex +@wcindex input-list +@code{} + +A list of identical input fields, which forms a group. For example +useful to handle keywords. + +@deftypeivar DateTimeInput {any[]} value +The value from each element, except the last which should always be empty. +Has an unspecified type, since children:s value field might give non-strings. +@end deftypeivar + +@end deftp diff --git a/doc/ref/javascript/components/popup_element.texi b/doc/ref/javascript/components/popup_element.texi new file mode 100644 index 00000000..2b76b347 --- /dev/null +++ b/doc/ref/javascript/components/popup_element.texi @@ -0,0 +1,40 @@ +@subsection Popup + +@deftp {Web Component for VEvent} PopupElement +@wcindex +@wcindex popup-element +@code{} + +A (small) floating window containing information, which can be dragged +arround. Consists of a navigation bar with a few buttons for +controlling the window, which also works as a drag handle, along with +an area for contents, which can be resized by the user. + +Currently tightly coupled to VEvent's, since their color +profile is derived from their owning events calendar, and they have +action buttons for the event in their navigation bar. + +@deftypecv {Static Member} PopupElement {PopupElement?} activePopup +The popup which was most recently interacted with by the user. Used to +move it on top of all others, as well as sending relevant key events there. +@end deftypecv + +@defcv {Attribute} PopupElement visible +Present is the popup is currently visible, absent otherwise. +@end defcv + +@deftypeivar PopupElement boolean visible +See the attribute of the same name. +@end deftypeivar + +@defmethod PopupElement maximize +Resize the popup window to fill the current viewport (mostly). Is +probably bonud to the maximize button in the navigation bar. +@end defmethod +@end deftp + +@deftypefun PopupElement setup_popup_element VEvent +Create a new popup element for the given VEvent, and ready it for +editing the event. Used when creating event (through the frontend). +The return value can safely be ignored. +@end deftypefun diff --git a/doc/ref/javascript/components/tab_group_element.texi b/doc/ref/javascript/components/tab_group_element.texi new file mode 100644 index 00000000..7d9ca412 --- /dev/null +++ b/doc/ref/javascript/components/tab_group_element.texi @@ -0,0 +1,46 @@ +@subsection Tab Group Element + +@deftp {Web Component for VEvent} TabGroupElement +@wcindex +@wcindex tab-group +@code{} + +A group of tabs, where only one can be visible at a time. + +@c TODO which form does the HTML document have? For CSS purposes + +Each tab consists of two parts, a label which is used for selecting +it, and a tab-element, which contains the actual content. These two +should refer to each other as follows: + +@verbatim ++---------------+ +----------------+ +| TabLabel | | Tab | ++---------------+ +----------------+ +| id |<----| aria-labeledby | +| aria-controls |---->| id | ++---------------+ +----------------+ +@end verbatim + +Further information about tabs in HTML can be found here: +@url{https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role} + +@defvr {CSS Variable} {--tabcount} +Each tab element has the style property @code{--tabcount} set to how +many tabs it has. This is mostly useful to make sure the tab context +is large enough to fit all tab labels without overflowing. +@end defvr + +@deftypemethod TabGroupElement void addTab {HTMLElement} {label: string?} {title: string?} +Adds a new tab to the group. The first parameter will make up the body +of the tab. The label is whath should be shown in the tab selector, +but defaults to the first letter of the text content of the body node. +Title is the hoover text of the label. +@end deftypemethod + +@deftypemethod TabGroupElement void removeTab {HTMLElement} +HTMLElement must be one of the tab bodies in this group. This method +removes it, along with its TabLabel. +@end deftypemethod + +@end deftp diff --git a/doc/ref/javascript/components/vevent.texi b/doc/ref/javascript/components/vevent.texi new file mode 100644 index 00000000..be53a46e --- /dev/null +++ b/doc/ref/javascript/components/vevent.texi @@ -0,0 +1,23 @@ +@subsection vevent + +@deftp {Abstract Web Component} ComponentVEvent {uid: string?} + +@c TODO what is done in the default constructor, +@c and the default connectedCallback + +This registeres itself, but doesn't redraw +We do however redraw in connectedCallback + +@deftypeivar ComponentVEvent uid uid +@end deftypeivar + +@deftypeivar ComponentVEvent {HTMLTemplateElement?} template +@end deftypeivar + +@deftypemethod ComponentVEvent void redraw (data: VEvent) +While abstract for this, @emph{must} be overridden for everyone else +@end deftypemethod +@end deftp + +Note that many of these assume that their initial children are +configured specifically, that is however not completely documented. diff --git a/doc/ref/javascript/components/vevent_block.texi b/doc/ref/javascript/components/vevent_block.texi new file mode 100644 index 00000000..1a0ef160 --- /dev/null +++ b/doc/ref/javascript/components/vevent_block.texi @@ -0,0 +1,10 @@ +@subsection VEvent Block + +@deftp {Web Component for VEvent} ComponentBlock +@wcindex +@wcindex vevent-block +@code{} +A block in our graphical view. + +Unique in that it works quite differently between the week and month view. +@end deftp diff --git a/doc/ref/javascript/components/vevent_description.texi b/doc/ref/javascript/components/vevent_description.texi new file mode 100644 index 00000000..492c8dff --- /dev/null +++ b/doc/ref/javascript/components/vevent_description.texi @@ -0,0 +1,10 @@ +@subsection VEvent Description + +@deftp {Web Component for VEvent} ComponentDescription +@wcindex +@wcindex vevent-description +@code{} + +A text representation of a VEvent. Used as the summary tab of our +popup windows, and in the sidebar. +@end deftp diff --git a/doc/ref/javascript/components/vevent_dl.texi b/doc/ref/javascript/components/vevent_dl.texi new file mode 100644 index 00000000..26bc8fd4 --- /dev/null +++ b/doc/ref/javascript/components/vevent_dl.texi @@ -0,0 +1,11 @@ +@subsection VEvent Description List + +@deftp {Web Component for VEvent} VEventDL +@wcindex +@wcindex vevent-dl +@code{} +A description list of a vevent, used for debugging. + +No guarantees are given about the contents of the data fields, more +than that they are related to the value in question. +@end deftp diff --git a/doc/ref/javascript/components/vevent_edit.texi b/doc/ref/javascript/components/vevent_edit.texi new file mode 100644 index 00000000..67e9f6b3 --- /dev/null +++ b/doc/ref/javascript/components/vevent_edit.texi @@ -0,0 +1,9 @@ +@subsection VEvent Edit + +@deftp {Web Component for VEvent} ComponentEdit +@wcindex +@wcindex vevent-edit +@code{} +Edit form for a vevent, designed for useful human interaction (and +thereby not being all-encompassing). +@end deftp -- cgit v1.2.3