File tree 3 files changed +19
-22
lines changed
3 files changed +19
-22
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ class UI5Element extends HTMLElement {
217
217
}
218
218
219
219
static get observedAttributes ( ) {
220
- const observedProps = this . getMetadata ( ) . getObservedProps ( ) ;
220
+ const observedProps = this . getMetadata ( ) . getPublicPropsList ( ) ;
221
221
return observedProps . map ( camelToKebabCase ) ;
222
222
}
223
223
@@ -268,8 +268,8 @@ class UI5Element extends HTMLElement {
268
268
}
269
269
270
270
_upgradeAllProperties ( ) {
271
- const observedProps = this . constructor . getMetadata ( ) . getObservedProps ( ) ;
272
- observedProps . forEach ( this . _upgradeProperty . bind ( this ) ) ;
271
+ const allProps = this . constructor . getMetadata ( ) . getPropsList ( ) ;
272
+ allProps . forEach ( this . _upgradeProperty . bind ( this ) ) ;
273
273
}
274
274
275
275
static define ( ) {
Original file line number Diff line number Diff line change @@ -17,11 +17,12 @@ class UI5ElementMetadata {
17
17
return this . metadata . defaultSlot || "content" ;
18
18
}
19
19
20
- getObservedProps ( ) {
21
- const properties = this . getProperties ( ) ;
22
- const allProps = Object . keys ( properties ) ;
23
- const observedProps = allProps . filter ( UI5ElementMetadata . isPublicProperty ) ;
24
- return observedProps ;
20
+ getPropsList ( ) {
21
+ return Object . keys ( this . getProperties ( ) ) ;
22
+ }
23
+
24
+ getPublicPropsList ( ) {
25
+ return this . getPropsList ( ) . filter ( UI5ElementMetadata . isPublicProperty ) ;
25
26
}
26
27
27
28
getSlots ( ) {
@@ -99,7 +100,16 @@ const validateSingleSlot = (value, slotData) => {
99
100
const slottedNodes = getSlottedNodes ( value ) ;
100
101
slottedNodes . forEach ( el => {
101
102
if ( ! ( el instanceof propertyType ) ) {
102
- throw new Error ( `${ el } is not of type ${ propertyType } ` ) ;
103
+ const isHTMLElement = el instanceof HTMLElement ;
104
+ const tagName = isHTMLElement && el . tagName . toLowerCase ( ) ;
105
+ const isCustomElement = isHTMLElement && tagName . includes ( "-" ) ;
106
+ if ( isCustomElement ) {
107
+ window . customElements . whenDefined ( tagName ) . then ( ( ) => {
108
+ if ( ! ( el instanceof propertyType ) ) {
109
+ throw new Error ( `${ el } is not of type ${ propertyType } ` ) ;
110
+ }
111
+ } ) ;
112
+ }
103
113
}
104
114
} ) ;
105
115
Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ import ListItemBase from "./ListItemBase.js";
9
9
import ListMode from "./types/ListMode.js" ;
10
10
import ListSeparators from "./types/ListSeparators.js" ;
11
11
import ListItemType from "./types/ListItemType.js" ;
12
- import StandardListItem from "./StandardListItem.js" ;
13
- import CustomListItem from "./CustomListItem.js" ;
14
- import GroupHeaderListItem from "./GroupHeaderListItem.js" ;
15
12
// Template
16
13
import ListRenderer from "./build/compiled/ListRenderer.lit.js" ;
17
14
@@ -589,16 +586,6 @@ class List extends UI5Element {
589
586
} ,
590
587
} ;
591
588
}
592
-
593
- static async define ( ...params ) {
594
- await Promise . all ( [
595
- StandardListItem . define ( ) ,
596
- CustomListItem . define ( ) ,
597
- GroupHeaderListItem . define ( ) ,
598
- ] ) ;
599
-
600
- super . define ( ...params ) ;
601
- }
602
589
}
603
590
604
591
Bootstrap . boot ( ) . then ( _ => {
You can’t perform that action at this time.
0 commit comments