Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support decorators for custom elements metadata #6072

Merged
merged 24 commits into from
Dec 2, 2022

Conversation

ilhan007
Copy link
Member

@ilhan007 ilhan007 commented Nov 21, 2022

The change adds support for Typescript decorators, for defining component's metadata.
Prior to this change, we used to have the static get metadata to define component's metadata. This will keep working for backward compatibility, but using decorators will be recommended from now on:

@customElement("ui5-label")
class Label extends UI5Element {
	/**
	 * Defines the labeled input by providing its ID.
	 * <br><br>
	 * <b>Note:</b> Can be used with both <code>ui5-input</code> and native input.
	 *
	 * @type {string}
	 * @defaultvalue ""
	 * @public
	 */
	@property({ type: String })
	for = "";

	/**
	 * Defines whether colon is added to the component text.
	 * <br><br>
	 * <b>Note:</b> Usually used in forms.
	 * @type {boolean}
	 * @defaultvalue false
	 * @public
	 */
	@property({ type: Boolean })
	showColon = false;
}

@ilhan007 ilhan007 changed the title [experimental] feat: support decorators for custom elements metadata [exp] feat: support decorators for custom elements metadata Nov 22, 2022
@vladitasev vladitasev changed the title [exp] feat: support decorators for custom elements metadata feat: support decorators for custom elements metadata Dec 2, 2022
@ilhan007 ilhan007 merged commit fc9ee6e into main Dec 2, 2022
@ilhan007 ilhan007 deleted the fead-add-decorators branch December 2, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants