import { UI } from './UI' ; import { PageFlip } from '../PageFlip' ; import { FlipSetting } from '../Settings' ; /**
 * UI for HTML mode
 */ export class HTMLUI extends UI { private items : NodeListOf < HTMLElement > | HTMLElement [ ] ; constructor ( inBlock , app , setting , items ) { super ( inBlock , app , setting ) ; this . wrapper . insertAdjacentHTML ( 'afterbegin' , '<div class="stf__block"></div>' ) ; this . distElement = inBlock . querySelector ( '.stf__block' ) ; this . items = items ; for ( const item of items ) { this . distElement . appendChild ( item ) ; } this . setHandlers ( ) ; } public clear ( ) { for ( const item of this . items ) { this . parentElement . appendChild ( item ) ; } } param { ( NodeListOf < HTMLElement > | HTMLElement [ ] ) } items public updateItems ( items ) { this . removeHandlers ( ) ; this . distElement . innerHTML = '' ; for ( const item of items ) { this . distElement . appendChild ( item ) ; } this . items = items ; this . setHandlers ( ) ; } public update ( ) { this . app . getRender ( ) . update ( ) ; } }