From 612574c5e337501ad162e44e8d4aea3dc8ac2272 Mon Sep 17 00:00:00 2001 From: Genadi Sokolov Date: Mon, 15 Feb 2016 18:02:18 +0200 Subject: [PATCH] chore(all): release removed dialog js upgrade --- dist/amd/mdl.js | 4 ++-- dist/amd/mdl.js.map | 2 +- dist/commonjs/mdl.js | 4 ++-- dist/commonjs/mdl.js.map | 2 +- dist/es6/mdl.js | 4 ++-- dist/system/mdl.js | 4 ++-- dist/system/mdl.js.map | 2 +- package.json | 2 +- src/mdl.js | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/amd/mdl.js b/dist/amd/mdl.js index ae11243..7948793 100644 --- a/dist/amd/mdl.js +++ b/dist/amd/mdl.js @@ -86,8 +86,8 @@ define(['exports', 'aurelia-framework', 'encapsulated-mdl', 'aurelia-event-aggre fct: [manageRipple] }, dialog: { - js: ['MaterialDialog'], - html: ['mdl-dialog', 'mdl-js-dialog'], + js: [], + html: ['mdl-dialog'], fct: [] }, 'mega-footer': { diff --git a/dist/amd/mdl.js.map b/dist/amd/mdl.js.map index 1e2436d..2193edb 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,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;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C,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,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';\r\nimport {componentHandler} from 'encapsulated-mdl';\r\nimport {EventAggregator} from 'aurelia-event-aggregator';\r\n\r\nlet mdlTypes = {\r\n button: {\r\n html: ['mdl-button', 'mdl-js-button'],\r\n js: ['MaterialButton'],\r\n fct: [manageRipple]\r\n },\r\n textfield: {\r\n js: ['MaterialTextfield'],\r\n html: ['mdl-textfield', 'mdl-js-textfield'],\r\n fct: []\r\n },\r\n layout: {\r\n js: ['MaterialLayout'],\r\n html: ['mdl-layout', 'mdl-js-layout'],\r\n fct: [manageRipple]\r\n },\r\n menu: {\r\n js: ['MaterialMenu'],\r\n html: ['mdl-menu', 'mdl-js-menu'],\r\n fct: [manageRipple]\r\n },\r\n 'data-table': {\r\n js: ['MaterialDataTable'],\r\n html: ['mdl-data-table', 'mdl-js-data-table'],\r\n fct: [manageRipple]\r\n },\r\n tabs: {\r\n js: ['MaterialTabs'],\r\n html: ['mdl-tabs', 'mdl-js-tabs'],\r\n fct: [manageRipple]\r\n },\r\n slider: {\r\n js: ['MaterialSlider'],\r\n html: ['mdl-slider', 'mdl-js-slider'],\r\n fct: []\r\n },\r\n tooltip: {\r\n js: ['MaterialTooltip'],\r\n html: ['mdl-tooltip'],\r\n fct: []\r\n },\r\n progress: {\r\n js: ['MaterialProgress'],\r\n html: ['mdl-progress', 'mdl-js-progress'],\r\n fct: []\r\n },\r\n spinner: {\r\n js: ['MaterialSpinner'],\r\n html: ['mdl-spinner', 'mdl-js-spinner'],\r\n fct: []\r\n },\r\n badge: {\r\n js: [],\r\n html: ['mdl-badge'],\r\n fct: []\r\n },\r\n switch: {\r\n js: ['MaterialSwitch'],\r\n html: ['mdl-switch', 'mdl-js-switch'],\r\n fct: [manageRipple]\r\n },\r\n radio: {\r\n js: ['MaterialRadio'],\r\n html: ['mdl-radio', 'mdl-js-radio'],\r\n fct: [manageRipple]\r\n },\r\n 'icon-toggle': {\r\n js: ['MaterialIconToggle'],\r\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\r\n fct: [manageRipple]\r\n },\r\n checkbox: {\r\n js: ['MaterialCheckbox'],\r\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\r\n fct: [manageRipple]\r\n },\r\n dialog: {\r\n js: ['MaterialDialog'],\r\n html: ['mdl-dialog', 'mdl-js-dialog'],\r\n fct: []\r\n },\r\n 'mega-footer': {\r\n js: [],\r\n html: ['mdl-mega-footer'],\r\n fct: []\r\n },\r\n 'mini-footer': {\r\n js: [],\r\n html: ['mdl-mini-footer'],\r\n fct: []\r\n },\r\n grid: {\r\n js: [],\r\n html: ['mdl-grid'],\r\n fct: []\r\n },\r\n snackbar: {\r\n js: ['MaterialSnackbar'],\r\n html: ['mdl-snackbar'],\r\n fct: []\r\n }\r\n\r\n};\r\n\r\nfunction manageRipple(element) {\r\n if (element.classList.contains('mdl-js-ripple-effect')) {\r\n componentHandler.upgradeElement(element, 'MaterialRipple');\r\n }\r\n /**\r\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\r\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\r\n * marked as upgraded.\r\n * eventually causing rippleElement to be null on MaterialRipple.\r\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\r\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\r\n for (let el of elements) {\r\n componentHandler.upgradeElement(el, 'MaterialRipple');\r\n }*/\r\n\r\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\r\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\r\n */\r\n if (element.MaterialIconToggle || element.MaterialCheckbox) {\r\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\r\n let children = element.children;\r\n if (children) {\r\n for (let i = 0; i < children.length; i++) {\r\n let child = children[i];\r\n if (child.classList.contains('mdl-js-ripple-effect')) {\r\n componentHandler.upgradeElement(child, 'MaterialRipple');\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction upgradeElement(element, type) {\r\n let {html, fct, js} = (mdlTypes[type] || {});\r\n if (html) {\r\n for (let h of html) {\r\n element.classList.add(h);\r\n }\r\n }\r\n for (let t of js) componentHandler.upgradeElement(element, t);\r\n for (let f of fct) f(element);\r\n}\r\n\r\n@inject(Element, EventAggregator)\r\n@customAttribute('mdl')\r\nexport class MDLCustomAttribute {\r\n\r\n constructor(element, eventAggregator) {\r\n this.element = element;\r\n this.eventAggregator = eventAggregator;\r\n }\r\n\r\n attached() {\r\n //console.log(\"mdl attached: \" + this.value);\r\n upgradeElement(this.element, this.value);\r\n let payload = {publisher: this, data: this.element};\r\n this.eventAggregator.publish('mdl:component:upgrade', payload);\r\n }\r\n}\r\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,EAA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;;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,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: [],\n html: ['mdl-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/mdl.js b/dist/commonjs/mdl.js index 126ce20..b2ac09b 100644 --- a/dist/commonjs/mdl.js +++ b/dist/commonjs/mdl.js @@ -91,8 +91,8 @@ var mdlTypes = { fct: [manageRipple] }, dialog: { - js: ['MaterialDialog'], - html: ['mdl-dialog', 'mdl-js-dialog'], + js: [], + html: ['mdl-dialog'], fct: [] }, 'mega-footer': { diff --git a/dist/commonjs/mdl.js.map b/dist/commonjs/mdl.js.map index 431800a..aed95da 100644 --- a/dist/commonjs/mdl.js.map +++ b/dist/commonjs/mdl.js.map @@ -1 +1 @@ -{"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,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AR,CAAC;AAAS,OAAC,CAAC,OAAO,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';\r\nimport {componentHandler} from 'encapsulated-mdl';\r\nimport {EventAggregator} from 'aurelia-event-aggregator';\r\n\r\nlet mdlTypes = {\r\n button: {\r\n html: ['mdl-button', 'mdl-js-button'],\r\n js: ['MaterialButton'],\r\n fct: [manageRipple]\r\n },\r\n textfield: {\r\n js: ['MaterialTextfield'],\r\n html: ['mdl-textfield', 'mdl-js-textfield'],\r\n fct: []\r\n },\r\n layout: {\r\n js: ['MaterialLayout'],\r\n html: ['mdl-layout', 'mdl-js-layout'],\r\n fct: [manageRipple]\r\n },\r\n menu: {\r\n js: ['MaterialMenu'],\r\n html: ['mdl-menu', 'mdl-js-menu'],\r\n fct: [manageRipple]\r\n },\r\n 'data-table': {\r\n js: ['MaterialDataTable'],\r\n html: ['mdl-data-table', 'mdl-js-data-table'],\r\n fct: [manageRipple]\r\n },\r\n tabs: {\r\n js: ['MaterialTabs'],\r\n html: ['mdl-tabs', 'mdl-js-tabs'],\r\n fct: [manageRipple]\r\n },\r\n slider: {\r\n js: ['MaterialSlider'],\r\n html: ['mdl-slider', 'mdl-js-slider'],\r\n fct: []\r\n },\r\n tooltip: {\r\n js: ['MaterialTooltip'],\r\n html: ['mdl-tooltip'],\r\n fct: []\r\n },\r\n progress: {\r\n js: ['MaterialProgress'],\r\n html: ['mdl-progress', 'mdl-js-progress'],\r\n fct: []\r\n },\r\n spinner: {\r\n js: ['MaterialSpinner'],\r\n html: ['mdl-spinner', 'mdl-js-spinner'],\r\n fct: []\r\n },\r\n badge: {\r\n js: [],\r\n html: ['mdl-badge'],\r\n fct: []\r\n },\r\n switch: {\r\n js: ['MaterialSwitch'],\r\n html: ['mdl-switch', 'mdl-js-switch'],\r\n fct: [manageRipple]\r\n },\r\n radio: {\r\n js: ['MaterialRadio'],\r\n html: ['mdl-radio', 'mdl-js-radio'],\r\n fct: [manageRipple]\r\n },\r\n 'icon-toggle': {\r\n js: ['MaterialIconToggle'],\r\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\r\n fct: [manageRipple]\r\n },\r\n checkbox: {\r\n js: ['MaterialCheckbox'],\r\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\r\n fct: [manageRipple]\r\n },\r\n dialog: {\r\n js: ['MaterialDialog'],\r\n html: ['mdl-dialog', 'mdl-js-dialog'],\r\n fct: []\r\n },\r\n 'mega-footer': {\r\n js: [],\r\n html: ['mdl-mega-footer'],\r\n fct: []\r\n },\r\n 'mini-footer': {\r\n js: [],\r\n html: ['mdl-mini-footer'],\r\n fct: []\r\n },\r\n grid: {\r\n js: [],\r\n html: ['mdl-grid'],\r\n fct: []\r\n },\r\n snackbar: {\r\n js: ['MaterialSnackbar'],\r\n html: ['mdl-snackbar'],\r\n fct: []\r\n }\r\n\r\n};\r\n\r\nfunction manageRipple(element) {\r\n if (element.classList.contains('mdl-js-ripple-effect')) {\r\n componentHandler.upgradeElement(element, 'MaterialRipple');\r\n }\r\n /**\r\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\r\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\r\n * marked as upgraded.\r\n * eventually causing rippleElement to be null on MaterialRipple.\r\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\r\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\r\n for (let el of elements) {\r\n componentHandler.upgradeElement(el, 'MaterialRipple');\r\n }*/\r\n\r\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\r\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\r\n */\r\n if (element.MaterialIconToggle || element.MaterialCheckbox) {\r\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\r\n let children = element.children;\r\n if (children) {\r\n for (let i = 0; i < children.length; i++) {\r\n let child = children[i];\r\n if (child.classList.contains('mdl-js-ripple-effect')) {\r\n componentHandler.upgradeElement(child, 'MaterialRipple');\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction upgradeElement(element, type) {\r\n let {html, fct, js} = (mdlTypes[type] || {});\r\n if (html) {\r\n for (let h of html) {\r\n element.classList.add(h);\r\n }\r\n }\r\n for (let t of js) componentHandler.upgradeElement(element, t);\r\n for (let f of fct) f(element);\r\n}\r\n\r\n@inject(Element, EventAggregator)\r\n@customAttribute('mdl')\r\nexport class MDLCustomAttribute {\r\n\r\n constructor(element, eventAggregator) {\r\n this.element = element;\r\n this.eventAggregator = eventAggregator;\r\n }\r\n\r\n attached() {\r\n //console.log(\"mdl attached: \" + this.value);\r\n upgradeElement(this.element, this.value);\r\n let payload = {publisher: this, data: this.element};\r\n this.eventAggregator.publish('mdl:component:upgrade', payload);\r\n }\r\n}\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"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AAc,EAAE;UAAP,CAAC;AAAQ,wCAAiB,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;KAAA;;;;;;;;;;;;;;;;;;;;;AAC9D,0BAAc,GAAG;UAAR,CAAC;AAAS,OAAC,CAAC,OAAO,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: [],\n html: ['mdl-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 82dbb83..c55d6a1 100644 --- a/dist/es6/mdl.js +++ b/dist/es6/mdl.js @@ -79,8 +79,8 @@ let mdlTypes = { fct: [manageRipple] }, dialog: { - js: ['MaterialDialog'], - html: ['mdl-dialog', 'mdl-js-dialog'], + js: [], + html: ['mdl-dialog'], fct: [] }, 'mega-footer': { diff --git a/dist/system/mdl.js b/dist/system/mdl.js index 31364b5..2921906 100644 --- a/dist/system/mdl.js +++ b/dist/system/mdl.js @@ -194,8 +194,8 @@ System.register(['aurelia-framework', 'encapsulated-mdl', 'aurelia-event-aggrega fct: [manageRipple] }, dialog: { - js: ['MaterialDialog'], - html: ['mdl-dialog', 'mdl-js-dialog'], + js: [], + html: ['mdl-dialog'], fct: [] }, 'mega-footer': { diff --git a/dist/system/mdl.js.map b/dist/system/mdl.js.map index 5841c25..0a0a9c4 100644 --- a/dist/system/mdl.js.map +++ b/dist/system/mdl.js.map @@ -1 +1 @@ -{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;kEAII,QAAQ,EAqJC,kBAAkB;;;;;;AA7C/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,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAE1D,UAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,UAAI,QAAQ,EAAE;AACZ,aAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACxC,cAAI,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AACxB,cAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;AACpD,4BAAgB,CAAC,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;WAC1D;SACF;OACF;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,6BAAc,IA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B,kBAAkB;eAAlB,kBAAkB","file":"mdl.js","sourcesContent":["import {inject, customAttribute} from 'aurelia-framework';\r\nimport {componentHandler} from 'encapsulated-mdl';\r\nimport {EventAggregator} from 'aurelia-event-aggregator';\r\n\r\nlet mdlTypes = {\r\n button: {\r\n html: ['mdl-button', 'mdl-js-button'],\r\n js: ['MaterialButton'],\r\n fct: [manageRipple]\r\n },\r\n textfield: {\r\n js: ['MaterialTextfield'],\r\n html: ['mdl-textfield', 'mdl-js-textfield'],\r\n fct: []\r\n },\r\n layout: {\r\n js: ['MaterialLayout'],\r\n html: ['mdl-layout', 'mdl-js-layout'],\r\n fct: [manageRipple]\r\n },\r\n menu: {\r\n js: ['MaterialMenu'],\r\n html: ['mdl-menu', 'mdl-js-menu'],\r\n fct: [manageRipple]\r\n },\r\n 'data-table': {\r\n js: ['MaterialDataTable'],\r\n html: ['mdl-data-table', 'mdl-js-data-table'],\r\n fct: [manageRipple]\r\n },\r\n tabs: {\r\n js: ['MaterialTabs'],\r\n html: ['mdl-tabs', 'mdl-js-tabs'],\r\n fct: [manageRipple]\r\n },\r\n slider: {\r\n js: ['MaterialSlider'],\r\n html: ['mdl-slider', 'mdl-js-slider'],\r\n fct: []\r\n },\r\n tooltip: {\r\n js: ['MaterialTooltip'],\r\n html: ['mdl-tooltip'],\r\n fct: []\r\n },\r\n progress: {\r\n js: ['MaterialProgress'],\r\n html: ['mdl-progress', 'mdl-js-progress'],\r\n fct: []\r\n },\r\n spinner: {\r\n js: ['MaterialSpinner'],\r\n html: ['mdl-spinner', 'mdl-js-spinner'],\r\n fct: []\r\n },\r\n badge: {\r\n js: [],\r\n html: ['mdl-badge'],\r\n fct: []\r\n },\r\n switch: {\r\n js: ['MaterialSwitch'],\r\n html: ['mdl-switch', 'mdl-js-switch'],\r\n fct: [manageRipple]\r\n },\r\n radio: {\r\n js: ['MaterialRadio'],\r\n html: ['mdl-radio', 'mdl-js-radio'],\r\n fct: [manageRipple]\r\n },\r\n 'icon-toggle': {\r\n js: ['MaterialIconToggle'],\r\n html: ['mdl-icon-toggle', 'mdl-js-icon-toggle'],\r\n fct: [manageRipple]\r\n },\r\n checkbox: {\r\n js: ['MaterialCheckbox'],\r\n html: ['mdl-checkbox', 'mdl-js-checkbox'],\r\n fct: [manageRipple]\r\n },\r\n dialog: {\r\n js: ['MaterialDialog'],\r\n html: ['mdl-dialog', 'mdl-js-dialog'],\r\n fct: []\r\n },\r\n 'mega-footer': {\r\n js: [],\r\n html: ['mdl-mega-footer'],\r\n fct: []\r\n },\r\n 'mini-footer': {\r\n js: [],\r\n html: ['mdl-mini-footer'],\r\n fct: []\r\n },\r\n grid: {\r\n js: [],\r\n html: ['mdl-grid'],\r\n fct: []\r\n },\r\n snackbar: {\r\n js: ['MaterialSnackbar'],\r\n html: ['mdl-snackbar'],\r\n fct: []\r\n }\r\n\r\n};\r\n\r\nfunction manageRipple(element) {\r\n if (element.classList.contains('mdl-js-ripple-effect')) {\r\n componentHandler.upgradeElement(element, 'MaterialRipple');\r\n }\r\n /**\r\n * Causes issues: upgrades nested elements that has mdl-js-ripple-effect class before the nested elements upgraded, marking them as\r\n * MaterialRipple upgraded, when the nested elements upgraded, and ripple upgrade tries to take place, it doesn't because it is already\r\n * marked as upgraded.\r\n * eventually causing rippleElement to be null on MaterialRipple.\r\n * NOTE: \"mdl-js-ripple-effect\" should be only on upgradable material elements, not on non material nested elements.\r\n let elements = element.querySelectorAll('.mdl-js-ripple-effect');\r\n for (let el of elements) {\r\n componentHandler.upgradeElement(el, 'MaterialRipple');\r\n }*/\r\n\r\n /** Some of the elements do require upgrade of nested elements, to avoid issues we must handle it carefully\r\n * NOTE: not sure about all the elements that require nested upgrading. Will add all the required when used and tested.\r\n */\r\n if (element.MaterialIconToggle || element.MaterialCheckbox) {\r\n /* We need to upgrade immediate children only, no easy way to do it (for all browsers) */\r\n let children = element.children;\r\n if (children) {\r\n for (let i = 0; i < children.length; i++) {\r\n let child = children[i];\r\n if (child.classList.contains('mdl-js-ripple-effect')) {\r\n componentHandler.upgradeElement(child, 'MaterialRipple');\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction upgradeElement(element, type) {\r\n let {html, fct, js} = (mdlTypes[type] || {});\r\n if (html) {\r\n for (let h of html) {\r\n element.classList.add(h);\r\n }\r\n }\r\n for (let t of js) componentHandler.upgradeElement(element, t);\r\n for (let f of fct) f(element);\r\n}\r\n\r\n@inject(Element, EventAggregator)\r\n@customAttribute('mdl')\r\nexport class MDLCustomAttribute {\r\n\r\n constructor(element, eventAggregator) {\r\n this.element = element;\r\n this.eventAggregator = eventAggregator;\r\n }\r\n\r\n attached() {\r\n //console.log(\"mdl attached: \" + this.value);\r\n upgradeElement(this.element, this.value);\r\n let payload = {publisher: this, data: this.element};\r\n this.eventAggregator.publish('mdl:component:upgrade', payload);\r\n }\r\n}\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["mdl.js"],"names":[],"mappings":";;;kEAII,QAAQ,EAqJC,kBAAkB;;;;;;AA7C/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,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAE1D,UAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AAChC,UAAI,QAAQ,EAAE;AACZ,aAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACxC,cAAI,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AACxB,cAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;AACpD,4BAAgB,CAAC,cAAc,CAAC,KAAK,EAAE,gBAAgB,CAAC,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AAC,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: [],\n html: ['mdl-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/package.json b/package.json index c746145..b4e97ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-mdl", - "version": "0.2.0", + "version": "0.2.1", "description": "Aurelia wrapper for Material Design Lite.", "keywords": [ "aurelia", diff --git a/src/mdl.js b/src/mdl.js index 82dbb83..c55d6a1 100644 --- a/src/mdl.js +++ b/src/mdl.js @@ -79,8 +79,8 @@ let mdlTypes = { fct: [manageRipple] }, dialog: { - js: ['MaterialDialog'], - html: ['mdl-dialog', 'mdl-js-dialog'], + js: [], + html: ['mdl-dialog'], fct: [] }, 'mega-footer': {