Skip to content

Commit

Permalink
doc: adding missing doc annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
juancho0202 committed Nov 6, 2023
1 parent 590d2a9 commit 1c33500
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 8 deletions.
7 changes: 7 additions & 0 deletions components/compas-loading/src/compas-loading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import { html, LitElement, TemplateResult, property } from "lit-element";
import "@material/mwc-list";
import "@material/mwc-list/mwc-list-item";

/**
* @prop {string} message - The message to display.
* @example <compas-loading message="Custom Loading Message..."></compas-loading>
* @summary Displays a loading message.
* @tagname compas-loading
*/
export class CompasLoadingElement extends LitElement {
/** the message to display. */
@property({ type: String }) message?: string;

render(): TemplateResult {
Expand Down
10 changes: 10 additions & 0 deletions components/compas-open/src/compas-open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ export function newDocRetrievedEvent(
});
}

/**
* @prop {boolean} allowLocalFile - If true, the user can select a local file to open.
* @slot sclTypes - The list of SCL types.
* @slot sclList - The list of SCL documents.
* @slot - The default slot.
* @example <compas-open></compas-open>
* @summary Displays a file selector to open an SCL document and/or a list of SCL documents to open.
* @tagname compas-open
*/
export class CompasOpenElement extends LitElement {
/** if true, the user can select a local file to open. */
@property({ type: Boolean })
allowLocalFile = true;

Expand Down
22 changes: 18 additions & 4 deletions components/compas-scl-list/src/compas-scl-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,32 @@ export function newSclSelectedEvent(docId: string): SclSelectedEvent {
});
}

/**
* @prop {string} type - The type of SCL to retrieve.
* @prop {string} nameSpace - The namespace of the SCL to retrieve.
* @prop {Element[]} items - The list of SCL documents.
* @prop {string[]} labels - The list of labels.
* @prop {string[]} selectedLabels - The list of selected labels.
* @example <compas-scl-list></compas-scl-list>
* @summary Displays a list of SCL documents filterable by labels.
* @tagname compas-scl-list
* @cssprop --mdc-list-side-padding - The padding of the list.
*
*/
export class CompasSclList extends LitElement {
/** the type of SCL to retrieve. */
@property({ type: String })
type?: string;
/** the namespace of the SCL to retrieve. */
@property({ type: String })
nameSpace = "";

/** the list of SCL documents. */
@property({ type: Array })
private items: Element[] | undefined;

/** the list of labels. */
@property({ type: Array })
private labels: string[] = [];

/** the list of selected labels. */
@property({ type: Array })
private selectedLabels: string[] = [];

Expand Down Expand Up @@ -81,7 +95,7 @@ export class CompasSclList extends LitElement {
id="labelsFilter"
multi="true"
?disabled="${this.labels.length <= 0}"
.header="Select"
header="Select"
labels
to
be
Expand Down
10 changes: 9 additions & 1 deletion components/compas-scl-type-list/src/compas-scl-type-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ export function newTypeSelectedEvent(type: string): TypeSelectedEvent {
});
}

/**
* @prop {Element[]} sclTypes - The list of SCL types.
* @prop {string} nameSpace - The namespace of the SCL types.
* @example <compas-scl-type-list></compas-scl-type-list>
* @summary Displays a list of SCL types.
* @tagname compas-scl-type-list
*/
export class CompasSclTypeList extends LitElement {
/** the list of SCL types. */
@property({ type: Array })
sclTypes: Element[] | undefined;

/** the namespace of the SCL types. */
@property({ type: String })
nameSpace = "";

Expand Down
14 changes: 12 additions & 2 deletions components/oscd-filter-button/src/oscd-filter-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,23 @@ import {
}

/**
* A mwc-list with mwc-textfield that filters the list items for given or separated terms
* @prop {string} header - The header of the dialog.
* @prop {string} icon - The icon of the button.
* @prop {boolean} disabled - If true, the button is disabled.
* @slot - The default slot.
* @example <oscd-filter-button></oscd-filter-button>
* @summary Displays a button that opens a dialog with a list filterable by given search terms
* @tagname oscd-filter-button
* @cssprop --mdc-theme-on-surface - The color of the icon.
*/
export class OscdFilterButton extends OscdFilteredList {
/** the header of the dialog. */
@property()
header!: TemplateResult | string;
/** the icon of the button. */
@property()
icon!: string;
/** if true, the button is disabled. */
@property({ type: Boolean })
disabled = false;

Expand Down Expand Up @@ -71,7 +81,7 @@ import {
</mwc-icon-button>
<mwc-dialog
id="filterDialog"
heading="${this.header ? this.header : "Filter"}
heading="${this.header ? this.header : "Filter"}"
scrimClickAction=""
@closing="${() => this.onClosing()}"
>
Expand Down
9 changes: 8 additions & 1 deletion packages/compas-open-plugin/src/compas-open-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,29 @@ import {
export default class CompasOpenMenuPlugin extends LitElement {
@query("mwc-dialog#compas-open-dlg")
dialog!: Dialog;
/** if true, the user can select a local file to open */
@property({ type: Boolean })
allowLocalFile = true;

/** the selected SCL type */
@property({ type: String })
selectedType: string | undefined;
/** the list of SCL types */
@property({ type: Array })
sclTypes!: Element[];
/** the list of SCL documents */
@property({ type: Array })
items: Element[] | undefined;
/** the list of labels */
@property({ type: Array })
labels: string[] = [];
/** the list of selected labels */
@property({ type: Array })
selectedLabels: string[] = [];
/** the locale to use for translations */
@property({ type: String })
locale = "en";

/** Run method to start the plugin. */
async run(): Promise<void> {
this.dialog.show();
}
Expand Down

0 comments on commit 1c33500

Please sign in to comment.