UNPKG

app-decorators

Version:

Collection of useful ES7 Decorators, writtin in ES6, that can be used for building webapps

149 lines (124 loc) 5.81 kB
System.register(['app-decorators/src/libs/random-storage', 'app-decorators/src/libs/customelement', 'app-decorators/src/libs/element-to-function', 'app-decorators'], function (_export, _context) { "use strict"; var _storage, _Register, _elementToFunc, component, view, _typeof, _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _class3, _temp2, Test; function _initDefineProp(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.'); } return { setters: [function (_appDecoratorsSrcLibsRandomStorage) { _storage = _appDecoratorsSrcLibsRandomStorage; }, function (_appDecoratorsSrcLibsCustomelement) { _Register = _appDecoratorsSrcLibsCustomelement; }, function (_appDecoratorsSrcLibsElementToFunction) { _elementToFunc = _appDecoratorsSrcLibsElementToFunction.default; }, function (_appDecorators) { component = _appDecorators.component; view = _appDecorators.view; }], execute: function () { _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; _export('Test', Test = (_dec = view({ "compiler": [7, ">= 4.0.0"], "main": function main(container, depth0, helpers, partials, data) { var helper, alias1 = depth0 != null ? depth0 : container.nullContext || {}, alias2 = helpers.helperMissing, alias3 = "function", alias4 = container.escapeExpression; return "<div class=\"" + alias4((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2, (typeof helper === 'undefined' ? 'undefined' : _typeof(helper)) === alias3 ? helper.call(alias1, { "name": "name", "hash": {}, "data": data }) : helper)) + "\">" + alias4((helper = (helper = helpers.content || (depth0 != null ? depth0.content : depth0)) != null ? helper : alias2, (typeof helper === 'undefined' ? 'undefined' : _typeof(helper)) === alias3 ? helper.call(alias1, { "name": "content", "hash": {}, "data": data }) : helper)) + "</div> "; }, "useData": true }, { renderedFlag: false }), _dec2 = component(), _dec3 = view.bind, _dec4 = view.bind, _dec(_class = _dec2(_class = (_class2 = (_temp2 = _class3 = function (_elementToFunc2) { _inherits(Test, _elementToFunc2); function Test() { var _ref; var _temp, _this, _ret; _classCallCheck(this, Test); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Test.__proto__ || Object.getPrototypeOf(Test)).call.apply(_ref, [this].concat(args))), _this), _initDefineProp(_this, 'name', _descriptor, _this), _initDefineProp(_this, 'content', _descriptor2, _this), _temp), _possibleConstructorReturn(_this, _ret); } return Test; }(_elementToFunc(HTMLDivElement)), _class3.$$componentName = 'Test', _temp2), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, 'name', [_dec3], { enumerable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'content', [_dec4], { enumerable: true, initializer: null })), _class2)) || _class) || _class)); _Register.Register.customElement(Test, _storage.storage.get(Test).get('@component')); _export('Test', Test); } }; }); //# sourceMappingURL=testcomponent.js.map