MCPcopy
hub / github.com/UI5/webcomponents / customElement

Function customElement

packages/base/src/decorators/customElement.ts:12–114  ·  view source on GitHub ↗
(tagNameOrComponentSettings: string | {
	/**
	 * The tag name of the custom element (will be suffixed if the scoping feature is used).
	 */
	tag?: string,
	/**
	 * The renderer of the custom element - officially supported are: jsxRenderer and litRender (deprecated).
	 */
	renderer?: Renderer,
	/**
	 * The styles to be injected into the shadow root of the custom element.
	 */
	styles?: Styles,
	/**
	 * The template function of the custom element - must match the renderer.
	 */
	template?: Template,
	/**
	 * Other custom elements used in the shadow root of the custom element.
	 * @deprecated no longer necessary for jsxRenderer-enabled components
	 */
	dependencies?: Array<typeof UI5Element>,
	/**
	 * Whether the custom element should be re-rendered when the language changes.
	 */
	languageAware?: boolean,
	/**
	 * Whether the custom element should be re-rendered when the theme changes.
	 */
	themeAware?: boolean,
	/**
	 * Whether the custom element needs the CLDR assets.
	 */
	cldr?: boolean,
	/**
	 * Whether the custom element supports the F6 Fast navigation feature (is a fast-navigation group).
	 */
	fastNavigation?: boolean,
	/**
	 * Whether the custom element is form-associated and implements form-relevant features.
	 */
	formAssociated?: boolean,
	/**
	 * The shadow root options of the custom element.
	 */
	shadowRootOptions?: Partial<ShadowRootInit>,
	/**
	 * A list of all features, supported by the custom element.
	 * @deprecated no longer necessary for jsxRenderer-enabled components
	 */
	features?: Array<string>,
} = {})

Source from the content-addressed store, hash-verified

10 * @returns { ClassDecorator }
11 */
12const customElement = (tagNameOrComponentSettings: string | {
13 /**
14 * The tag name of the custom element (will be suffixed if the scoping feature is used).
15 */
16 tag?: string,
17 /**
18 * The renderer of the custom element - officially supported are: jsxRenderer and litRender (deprecated).
19 */
20 renderer?: Renderer,
21 /**
22 * The styles to be injected into the shadow root of the custom element.
23 */
24 styles?: Styles,
25 /**
26 * The template function of the custom element - must match the renderer.
27 */
28 template?: Template,
29 /**
30 * Other custom elements used in the shadow root of the custom element.
31 * @deprecated no longer necessary for jsxRenderer-enabled components
32 */
33 dependencies?: Array<typeof UI5Element>,
34 /**
35 * Whether the custom element should be re-rendered when the language changes.
36 */
37 languageAware?: boolean,
38 /**
39 * Whether the custom element should be re-rendered when the theme changes.
40 */
41 themeAware?: boolean,
42 /**
43 * Whether the custom element needs the CLDR assets.
44 */
45 cldr?: boolean,
46 /**
47 * Whether the custom element supports the F6 Fast navigation feature (is a fast-navigation group).
48 */
49 fastNavigation?: boolean,
50 /**
51 * Whether the custom element is form-associated and implements form-relevant features.
52 */
53 formAssociated?: boolean,
54 /**
55 * The shadow root options of the custom element.
56 */
57 shadowRootOptions?: Partial<ShadowRootInit>,
58 /**
59 * A list of all features, supported by the custom element.
60 * @deprecated no longer necessary for jsxRenderer-enabled components
61 */
62 features?: Array<string>,
63} = {}): ClassDecorator => {
64 return (target: any) => {
65 if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
66 target.metadata = {};
67 }
68
69 if (typeof tagNameOrComponentSettings === "string") {

Callers 15

TableCellClass · 0.85
TableGroupRowClass · 0.85
TableRowClass · 0.85
TableColumnClass · 0.85
TableClass · 0.85
DropIndicatorClass · 0.85
SplitButtonClass · 0.85
TableVirtualizerClass · 0.85
CheckBoxClass · 0.85
CalendarPartClass · 0.85
ButtonClass · 0.85
SelectClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected