File tree Expand file tree Collapse file tree 4 files changed +29
-30
lines changed
Expand file tree Collapse file tree 4 files changed +29
-30
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @author.io/element-control" ,
3- "version" : " 1.0.13 " ,
3+ "version" : " 1.0.14 " ,
44 "description" : " author-control custom element (web component)." ,
55 "main" : " dist/author-control.min.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -2,7 +2,15 @@ const Demo = new NGNX.VIEW.Registry({
22 selector : '.demo' ,
33 namespace : 'demo.' ,
44
5+ references : {
6+ content : 'main .content'
7+ } ,
8+
9+ templates : {
10+ select : './js/templates/select.html'
11+ } ,
12+
513 init ( ) {
6- console . log ( 'works' ) ;
14+ this . render ( 'select' , { } , this . ref . content . element )
715 }
816} )
Original file line number Diff line number Diff line change 1+ < author-control >
2+ < label > Rendered Select</ label >
3+ < select >
4+ < option > Option 1</ option >
5+ < option > Option 2</ option >
6+ < option > Option 3</ option >
7+ </ select >
8+ </ author-control >
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
77 } )
88
99 this . UTIL . defineProperties ( {
10+ initialized : {
11+ private : true ,
12+ default : false
13+ } ,
14+
1015 initialValue : {
1116 default : null
1217 } ,
@@ -168,8 +173,8 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
168173 break
169174 }
170175
176+ this . PRIVATE . initialized = true
171177 this . emit ( 'initialized' )
172- return console . dir ( this ) ;
173178 } ,
174179
175180 initAuthorDatalist : ( ) => {
@@ -246,34 +251,12 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
246251 }
247252 } )
248253
249- this . UTIL . monitorChildren ( ( mutations , observer ) => {
250- let filtered = mutations . filter ( record => {
251- let node = record . addedNodes . item ( 0 )
252-
253- if ( ! node ) {
254- return false
255- }
256-
257- return node . nodeType !== 3
258- } )
259-
260- filtered . forEach ( ( record , index , array ) => {
261- let node = record . addedNodes . item ( 0 )
262-
263- if ( ! node ) {
264- return
265- }
266-
267- this . PRIVATE . catalogChild ( node )
268- // this.PRIVATE.transformChild(node, index, array.map(mutation => mutation.addedNodes.item(0)))
269- } )
270-
271- observer . disconnect ( )
272- this . PRIVATE . init ( )
273- } )
274-
275254 this . UTIL . registerListeners ( this , {
276- connected : ( ) => this . PRIVATE . guid = this . UTIL . generateGuid ( 'control_' )
255+ connected : ( ) => this . PRIVATE . guid = this . UTIL . generateGuid ( 'control_' ) ,
256+ rendered : ( ) => {
257+ Array . from ( this . children ) . forEach ( child => this . PRIVATE . catalogChild ( child ) )
258+ this . PRIVATE . init ( )
259+ }
277260 } )
278261 }
279262
You can’t perform that action at this time.
0 commit comments