@material/base
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -28,6 +28,8 @@ /** | ||
constructor(root, foundation = this.getDefaultFoundation(), ...args) { | ||
constructor(root, foundation = undefined, ...args) { | ||
this.root_ = root; | ||
this.initialize(...args); | ||
this.foundation_ = foundation; | ||
// Note that we initialize foundation here and not within the constructor's default param so that | ||
// this.root_ is defined and can be used within the foundation class. | ||
this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation; | ||
this.foundation_.init(); | ||
@@ -34,0 +36,0 @@ this.initialSyncWithDOM(); |
@@ -29,5 +29,5 @@ /*! | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
@@ -39,3 +39,3 @@ | ||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = true; | ||
/******/ module.l = true; | ||
@@ -53,2 +53,28 @@ /******/ // Return the exports of the module | ||
/******/ // identity function for calling harmony imports with the correct context | ||
/******/ __webpack_require__.i = function(value) { return value; }; | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ // 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__ | ||
@@ -58,268 +84,260 @@ /******/ __webpack_require__.p = "/assets/"; | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ return __webpack_require__(__webpack_require__.s = 38); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
/******/ ({ | ||
module.exports = __webpack_require__(3); | ||
/***/ 0: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(1); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; }); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(2); | ||
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; }); | ||
/** | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/***/ }, | ||
/* 1 */, | ||
/* 2 */, | ||
/* 3 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _foundation = __webpack_require__(4); | ||
/***/ }), | ||
Object.defineProperty(exports, 'MDCFoundation', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_foundation).default; | ||
} | ||
}); | ||
/***/ 1: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
var _component = __webpack_require__(5); | ||
"use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
Object.defineProperty(exports, 'MDCComponent', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_component).default; | ||
} | ||
}); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/***/ }, | ||
/* 4 */ | ||
/***/ function(module, exports) { | ||
var MDCFoundation = function () { | ||
_createClass(MDCFoundation, null, [{ | ||
key: "cssClasses", | ||
get: function get() { | ||
// Classes extending MDCFoundation should implement this method to return an object which exports every | ||
// CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'} | ||
return {}; | ||
} | ||
}, { | ||
key: "strings", | ||
get: function get() { | ||
// Classes extending MDCFoundation should implement this method to return an object which exports all | ||
// semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'} | ||
return {}; | ||
} | ||
}, { | ||
key: "numbers", | ||
get: function get() { | ||
// Classes extending MDCFoundation should implement this method to return an object which exports all | ||
// of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350} | ||
return {}; | ||
} | ||
}, { | ||
key: "defaultAdapter", | ||
get: function get() { | ||
// Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient | ||
// way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter | ||
// validation. | ||
return {}; | ||
} | ||
}]); | ||
"use strict"; | ||
function MDCFoundation() { | ||
var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
_classCallCheck(this, MDCFoundation); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
this.adapter_ = adapter; | ||
} | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_createClass(MDCFoundation, [{ | ||
key: "init", | ||
value: function init() { | ||
// Subclasses should override this method to perform initialization routines (registering events, etc.) | ||
} | ||
}, { | ||
key: "destroy", | ||
value: function destroy() { | ||
// Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) | ||
} | ||
}]); | ||
/** | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
return MDCFoundation; | ||
}(); | ||
var MDCFoundation = function () { | ||
_createClass(MDCFoundation, null, [{ | ||
key: "cssClasses", | ||
get: function get() { | ||
// Classes extending MDCFoundation should implement this method to return an object which exports every | ||
// CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'} | ||
return {}; | ||
} | ||
}, { | ||
key: "strings", | ||
get: function get() { | ||
// Classes extending MDCFoundation should implement this method to return an object which exports all | ||
// semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'} | ||
return {}; | ||
} | ||
}, { | ||
key: "numbers", | ||
get: function get() { | ||
// Classes extending MDCFoundation should implement this method to return an object which exports all | ||
// of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350} | ||
return {}; | ||
} | ||
}, { | ||
key: "defaultAdapter", | ||
get: function get() { | ||
// Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient | ||
// way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter | ||
// validation. | ||
return {}; | ||
} | ||
}]); | ||
/* harmony default export */ __webpack_exports__["a"] = MDCFoundation; | ||
function MDCFoundation() { | ||
var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
/***/ }), | ||
_classCallCheck(this, MDCFoundation); | ||
/***/ 2: | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
this.adapter_ = adapter; | ||
} | ||
"use strict"; | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(1); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
_createClass(MDCFoundation, [{ | ||
key: "init", | ||
value: function init() { | ||
// Subclasses should override this method to perform initialization routines (registering events, etc.) | ||
} | ||
}, { | ||
key: "destroy", | ||
value: function destroy() { | ||
// Subclasses should override this method to perform de-initialization routines (de-registering events, etc.) | ||
} | ||
}]); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
return MDCFoundation; | ||
}(); | ||
/** | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
exports.default = MDCFoundation; | ||
/***/ }, | ||
/* 5 */ | ||
/***/ function(module, exports, __webpack_require__) { | ||
'use strict'; | ||
var MDCComponent = function () { | ||
_createClass(MDCComponent, null, [{ | ||
key: 'attachTo', | ||
value: function attachTo(root) { | ||
// Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and | ||
// returns an instantiated component with its root set to that element. Also note that in the cases of | ||
// subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized | ||
// from getDefaultFoundation(). | ||
return new MDCComponent(root, new __WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]()); | ||
} | ||
}]); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function MDCComponent(root) { | ||
var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** | ||
* Copyright 2016 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
_classCallCheck(this, MDCComponent); | ||
var _foundation = __webpack_require__(4); | ||
this.root_ = root; | ||
var _foundation2 = _interopRequireDefault(_foundation); | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
this.initialize.apply(this, args); | ||
// Note that we initialize foundation here and not within the constructor's default param so that | ||
// this.root_ is defined and can be used within the foundation class. | ||
this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation; | ||
this.foundation_.init(); | ||
this.initialSyncWithDOM(); | ||
} | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
_createClass(MDCComponent, [{ | ||
key: 'initialize', | ||
value: function initialize() /* ...args */{ | ||
// Subclasses can override this to do any additional setup work that would be considered part of a | ||
// "constructor". Essentially, it is a hook into the parent constructor before the foundation is | ||
// initialized. Any additional arguments besides root and foundation will be passed in here. | ||
} | ||
}, { | ||
key: 'getDefaultFoundation', | ||
value: function getDefaultFoundation() { | ||
// Subclasses must override this method to return a properly configured foundation class for the | ||
// component. | ||
throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class'); | ||
} | ||
}, { | ||
key: 'initialSyncWithDOM', | ||
value: function initialSyncWithDOM() { | ||
// Subclasses should override this method if they need to perform work to synchronize with a host DOM | ||
// object. An example of this would be a form control wrapper that needs to synchronize its internal state | ||
// to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM | ||
// reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. | ||
} | ||
}, { | ||
key: 'destroy', | ||
value: function destroy() { | ||
// Subclasses may implement this method to release any resources / deregister any listeners they have | ||
// attached. An example of this might be deregistering a resize event from the window object. | ||
this.foundation_.destroy(); | ||
} | ||
var MDCComponent = function () { | ||
_createClass(MDCComponent, null, [{ | ||
key: 'attachTo', | ||
value: function attachTo(root) { | ||
// Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and | ||
// returns an instantiated component with its root set to that element. Also note that in the cases of | ||
// subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized | ||
// from getDefaultFoundation(). | ||
return new MDCComponent(root, new _foundation2.default()); | ||
} | ||
}]); | ||
// Wrapper method to add an event listener to the component's root element. This is most useful when | ||
// listening for custom events. | ||
function MDCComponent(root) { | ||
var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getDefaultFoundation(); | ||
}, { | ||
key: 'listen', | ||
value: function listen(evtType, handler) { | ||
this.root_.addEventListener(evtType, handler); | ||
} | ||
_classCallCheck(this, MDCComponent); | ||
// Wrapper method to remove an event listener to the component's root element. This is most useful when | ||
// unlistening for custom events. | ||
this.root_ = root; | ||
}, { | ||
key: 'unlisten', | ||
value: function unlisten(evtType, handler) { | ||
this.root_.removeEventListener(evtType, handler); | ||
} | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
// Fires a cross-browser-compatible custom event from the component root of the given type, | ||
// with the given data. | ||
this.initialize.apply(this, args); | ||
this.foundation_ = foundation; | ||
this.foundation_.init(); | ||
this.initialSyncWithDOM(); | ||
} | ||
}, { | ||
key: 'emit', | ||
value: function emit(evtType, evtData) { | ||
var evt = void 0; | ||
if (typeof CustomEvent === 'function') { | ||
evt = new CustomEvent(evtType, { detail: evtData }); | ||
} else { | ||
evt = document.createEvent('CustomEvent'); | ||
evt.initCustomEvent(evtType, false, false, evtData); | ||
} | ||
_createClass(MDCComponent, [{ | ||
key: 'initialize', | ||
value: function initialize() /* ...args */{ | ||
// Subclasses can override this to do any additional setup work that would be considered part of a | ||
// "constructor". Essentially, it is a hook into the parent constructor before the foundation is | ||
// initialized. Any additional arguments besides root and foundation will be passed in here. | ||
} | ||
}, { | ||
key: 'getDefaultFoundation', | ||
value: function getDefaultFoundation() { | ||
// Subclasses must override this method to return a properly configured foundation class for the | ||
// component. | ||
throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class'); | ||
} | ||
}, { | ||
key: 'initialSyncWithDOM', | ||
value: function initialSyncWithDOM() { | ||
// Subclasses should override this method if they need to perform work to synchronize with a host DOM | ||
// object. An example of this would be a form control wrapper that needs to synchronize its internal state | ||
// to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM | ||
// reads/writes that would cause layout / paint, as this is called synchronously from within the constructor. | ||
} | ||
}, { | ||
key: 'destroy', | ||
value: function destroy() { | ||
// Subclasses may implement this method to release any resources / deregister any listeners they have | ||
// attached. An example of this might be deregistering a resize event from the window object. | ||
this.foundation_.destroy(); | ||
} | ||
this.root_.dispatchEvent(evt); | ||
} | ||
}]); | ||
// Wrapper method to add an event listener to the component's root element. This is most useful when | ||
// listening for custom events. | ||
return MDCComponent; | ||
}(); | ||
}, { | ||
key: 'listen', | ||
value: function listen(evtType, handler) { | ||
this.root_.addEventListener(evtType, handler); | ||
} | ||
/* harmony default export */ __webpack_exports__["a"] = MDCComponent; | ||
// Wrapper method to remove an event listener to the component's root element. This is most useful when | ||
// unlistening for custom events. | ||
/***/ }), | ||
}, { | ||
key: 'unlisten', | ||
value: function unlisten(evtType, handler) { | ||
this.root_.removeEventListener(evtType, handler); | ||
} | ||
/***/ 38: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// Fires a cross-browser-compatible custom event from the component root of the given type, | ||
// with the given data. | ||
module.exports = __webpack_require__(0); | ||
}, { | ||
key: 'emit', | ||
value: function emit(evtType, evtData) { | ||
var evt = void 0; | ||
if (typeof CustomEvent === 'function') { | ||
evt = new CustomEvent(evtType, { detail: evtData }); | ||
} else { | ||
evt = document.createEvent('CustomEvent'); | ||
evt.initCustomEvent(evtType, false, false, evtData); | ||
} | ||
this.root_.dispatchEvent(evt); | ||
} | ||
}]); | ||
/***/ }) | ||
return MDCComponent; | ||
}(); | ||
exports.default = MDCComponent; | ||
/***/ } | ||
/******/ ]) | ||
}); | ||
; | ||
/******/ }); | ||
}); |
@@ -6,2 +6,2 @@ /*! | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.base=t():(e.mdc=e.mdc||{},e.mdc.base=t())}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="/assets/",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"MDCFoundation",{enumerable:!0,get:function(){return o(r).default}});var u=n(3);Object.defineProperty(t,"MDCComponent",{enumerable:!0,get:function(){return o(u).default}})},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.adapter_=t}return o(e,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),o(e,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),e}();t.default=r},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(2),a=o(i),f=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getDefaultFoundation();r(this,e),this.root_=t;for(var o=arguments.length,u=Array(o>2?o-2:0),i=2;i<o;i++)u[i-2]=arguments[i];this.initialize.apply(this,u),this.foundation_=n,this.foundation_.init(),this.initialSyncWithDOM()}return u(e,null,[{key:"attachTo",value:function(t){return new e(t,new a.default)}}]),u(e,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(e,t){this.root_.addEventListener(e,t)}},{key:"unlisten",value:function(e,t){this.root_.removeEventListener(e,t)}},{key:"emit",value:function(e,t){var n=void 0;"function"==typeof CustomEvent?n=new CustomEvent(e,{detail:t}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!1,t)),this.root_.dispatchEvent(n)}}]),e}();t.default=f}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.base=n():(t.mdc=t.mdc||{},t.mdc.base=n())}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="/assets/",n(n.s=38)}({0:function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(1);e.d(n,"MDCFoundation",function(){return o.a});var r=e(2);e.d(n,"MDCComponent",function(){return r.a})},1:function(t,n,e){"use strict";function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(n,e,o){return e&&t(n.prototype,e),o&&t(n,o),n}}(),i=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.adapter_=n}return r(t,null,[{key:"cssClasses",get:function(){return{}}},{key:"strings",get:function(){return{}}},{key:"numbers",get:function(){return{}}},{key:"defaultAdapter",get:function(){return{}}}]),r(t,[{key:"init",value:function(){}},{key:"destroy",value:function(){}}]),t}();n.a=i},2:function(t,n,e){"use strict";function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var r=e(1),i=function(){function t(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(n,e,o){return e&&t(n.prototype,e),o&&t(n,o),n}}(),u=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;o(this,t),this.root_=n;for(var r=arguments.length,i=Array(r>2?r-2:0),u=2;u<r;u++)i[u-2]=arguments[u];this.initialize.apply(this,i),this.foundation_=void 0===e?this.getDefaultFoundation():e,this.foundation_.init(),this.initialSyncWithDOM()}return i(t,null,[{key:"attachTo",value:function(n){return new t(n,new r.a)}}]),i(t,[{key:"initialize",value:function(){}},{key:"getDefaultFoundation",value:function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")}},{key:"initialSyncWithDOM",value:function(){}},{key:"destroy",value:function(){this.foundation_.destroy()}},{key:"listen",value:function(t,n){this.root_.addEventListener(t,n)}},{key:"unlisten",value:function(t,n){this.root_.removeEventListener(t,n)}},{key:"emit",value:function(t,n){var e=void 0;"function"==typeof CustomEvent?e=new CustomEvent(t,{detail:n}):(e=document.createEvent("CustomEvent"),e.initCustomEvent(t,!1,!1,n)),this.root_.dispatchEvent(e)}}]),t}();n.a=u},38:function(t,n,e){t.exports=e(0)}})}); |
{ | ||
"name": "@material/base", | ||
"description": "The set of base classes for Material Components for the web", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
426
33741