SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.48k stars 254 forks source link

[Feature Request]: Introduce query decorator #6743

Open g-cheishvili opened 1 year ago

g-cheishvili commented 1 year ago

Feature Request Description

Introduce a @query decorator because every time component needs to query it's child elements, same pattern is written

get titleTextDOM() {
  return this.shadowRoot!.querySelector<HTMLElement>(".ui5-nli-title-text");
}

or something along the lines. This leads to repetitive code and a lot of the noise

Proposed Solution

One decorator, which receives either string or Ui5Element, which will set a getter with similar thing that Is above

Proposed Alternatives

No response

Additional Context

No response

Priority

Medium

Privacy Policy

g-cheishvili commented 1 year ago

Nice, and I tagged someone :D sorry @query for bothering, did not mean to