src/Widget.js
/**
         * Applies data attribute settings and defaults to the widget configuration
         * @private
         */
Applies data attribute settings and defaults to the widget configuration
@private
Applies data attribute settings and defaults to the widget configuration @private
_applyConfiguration() {
            const data = this.getDataAttributes();
            const settings = this.getSettings();
            Object
                .keys(data)
                .forEach((key) => {
                    let normalizedKey = key.replace(DATA_REPLACE_PATTERN, '_');
                    let val = data[key];
                    if (settings[normalizedKey]) val = settings[normalizedKey].value(val, false);
                    if (!okanjo.util.isEmpty(val)) {
                        this.config[normalizedKey] = val;
                    }
                })
            ;
            Object.keys(settings).forEach((key) => {
                if (this.config[key] === undefined && settings[key]._default !== undefined) {
                    this.config[key] = settings[key].value(undefined, false);
                }
            });
        }
_applyConfiguration ( ) { const data = this . getDataAttributes ( ) ; const settings = this . getSettings ( ) ; Object . keys ( data ) . forEach ( ( key ) => { let normalizedKey = key . replace ( DATA_REPLACE_PATTERN , '_' ) ; let val = data [ key ] ; if ( settings [ normalizedKey ] ) val = settings [ normalizedKey ] . value ( val , false ) ; if ( ! okanjo . util . isEmpty ( val ) ) { this . config [ normalizedKey ] = val ; } } ) ; Object . keys ( settings ) . forEach ( ( key ) => { if ( this . config [ key ] === undefined && settings [ key ] . _default !== undefined ) { this . config [ key ] = settings [ key ] . value ( undefined , false ) ; } } ) ; }
Applies data attribute settings and defaults to the widget configuration
 @private
Applies data attribute settings and defaults to the widget configuration @private
// this.config was set to the options provided in the constructor // so layer data attributes on top // Attempt to convert the value if there's a setting for it // Apply defaults from the widget settings