@material/auto-init
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -6,4 +6,4 @@ # Change Log | ||
# [3.0.0](https://github.com/material-components/material-components-web/compare/v2.3.1...v3.0.0) (2019-06-25) | ||
# [3.1.0](https://github.com/material-components/material-components-web/compare/v3.0.0...v3.1.0) (2019-07-22) | ||
**Note:** Version bump only for package @material/auto-init |
// Generated by dts-bundle v0.7.3 | ||
// Dependencies for this module: | ||
// ../../../@material/base/component | ||
// ../../../@material/base/foundation | ||
// ../../@material/base/component | ||
// ../../@material/base/foundation | ||
@@ -38,4 +38,4 @@ declare module '@material/auto-init' { | ||
*/ | ||
export function mdcAutoInit(root?: Document): MDCComponent<MDCFoundation<{}>>[]; | ||
export namespace mdcAutoInit { | ||
function mdcAutoInit(root?: Document): MDCComponent<MDCFoundation<{}>>[]; | ||
namespace mdcAutoInit { | ||
var register: (componentName: string, Constructor: MDCAttachable, warn?: (message?: any, ...optionalParams: any[]) => void) => void; | ||
@@ -46,3 +46,4 @@ var deregister: (componentName: string) => void; | ||
export default mdcAutoInit; | ||
export default mdcAutoInit; | ||
} | ||
@@ -9,165 +9,285 @@ /** | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports === "object") exports["autoInit"] = factory(); else root["mdc"] = root["mdc"] || {}, | ||
root["mdc"]["autoInit"] = factory(); | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else if(typeof exports === 'object') | ||
exports["autoInit"] = factory(); | ||
else | ||
root["mdc"] = root["mdc"] || {}, root["mdc"]["autoInit"] = factory(); | ||
})(this, function() { | ||
return function(modules) { | ||
var installedModules = {}; | ||
function __webpack_require__(moduleId) { | ||
if (installedModules[moduleId]) { | ||
return installedModules[moduleId].exports; | ||
} | ||
var module = installedModules[moduleId] = { | ||
i: moduleId, | ||
l: false, | ||
exports: {} | ||
}; | ||
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
module.l = true; | ||
return module.exports; | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = function(exports) { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ | ||
/******/ // create a fake namespace object | ||
/******/ // mode & 1: value is a module id, require it | ||
/******/ // mode & 2: merge all properties of value into the ns | ||
/******/ // mode & 4: return value when already ns object | ||
/******/ // mode & 8|1: behave like require | ||
/******/ __webpack_require__.t = function(value, mode) { | ||
/******/ if(mode & 1) value = __webpack_require__(value); | ||
/******/ if(mode & 8) return value; | ||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | ||
/******/ var ns = Object.create(null); | ||
/******/ __webpack_require__.r(ns); | ||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | ||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | ||
/******/ return ns; | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = "./packages/mdc-auto-init/index.ts"); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
/***/ "./packages/mdc-auto-init/constants.ts": | ||
/*!*********************************************!*\ | ||
!*** ./packages/mdc-auto-init/constants.ts ***! | ||
\*********************************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/** | ||
* @license | ||
* Copyright 2019 Google Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.strings = { | ||
AUTO_INIT_ATTR: 'data-mdc-auto-init', | ||
AUTO_INIT_STATE_ATTR: 'data-mdc-auto-init-state', | ||
INITIALIZED_STATE: 'initialized' | ||
}; | ||
/***/ }), | ||
/***/ "./packages/mdc-auto-init/index.ts": | ||
/*!*****************************************!*\ | ||
!*** ./packages/mdc-auto-init/index.ts ***! | ||
\*****************************************/ | ||
/*! no static exports found */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
/** | ||
* @license | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
var __values = this && this.__values || function (o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], | ||
i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function next() { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
__webpack_require__.m = modules; | ||
__webpack_require__.c = installedModules; | ||
__webpack_require__.d = function(exports, name, getter) { | ||
if (!__webpack_require__.o(exports, name)) { | ||
Object.defineProperty(exports, name, { | ||
configurable: false, | ||
enumerable: true, | ||
get: getter | ||
}); | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-auto-init/constants.ts"); | ||
var AUTO_INIT_ATTR = constants_1.strings.AUTO_INIT_ATTR, | ||
AUTO_INIT_STATE_ATTR = constants_1.strings.AUTO_INIT_STATE_ATTR, | ||
INITIALIZED_STATE = constants_1.strings.INITIALIZED_STATE; | ||
var registry = {}; | ||
var CONSOLE_WARN = console.warn.bind(console); // tslint:disable-line:no-console | ||
function emit(evtType, evtData, shouldBubble) { | ||
if (shouldBubble === void 0) { | ||
shouldBubble = false; | ||
} | ||
var evt; | ||
if (typeof CustomEvent === 'function') { | ||
evt = new CustomEvent(evtType, { | ||
bubbles: shouldBubble, | ||
detail: evtData | ||
}); | ||
} else { | ||
evt = document.createEvent('CustomEvent'); | ||
evt.initCustomEvent(evtType, shouldBubble, false, evtData); | ||
} | ||
document.dispatchEvent(evt); | ||
} | ||
/* istanbul ignore next: optional argument is not a branch statement */ | ||
/** | ||
* Auto-initializes all MDC components on a page. | ||
*/ | ||
function mdcAutoInit(root) { | ||
var e_1, _a; | ||
if (root === void 0) { | ||
root = document; | ||
} | ||
var components = []; | ||
var nodes = [].slice.call(root.querySelectorAll("[" + AUTO_INIT_ATTR + "]")); | ||
nodes = nodes.filter(function (node) { | ||
return node.getAttribute(AUTO_INIT_STATE_ATTR) !== INITIALIZED_STATE; | ||
}); | ||
try { | ||
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) { | ||
var node = nodes_1_1.value; | ||
var ctorName = node.getAttribute(AUTO_INIT_ATTR); | ||
if (!ctorName) { | ||
throw new Error('(mdc-auto-init) Constructor name must be given.'); | ||
} | ||
}; | ||
__webpack_require__.n = function(module) { | ||
var getter = module && module.__esModule ? function getDefault() { | ||
return module["default"]; | ||
} : function getModuleExports() { | ||
return module; | ||
}; | ||
__webpack_require__.d(getter, "a", getter); | ||
return getter; | ||
}; | ||
__webpack_require__.o = function(object, property) { | ||
return Object.prototype.hasOwnProperty.call(object, property); | ||
}; | ||
__webpack_require__.p = ""; | ||
return __webpack_require__(__webpack_require__.s = 103); | ||
}({ | ||
103: function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var __values = this && this.__values || function(o) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; | ||
if (m) return m.call(o); | ||
return { | ||
next: function next() { | ||
if (o && i >= o.length) o = void 0; | ||
return { | ||
value: o && o[i++], | ||
done: !o | ||
}; | ||
} | ||
}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var constants_1 = __webpack_require__(104); | ||
var AUTO_INIT_ATTR = constants_1.strings.AUTO_INIT_ATTR, AUTO_INIT_STATE_ATTR = constants_1.strings.AUTO_INIT_STATE_ATTR, INITIALIZED_STATE = constants_1.strings.INITIALIZED_STATE; | ||
var registry = {}; | ||
var CONSOLE_WARN = console.warn.bind(console); | ||
function emit(evtType, evtData, shouldBubble) { | ||
if (shouldBubble === void 0) { | ||
shouldBubble = false; | ||
} | ||
var evt; | ||
if (typeof CustomEvent === "function") { | ||
evt = new CustomEvent(evtType, { | ||
bubbles: shouldBubble, | ||
detail: evtData | ||
}); | ||
} else { | ||
evt = document.createEvent("CustomEvent"); | ||
evt.initCustomEvent(evtType, shouldBubble, false, evtData); | ||
} | ||
document.dispatchEvent(evt); | ||
var Constructor = registry[ctorName]; // tslint:disable-line:variable-name | ||
if (typeof Constructor !== 'function') { | ||
throw new Error("(mdc-auto-init) Could not find constructor in registry for " + ctorName); | ||
} | ||
function mdcAutoInit(root) { | ||
if (root === void 0) { | ||
root = document; | ||
} | ||
var e_1, _a; | ||
var components = []; | ||
var nodes = [].slice.call(root.querySelectorAll("[" + AUTO_INIT_ATTR + "]")); | ||
nodes = nodes.filter(function(node) { | ||
return node.getAttribute(AUTO_INIT_STATE_ATTR) !== INITIALIZED_STATE; | ||
}); | ||
try { | ||
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) { | ||
var node = nodes_1_1.value; | ||
var ctorName = node.getAttribute(AUTO_INIT_ATTR); | ||
if (!ctorName) { | ||
throw new Error("(mdc-auto-init) Constructor name must be given."); | ||
} | ||
var Constructor = registry[ctorName]; | ||
if (typeof Constructor !== "function") { | ||
throw new Error("(mdc-auto-init) Could not find constructor in registry for " + ctorName); | ||
} | ||
var component = Constructor.attachTo(node); | ||
Object.defineProperty(node, ctorName, { | ||
configurable: true, | ||
enumerable: false, | ||
value: component, | ||
writable: false | ||
}); | ||
components.push(component); | ||
node.setAttribute(AUTO_INIT_STATE_ATTR, INITIALIZED_STATE); | ||
} | ||
} catch (e_1_1) { | ||
e_1 = { | ||
error: e_1_1 | ||
}; | ||
} finally { | ||
try { | ||
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1); | ||
} finally { | ||
if (e_1) throw e_1.error; | ||
} | ||
} | ||
emit("MDCAutoInit:End", {}); | ||
return components; | ||
} | ||
exports.mdcAutoInit = mdcAutoInit; | ||
mdcAutoInit.register = function(componentName, Constructor, warn) { | ||
if (warn === void 0) { | ||
warn = CONSOLE_WARN; | ||
} | ||
if (typeof Constructor !== "function") { | ||
throw new Error("(mdc-auto-init) Invalid Constructor value: " + Constructor + ". Expected function."); | ||
} | ||
var registryValue = registry[componentName]; | ||
if (registryValue) { | ||
warn("(mdc-auto-init) Overriding registration for " + componentName + " with " + Constructor + ". Was: " + registryValue); | ||
} | ||
registry[componentName] = Constructor; | ||
}; | ||
mdcAutoInit.deregister = function(componentName) { | ||
delete registry[componentName]; | ||
}; | ||
mdcAutoInit.deregisterAll = function() { | ||
var keys = Object.keys(registry); | ||
keys.forEach(this.deregister, this); | ||
}; | ||
exports.default = mdcAutoInit; | ||
}, | ||
104: function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
// TODO: Should we make an eslint rule for an attachTo() static method? | ||
// See https://github.com/Microsoft/TypeScript/issues/14600 for discussion of static interface support in TS | ||
var component = Constructor.attachTo(node); | ||
Object.defineProperty(node, ctorName, { | ||
configurable: true, | ||
enumerable: false, | ||
value: component, | ||
writable: false | ||
}); | ||
exports.strings = { | ||
AUTO_INIT_ATTR: "data-mdc-auto-init", | ||
AUTO_INIT_STATE_ATTR: "data-mdc-auto-init-state", | ||
INITIALIZED_STATE: "initialized" | ||
}; | ||
components.push(component); | ||
node.setAttribute(AUTO_INIT_STATE_ATTR, INITIALIZED_STATE); | ||
} | ||
}); | ||
} catch (e_1_1) { | ||
e_1 = { error: e_1_1 }; | ||
} finally { | ||
try { | ||
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1); | ||
} finally { | ||
if (e_1) throw e_1.error; | ||
} | ||
} | ||
emit('MDCAutoInit:End', {}); | ||
return components; | ||
} | ||
exports.mdcAutoInit = mdcAutoInit; | ||
// Constructor is PascalCased because it is a direct reference to a class, rather than an instance of a class. | ||
// tslint:disable-next-line:variable-name | ||
mdcAutoInit.register = function (componentName, Constructor, warn) { | ||
if (warn === void 0) { | ||
warn = CONSOLE_WARN; | ||
} | ||
if (typeof Constructor !== 'function') { | ||
throw new Error("(mdc-auto-init) Invalid Constructor value: " + Constructor + ". Expected function."); | ||
} | ||
var registryValue = registry[componentName]; | ||
if (registryValue) { | ||
warn("(mdc-auto-init) Overriding registration for " + componentName + " with " + Constructor + ". Was: " + registryValue); | ||
} | ||
registry[componentName] = Constructor; | ||
}; | ||
mdcAutoInit.deregister = function (componentName) { | ||
delete registry[componentName]; | ||
}; | ||
mdcAutoInit.deregisterAll = function () { | ||
var keys = Object.keys(registry); | ||
keys.forEach(this.deregister, this); | ||
}; | ||
// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier. | ||
exports.default = mdcAutoInit; | ||
/***/ }) | ||
/******/ }); | ||
}); | ||
//# sourceMappingURL=mdc.autoInit.js.map |
@@ -1,9 +0,1 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.autoInit=e():(t.mdc=t.mdc||{},t.mdc.autoInit=e())}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=103)}({103:function(t,e,n){"use strict";function r(t,e,n){void 0===n&&(n=!1);var r;"function"==typeof CustomEvent?r=new CustomEvent(t,{bubbles:n,detail:e}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(t,n,!1,e)),document.dispatchEvent(r)}function o(t){void 0===t&&(t=document);var e,n,o=[],u=[].slice.call(t.querySelectorAll("["+c+"]"));u=u.filter(function(t){return t.getAttribute(a)!==f});try{for(var d=i(u),l=d.next();!l.done;l=d.next()){var v=l.value,p=v.getAttribute(c);if(!p)throw new Error("(mdc-auto-init) Constructor name must be given.");var m=s[p];if("function"!=typeof m)throw new Error("(mdc-auto-init) Could not find constructor in registry for "+p);var T=m.attachTo(v);Object.defineProperty(v,p,{configurable:!0,enumerable:!1,value:T,writable:!1}),o.push(T),v.setAttribute(a,f)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}return r("MDCAutoInit:End",{}),o}var i=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var u=n(104),c=u.strings.AUTO_INIT_ATTR,a=u.strings.AUTO_INIT_STATE_ATTR,f=u.strings.INITIALIZED_STATE,s={},d=console.warn.bind(console);e.mdcAutoInit=o,o.register=function(t,e,n){if(void 0===n&&(n=d),"function"!=typeof e)throw new Error("(mdc-auto-init) Invalid Constructor value: "+e+". Expected function.");var r=s[t];r&&n("(mdc-auto-init) Overriding registration for "+t+" with "+e+". Was: "+r),s[t]=e},o.deregister=function(t){delete s[t]},o.deregisterAll=function(){Object.keys(s).forEach(this.deregister,this)},e.default=o},104:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.strings={AUTO_INIT_ATTR:"data-mdc-auto-init",AUTO_INIT_STATE_ATTR:"data-mdc-auto-init-state",INITIALIZED_STATE:"initialized"}}})}); | ||
//# sourceMappingURL=mdc.autoInit.min.js.map | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.autoInit=e():(t.mdc=t.mdc||{},t.mdc.autoInit=e())}(this,function(){return r={},o.m=n={106:function(t,e,n){"use strict";var d=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var r=n(107),s=r.strings.AUTO_INIT_ATTR,v=r.strings.AUTO_INIT_STATE_ATTR,p=r.strings.INITIALIZED_STATE,b={},o=console.warn.bind(console);function i(t){var e,n;void 0===t&&(t=document);var r=[],o=[].slice.call(t.querySelectorAll("["+s+"]"));o=o.filter(function(t){return t.getAttribute(v)!==p});try{for(var i=d(o),u=i.next();!u.done;u=i.next()){var c=u.value,a=c.getAttribute(s);if(!a)throw new Error("(mdc-auto-init) Constructor name must be given.");var f=b[a];if("function"!=typeof f)throw new Error("(mdc-auto-init) Could not find constructor in registry for "+a);var l=f.attachTo(c);Object.defineProperty(c,a,{configurable:!0,enumerable:!1,value:l,writable:!1}),r.push(l),c.setAttribute(v,p)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return function(t,e,n){var r;void 0===n&&(n=!1),"function"==typeof CustomEvent?r=new CustomEvent(t,{bubbles:n,detail:e}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),document.dispatchEvent(r)}("MDCAutoInit:End",{}),r}(e.mdcAutoInit=i).register=function(t,e,n){if(void 0===n&&(n=o),"function"!=typeof e)throw new Error("(mdc-auto-init) Invalid Constructor value: "+e+". Expected function.");var r=b[t];r&&n("(mdc-auto-init) Overriding registration for "+t+" with "+e+". Was: "+r),b[t]=e},i.deregister=function(t){delete b[t]},i.deregisterAll=function(){Object.keys(b).forEach(this.deregister,this)},e.default=i},107:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.strings={AUTO_INIT_ATTR:"data-mdc-auto-init",AUTO_INIT_STATE_ATTR:"data-mdc-auto-init-state",INITIALIZED_STATE:"initialized"}}},o.c=r,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=106);function o(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var n,r}); |
@@ -32,4 +32,4 @@ /** | ||
*/ | ||
export declare function mdcAutoInit(root?: Document): MDCComponent<MDCFoundation<{}>>[]; | ||
export declare namespace mdcAutoInit { | ||
declare function mdcAutoInit(root?: Document): MDCComponent<MDCFoundation<{}>>[]; | ||
declare namespace mdcAutoInit { | ||
var register: (componentName: string, Constructor: MDCAttachable, warn?: (message?: any, ...optionalParams: any[]) => void) => void; | ||
@@ -40,1 +40,2 @@ var deregister: (componentName: string) => void; | ||
export default mdcAutoInit; | ||
export default mdcAutoInit; |
@@ -48,4 +48,4 @@ /** | ||
export function mdcAutoInit(root) { | ||
var e_1, _a; | ||
if (root === void 0) { root = document; } | ||
var e_1, _a; | ||
var components = []; | ||
@@ -52,0 +52,0 @@ var nodes = [].slice.call(root.querySelectorAll("[" + AUTO_INIT_ATTR + "]")); |
{ | ||
"name": "@material/auto-init", | ||
"description": "Declarative, easy-to-use auto-initialization for Material Components for the web", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"main": "dist/mdc.autoInit.js", | ||
@@ -12,9 +12,10 @@ "module": "index.js", | ||
"type": "git", | ||
"url": "https://github.com/material-components/material-components-web.git" | ||
"url": "https://github.com/material-components/material-components-web.git", | ||
"directory": "packages/mdc-auto-init" | ||
}, | ||
"dependencies": { | ||
"@material/base": "^3.0.0", | ||
"@material/base": "^3.1.0", | ||
"tslib": "^1.9.3" | ||
}, | ||
"gitHead": "747f6ed544e3a3bb3fde71ceaa51359f2212bfb9" | ||
"gitHead": "6b7e616da1a1ca53df2253f6207642739e13b5dc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
526
50363
14
Updated@material/base@^3.1.0