import { Context } from '../../../Context' ; import { Component } from 'nano-jsx' ; export interface ApplicationSettingItemProps { context : Context ; } export interface ApplicationSettingItemState { } export class ApplicationSettingItem < props extends ApplicationSettingItemProps , state extends ApplicationSettingItemState > extends Component < props , state > { protected localContext : Context = this . props . context ; switch ( id , value ) { Context . update ( id , value ) ; this . localContext = Context . get ( ) ; this . update ( ) ; } switchNative ( id , value ) { Context . updateNative ( id , value ) ; this . localContext = Context . get ( ) ; this . update ( ) ; } select ( id , element ) { Context . update ( id , element [ element . selectedIndex ] [ 'value' ] ) ; this . localContext = Context . get ( ) ; this . update ( ) ; } selectNative ( id , element ) { Context . updateNative ( id , element [ element . selectedIndex ] [ 'value' ] ) ; this . localContext = Context . get ( ) ; this . update ( ) ; } }