import * as util from 'ionic/util' import {dom} from 'ionic/util' import {Platform} from 'ionic/platform/platform' let platformMode = Platform.getMode(); // Low-level: how the user will override // BackButton.config.bind.icon.value = 'ion-chevron-right' // BackButton.config._computeDefaultValue(BackButton.config.bind.icon) export class IonicComponent { constructor(ComponentClass, { properties, bind, enhanceRawElement, delegates, propClasses }) { // TODO give errors if not providing valid delegates ComponentClass.config = this this.componentCssName = util.pascalCaseToDashCase(ComponentClass.name) this.properties = properties || (properties = {}); this.bind = bind || (bind = {}) for (let attrName in bind) { let binding = bind[attrName] if (util.isObject(binding)) { binding.property || (binding.property = attrName) this._computeDefaultValue(binding) // TODO recompute defaultValue when user possibly adds a binding } } this.delegates = delegates || (delegates = {}) this.propClasses = propClasses || (propClasses = []); // Whether to support raw element enhancement (for example, supporting