123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
- import _createClass from 'babel-runtime/helpers/createClass';
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
- import _inherits from 'babel-runtime/helpers/inherits';
-
-
- import onsElements from '../ons/elements';
- import BaseElement from './base/base-element';
- import autoStyle from '../ons/autostyle';
- import ModifierUtil from '../ons/internal/modifier-util';
- import util from '../ons/util';
-
- var defaultClassName = 'list-title';
- var scheme = { '': 'list-title--*' };
-
-
-
- var ListTitleElement = function (_BaseElement) {
- _inherits(ListTitleElement, _BaseElement);
-
- function ListTitleElement() {
- _classCallCheck(this, ListTitleElement);
-
- var _this = _possibleConstructorReturn(this, (ListTitleElement.__proto__ || _Object$getPrototypeOf(ListTitleElement)).call(this));
-
- _this._compile();
- return _this;
- }
-
- _createClass(ListTitleElement, [{
- key: '_compile',
- value: function _compile() {
- autoStyle.prepare(this);
- this.classList.add(defaultClassName);
- ModifierUtil.initModifier(this, scheme);
- }
- }, {
- key: 'attributeChangedCallback',
- value: function attributeChangedCallback(name, last, current) {
- switch (name) {
- case 'class':
- util.restoreClass(this, defaultClassName, scheme);
- break;
- case 'modifier':
- ModifierUtil.onModifierChanged(last, current, this, scheme);
- break;
- }
- }
- }], [{
- key: 'observedAttributes',
- get: function get() {
- return ['modifier', 'class'];
- }
- }]);
-
- return ListTitleElement;
- }(BaseElement);
-
- export default ListTitleElement;
-
-
- onsElements.ListTitle = ListTitleElement;
- customElements.define('ons-list-title', ListTitleElement);
|