From 73672d736fcdbaff6946e0e412b65d0aef79409e Mon Sep 17 00:00:00 2001 From: Genadi Sokolov Date: Mon, 15 Feb 2016 02:55:23 +0200 Subject: [PATCH] chore (all) release --- dist/amd/index.js.map | 2 +- dist/amd/mdl.js | 92 +++++++++++++++----------------------- dist/amd/mdl.js.map | 2 +- dist/commonjs/index.js.map | 2 +- dist/commonjs/mdl.js | 92 +++++++++++++++----------------------- dist/commonjs/mdl.js.map | 2 +- dist/es6/mdl.js | 11 +++-- dist/system/index.js.map | 2 +- dist/system/mdl.js | 92 +++++++++++++++----------------------- dist/system/mdl.js.map | 2 +- 10 files changed, 124 insertions(+), 175 deletions(-) diff --git a/dist/amd/index.js.map b/dist/amd/index.js.map index 8cc944a..8a40e49 100644 --- a/dist/amd/index.js.map +++ b/dist/amd/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;AACO,WAAS,SAAS,CAAC,MAAM,EAAE;AAChC,UAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;GACjC","file":"index.js","sourcesContent":["\r\nexport function configure(config) {\r\n config.globalResources('./mdl');\r\n}\r\n\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;AACO,WAAS,SAAS,CAAC,MAAM,EAAE;AAChC,UAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;GACjC","file":"index.js","sourcesContent":["\nexport function configure(config) {\n config.globalResources('./mdl');\n}\n\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/amd/mdl.js b/dist/amd/mdl.js index 4ba6d22..ae11243 100644 --- a/dist/amd/mdl.js +++ b/dist/amd/mdl.js @@ -118,33 +118,15 @@ define(['exports', 'aurelia-framework', 'encapsulated-mdl', 'aurelia-event-aggre _encapsulatedMdl.componentHandler.upgradeElement(element, 'MaterialRipple'); } - if (element.MaterialIconToggle) { + if (element.MaterialIconToggle || element.MaterialCheckbox) { var children = element.children; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var child = _step.value; - + if (children) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; if (child.classList.contains('mdl-js-ripple-effect')) { _encapsulatedMdl.componentHandler.upgradeElement(child, 'MaterialRipple'); } } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator['return']) { - _iterator['return'](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } } } } @@ -157,75 +139,75 @@ define(['exports', 'aurelia-framework', 'encapsulated-mdl', 'aurelia-event-aggre var js = _ref.js; if (html) { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; try { - for (var _iterator2 = html[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var h = _step2.value; + for (var _iterator = html[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var h = _step.value; element.classList.add(h); } } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; + _didIteratorError = true; + _iteratorError = err; } finally { try { - if (!_iteratorNormalCompletion2 && _iterator2['return']) { - _iterator2['return'](); + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); } } finally { - if (_didIteratorError2) { - throw _iteratorError2; + if (_didIteratorError) { + throw _iteratorError; } } } } - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; try { - for (var _iterator3 = js[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var t = _step3.value; + for (var _iterator2 = js[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var t = _step2.value; _encapsulatedMdl.componentHandler.upgradeElement(element, t); } } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; + _didIteratorError2 = true; + _iteratorError2 = err; } finally { try { - if (!_iteratorNormalCompletion3 && _iterator3['return']) { - _iterator3['return'](); + if (!_iteratorNormalCompletion2 && _iterator2['return']) { + _iterator2['return'](); } } finally { - if (_didIteratorError3) { - throw _iteratorError3; + if (_didIteratorError2) { + throw _iteratorError2; } } } - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; try { - for (var _iterator4 = fct[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var f = _step4.value; + for (var _iterator3 = fct[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var f = _step3.value; f(element); } } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; + _didIteratorError3 = true; + _iteratorError3 = err; } finally { try { - if (!_iteratorNormalCompletion4 && _iterator4['return']) { - _iterator4['return'](); + if (!_iteratorNormalCompletion3 && _iterator3['return']) { + _iterator3['return'](); } } finally { - if (_didIteratorError4) { - throw _iteratorError4; + if (_didIteratorError3) { + throw _iteratorError3; } } } diff --git a/dist/amd/mdl.js.map b/dist/amd/mdl.js.map index e7971dc..d888db1 100644 --- a/dist/amd/mdl.js.map +++ b/dist/amd/mdl.js.map @@ -1 +1 @@ -{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;;;;;;;;;AAIA,MAAI,QAAQ,GAAG;AACb,UAAM,EAAE;AACN,UAAI,EAAE,CAAC,YAAY,EAAE,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ElB,aAFA,kBAAkB,CAEjB,OAAO,EAAE,eAAe,EAAE;;;AACpC,UAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,UAAI,CAAC,eAAe,GAAG,eAAe,CAAC;KACxC;;iBALU,kBAAkB;;aAOrB,oBAAG;AAET,sBAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,YAAI,OAAO,GAAG,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC;AACpD,YAAI,CAAC,eAAe,CAAC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;OAChE;;;8BAZU,kBAAkB;AAAlB,sBAAkB,GAD9B,sBArJe,eAAe,EAqJd,KAAK,CAAC,CACV,kBAAkB,KAAlB,kBAAkB;AAAlB,sBAAkB,GAF9B,sBApJO,MAAM,EAoJN,OAAO,0BAlJP,eAAe,CAkJU,CAEpB,kBAAkB,KAAlB,kBAAkB;WAAlB,kBAAkB","file":"mdl.js","sourcesContent":["import {inject, customAttribute} from 'aurelia-framework';\nimport {componentHandler} from 'encapsulated-mdl';\nimport {EventAggregator} from 'aurelia-event-aggregator';\n\nlet mdlTypes = {\n button: {\n html: ['mdl-button', 'mdl-js-button'],\n js: ['MaterialButton'],\n fct: [manageRipple]\n },\n textfield: {\n js: ['MaterialTextfield'],\n html: ['mdl-textfield', 'mdl-js-textfield'],\n fct: []\n },\n layout: {\n js: ['MaterialLayout'],\n html: ['mdl-layout', 'mdl-js-layout'],\n fct: [manageRipple]\n },\n menu: {\n js: ['MaterialMenu'],\n html: ['mdl-menu', 'mdl-js-menu'],\n fct: [manageRipple]\n },\n 'data-table': {\n js: ['MaterialDataTable'],\n html: ['mdl-data-table', 'mdl-js-data-table'],\n fct: [manageRipple]\n },\n tabs: {\n js: ['MaterialTabs'],\n html: ['mdl-tabs', 'mdl-js-tabs'],\n fct: [manageRipple]\n },\n slider: {\n js: ['MaterialSlider'],\n html: ['mdl-slider', 'mdl-js-slider'],\n fct: []\n },\n tooltip: {\n js: ['MaterialTooltip'],\n html: ['mdl-tooltip'],\n fct: []\n },\n progress: {\n js: ['MaterialProgress'],\n html: ['mdl-progress', 'mdl-js-progress'],\n fct: []\n },\n spinner: {\n js: ['MaterialSpinner'],\n html: ['mdl-spinner', 'mdl-js-spinner'],\n fct: []\n },\n badge: {\n js: [],\n html: ['mdl-badge'],\n fct: []\n },\n switch: {\n js: ['MaterialSwitch'],\n html: ['mdl-switch', 'mdl-js-switch'],\n fct: [manageRipple]\n },\n radio: {\n js: ['MaterialRadio'],\n html: ['mdl-radio', 'mdl-js-radio'],\n fct: [manageRipple]\n },\n 'icon-toggle': {\n js: ['MaterialIconToggle'],\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\n fct: [manageRipple]\n },\n checkbox: {\n js: ['MaterialCheckbox'],\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\n fct: [manageRipple]\n },\n dialog: {\n js: ['MaterialDialog'],\n html: ['mdl-dialog', 'mdl-js-dialog'],\n fct: []\n },\n 'mega-footer': {\n js: [],\n html: ['mdl-mega-footer'],\n fct: []\n },\n 'mini-footer': {\n js: [],\n html: ['mdl-mini-footer'],\n fct: []\n },\n grid: {\n js: [],\n html: ['mdl-grid'],\n fct: []\n },\n snackbar: {\n js: ['MaterialSnackbar'],\n html: ['mdl-snackbar'],\n fct: []\n }\n\n};\n\nfunction manageRipple(element) {\n if (element.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(element, 'MaterialRipple');\n }\n /**\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\n * marked as upgraded.\n * eventually causing rippleElement to be null on MaterialRipple.\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\n for (let el of elements) {\n componentHandler.upgradeElement(el, 'MaterialRipple');\n }*/\n\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\n */\n if (element.MaterialIconToggle) {\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\n let children = element.children;\n for (let child of children) {\n if (child.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(child, 'MaterialRipple');\n }\n }\n }\n}\n\nfunction upgradeElement(element, type) {\n let {html, fct, js} = (mdlTypes[type] || {});\n if (html) {\n for (let h of html) {\n element.classList.add(h);\n }\n }\n for (let t of js) componentHandler.upgradeElement(element, t);\n for (let f of fct) f(element);\n}\n\n@inject(Element, EventAggregator)\n@customAttribute('mdl')\nexport class MDLCustomAttribute {\n\n constructor(element, eventAggregator) {\n this.element = element;\n this.eventAggregator = eventAggregator;\n }\n\n attached() {\n //console.log(\"mdl attached: \" + this.value);\n upgradeElement(this.element, this.value);\n let payload = {publisher: this, data: this.element};\n this.eventAggregator.publish('mdl:component:upgrade', payload);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;;;;;;;;;AAIA,MAAI,QAAQ,GAAG;AACb,UAAM,EAAE;AACN,UAAI,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;AACrC,QAAE,EAAE,CAAC,gBAAgB,CAAC;AACtB,SAAG,EAAE,CAAC,YAAY,CAAC;KACpB;AACD,aAAS,EAAE;AACT,QAAE,EAAE,CAAC,mBAAmB,CAAC;AACzB,UAAI,EAAE,CAAC,eAAe,EAAE,kBAAkB,CAAC;AAC3C,SAAG,EAAE,EAAE;KACR;AACD,UAAM,EAAE;AACN,QAAE,EAAE,CAAC,gBAAgB,CAAC;AACtB,UAAI,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;AACrC,SAAG,EAAE,CAAC,YAAY,CAAC;KACpB;AACD,QAAI,EAAE;A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C,YAAI,OAAO,GAAG,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC;AACpD,YAAI,CAAC,eAAe,CAAC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;OAChE;;;8BAZU,kBAAkB;AAAlB,sBAAkB,GAD9B,sBAxJe,eAAe,EAwJd,KAAK,CAAC,CACV,kBAAkB,KAAlB,kBAAkB;AAAlB,sBAAkB,GAF9B,sBAvJO,MAAM,EAuJN,OAAO,0BArJP,eAAe,CAqJU,CAEpB,kBAAkB,KAAlB,kBAAkB;WAAlB,kBAAkB","file":"mdl.js","sourcesContent":["import {inject, customAttribute} from 'aurelia-framework';\nimport {componentHandler} from 'encapsulated-mdl';\nimport {EventAggregator} from 'aurelia-event-aggregator';\n\nlet mdlTypes = {\n button: {\n html: ['mdl-button', 'mdl-js-button'],\n js: ['MaterialButton'],\n fct: [manageRipple]\n },\n textfield: {\n js: ['MaterialTextfield'],\n html: ['mdl-textfield', 'mdl-js-textfield'],\n fct: []\n },\n layout: {\n js: ['MaterialLayout'],\n html: ['mdl-layout', 'mdl-js-layout'],\n fct: [manageRipple]\n },\n menu: {\n js: ['MaterialMenu'],\n html: ['mdl-menu', 'mdl-js-menu'],\n fct: [manageRipple]\n },\n 'data-table': {\n js: ['MaterialDataTable'],\n html: ['mdl-data-table', 'mdl-js-data-table'],\n fct: [manageRipple]\n },\n tabs: {\n js: ['MaterialTabs'],\n html: ['mdl-tabs', 'mdl-js-tabs'],\n fct: [manageRipple]\n },\n slider: {\n js: ['MaterialSlider'],\n html: ['mdl-slider', 'mdl-js-slider'],\n fct: []\n },\n tooltip: {\n js: ['MaterialTooltip'],\n html: ['mdl-tooltip'],\n fct: []\n },\n progress: {\n js: ['MaterialProgress'],\n html: ['mdl-progress', 'mdl-js-progress'],\n fct: []\n },\n spinner: {\n js: ['MaterialSpinner'],\n html: ['mdl-spinner', 'mdl-js-spinner'],\n fct: []\n },\n badge: {\n js: [],\n html: ['mdl-badge'],\n fct: []\n },\n switch: {\n js: ['MaterialSwitch'],\n html: ['mdl-switch', 'mdl-js-switch'],\n fct: [manageRipple]\n },\n radio: {\n js: ['MaterialRadio'],\n html: ['mdl-radio', 'mdl-js-radio'],\n fct: [manageRipple]\n },\n 'icon-toggle': {\n js: ['MaterialIconToggle'],\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\n fct: [manageRipple]\n },\n checkbox: {\n js: ['MaterialCheckbox'],\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\n fct: [manageRipple]\n },\n dialog: {\n js: ['MaterialDialog'],\n html: ['mdl-dialog', 'mdl-js-dialog'],\n fct: []\n },\n 'mega-footer': {\n js: [],\n html: ['mdl-mega-footer'],\n fct: []\n },\n 'mini-footer': {\n js: [],\n html: ['mdl-mini-footer'],\n fct: []\n },\n grid: {\n js: [],\n html: ['mdl-grid'],\n fct: []\n },\n snackbar: {\n js: ['MaterialSnackbar'],\n html: ['mdl-snackbar'],\n fct: []\n }\n\n};\n\nfunction manageRipple(element) {\n if (element.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(element, 'MaterialRipple');\n }\n /**\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\n * marked as upgraded.\n * eventually causing rippleElement to be null on MaterialRipple.\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\n for (let el of elements) {\n componentHandler.upgradeElement(el, 'MaterialRipple');\n }*/\n\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\n */\n if (element.MaterialIconToggle || element.MaterialCheckbox) {\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\n let children = element.children;\n if (children) {\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n if (child.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(child, 'MaterialRipple');\n }\n }\n }\n }\n}\n\nfunction upgradeElement(element, type) {\n let {html, fct, js} = (mdlTypes[type] || {});\n if (html) {\n for (let h of html) {\n element.classList.add(h);\n }\n }\n for (let t of js) componentHandler.upgradeElement(element, t);\n for (let f of fct) f(element);\n}\n\n@inject(Element, EventAggregator)\n@customAttribute('mdl')\nexport class MDLCustomAttribute {\n\n constructor(element, eventAggregator) {\n this.element = element;\n this.eventAggregator = eventAggregator;\n }\n\n attached() {\n //console.log(\"mdl attached: \" + this.value);\n upgradeElement(this.element, this.value);\n let payload = {publisher: this, data: this.element};\n this.eventAggregator.publish('mdl:component:upgrade', payload);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/commonjs/index.js.map b/dist/commonjs/index.js.map index e7b9a0b..78c1445 100644 --- a/dist/commonjs/index.js.map +++ b/dist/commonjs/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AACO,SAAS,SAAS,CAAC,MAAM,EAAE;AAChC,QAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;CACjC","file":"index.js","sourcesContent":["\r\nexport function configure(config) {\r\n config.globalResources('./mdl');\r\n}\r\n\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AACO,SAAS,SAAS,CAAC,MAAM,EAAE;AAChC,QAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;CACjC","file":"index.js","sourcesContent":["\nexport function configure(config) {\n config.globalResources('./mdl');\n}\n\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/commonjs/mdl.js b/dist/commonjs/mdl.js index dd59513..126ce20 100644 --- a/dist/commonjs/mdl.js +++ b/dist/commonjs/mdl.js @@ -123,33 +123,15 @@ function manageRipple(element) { _encapsulatedMdl.componentHandler.upgradeElement(element, 'MaterialRipple'); } - if (element.MaterialIconToggle) { + if (element.MaterialIconToggle || element.MaterialCheckbox) { var children = element.children; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var child = _step.value; - + if (children) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; if (child.classList.contains('mdl-js-ripple-effect')) { _encapsulatedMdl.componentHandler.upgradeElement(child, 'MaterialRipple'); } } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator['return']) { - _iterator['return'](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } } } } @@ -162,75 +144,75 @@ function upgradeElement(element, type) { var js = _ref.js; if (html) { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; try { - for (var _iterator2 = html[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var h = _step2.value; + for (var _iterator = html[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var h = _step.value; element.classList.add(h); } } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; + _didIteratorError = true; + _iteratorError = err; } finally { try { - if (!_iteratorNormalCompletion2 && _iterator2['return']) { - _iterator2['return'](); + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); } } finally { - if (_didIteratorError2) { - throw _iteratorError2; + if (_didIteratorError) { + throw _iteratorError; } } } } - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; try { - for (var _iterator3 = js[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var t = _step3.value; + for (var _iterator2 = js[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var t = _step2.value; _encapsulatedMdl.componentHandler.upgradeElement(element, t); } } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; + _didIteratorError2 = true; + _iteratorError2 = err; } finally { try { - if (!_iteratorNormalCompletion3 && _iterator3['return']) { - _iterator3['return'](); + if (!_iteratorNormalCompletion2 && _iterator2['return']) { + _iterator2['return'](); } } finally { - if (_didIteratorError3) { - throw _iteratorError3; + if (_didIteratorError2) { + throw _iteratorError2; } } } - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; try { - for (var _iterator4 = fct[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var f = _step4.value; + for (var _iterator3 = fct[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var f = _step3.value; f(element); } } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; + _didIteratorError3 = true; + _iteratorError3 = err; } finally { try { - if (!_iteratorNormalCompletion4 && _iterator4['return']) { - _iterator4['return'](); + if (!_iteratorNormalCompletion3 && _iterator3['return']) { + _iterator3['return'](); } } finally { - if (_didIteratorError4) { - throw _iteratorError4; + if (_didIteratorError3) { + throw _iteratorError3; } } } diff --git a/dist/commonjs/mdl.js.map b/dist/commonjs/mdl.js.map index 6d5a057..1ff670b 100644 --- a/dist/commonjs/mdl.js.map +++ b/dist/commonjs/mdl.js.map @@ -1 +1 @@ -{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;;;;;;;;gCAAsC,mBA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O,CAAC,CAAC;KAAA;;;;;;;;;;;;;;;CAC/B;;IAIY,kBAAkB;AAElB,WAFA,kBAAkB,CAEjB,OAAO,EAAE,eAAe,EAAE;;;AACpC,QAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,QAAI,CAAC,eAAe,GAAG,eAAe,CAAC;GACxC;;eALU,kBAAkB;;WAOrB,oBAAG;AAET,oBAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,UAAI,OAAO,GAAG,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC;AACpD,UAAI,CAAC,eAAe,CAAC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;KAChE;;;4BAZU,kBAAkB;AAAlB,oBAAkB,GAD9B,uCAAgB,KAAK,CAAC,CACV,kBAAkB,KAAlB,kBAAkB;AAAlB,oBAAkB,GAF9B,8BAAO,OAAO,0CAAkB,CAEpB,kBAAkB,KAAlB,kBAAkB;SAAlB,kBAAkB","file":"mdl.js","sourcesContent":["import {inject, customAttribute} from 'aurelia-framework';\nimport {componentHandler} from 'encapsulated-mdl';\nimport {EventAggregator} from 'aurelia-event-aggregator';\n\nlet mdlTypes = {\n button: {\n html: ['mdl-button', 'mdl-js-button'],\n js: ['MaterialButton'],\n fct: [manageRipple]\n },\n textfield: {\n js: ['MaterialTextfield'],\n html: ['mdl-textfield', 'mdl-js-textfield'],\n fct: []\n },\n layout: {\n js: ['MaterialLayout'],\n html: ['mdl-layout', 'mdl-js-layout'],\n fct: [manageRipple]\n },\n menu: {\n js: ['MaterialMenu'],\n html: ['mdl-menu', 'mdl-js-menu'],\n fct: [manageRipple]\n },\n 'data-table': {\n js: ['MaterialDataTable'],\n html: ['mdl-data-table', 'mdl-js-data-table'],\n fct: [manageRipple]\n },\n tabs: {\n js: ['MaterialTabs'],\n html: ['mdl-tabs', 'mdl-js-tabs'],\n fct: [manageRipple]\n },\n slider: {\n js: ['MaterialSlider'],\n html: ['mdl-slider', 'mdl-js-slider'],\n fct: []\n },\n tooltip: {\n js: ['MaterialTooltip'],\n html: ['mdl-tooltip'],\n fct: []\n },\n progress: {\n js: ['MaterialProgress'],\n html: ['mdl-progress', 'mdl-js-progress'],\n fct: []\n },\n spinner: {\n js: ['MaterialSpinner'],\n html: ['mdl-spinner', 'mdl-js-spinner'],\n fct: []\n },\n badge: {\n js: [],\n html: ['mdl-badge'],\n fct: []\n },\n switch: {\n js: ['MaterialSwitch'],\n html: ['mdl-switch', 'mdl-js-switch'],\n fct: [manageRipple]\n },\n radio: {\n js: ['MaterialRadio'],\n html: ['mdl-radio', 'mdl-js-radio'],\n fct: [manageRipple]\n },\n 'icon-toggle': {\n js: ['MaterialIconToggle'],\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\n fct: [manageRipple]\n },\n checkbox: {\n js: ['MaterialCheckbox'],\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\n fct: [manageRipple]\n },\n dialog: {\n js: ['MaterialDialog'],\n html: ['mdl-dialog', 'mdl-js-dialog'],\n fct: []\n },\n 'mega-footer': {\n js: [],\n html: ['mdl-mega-footer'],\n fct: []\n },\n 'mini-footer': {\n js: [],\n html: ['mdl-mini-footer'],\n fct: []\n },\n grid: {\n js: [],\n html: ['mdl-grid'],\n fct: []\n },\n snackbar: {\n js: ['MaterialSnackbar'],\n html: ['mdl-snackbar'],\n fct: []\n }\n\n};\n\nfunction manageRipple(element) {\n if (element.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(element, 'MaterialRipple');\n }\n /**\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\n * marked as upgraded.\n * eventually causing rippleElement to be null on MaterialRipple.\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\n for (let el of elements) {\n componentHandler.upgradeElement(el, 'MaterialRipple');\n }*/\n\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\n */\n if (element.MaterialIconToggle) {\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\n let children = element.children;\n for (let child of children) {\n if (child.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(child, 'MaterialRipple');\n }\n }\n }\n}\n\nfunction upgradeElement(element, type) {\n let {html, fct, js} = (mdlTypes[type] || {});\n if (html) {\n for (let h of html) {\n element.classList.add(h);\n }\n }\n for (let t of js) componentHandler.upgradeElement(element, t);\n for (let f of fct) f(element);\n}\n\n@inject(Element, EventAggregator)\n@customAttribute('mdl')\nexport class MDLCustomAttribute {\n\n constructor(element, eventAggregator) {\n this.element = element;\n this.eventAggregator = eventAggregator;\n }\n\n attached() {\n //console.log(\"mdl attached: \" + this.value);\n upgradeElement(this.element, this.value);\n let payload = {publisher: this, data: this.element};\n this.eventAggregator.publish('mdl:component:upgrade', payload);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;;;;;;;;gCAAsC,mBAAmB;;+BAC1B,kBAAkB;;sCACnB,0BAA0B;;AAExD,IAAI,QAAQ,GAAG;AACb,QAAM,EAAE;AACN,QAAI,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;AACrC,MAAE,EAAE,CAAC,gBAAgB,CAAC;AACtB,OAAG,EAAE,CAAC,YAAY,CAAC;GACpB;AACD,WAAS,EAAE;AACT,MAAE,EAAE,CAAC,mBAAmB,CAAC;AACzB,QAAI,EAAE,CAAC,eAAe,EAAE,kBAAkB,CAAC;AAC3C,OAAG,EAAE,EAAE;GACR;AACD,QAAM,EAAE;AACN,MAAE,EAAE,CAAC,gBAAgB,CAAC;AACtB,QAAI,EAAE,CAAC,YAAY,EAA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AAK,CAAC,CAAC;AACzC,UAAI,OAAO,GAAG,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC;AACpD,UAAI,CAAC,eAAe,CAAC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;KAChE;;;4BAZU,kBAAkB;AAAlB,oBAAkB,GAD9B,uCAAgB,KAAK,CAAC,CACV,kBAAkB,KAAlB,kBAAkB;AAAlB,oBAAkB,GAF9B,8BAAO,OAAO,0CAAkB,CAEpB,kBAAkB,KAAlB,kBAAkB;SAAlB,kBAAkB","file":"mdl.js","sourcesContent":["import {inject, customAttribute} from 'aurelia-framework';\nimport {componentHandler} from 'encapsulated-mdl';\nimport {EventAggregator} from 'aurelia-event-aggregator';\n\nlet mdlTypes = {\n button: {\n html: ['mdl-button', 'mdl-js-button'],\n js: ['MaterialButton'],\n fct: [manageRipple]\n },\n textfield: {\n js: ['MaterialTextfield'],\n html: ['mdl-textfield', 'mdl-js-textfield'],\n fct: []\n },\n layout: {\n js: ['MaterialLayout'],\n html: ['mdl-layout', 'mdl-js-layout'],\n fct: [manageRipple]\n },\n menu: {\n js: ['MaterialMenu'],\n html: ['mdl-menu', 'mdl-js-menu'],\n fct: [manageRipple]\n },\n 'data-table': {\n js: ['MaterialDataTable'],\n html: ['mdl-data-table', 'mdl-js-data-table'],\n fct: [manageRipple]\n },\n tabs: {\n js: ['MaterialTabs'],\n html: ['mdl-tabs', 'mdl-js-tabs'],\n fct: [manageRipple]\n },\n slider: {\n js: ['MaterialSlider'],\n html: ['mdl-slider', 'mdl-js-slider'],\n fct: []\n },\n tooltip: {\n js: ['MaterialTooltip'],\n html: ['mdl-tooltip'],\n fct: []\n },\n progress: {\n js: ['MaterialProgress'],\n html: ['mdl-progress', 'mdl-js-progress'],\n fct: []\n },\n spinner: {\n js: ['MaterialSpinner'],\n html: ['mdl-spinner', 'mdl-js-spinner'],\n fct: []\n },\n badge: {\n js: [],\n html: ['mdl-badge'],\n fct: []\n },\n switch: {\n js: ['MaterialSwitch'],\n html: ['mdl-switch', 'mdl-js-switch'],\n fct: [manageRipple]\n },\n radio: {\n js: ['MaterialRadio'],\n html: ['mdl-radio', 'mdl-js-radio'],\n fct: [manageRipple]\n },\n 'icon-toggle': {\n js: ['MaterialIconToggle'],\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\n fct: [manageRipple]\n },\n checkbox: {\n js: ['MaterialCheckbox'],\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\n fct: [manageRipple]\n },\n dialog: {\n js: ['MaterialDialog'],\n html: ['mdl-dialog', 'mdl-js-dialog'],\n fct: []\n },\n 'mega-footer': {\n js: [],\n html: ['mdl-mega-footer'],\n fct: []\n },\n 'mini-footer': {\n js: [],\n html: ['mdl-mini-footer'],\n fct: []\n },\n grid: {\n js: [],\n html: ['mdl-grid'],\n fct: []\n },\n snackbar: {\n js: ['MaterialSnackbar'],\n html: ['mdl-snackbar'],\n fct: []\n }\n\n};\n\nfunction manageRipple(element) {\n if (element.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(element, 'MaterialRipple');\n }\n /**\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\n * marked as upgraded.\n * eventually causing rippleElement to be null on MaterialRipple.\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\n for (let el of elements) {\n componentHandler.upgradeElement(el, 'MaterialRipple');\n }*/\n\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\n */\n if (element.MaterialIconToggle || element.MaterialCheckbox) {\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\n let children = element.children;\n if (children) {\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n if (child.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(child, 'MaterialRipple');\n }\n }\n }\n }\n}\n\nfunction upgradeElement(element, type) {\n let {html, fct, js} = (mdlTypes[type] || {});\n if (html) {\n for (let h of html) {\n element.classList.add(h);\n }\n }\n for (let t of js) componentHandler.upgradeElement(element, t);\n for (let f of fct) f(element);\n}\n\n@inject(Element, EventAggregator)\n@customAttribute('mdl')\nexport class MDLCustomAttribute {\n\n constructor(element, eventAggregator) {\n this.element = element;\n this.eventAggregator = eventAggregator;\n }\n\n attached() {\n //console.log(\"mdl attached: \" + this.value);\n upgradeElement(this.element, this.value);\n let payload = {publisher: this, data: this.element};\n this.eventAggregator.publish('mdl:component:upgrade', payload);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/es6/mdl.js b/dist/es6/mdl.js index 652c766..82dbb83 100644 --- a/dist/es6/mdl.js +++ b/dist/es6/mdl.js @@ -124,12 +124,15 @@ function manageRipple(element) { /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested. */ - if (element.MaterialIconToggle) { + if (element.MaterialIconToggle || element.MaterialCheckbox) { /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */ let children = element.children; - for (let child of children) { - if (child.classList.contains('mdl-js-ripple-effect')) { - componentHandler.upgradeElement(child, 'MaterialRipple'); + if (children) { + for (let i = 0; i < children.length; i++) { + let child = children[i]; + if (child.classList.contains('mdl-js-ripple-effect')) { + componentHandler.upgradeElement(child, 'MaterialRipple'); + } } } } diff --git a/dist/system/index.js.map b/dist/system/index.js.map index d2f8a89..677659e 100644 --- a/dist/system/index.js.map +++ b/dist/system/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;AACO,WAAS,SAAS,CAAC,MAAM,EAAE;AAChC,UAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;GACjC","file":"index.js","sourcesContent":["\r\nexport function configure(config) {\r\n config.globalResources('./mdl');\r\n}\r\n\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;AACO,WAAS,SAAS,CAAC,MAAM,EAAE;AAChC,UAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;GACjC","file":"index.js","sourcesContent":["\nexport function configure(config) {\n config.globalResources('./mdl');\n}\n\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/dist/system/mdl.js b/dist/system/mdl.js index 9189b57..31364b5 100644 --- a/dist/system/mdl.js +++ b/dist/system/mdl.js @@ -12,33 +12,15 @@ System.register(['aurelia-framework', 'encapsulated-mdl', 'aurelia-event-aggrega componentHandler.upgradeElement(element, 'MaterialRipple'); } - if (element.MaterialIconToggle) { + if (element.MaterialIconToggle || element.MaterialCheckbox) { var children = element.children; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var child = _step.value; - + if (children) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; if (child.classList.contains('mdl-js-ripple-effect')) { componentHandler.upgradeElement(child, 'MaterialRipple'); } } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator['return']) { - _iterator['return'](); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } } } } @@ -51,75 +33,75 @@ System.register(['aurelia-framework', 'encapsulated-mdl', 'aurelia-event-aggrega var js = _ref.js; if (html) { - var _iteratorNormalCompletion2 = true; - var _didIteratorError2 = false; - var _iteratorError2 = undefined; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; try { - for (var _iterator2 = html[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { - var h = _step2.value; + for (var _iterator = html[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var h = _step.value; element.classList.add(h); } } catch (err) { - _didIteratorError2 = true; - _iteratorError2 = err; + _didIteratorError = true; + _iteratorError = err; } finally { try { - if (!_iteratorNormalCompletion2 && _iterator2['return']) { - _iterator2['return'](); + if (!_iteratorNormalCompletion && _iterator['return']) { + _iterator['return'](); } } finally { - if (_didIteratorError2) { - throw _iteratorError2; + if (_didIteratorError) { + throw _iteratorError; } } } } - var _iteratorNormalCompletion3 = true; - var _didIteratorError3 = false; - var _iteratorError3 = undefined; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; try { - for (var _iterator3 = js[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { - var t = _step3.value; + for (var _iterator2 = js[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var t = _step2.value; componentHandler.upgradeElement(element, t); } } catch (err) { - _didIteratorError3 = true; - _iteratorError3 = err; + _didIteratorError2 = true; + _iteratorError2 = err; } finally { try { - if (!_iteratorNormalCompletion3 && _iterator3['return']) { - _iterator3['return'](); + if (!_iteratorNormalCompletion2 && _iterator2['return']) { + _iterator2['return'](); } } finally { - if (_didIteratorError3) { - throw _iteratorError3; + if (_didIteratorError2) { + throw _iteratorError2; } } } - var _iteratorNormalCompletion4 = true; - var _didIteratorError4 = false; - var _iteratorError4 = undefined; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; try { - for (var _iterator4 = fct[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { - var f = _step4.value; + for (var _iterator3 = fct[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var f = _step3.value; f(element); } } catch (err) { - _didIteratorError4 = true; - _iteratorError4 = err; + _didIteratorError3 = true; + _iteratorError3 = err; } finally { try { - if (!_iteratorNormalCompletion4 && _iterator4['return']) { - _iterator4['return'](); + if (!_iteratorNormalCompletion3 && _iterator3['return']) { + _iterator3['return'](); } } finally { - if (_didIteratorError4) { - throw _iteratorError4; + if (_didIteratorError3) { + throw _iteratorError3; } } } diff --git a/dist/system/mdl.js.map b/dist/system/mdl.js.map index a0c0e9f..1ca8634 100644 --- a/dist/system/mdl.js.map +++ b/dist/system/mdl.js.map @@ -1 +1 @@ -{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;kEAII,QAAQ,EAkJC,kBAAkB;;;;;;AA1C/B,WAAS,YAAY,CAAC,OAAO,EAAE;AAC7B,QAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;AACtD,sBAAgB,CAAC,cAAc,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;KAC5D;;AAeD,QAAI,OAAO,CAAC,kBAAkB,EAAE;AAE9B,UAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;;;;;;AAChC,6BAAkB,QAAQ,8HAAE;cAAnB,KAAK;;AACZ,cAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;AACpD,4BAAgB,CAAC,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;WAC1D;SACF;;;;;;;;;;;;;;;KACF;GACF;;AAED,WAAS,cAAc,CAAC,OAAO,EAAE,IAAI,EAAE;eACd,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE;;QAAtC,IAAI,QAAJ,IAAI;QAAE,GAAG,QAAH,GAAG;QAAE,EAAE,QAAF,EAAE;;AAClB,QAAI,IAAI,EAAE;;;;;;AACR,8BAAc,IAAI,mIAAE;cAAX,CAAC;;AACR,iBAAO,CAAC,SAAS,CAAC,GAAG,C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from 'aurelia-framework';\nimport {componentHandler} from 'encapsulated-mdl';\nimport {EventAggregator} from 'aurelia-event-aggregator';\n\nlet mdlTypes = {\n button: {\n html: ['mdl-button', 'mdl-js-button'],\n js: ['MaterialButton'],\n fct: [manageRipple]\n },\n textfield: {\n js: ['MaterialTextfield'],\n html: ['mdl-textfield', 'mdl-js-textfield'],\n fct: []\n },\n layout: {\n js: ['MaterialLayout'],\n html: ['mdl-layout', 'mdl-js-layout'],\n fct: [manageRipple]\n },\n menu: {\n js: ['MaterialMenu'],\n html: ['mdl-menu', 'mdl-js-menu'],\n fct: [manageRipple]\n },\n 'data-table': {\n js: ['MaterialDataTable'],\n html: ['mdl-data-table', 'mdl-js-data-table'],\n fct: [manageRipple]\n },\n tabs: {\n js: ['MaterialTabs'],\n html: ['mdl-tabs', 'mdl-js-tabs'],\n fct: [manageRipple]\n },\n slider: {\n js: ['MaterialSlider'],\n html: ['mdl-slider', 'mdl-js-slider'],\n fct: []\n },\n tooltip: {\n js: ['MaterialTooltip'],\n html: ['mdl-tooltip'],\n fct: []\n },\n progress: {\n js: ['MaterialProgress'],\n html: ['mdl-progress', 'mdl-js-progress'],\n fct: []\n },\n spinner: {\n js: ['MaterialSpinner'],\n html: ['mdl-spinner', 'mdl-js-spinner'],\n fct: []\n },\n badge: {\n js: [],\n html: ['mdl-badge'],\n fct: []\n },\n switch: {\n js: ['MaterialSwitch'],\n html: ['mdl-switch', 'mdl-js-switch'],\n fct: [manageRipple]\n },\n radio: {\n js: ['MaterialRadio'],\n html: ['mdl-radio', 'mdl-js-radio'],\n fct: [manageRipple]\n },\n 'icon-toggle': {\n js: ['MaterialIconToggle'],\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\n fct: [manageRipple]\n },\n checkbox: {\n js: ['MaterialCheckbox'],\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\n fct: [manageRipple]\n },\n dialog: {\n js: ['MaterialDialog'],\n html: ['mdl-dialog', 'mdl-js-dialog'],\n fct: []\n },\n 'mega-footer': {\n js: [],\n html: ['mdl-mega-footer'],\n fct: []\n },\n 'mini-footer': {\n js: [],\n html: ['mdl-mini-footer'],\n fct: []\n },\n grid: {\n js: [],\n html: ['mdl-grid'],\n fct: []\n },\n snackbar: {\n js: ['MaterialSnackbar'],\n html: ['mdl-snackbar'],\n fct: []\n }\n\n};\n\nfunction manageRipple(element) {\n if (element.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(element, 'MaterialRipple');\n }\n /**\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\n * marked as upgraded.\n * eventually causing rippleElement to be null on MaterialRipple.\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\n for (let el of elements) {\n componentHandler.upgradeElement(el, 'MaterialRipple');\n }*/\n\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\n */\n if (element.MaterialIconToggle) {\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\n let children = element.children;\n for (let child of children) {\n if (child.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(child, 'MaterialRipple');\n }\n }\n }\n}\n\nfunction upgradeElement(element, type) {\n let {html, fct, js} = (mdlTypes[type] || {});\n if (html) {\n for (let h of html) {\n element.classList.add(h);\n }\n }\n for (let t of js) componentHandler.upgradeElement(element, t);\n for (let f of fct) f(element);\n}\n\n@inject(Element, EventAggregator)\n@customAttribute('mdl')\nexport class MDLCustomAttribute {\n\n constructor(element, eventAggregator) {\n this.element = element;\n this.eventAggregator = eventAggregator;\n }\n\n attached() {\n //console.log(\"mdl attached: \" + this.value);\n upgradeElement(this.element, this.value);\n let payload = {publisher: this, data: this.element};\n this.eventAggregator.publish('mdl:component:upgrade', payload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SACR;AACD,qBAAa,EAAE;AACb,YAAE,EAAE,EAAE;AACN,cAAI,EAAE,CAAC,iBAAiB,CAAC;AACzB,aAAG,EAAE,EAAE;SACR;AACD,YAAI,EAAE;AACJ,YAAE,EAAE,EAAE;AACN,cAAI,EAAE,CAAC,UAAU,CAAC;AAClB,aAAG,EAAE,EAAE;SACR;AACD,gBAAQ,EAAE;AACR,YAAE,EAAE,CAAC,kBAAkB,CAAC;AACxB,cAAI,EAAE,CAAC,cAAc,CAAC;AACtB,aAAG,EAAE,EAAE;SACR;;OAEF;;AA+CY,wBAAkB;AAElB,iBAFA,kBAAkB,CAEjB,OAAO,EAAE,eAAe,EAAE;;;AACpC,cAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,cAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC;;qBALU,kBAAkB;;iBAOrB,oBAAG;AAET,0BAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AACzC,gBAAI,OAAO,GAAG,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC;AACpD,gBAAI,CAAC,eAAe,CAAC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;WAChE;;;kCAZU,kBAAkB;AAAlB,0BAAkB,GAD9B,eAAe,CAAC,KAAK,CAAC,CACV,kBAAkB,KAAlB,kBAAkB;AAAlB,0BAAkB,GAF9B,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAEpB,kBAAkB,KAAlB,kBAAkB;eAAlB,kBAAkB","file":"mdl.js","sourcesContent":["import {inject, customAttribute} from 'aurelia-framework';\nimport {componentHandler} from 'encapsulated-mdl';\nimport {EventAggregator} from 'aurelia-event-aggregator';\n\nlet mdlTypes = {\n button: {\n html: ['mdl-button', 'mdl-js-button'],\n js: ['MaterialButton'],\n fct: [manageRipple]\n },\n textfield: {\n js: ['MaterialTextfield'],\n html: ['mdl-textfield', 'mdl-js-textfield'],\n fct: []\n },\n layout: {\n js: ['MaterialLayout'],\n html: ['mdl-layout', 'mdl-js-layout'],\n fct: [manageRipple]\n },\n menu: {\n js: ['MaterialMenu'],\n html: ['mdl-menu', 'mdl-js-menu'],\n fct: [manageRipple]\n },\n 'data-table': {\n js: ['MaterialDataTable'],\n html: ['mdl-data-table', 'mdl-js-data-table'],\n fct: [manageRipple]\n },\n tabs: {\n js: ['MaterialTabs'],\n html: ['mdl-tabs', 'mdl-js-tabs'],\n fct: [manageRipple]\n },\n slider: {\n js: ['MaterialSlider'],\n html: ['mdl-slider', 'mdl-js-slider'],\n fct: []\n },\n tooltip: {\n js: ['MaterialTooltip'],\n html: ['mdl-tooltip'],\n fct: []\n },\n progress: {\n js: ['MaterialProgress'],\n html: ['mdl-progress', 'mdl-js-progress'],\n fct: []\n },\n spinner: {\n js: ['MaterialSpinner'],\n html: ['mdl-spinner', 'mdl-js-spinner'],\n fct: []\n },\n badge: {\n js: [],\n html: ['mdl-badge'],\n fct: []\n },\n switch: {\n js: ['MaterialSwitch'],\n html: ['mdl-switch', 'mdl-js-switch'],\n fct: [manageRipple]\n },\n radio: {\n js: ['MaterialRadio'],\n html: ['mdl-radio', 'mdl-js-radio'],\n fct: [manageRipple]\n },\n 'icon-toggle': {\n js: ['MaterialIconToggle'],\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\n fct: [manageRipple]\n },\n checkbox: {\n js: ['MaterialCheckbox'],\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\n fct: [manageRipple]\n },\n dialog: {\n js: ['MaterialDialog'],\n html: ['mdl-dialog', 'mdl-js-dialog'],\n fct: []\n },\n 'mega-footer': {\n js: [],\n html: ['mdl-mega-footer'],\n fct: []\n },\n 'mini-footer': {\n js: [],\n html: ['mdl-mini-footer'],\n fct: []\n },\n grid: {\n js: [],\n html: ['mdl-grid'],\n fct: []\n },\n snackbar: {\n js: ['MaterialSnackbar'],\n html: ['mdl-snackbar'],\n fct: []\n }\n\n};\n\nfunction manageRipple(element) {\n if (element.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(element, 'MaterialRipple');\n }\n /**\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\n * marked as upgraded.\n * eventually causing rippleElement to be null on MaterialRipple.\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\n for (let el of elements) {\n componentHandler.upgradeElement(el, 'MaterialRipple');\n }*/\n\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\n */\n if (element.MaterialIconToggle || element.MaterialCheckbox) {\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\n let children = element.children;\n if (children) {\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n if (child.classList.contains('mdl-js-ripple-effect')) {\n componentHandler.upgradeElement(child, 'MaterialRipple');\n }\n }\n }\n }\n}\n\nfunction upgradeElement(element, type) {\n let {html, fct, js} = (mdlTypes[type] || {});\n if (html) {\n for (let h of html) {\n element.classList.add(h);\n }\n }\n for (let t of js) componentHandler.upgradeElement(element, t);\n for (let f of fct) f(element);\n}\n\n@inject(Element, EventAggregator)\n@customAttribute('mdl')\nexport class MDLCustomAttribute {\n\n constructor(element, eventAggregator) {\n this.element = element;\n this.eventAggregator = eventAggregator;\n }\n\n attached() {\n //console.log(\"mdl attached: \" + this.value);\n upgradeElement(this.element, this.value);\n let payload = {publisher: this, data: this.element};\n this.eventAggregator.publish('mdl:component:upgrade', payload);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file