New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

omi

Package Overview
Dependencies
Maintainers
1
Versions
373
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omi - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

cli/template/app/src/component/footer/index.css

2

cli/package.json
{
"name": "omi-cli",
"version": "0.1.1",
"version": "0.1.2",
"description": "CLI for scaffolding Omi.js projects.",

@@ -5,0 +5,0 @@ "main": "bin/omi",

@@ -118,3 +118,3 @@ var del = require('del'),

gulp.watch(ENV + '/**').on('change', browserSync.reload);
gulp.watch(['src/component/**/*.js', 'src/js/*.js', 'common/*.js'], function () {
gulp.watch(['src/component/**/*.**', 'src/js/*.js', 'common/*.js'], function () {
runSequence(

@@ -121,0 +121,0 @@ 'webpack',

@@ -28,2 +28,3 @@ {

"run-sequence": "^1.2.2",
"string-loader": "0.0.1",
"webpack": "^1.14.0",

@@ -30,0 +31,0 @@ "webpack-stream": "^3.2.0"

import Omi from 'omi';
const tpl = require('./index.html');
const css = require('./index.css');
class Footer extends Omi.Component {

@@ -9,21 +12,7 @@ constructor (data) {

style () {
return `
.footer{
position:fixed;
height:45px;
line-height: 45px;
width:100%;
bottom:0;
color:white;
background-color:black;
z-index:100;
}
`;
return css;
}
render () {
return `
<div class="footer">
I am footer
</div>`;
return tpl;
}

@@ -30,0 +19,0 @@ }

@@ -32,3 +32,5 @@ var path = require('path');

exclude:/node_modules/
}
},
{ test: /\.html$/, loader: "string" },
{ test: /\.css$/, loader: "string" }
]

@@ -35,0 +37,0 @@ },

/*!
* Omi v0.4.2 By dntzhang
* Omi v0.4.3 By dntzhang
* Github: https://github.com/AlloyTeam/omi
* MIT Licensed.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Omi=t():e.Omi=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(2),u=r(a);o.default.template=function(e,t){return e},o.default.Component=u.default,window.Omi=o.default,e.exports=o.default},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({key:n,value:e[n]});return t}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u={};u.instances={},u._instanceId=0,u.getInstanceId=function(){return u._instanceId++},u.customTags=[],u.mapping={},u.STYLEPREFIX="omi_style_",u.STYLESCOPEDPREFIX="omi_scoped_","function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,i,o=[],a=this.length,u=t||0;u=u>=0?u:a+u;var s=n?n:a;if(n<0&&(s=a+n),i=s-u,i>0)if(o=new Array(i),this.charAt)for(r=0;r<i;r++)o[r]=this.charAt(u+r);else for(r=0;r<i;r++)o[r]=this[u+r];return o}}}();var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();u.create=function(e,t,a){var l=t,d=u.Component;return arguments.length>2&&(l=a,d=t),u[e]=function(t){function a(t,i){return n(this,a),this.___omi_constructor_name=e,r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),s(a,o(l)),a}(d),u.customTags.push(e),u[e]},u.mixIndex=function(e,t){for(var n=e.length,r=t||"index",i=0;i<n;i++){var o=e[i];"object"===("undefined"==typeof o?"undefined":a(o))?o[r]=i:(e[i]={value:o},e[i][r]=i)}return e},u.$=function(e,t){return t?t.querySelector(e):document.querySelector(e)},u.$$=function(e,t){return t?Array.prototype.slice.call(t.querySelectorAll(e)):Array.prototype.slice.call(document.querySelectorAll(e))},u.getClassFromString=function(e){if(0!==e.indexOf(".")){for(var t=e.split("."),n=t.length,r=u[t[0]],i=1;i<n;i++)r=r[t[i]];return r}return u[e]},u.makeHTML=function(e,t){u[e]=t,u.customTags.push(e)},u.render=function(e,t,n){return e.renderTo="string"==typeof t?document.querySelector(t):t,e._omi_increment=n,e.install(),e._render(!0),e._childrenInstalled(e),e.installed(),e},u.get=function(e){return u.mapping[e]},u.plugins={},u.extendPlugin=function(e,t){u.plugins[e]=t},u.getParameters=function(e,t,n){var r={},i=function(){},o={stringType:function(e){return e},numberType:function(e){return Number(e)},booleanType:function(e){return"true"===e||"false"!==e&&Boolean(e)},functionType:function(e){if(!e)return i;var n=t[e.replace(/Omi.instances\[\d\]./,"")];return n?n.bind(t):(console.warn("You do not define [ "+e+" ] method in following component"),void console.warn(t))}};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){var i=e.getAttribute(n);null!==i&&(r[n]=o[t](i))})}),r},u.mixIndexToArray=function(e,t){e.forEach(function(e,n){e[t||"index"]=n})},e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=r(a),s=n(3),l=r(s),d=n(4),c=r(d),f=n(5),h=r(f),p=n(6),m=r(p),v=function(){function e(t,n){i(this,e);var r=Object.prototype.toString.call(t),o="[object Object]"!==r&&"[object Undefined]"!==r;o?(this.renderTo="string"==typeof t?document.querySelector(t):t,this._hidden=this.renderTo.querySelector(".omi_scoped__hidden_data"),this.id=this._hidden.dataset.omiId,this.data=JSON.parse(this._hidden.value)):(this.data=t||{},this._omi_server_rendering=n,this.id=this._omi_server_rendering?1e6+u.default.getInstanceId():u.default.getInstanceId()),this.refs={},this.children=[],this.childrenData=[],this.HTML=null,this._addedItems=[],this._omi_order=[],u.default.instances[this.id]=this,this.dataFirst=!0,this._omi_scoped_attr=u.default.STYLESCOPEDPREFIX+this.id,this._preCSS=null,this._omiGroupDataCounter={},(this._omi_server_rendering||o)&&(this.install(),this._render(!0),this._childrenInstalled(this),this.installed())}return o(e,[{key:"install",value:function(){}},{key:"installed",value:function(){}},{key:"uninstall",value:function(){}},{key:"afterUpdate",value:function(){}},{key:"beforeUpdate",value:function(){}},{key:"render",value:function(){}},{key:"style",value:function(){}},{key:"update",value:function(){if(this.beforeUpdate(),this._childrenBeforeUpdate(this),this.renderTo)this._render();else if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else(0,h.default)(this.node,(0,c.default)(this._childRender(this._omiChildStr),this.id)),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm();this._renderAddedChildren(),this._childrenAfterUpdate(this),this.afterUpdate()}},{key:"_childrenBeforeUpdate",value:function(e){var t=this;e.children.forEach(function(e){e.beforeUpdate(),t._childrenBeforeUpdate(e)})}},{key:"_childrenAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){t._childrenAfterUpdate(e),e.afterUpdate()})}},{key:"setData",value:function(e,t){this.data=e,t&&this.update()}},{key:"removeChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.remove()}},{key:"restoreChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.restore()}},{key:"setComponentOrder",value:function(e){var t=this;e.forEach(function(e,n){t._omi_order[n]=e}),this.update()}},{key:"addComponent",value:function(e,t,n){this._addedItems.push({position:e,el:t,component:n}),this.update()}},{key:"removeComponent",value:function(e){for(var t=0,n=this._addedItems.length;t<n;t++)if(e.id===this._addedItems[t].component.id){this._addedItems.splice(t,1);break}this.update()}},{key:"remove",value:function(){this._omi_removed=!0,this.update(),this.uninstall()}},{key:"restore",value:function(){this._omi_removed=!1,this.update(),this.installed()}},{key:"_renderAddedChildren",value:function(){var e=this;this._addedItems.forEach(function(t){var n="string"==typeof t.el?e.node.querySelector(t.el):t.el;t.component.install(),t.component._render(!0),t.component.installed(),t.component._childrenInstalled(t.component),n.insertAdjacentHTML(t.position,t.component.HTML)}),this.children.forEach(function(e){e._renderAddedChildren()})}},{key:"_render",value:function(e){var t=this;if(this._omi_removed){var n=this._createHiddenNode();return void(e?this.renderTo&&this.renderTo.appendChild(n):(this.node.parentNode.replaceChild(n,this.node),this.node=n))}this._generateHTMLCSS(),this._extractChildren(this),e&&this.children.forEach(function(e,n){t._omi_order[n]=n}),this.children.forEach(function(e,n){t.HTML=t.HTML.replace(e._omiChildStr,t.children[t._omi_order[n]].HTML)}),this.HTML=(0,c.default)(this.HTML,this.id),e?this.renderTo&&(this._omi_increment?this.renderTo.insertAdjacentHTML("beforeend",this.HTML):this.renderTo.innerHTML=this.HTML):""!==this.HTML?(0,h.default)(this.node,this.HTML):(0,h.default)(this.node,this._createHiddenNode()),this.renderTo&&(this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm())}},{key:"_childRender",value:function(e,t){var n=this;return this._omi_removed?(this.HTML='<input type="hidden" omi_scoped_'+this.id+" >",this.HTML):(this._mergeData(e),this._generateHTMLCSS(),this._extractChildren(this),t&&this.children.forEach(function(e,t){n._omi_order[t]=t}),this.children.forEach(function(e,t){n.HTML=n.HTML.replace(e._omiChildStr,n.children[n._omi_order[t]].HTML)}),this.HTML=(0,c.default)(this.HTML,this.id),this.HTML)}},{key:"_queryElements",value:function(e){e._mixRefs(),e._execPlugins(),e.children.forEach(function(t){t.node=e.node.querySelector("["+u.default.STYLESCOPEDPREFIX+t.id+"]"),e._queryElements(t)})}},{key:"_mixRefs",value:function(){var e=this,t=u.default.$$("*[ref]",this.node);t.forEach(function(t){t.hasAttribute(e._omi_scoped_attr)&&(e.refs[t.getAttribute("ref")]=t)});var n=this.node.getAttribute("ref");n&&(this.refs[n]=this.node)}},{key:"_execPlugins",value:function(){var e=this;Object.keys(u.default.plugins).forEach(function(t){var n=u.default.$$("*["+t+"]",e.node);n.forEach(function(n){n.hasAttribute(e._omi_scoped_attr)&&u.default.plugins[t](n,e)}),e.node.hasAttribute(t)&&u.default.plugins[t](e.node,e)})}},{key:"_childrenInstalled",value:function(e){var t=this;e.children.forEach(function(e){t._childrenInstalled(e),e.installed()})}},{key:"_fixForm",value:function(){u.default.$$("input",this.node).forEach(function(e){var t=e.type.toLowerCase();""===e.getAttribute("value")&&(e.value=""),"checked"!==t&&"radio"!==t||(e.hasAttribute("checked")?e.checked="checked":e.checked=!1)}),u.default.$$("textarea",this.node).forEach(function(e){e.value=e.getAttribute("value")}),u.default.$$("select",this.node).forEach(function(e){var t=e.getAttribute("value");if(t)u.default.$$("option",e).forEach(function(e){t===e.getAttribute("value")&&e.setAttribute("selected","selected")});else{var n=u.default.$$("option",e)[0];n&&n.setAttribute("selected","selected")}})}},{key:"_replaceTags",value:function(e,t){var n=e.join("|"),r=new RegExp("<("+n+"+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>","g");return t.replace(r,function(e,t){var n=e.length-2;return n>=0&&e.lastIndexOf("/>")===e.length-2?e.replace("<"+t,'<child tag="'+t+'"').substr(0,e.length+10)+"></child>":e.lastIndexOf(">")===e.length-1?e.replace("<"+t,'<child tag="'+t+'"')+"</child>":void 0})}},{key:"_createHiddenNode",value:function(){var e=document.createElement("input");return e.setAttribute("type","hidden"),e.setAttribute(this._omi_scoped_attr,""),e}},{key:"_mergeData",value:function(e){this.dataFirst?this.data=Object.assign({},this._getDataset(e),this.data):this.data=Object.assign({},this.data,this._getDataset(e))}},{key:"_generateHTMLCSS",value:function(){this.CSS=(this.style()||"").replace(/<\/?style>/g,""),this.CSS&&(this.CSS=l.default.scoper(this.CSS,"["+this._omi_scoped_attr+"]"),this.CSS===this._preCSS||this._omi_server_rendering||(l.default.addStyle(this.CSS,this.id),this._preCSS=this.CSS));var e=this.render();this.HTML=this._scopedAttr(u.default.template(e?e:"",this.data),this._omi_scoped_attr).trim(),this._omi_server_rendering&&(this.HTML='\r\n<style id="'+u.default.STYLEPREFIX+this.id+'">\r\n'+this.CSS+"\r\n</style>\r\n"+this.HTML,this.HTML+='\r\n<input type="hidden" data-omi-id="'+this.id+'" class="'+u.default.STYLESCOPEDPREFIX+"_hidden_data\" value='"+JSON.stringify(this.data)+"' />\r\n")}},{key:"_scopedAttr",value:function(e,t){return e.replace(/<[^\/]([A-Za-z]*)[^>]*>/g,function(e){var n=e.split(" ")[0].replace(">","");return e.replace(n,n+" "+t)})}},{key:"_getDataset",value:function(e){var t=this,n=(0,m.default)(e),r=n.child[0].attr;return Object.keys(r).forEach(function(e){0===e.indexOf("data-")&&(t._dataset[t._capitalize(e.replace("data-",""))]=r[e])}),this._dataset}},{key:"_capitalize",value:function(e){return e=e.toLowerCase(),e=e.replace(/\b\w+\b/g,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}).replace(/-/g,""),e.substring(0,1).toLowerCase()+e.substring(1)}},{key:"_extractPropertyFromString",value:function(e,t){var n=e.replace(/['|"|\]]/g,"").replace(/\[/g,".").split("."),r=t;return n.forEach(function(e){r=r[e]}),n=null,r}},{key:"_extractChildren",value:function(e){var t=this;u.default.customTags.length>0&&(e.HTML=this._replaceTags(u.default.customTags,e.HTML));var n=e.HTML.match(/<child[^>][\s\S]*?tag=['|"](\S*)['|"][\s\S]*?><\/child>/g);n&&n.forEach(function(n,r){var i=(0,m.default)(n),o=i.child[0].attr,a=o.tag;delete o.tag;var s=t.children[r];s&&s.___omi_constructor_name===a?s._childRender(n):!function(){var i={},l={},d={},c={},f=null,h=null;Object.keys(o).forEach(function(n){var r=o[n];if(0===n.indexOf("on")){var a=e[r];a&&(i[n]=a.bind(e))}else"omi-id"===n?f=r:"name"===n?h=r:"group-data"===n?(e._omiGroupDataCounter.hasOwnProperty(r)?e._omiGroupDataCounter[r]++:e._omiGroupDataCounter[r]=0,c=t._extractPropertyFromString(r,e)[e._omiGroupDataCounter[r]]):0===n.indexOf("data-")?l[t._capitalize(n.replace("data-",""))]=r:"data"===n&&(d=t._extractPropertyFromString(r,e))});var p=u.default.getClassFromString(a);if(!p)throw"Can't find Class called ["+a+"]";var m=new p(Object.assign(i,e.childrenData[r],l,d,c),!1);m._omiChildStr=n,m.parent=e,m.___omi_constructor_name=a,m._dataset={},m.install(),f&&(u.default.mapping[f]=m),h&&(e[h]=m),s?e.children[r]=m:e.children.push(m),m._childRender(n,!0)}()})}}]),e}();t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,n.trim()+t+",$1"+t+" ").replace(/\s+/g," "),n+r)})}function o(e,t){var n=document.getElementById(u.default.STYLEPREFIX+t),r=document.getElementsByTagName("head")[0];n&&n.parentNode===r&&r.removeChild(n);var i=document.createElement("style");r.appendChild(i),i.setAttribute("type","text/css"),i.setAttribute("id",u.default.STYLEPREFIX+t),window.ActiveXObject?i.styleSheet.cssText=e:i.textContent=e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),u=r(a);t.default={scoper:i,addStyle:o}},function(e,t){"use strict";function n(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=('|")([\s\S]*?)\([\s\S]*?\)/g,function(e,n,r,i){return 0===i.indexOf("Omi.instances[")?e:e.replace(/=(['|"])/,"=$1Omi.instances["+t+"].")})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,u){"object"===o(t)&&"undefined"!=typeof e?e.exports=u():(r=u,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)))}(void 0,function(){"use strict";function e(e){!l&&f.createRange&&(l=f.createRange(),l.selectNode(f.body));var t;return l&&l.createContextualFragment?t=l.createContextualFragment(e):(t=f.createElement("body"),t.innerHTML=e),t.childNodes[0]}function t(e,t){var n=e.nodeName,r=t.nodeName;return n===r||!!(t.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function n(e,t){return t&&t!==c?f.createElementNS(t,e):f.createElement(e)}function r(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function i(e,t){var n,r,i,o,a,u,s=t.attributes;for(n=s.length-1;n>=0;--n)r=s[n],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,u=e.getAttributeNS(o,i),u!==a&&e.setAttributeNS(o,i,a)):(u=e.getAttribute(i),u!==a&&e.setAttribute(i,a));for(s=e.attributes,n=s.length-1;n>=0;--n)r=s[n],r.specified!==!1&&(i=r.name,o=r.namespaceURI,o?(i=r.localName||i,p(t,o,i)||e.removeAttributeNS(o,i)):p(t,null,i)||e.removeAttribute(i))}function o(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n,""))}function a(){}function u(e){return e.id}function s(i){return function(o,s,l){function d(e){C?C.push(e):C=[e]}function c(e,t){if(e.nodeType===v)for(var n=e.firstChild;n;){var r=void 0;t&&(r=T(n))?d(r):(w(n),n.firstChild&&c(n,t)),n=n.nextSibling}}function h(e,t,n){O(e)!==!1&&(t&&t.removeChild(e),w(e),c(e,n))}function p(e){if(e.nodeType===v)for(var t=e.firstChild;t;){var n=T(t);n&&(P[n]=t),p(t),t=t.nextSibling}}function g(e){A(e);for(var n=e.firstChild;n;){var r=n.nextSibling,i=T(n);if(i){var o=P[i];o&&t(n,o)&&(n.parentNode.replaceChild(o,n),b(o,n))}g(n),n=r}}function b(e,n,r){var a,u=T(n);if(u&&delete P[u],!s.isSameNode||!s.isSameNode(o)){if(!r){if(x(e,n)===!1)return;if(i(e,n),k(e),L(e,n)===!1)return}if("TEXTAREA"!==e.nodeName){var l,c,p,S,C=n.firstChild,A=e.firstChild;e:for(;C;){for(p=C.nextSibling,l=T(C);A;){if(c=A.nextSibling,C.isSameNode&&C.isSameNode(A)){C=p,A=c;continue e}a=T(A);var O=A.nodeType,w=void 0;if(O===C.nodeType&&(O===v?(l?l!==a&&((S=P[l])?A.nextSibling===S?w=!1:(e.insertBefore(S,A),c=A.nextSibling,a?d(a):h(A,e,!0),A=S):w=!1):a&&(w=!1),w=w!==!1&&t(A,C),w&&b(A,C)):O!==_&&O!=y||(w=!0,A.nodeValue=C.nodeValue)),w){C=p,A=c;continue e}a?d(a):h(A,e,!0),A=c}if(l&&(S=P[l])&&t(S,C))e.appendChild(S),b(S,C);else{var M=E(C);M!==!1&&(M&&(C=M),C.actualize&&(C=C.actualize(e.ownerDocument||f)),e.appendChild(C),g(C))}C=p,A=c}for(;A;)c=A.nextSibling,(a=T(A))?d(a):h(A,e,!0),A=c}var N=m[e.nodeName];N&&N(e,n)}}if(l||(l={}),"string"==typeof s)if("#document"===o.nodeName||"HTML"===o.nodeName){var S=s;s=f.createElement("html"),s.innerHTML=S}else s=e(s);var C,T=l.getNodeKey||u,E=l.onBeforeNodeAdded||a,A=l.onNodeAdded||a,x=l.onBeforeElUpdated||a,k=l.onElUpdated||a,O=l.onBeforeNodeDiscarded||a,w=l.onNodeDiscarded||a,L=l.onBeforeElChildrenUpdated||a,M=l.childrenOnly===!0,P={};p(o);var N=o,I=N.nodeType,H=s.nodeType;if(!M)if(I===v)H===v?t(o,s)||(w(o),N=r(o,n(s.nodeName,s.namespaceURI))):N=s;else if(I===_||I===y){if(H===I)return N.nodeValue=s.nodeValue,N;N=s}if(N===s)w(o);else if(b(N,s,M),C)for(var j=0,D=C.length;j<D;j++){var R=P[C[j]];R&&h(R,R.parentNode,!1)}return!M&&N!==o&&o.parentNode&&(N.actualize&&(N=N.actualize(o.ownerDocument||f)),o.parentNode.replaceChild(N,o)),N}}var l,d,c="http://www.w3.org/1999/xhtml",f="undefined"==typeof document?void 0:document,h=f?f.body||f.createElement("div"):{};d=h.hasAttributeNS?function(e,t,n){return e.hasAttributeNS(t,n)}:h.hasAttribute?function(e,t,n){return e.hasAttribute(n)}:function(e,t,n){return null!=e.getAttributeNode(t,n)};var p=d,m={OPTION:function(e,t){o(e,t,"selected")},INPUT:function(e,t){o(e,t,"checked"),o(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),p(t,null,"value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;if(e.value!==n&&(e.value=n),e.firstChild){if(""===n&&e.firstChild.nodeValue===e.placeholder)return;e.firstChild.nodeValue=n}},SELECT:function(e,t){if(!p(t,null,"multiple")){for(var n=-1,r=0,i=t.firstChild;i;){var o=i.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(p(i,null,"selected")){n=r;break}r++}i=i.nextSibling}e.selectedIndex=r}}},v=1,_=3,y=8,g=s(i);return g})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,i=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=function(e,t){function o(e,n,r,o){if(n=n.toLowerCase(),o=!!o,o||d.push(n),t.start){var a=[];r.replace(i,function(e,t){var n=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:"";a.push({name:t,value:n,escaped:n.replace(/(^|[^\\])"/g,'$1\\"')})}),t.start&&t.start(n,a,o)}}function a(e,n){if(n)for(var r=d.length-1;r>=0&&d[r]!=n;r--);else var r=0;if(r>=0){for(var i=d.length-1;i>=r;i--)t.end&&t.end(d[i]);d.length=r}}var u,s,l,d=[],c=e;for(d.last=function(){return this[this.length-1]};e;){if(s=!0,d.last())e=e.replace(new RegExp("([\\s\\S]*?)</"+d.last()+"[^>]*>"),function(e,n){return t.chars&&t.chars(n),""}),a("",d.last());else if(0==e.indexOf("</")?(l=e.match(r),l&&(e=e.substring(l[0].length),l[0].replace(r,a),s=!1)):0==e.indexOf("<")&&(l=e.match(n),l&&(e=e.substring(l[0].length),l[0].replace(n,o),s=!1)),s){u=e.indexOf("<");var f=u<0?e:e.substring(0,u);e=u<0?"":e.substring(u),t.chars&&t.chars(f)}if(e==c)throw"Parse Error: "+e;c=e}a()},a=!1,u=a?console.log.bind(console):function(){};Array.prototype.reduce||(Array.prototype.reduce=function(e){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var t,n=Object(this),r=n.length>>>0,i=0;if(2==arguments.length)t=arguments[1];else{for(;i<r&&!(i in n);)i++;if(i>=r)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<r;i++)i in n&&(t=e(t,n[i],i,n));return t});var s=function(e){var t=[],n={node:"root",child:[]};return o(e,{start:function(e,r,i){u(e,r,i);var o={node:"element",tag:e};if(0!==r.length&&(o.attr=r.reduce(function(e,t){var n=t.name,r=t.value;return e[n]=r,e},{})),i){var a=t[0]||n;void 0===a.child&&(a.child=[]),a.child.push(o)}else t.unshift(o)},end:function(e){u(e);var r=t.shift();if(r.tag!==e&&console.error("invalid state: mismatch end tag"),0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}},chars:function(e){u(e);var r={node:"text",text:e};if(0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}}}),n};t.default=s}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Omi=t():e.Omi=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(2),u=r(a);o.default.template=function(e,t){return e},o.default.Component=u.default,window.Omi?e.exports=window.Omi:(window.Omi=o.default,e.exports=o.default)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({key:n,value:e[n]});return t}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u={};u.instances={},u._instanceId=0,u.getInstanceId=function(){return u._instanceId++},u.customTags=[],u.mapping={},u.STYLEPREFIX="omi_style_",u.STYLESCOPEDPREFIX="omi_scoped_","function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,i,o=[],a=this.length,u=t||0;u=u>=0?u:a+u;var l=n?n:a;if(n<0&&(l=a+n),i=l-u,i>0)if(o=new Array(i),this.charAt)for(r=0;r<i;r++)o[r]=this.charAt(u+r);else for(r=0;r<i;r++)o[r]=this[u+r];return o}}}();var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();u.create=function(e,t,a){var s=t,c=u.Component;return arguments.length>2&&(s=a,c=t),u[e]=function(t){function a(t,i){return n(this,a),this.___omi_constructor_name=e,r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),l(a,o(s)),a}(c),u.customTags.push(e),u[e]},u.mixIndex=function(e,t){for(var n=e.length,r=t||"index",i=0;i<n;i++){var o=e[i];"object"===("undefined"==typeof o?"undefined":a(o))?o[r]=i:(e[i]={value:o},e[i][r]=i)}return e},u.$=function(e,t){return t?t.querySelector(e):document.querySelector(e)},u.$$=function(e,t){return t?Array.prototype.slice.call(t.querySelectorAll(e)):Array.prototype.slice.call(document.querySelectorAll(e))},u.getClassFromString=function(e){if(0!==e.indexOf(".")){for(var t=e.split("."),n=t.length,r=u[t[0]],i=1;i<n;i++)r=r[t[i]];return r}return u[e]},u.makeHTML=function(e,t){u[e]=t,u.customTags.push(e)},u.render=function(e,t,n){return e.renderTo="string"==typeof t?document.querySelector(t):t,e._omi_increment=n,e.install(),e._render(!0),e._childrenInstalled(e),e.installed(),e},u.get=function(e){return u.mapping[e]},u.plugins={},u.extendPlugin=function(e,t){u.plugins[e]=t},u.getParameters=function(e,t,n){var r={},i=function(){},o={stringType:function(e){return e},numberType:function(e){return Number(e)},booleanType:function(e){return"true"===e||"false"!==e&&Boolean(e)},functionType:function(e){if(!e)return i;var n=t[e.replace(/Omi.instances\[\d\]./,"")];return n?n.bind(t):(console.warn("You do not define [ "+e+" ] method in following component"),void console.warn(t))}};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){var i=e.getAttribute(n);null!==i&&(r[n]=o[t](i))})}),r},u.mixIndexToArray=function(e,t){e.forEach(function(e,n){e[t||"index"]=n})},e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=r(a),l=n(3),s=r(l),c=n(4),d=r(c),f=n(5),h=r(f),p=n(6),m=r(p),v=function(){function e(t,n){i(this,e);var r=Object.prototype.toString.call(t),o="[object Object]"!==r&&"[object Undefined]"!==r;o?(this.renderTo="string"==typeof t?document.querySelector(t):t,this._hidden=this.renderTo.querySelector(".omi_scoped__hidden_data"),this.id=this._hidden.dataset.omiId,this.data=JSON.parse(this._hidden.value)):(this.data=t||{},this._omi_server_rendering=n,this.id=this._omi_server_rendering?1e6+u.default.getInstanceId():u.default.getInstanceId()),this.refs={},this.children=[],this.childrenData=[],this.HTML=null,this._addedItems=[],this._omi_order=[],u.default.instances[this.id]=this,this.dataFirst=!0,this._omi_scoped_attr=u.default.STYLESCOPEDPREFIX+this.id,this._preCSS=null,this._omiGroupDataCounter={},(this._omi_server_rendering||o)&&(this.install(),this._render(!0),this._childrenInstalled(this),this.installed())}return o(e,[{key:"install",value:function(){}},{key:"installed",value:function(){}},{key:"uninstall",value:function(){}},{key:"afterUpdate",value:function(){}},{key:"beforeUpdate",value:function(){}},{key:"render",value:function(){}},{key:"style",value:function(){}},{key:"update",value:function(){if(this.beforeUpdate(),this._childrenBeforeUpdate(this),this.renderTo)this._render();else if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else(0,h.default)(this.node,(0,d.default)(this._childRender(this._omiChildStr),this.id)),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm();this._renderAddedChildren(),this._childrenAfterUpdate(this),this.afterUpdate()}},{key:"_childrenBeforeUpdate",value:function(e){var t=this;e.children.forEach(function(e){e.beforeUpdate(),t._childrenBeforeUpdate(e)})}},{key:"_childrenAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){t._childrenAfterUpdate(e),e.afterUpdate()})}},{key:"setData",value:function(e,t){this.data=e,t&&this.update()}},{key:"removeChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.remove()}},{key:"restoreChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.restore()}},{key:"setComponentOrder",value:function(e){var t=this;e.forEach(function(e,n){t._omi_order[n]=e}),this.update()}},{key:"addComponent",value:function(e,t,n){this._addedItems.push({position:e,el:t,component:n}),this.update()}},{key:"removeComponent",value:function(e){for(var t=0,n=this._addedItems.length;t<n;t++)if(e.id===this._addedItems[t].component.id){this._addedItems.splice(t,1);break}this.update()}},{key:"remove",value:function(){this._omi_removed=!0,this.update(),this.uninstall()}},{key:"restore",value:function(){this._omi_removed=!1,this.update(),this.installed()}},{key:"_renderAddedChildren",value:function(){var e=this;this._addedItems.forEach(function(t){var n="string"==typeof t.el?e.node.querySelector(t.el):t.el;t.component.install(),t.component._render(!0),t.component.installed(),t.component._childrenInstalled(t.component),n.insertAdjacentHTML(t.position,t.component.HTML)}),this.children.forEach(function(e){e._renderAddedChildren()})}},{key:"_render",value:function(e){var t=this;if(this._omi_removed){var n=this._createHiddenNode();return void(e?this.renderTo&&this.renderTo.appendChild(n):(this.node.parentNode.replaceChild(n,this.node),this.node=n))}this._generateHTMLCSS(),this._extractChildren(this),e&&this.children.forEach(function(e,n){t._omi_order[n]=n}),this.children.forEach(function(e,n){t.HTML=t.HTML.replace(e._omiChildStr,t.children[t._omi_order[n]].HTML)}),this.HTML=(0,d.default)(this.HTML,this.id),e?this.renderTo&&(this._omi_increment?this.renderTo.insertAdjacentHTML("beforeend",this.HTML):this.renderTo.innerHTML=this.HTML):""!==this.HTML?(0,h.default)(this.node,this.HTML):(0,h.default)(this.node,this._createHiddenNode()),this.renderTo&&(this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm())}},{key:"_childRender",value:function(e,t){var n=this;return this._omi_removed?(this.HTML='<input type="hidden" omi_scoped_'+this.id+" >",this.HTML):(this._mergeData(e),this._generateHTMLCSS(),this._extractChildren(this),t&&this.children.forEach(function(e,t){n._omi_order[t]=t}),this.children.forEach(function(e,t){n.HTML=n.HTML.replace(e._omiChildStr,n.children[n._omi_order[t]].HTML)}),this.HTML=(0,d.default)(this.HTML,this.id),this.HTML)}},{key:"_queryElements",value:function(e){e._mixRefs(),e._execPlugins(),e.children.forEach(function(t){t.node=e.node.querySelector("["+u.default.STYLESCOPEDPREFIX+t.id+"]"),e._queryElements(t)})}},{key:"_mixRefs",value:function(){var e=this,t=u.default.$$("*[ref]",this.node);t.forEach(function(t){t.hasAttribute(e._omi_scoped_attr)&&(e.refs[t.getAttribute("ref")]=t)});var n=this.node.getAttribute("ref");n&&(this.refs[n]=this.node)}},{key:"_execPlugins",value:function(){var e=this;Object.keys(u.default.plugins).forEach(function(t){var n=u.default.$$("*["+t+"]",e.node);n.forEach(function(n){n.hasAttribute(e._omi_scoped_attr)&&u.default.plugins[t](n,e)}),e.node.hasAttribute(t)&&u.default.plugins[t](e.node,e)})}},{key:"_childrenInstalled",value:function(e){var t=this;e.children.forEach(function(e){t._childrenInstalled(e),e.installed()})}},{key:"_fixForm",value:function(){u.default.$$("input",this.node).forEach(function(e){var t=e.type.toLowerCase();""===e.getAttribute("value")&&(e.value=""),"checked"!==t&&"radio"!==t||(e.hasAttribute("checked")?e.checked="checked":e.checked=!1)}),u.default.$$("textarea",this.node).forEach(function(e){e.value=e.getAttribute("value")}),u.default.$$("select",this.node).forEach(function(e){var t=e.getAttribute("value");if(t)u.default.$$("option",e).forEach(function(e){t===e.getAttribute("value")&&e.setAttribute("selected","selected")});else{var n=u.default.$$("option",e)[0];n&&n.setAttribute("selected","selected")}})}},{key:"_replaceTags",value:function(e,t){var n=e.join("|"),r=new RegExp("<("+n+"+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>","g");return t.replace(r,function(e,t){var n=e.length-2;return n>=0&&e.lastIndexOf("/>")===e.length-2?e.replace("<"+t,'<child tag="'+t+'"').substr(0,e.length+10)+"></child>":e.lastIndexOf(">")===e.length-1?e.replace("<"+t,'<child tag="'+t+'"')+"</child>":void 0})}},{key:"_createHiddenNode",value:function(){var e=document.createElement("input");return e.setAttribute("type","hidden"),e.setAttribute(this._omi_scoped_attr,""),e}},{key:"_mergeData",value:function(e){this.dataFirst?this.data=Object.assign({},this._getDataset(e),this.data):this.data=Object.assign({},this.data,this._getDataset(e))}},{key:"_generateHTMLCSS",value:function(){this.CSS=(this.style()||"").replace(/<\/?style>/g,""),this.CSS&&(this.CSS=s.default.scoper(this.CSS,"["+this._omi_scoped_attr+"]"),this.CSS===this._preCSS||this._omi_server_rendering||(s.default.addStyle(this.CSS,this.id),this._preCSS=this.CSS));var e=this.render();this.HTML=this._scopedAttr(u.default.template(e?e:"",this.data),this._omi_scoped_attr).trim(),this._omi_server_rendering&&(this.HTML='\r\n<style id="'+u.default.STYLEPREFIX+this.id+'">\r\n'+this.CSS+"\r\n</style>\r\n"+this.HTML,this.HTML+='\r\n<input type="hidden" data-omi-id="'+this.id+'" class="'+u.default.STYLESCOPEDPREFIX+"_hidden_data\" value='"+JSON.stringify(this.data)+"' />\r\n")}},{key:"_scopedAttr",value:function(e,t){return e.replace(/<[^\/]([A-Za-z]*)[^>]*>/g,function(e){var n=e.split(" ")[0].replace(">","");return e.replace(n,n+" "+t)})}},{key:"_getDataset",value:function(e){var t=this,n=(0,m.default)(e),r=n.child[0].attr;return Object.keys(r).forEach(function(e){0===e.indexOf("data-")&&(t._dataset[t._capitalize(e.replace("data-",""))]=r[e])}),this._dataset}},{key:"_capitalize",value:function(e){return e=e.toLowerCase(),e=e.replace(/\b\w+\b/g,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}).replace(/-/g,""),e.substring(0,1).toLowerCase()+e.substring(1)}},{key:"_extractPropertyFromString",value:function(e,t){var n=e.replace(/['|"|\]]/g,"").replace(/\[/g,".").split("."),r=t;return n.forEach(function(e){r=r[e]}),n=null,r}},{key:"_extractChildren",value:function(e){var t=this;u.default.customTags.length>0&&(e.HTML=this._replaceTags(u.default.customTags,e.HTML));var n=e.HTML.match(/<child[^>][\s\S]*?tag=['|"](\S*)['|"][\s\S]*?><\/child>/g);n&&n.forEach(function(n,r){var i=(0,m.default)(n),o=i.child[0].attr,a=o.tag;delete o.tag;var l=t.children[r];l&&l.___omi_constructor_name===a?l._childRender(n):!function(){var i={},s={},c={},d={},f=null,h=null;Object.keys(o).forEach(function(n){var r=o[n];if(0===n.indexOf("on")){var a=e[r];a&&(i[n]=a.bind(e))}else"omi-id"===n?f=r:"name"===n?h=r:"group-data"===n?(e._omiGroupDataCounter.hasOwnProperty(r)?e._omiGroupDataCounter[r]++:e._omiGroupDataCounter[r]=0,d=t._extractPropertyFromString(r,e)[e._omiGroupDataCounter[r]]):0===n.indexOf("data-")?s[t._capitalize(n.replace("data-",""))]=r:"data"===n&&(c=t._extractPropertyFromString(r,e))});var p=u.default.getClassFromString(a);if(!p)throw"Can't find Class called ["+a+"]";var m=new p(Object.assign(i,e.childrenData[r],s,c,d),!1);m._omiChildStr=n,m.parent=e,m.___omi_constructor_name=a,m._dataset={},m.install(),f&&(u.default.mapping[f]=m),h&&(e[h]=m),l?e.children[r]=m:e.children.push(m),m._childRender(n,!0)}()})}}]),e}();t.default=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,n.trim()+t+",$1"+t+" ").replace(/\s+/g," "),n+r)})}function o(e,t){var n=document.getElementById(u.default.STYLEPREFIX+t),r=document.getElementsByTagName("head")[0];n&&n.parentNode===r&&r.removeChild(n);var i=document.createElement("style");r.appendChild(i),i.setAttribute("type","text/css"),i.setAttribute("id",u.default.STYLEPREFIX+t),window.ActiveXObject?i.styleSheet.cssText=e:i.textContent=e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),u=r(a);t.default={scoper:i,addStyle:o}},function(e,t){"use strict";function n(e,t,n){return e.split(t).map(function(e){return e.replace(new RegExp(n,"g"),t)}).join(n)}function r(e){return JSON.stringify(e).replace(/(^"|"$)/g,"")}function i(e){return e=n(e,"'",'"'),n(r(e),"'",'"')}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function a(e,t){return String.prototype.endsWith?String.prototype.endsWith.call(e,t):e.substr(e.length-1,1)===t}function u(e,t){return e.replace(/<[\s\S]*?[^=]>/g,function(e){return e.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=('|"|{)([\s\S]*)('|"|})/g,function(e,n,r,u,l){if(0===u.indexOf("Omi.instances[")||0===u.indexOf("new Function("))return e;if("{"===r){var s="("+u+").bind(Omi.instances["+t+"])(event)",c="on"+n+"=\"new Function('event', '"+o(i(s))+"')(event)\"";return c.split("\n").map(function(e){return a(e,";")?e:e+";"}).join("")}return u.match(/.*?\(.*?\)/)?e.replace(/=(['|"])/,"=$1Omi.instances["+t+"]."):e})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=u},function(e,t,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,u){"object"===o(t)&&"undefined"!=typeof e?e.exports=u():(r=u,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)))}(void 0,function(){"use strict";function e(e){!s&&f.createRange&&(s=f.createRange(),s.selectNode(f.body));var t;return s&&s.createContextualFragment?t=s.createContextualFragment(e):(t=f.createElement("body"),t.innerHTML=e),t.childNodes[0]}function t(e,t){var n=e.nodeName,r=t.nodeName;return n===r||!!(t.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function n(e,t){return t&&t!==d?f.createElementNS(t,e):f.createElement(e)}function r(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function i(e,t){var n,r,i,o,a,u,l=t.attributes;for(n=l.length-1;n>=0;--n)r=l[n],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,u=e.getAttributeNS(o,i),u!==a&&e.setAttributeNS(o,i,a)):(u=e.getAttribute(i),u!==a&&e.setAttribute(i,a));for(l=e.attributes,n=l.length-1;n>=0;--n)r=l[n],r.specified!==!1&&(i=r.name,o=r.namespaceURI,o?(i=r.localName||i,p(t,o,i)||e.removeAttributeNS(o,i)):p(t,null,i)||e.removeAttribute(i))}function o(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n,""))}function a(){}function u(e){return e.id}function l(i){return function(o,l,s){function c(e){C?C.push(e):C=[e]}function d(e,t){if(e.nodeType===v)for(var n=e.firstChild;n;){var r=void 0;t&&(r=T(n))?c(r):(k(n),n.firstChild&&d(n,t)),n=n.nextSibling}}function h(e,t,n){w(e)!==!1&&(t&&t.removeChild(e),k(e),d(e,n))}function p(e){if(e.nodeType===v)for(var t=e.firstChild;t;){var n=T(t);n&&(P[n]=t),p(t),t=t.nextSibling}}function g(e){A(e);for(var n=e.firstChild;n;){var r=n.nextSibling,i=T(n);if(i){var o=P[i];o&&t(n,o)&&(n.parentNode.replaceChild(o,n),b(o,n))}g(n),n=r}}function b(e,n,r){var a,u=T(n);if(u&&delete P[u],!l.isSameNode||!l.isSameNode(o)){if(!r){if(x(e,n)===!1)return;if(i(e,n),O(e),L(e,n)===!1)return}if("TEXTAREA"!==e.nodeName){var s,d,p,S,C=n.firstChild,A=e.firstChild;e:for(;C;){for(p=C.nextSibling,s=T(C);A;){if(d=A.nextSibling,C.isSameNode&&C.isSameNode(A)){C=p,A=d;continue e}a=T(A);var w=A.nodeType,k=void 0;if(w===C.nodeType&&(w===v?(s?s!==a&&((S=P[s])?A.nextSibling===S?k=!1:(e.insertBefore(S,A),d=A.nextSibling,a?c(a):h(A,e,!0),A=S):k=!1):a&&(k=!1),k=k!==!1&&t(A,C),k&&b(A,C)):w!==y&&w!=_||(k=!0,A.nodeValue=C.nodeValue)),k){C=p,A=d;continue e}a?c(a):h(A,e,!0),A=d}if(s&&(S=P[s])&&t(S,C))e.appendChild(S),b(S,C);else{var M=E(C);M!==!1&&(M&&(C=M),C.actualize&&(C=C.actualize(e.ownerDocument||f)),e.appendChild(C),g(C))}C=p,A=d}for(;A;)d=A.nextSibling,(a=T(A))?c(a):h(A,e,!0),A=d}var N=m[e.nodeName];N&&N(e,n)}}if(s||(s={}),"string"==typeof l)if("#document"===o.nodeName||"HTML"===o.nodeName){var S=l;l=f.createElement("html"),l.innerHTML=S}else l=e(l);var C,T=s.getNodeKey||u,E=s.onBeforeNodeAdded||a,A=s.onNodeAdded||a,x=s.onBeforeElUpdated||a,O=s.onElUpdated||a,w=s.onBeforeNodeDiscarded||a,k=s.onNodeDiscarded||a,L=s.onBeforeElChildrenUpdated||a,M=s.childrenOnly===!0,P={};p(o);var N=o,I=N.nodeType,j=l.nodeType;if(!M)if(I===v)j===v?t(o,l)||(k(o),N=r(o,n(l.nodeName,l.namespaceURI))):N=l;else if(I===y||I===_){if(j===I)return N.nodeValue=l.nodeValue,N;N=l}if(N===l)k(o);else if(b(N,l,M),C)for(var H=0,D=C.length;H<D;H++){var R=P[C[H]];R&&h(R,R.parentNode,!1)}return!M&&N!==o&&o.parentNode&&(N.actualize&&(N=N.actualize(o.ownerDocument||f)),o.parentNode.replaceChild(N,o)),N}}var s,c,d="http://www.w3.org/1999/xhtml",f="undefined"==typeof document?void 0:document,h=f?f.body||f.createElement("div"):{};c=h.hasAttributeNS?function(e,t,n){return e.hasAttributeNS(t,n)}:h.hasAttribute?function(e,t,n){return e.hasAttribute(n)}:function(e,t,n){return null!=e.getAttributeNode(t,n)};var p=c,m={OPTION:function(e,t){o(e,t,"selected")},INPUT:function(e,t){o(e,t,"checked"),o(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),p(t,null,"value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;if(e.value!==n&&(e.value=n),e.firstChild){if(""===n&&e.firstChild.nodeValue===e.placeholder)return;e.firstChild.nodeValue=n}},SELECT:function(e,t){if(!p(t,null,"multiple")){for(var n=-1,r=0,i=t.firstChild;i;){var o=i.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(p(i,null,"selected")){n=r;break}r++}i=i.nextSibling}e.selectedIndex=r}}},v=1,y=3,_=8,g=l(i);return g})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,i=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=function(e,t){function o(e,n,r,o){if(n=n.toLowerCase(),o=!!o,o||c.push(n),t.start){var a=[];r.replace(i,function(e,t){var n=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:"";a.push({name:t,value:n,escaped:n.replace(/(^|[^\\])"/g,'$1\\"')})}),t.start&&t.start(n,a,o)}}function a(e,n){if(n)for(var r=c.length-1;r>=0&&c[r]!=n;r--);else var r=0;if(r>=0){for(var i=c.length-1;i>=r;i--)t.end&&t.end(c[i]);c.length=r}}var u,l,s,c=[],d=e;for(c.last=function(){return this[this.length-1]};e;){if(l=!0,c.last())e=e.replace(new RegExp("([\\s\\S]*?)</"+c.last()+"[^>]*>"),function(e,n){return t.chars&&t.chars(n),""}),a("",c.last());else if(0==e.indexOf("</")?(s=e.match(r),s&&(e=e.substring(s[0].length),s[0].replace(r,a),l=!1)):0==e.indexOf("<")&&(s=e.match(n),s&&(e=e.substring(s[0].length),s[0].replace(n,o),l=!1)),l){u=e.indexOf("<");var f=u<0?e:e.substring(0,u);e=u<0?"":e.substring(u),t.chars&&t.chars(f)}if(e==d)throw"Parse Error: "+e;d=e}a()},a=!1,u=a?console.log.bind(console):function(){};Array.prototype.reduce||(Array.prototype.reduce=function(e){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var t,n=Object(this),r=n.length>>>0,i=0;if(2==arguments.length)t=arguments[1];else{for(;i<r&&!(i in n);)i++;if(i>=r)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<r;i++)i in n&&(t=e(t,n[i],i,n));return t});var l=function(e){var t=[],n={node:"root",child:[]};return o(e,{start:function(e,r,i){u(e,r,i);var o={node:"element",tag:e};if(0!==r.length&&(o.attr=r.reduce(function(e,t){var n=t.name,r=t.value;return e[n]=r,e},{})),i){var a=t[0]||n;void 0===a.child&&(a.child=[]),a.child.push(o)}else t.unshift(o)},end:function(e){u(e);var r=t.shift();if(r.tag!==e&&console.error("invalid state: mismatch end tag"),0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}},chars:function(e){u(e);var r={node:"text",text:e};if(0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}}}),n};t.default=l}])});
/*!
* Omi v0.4.2 By dntzhang
* Omi v0.4.3 By dntzhang
* Github: https://github.com/AlloyTeam/omi
* MIT Licensed.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Omi=t():e.Omi=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(7),s=r(a),u=n(2),l=r(u);o.default.template=s.default.render,o.default.Component=l.default,window.Omi=o.default,e.exports=o.default},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({key:n,value:e[n]});return t}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s={};s.instances={},s._instanceId=0,s.getInstanceId=function(){return s._instanceId++},s.customTags=[],s.mapping={},s.STYLEPREFIX="omi_style_",s.STYLESCOPEDPREFIX="omi_scoped_","function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,i,o=[],a=this.length,s=t||0;s=s>=0?s:a+s;var u=n?n:a;if(n<0&&(u=a+n),i=u-s,i>0)if(o=new Array(i),this.charAt)for(r=0;r<i;r++)o[r]=this.charAt(s+r);else for(r=0;r<i;r++)o[r]=this[s+r];return o}}}();var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();s.create=function(e,t,a){var l=t,c=s.Component;return arguments.length>2&&(l=a,c=t),s[e]=function(t){function a(t,i){return n(this,a),this.___omi_constructor_name=e,r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),u(a,o(l)),a}(c),s.customTags.push(e),s[e]},s.mixIndex=function(e,t){for(var n=e.length,r=t||"index",i=0;i<n;i++){var o=e[i];"object"===("undefined"==typeof o?"undefined":a(o))?o[r]=i:(e[i]={value:o},e[i][r]=i)}return e},s.$=function(e,t){return t?t.querySelector(e):document.querySelector(e)},s.$$=function(e,t){return t?Array.prototype.slice.call(t.querySelectorAll(e)):Array.prototype.slice.call(document.querySelectorAll(e))},s.getClassFromString=function(e){if(0!==e.indexOf(".")){for(var t=e.split("."),n=t.length,r=s[t[0]],i=1;i<n;i++)r=r[t[i]];return r}return s[e]},s.makeHTML=function(e,t){s[e]=t,s.customTags.push(e)},s.render=function(e,t,n){return e.renderTo="string"==typeof t?document.querySelector(t):t,e._omi_increment=n,e.install(),e._render(!0),e._childrenInstalled(e),e.installed(),e},s.get=function(e){return s.mapping[e]},s.plugins={},s.extendPlugin=function(e,t){s.plugins[e]=t},s.getParameters=function(e,t,n){var r={},i=function(){},o={stringType:function(e){return e},numberType:function(e){return Number(e)},booleanType:function(e){return"true"===e||"false"!==e&&Boolean(e)},functionType:function(e){if(!e)return i;var n=t[e.replace(/Omi.instances\[\d\]./,"")];return n?n.bind(t):(console.warn("You do not define [ "+e+" ] method in following component"),void console.warn(t))}};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){var i=e.getAttribute(n);null!==i&&(r[n]=o[t](i))})}),r},s.mixIndexToArray=function(e,t){e.forEach(function(e,n){e[t||"index"]=n})},e.exports=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),s=r(a),u=n(3),l=r(u),c=n(4),d=r(c),f=n(5),h=r(f),p=n(6),v=r(p),m=function(){function e(t,n){i(this,e);var r=Object.prototype.toString.call(t),o="[object Object]"!==r&&"[object Undefined]"!==r;o?(this.renderTo="string"==typeof t?document.querySelector(t):t,this._hidden=this.renderTo.querySelector(".omi_scoped__hidden_data"),this.id=this._hidden.dataset.omiId,this.data=JSON.parse(this._hidden.value)):(this.data=t||{},this._omi_server_rendering=n,this.id=this._omi_server_rendering?1e6+s.default.getInstanceId():s.default.getInstanceId()),this.refs={},this.children=[],this.childrenData=[],this.HTML=null,this._addedItems=[],this._omi_order=[],s.default.instances[this.id]=this,this.dataFirst=!0,this._omi_scoped_attr=s.default.STYLESCOPEDPREFIX+this.id,this._preCSS=null,this._omiGroupDataCounter={},(this._omi_server_rendering||o)&&(this.install(),this._render(!0),this._childrenInstalled(this),this.installed())}return o(e,[{key:"install",value:function(){}},{key:"installed",value:function(){}},{key:"uninstall",value:function(){}},{key:"afterUpdate",value:function(){}},{key:"beforeUpdate",value:function(){}},{key:"render",value:function(){}},{key:"style",value:function(){}},{key:"update",value:function(){if(this.beforeUpdate(),this._childrenBeforeUpdate(this),this.renderTo)this._render();else if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else(0,h.default)(this.node,(0,d.default)(this._childRender(this._omiChildStr),this.id)),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm();this._renderAddedChildren(),this._childrenAfterUpdate(this),this.afterUpdate()}},{key:"_childrenBeforeUpdate",value:function(e){var t=this;e.children.forEach(function(e){e.beforeUpdate(),t._childrenBeforeUpdate(e)})}},{key:"_childrenAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){t._childrenAfterUpdate(e),e.afterUpdate()})}},{key:"setData",value:function(e,t){this.data=e,t&&this.update()}},{key:"removeChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.remove()}},{key:"restoreChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.restore()}},{key:"setComponentOrder",value:function(e){var t=this;e.forEach(function(e,n){t._omi_order[n]=e}),this.update()}},{key:"addComponent",value:function(e,t,n){this._addedItems.push({position:e,el:t,component:n}),this.update()}},{key:"removeComponent",value:function(e){for(var t=0,n=this._addedItems.length;t<n;t++)if(e.id===this._addedItems[t].component.id){this._addedItems.splice(t,1);break}this.update()}},{key:"remove",value:function(){this._omi_removed=!0,this.update(),this.uninstall()}},{key:"restore",value:function(){this._omi_removed=!1,this.update(),this.installed()}},{key:"_renderAddedChildren",value:function(){var e=this;this._addedItems.forEach(function(t){var n="string"==typeof t.el?e.node.querySelector(t.el):t.el;t.component.install(),t.component._render(!0),t.component.installed(),t.component._childrenInstalled(t.component),n.insertAdjacentHTML(t.position,t.component.HTML)}),this.children.forEach(function(e){e._renderAddedChildren()})}},{key:"_render",value:function(e){var t=this;if(this._omi_removed){var n=this._createHiddenNode();return void(e?this.renderTo&&this.renderTo.appendChild(n):(this.node.parentNode.replaceChild(n,this.node),this.node=n))}this._generateHTMLCSS(),this._extractChildren(this),e&&this.children.forEach(function(e,n){t._omi_order[n]=n}),this.children.forEach(function(e,n){t.HTML=t.HTML.replace(e._omiChildStr,t.children[t._omi_order[n]].HTML)}),this.HTML=(0,d.default)(this.HTML,this.id),e?this.renderTo&&(this._omi_increment?this.renderTo.insertAdjacentHTML("beforeend",this.HTML):this.renderTo.innerHTML=this.HTML):""!==this.HTML?(0,h.default)(this.node,this.HTML):(0,h.default)(this.node,this._createHiddenNode()),this.renderTo&&(this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm())}},{key:"_childRender",value:function(e,t){var n=this;return this._omi_removed?(this.HTML='<input type="hidden" omi_scoped_'+this.id+" >",this.HTML):(this._mergeData(e),this._generateHTMLCSS(),this._extractChildren(this),t&&this.children.forEach(function(e,t){n._omi_order[t]=t}),this.children.forEach(function(e,t){n.HTML=n.HTML.replace(e._omiChildStr,n.children[n._omi_order[t]].HTML)}),this.HTML=(0,d.default)(this.HTML,this.id),this.HTML)}},{key:"_queryElements",value:function(e){e._mixRefs(),e._execPlugins(),e.children.forEach(function(t){t.node=e.node.querySelector("["+s.default.STYLESCOPEDPREFIX+t.id+"]"),e._queryElements(t)})}},{key:"_mixRefs",value:function(){var e=this,t=s.default.$$("*[ref]",this.node);t.forEach(function(t){t.hasAttribute(e._omi_scoped_attr)&&(e.refs[t.getAttribute("ref")]=t)});var n=this.node.getAttribute("ref");n&&(this.refs[n]=this.node)}},{key:"_execPlugins",value:function(){var e=this;Object.keys(s.default.plugins).forEach(function(t){var n=s.default.$$("*["+t+"]",e.node);n.forEach(function(n){n.hasAttribute(e._omi_scoped_attr)&&s.default.plugins[t](n,e)}),e.node.hasAttribute(t)&&s.default.plugins[t](e.node,e)})}},{key:"_childrenInstalled",value:function(e){var t=this;e.children.forEach(function(e){t._childrenInstalled(e),e.installed()})}},{key:"_fixForm",value:function(){s.default.$$("input",this.node).forEach(function(e){var t=e.type.toLowerCase();""===e.getAttribute("value")&&(e.value=""),"checked"!==t&&"radio"!==t||(e.hasAttribute("checked")?e.checked="checked":e.checked=!1)}),s.default.$$("textarea",this.node).forEach(function(e){e.value=e.getAttribute("value")}),s.default.$$("select",this.node).forEach(function(e){var t=e.getAttribute("value");if(t)s.default.$$("option",e).forEach(function(e){t===e.getAttribute("value")&&e.setAttribute("selected","selected")});else{var n=s.default.$$("option",e)[0];n&&n.setAttribute("selected","selected")}})}},{key:"_replaceTags",value:function(e,t){var n=e.join("|"),r=new RegExp("<("+n+"+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>","g");return t.replace(r,function(e,t){var n=e.length-2;return n>=0&&e.lastIndexOf("/>")===e.length-2?e.replace("<"+t,'<child tag="'+t+'"').substr(0,e.length+10)+"></child>":e.lastIndexOf(">")===e.length-1?e.replace("<"+t,'<child tag="'+t+'"')+"</child>":void 0})}},{key:"_createHiddenNode",value:function(){var e=document.createElement("input");return e.setAttribute("type","hidden"),e.setAttribute(this._omi_scoped_attr,""),e}},{key:"_mergeData",value:function(e){this.dataFirst?this.data=Object.assign({},this._getDataset(e),this.data):this.data=Object.assign({},this.data,this._getDataset(e))}},{key:"_generateHTMLCSS",value:function(){this.CSS=(this.style()||"").replace(/<\/?style>/g,""),this.CSS&&(this.CSS=l.default.scoper(this.CSS,"["+this._omi_scoped_attr+"]"),this.CSS===this._preCSS||this._omi_server_rendering||(l.default.addStyle(this.CSS,this.id),this._preCSS=this.CSS));var e=this.render();this.HTML=this._scopedAttr(s.default.template(e?e:"",this.data),this._omi_scoped_attr).trim(),this._omi_server_rendering&&(this.HTML='\r\n<style id="'+s.default.STYLEPREFIX+this.id+'">\r\n'+this.CSS+"\r\n</style>\r\n"+this.HTML,this.HTML+='\r\n<input type="hidden" data-omi-id="'+this.id+'" class="'+s.default.STYLESCOPEDPREFIX+"_hidden_data\" value='"+JSON.stringify(this.data)+"' />\r\n")}},{key:"_scopedAttr",value:function(e,t){return e.replace(/<[^\/]([A-Za-z]*)[^>]*>/g,function(e){var n=e.split(" ")[0].replace(">","");return e.replace(n,n+" "+t)})}},{key:"_getDataset",value:function(e){var t=this,n=(0,v.default)(e),r=n.child[0].attr;return Object.keys(r).forEach(function(e){0===e.indexOf("data-")&&(t._dataset[t._capitalize(e.replace("data-",""))]=r[e])}),this._dataset}},{key:"_capitalize",value:function(e){return e=e.toLowerCase(),e=e.replace(/\b\w+\b/g,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}).replace(/-/g,""),e.substring(0,1).toLowerCase()+e.substring(1)}},{key:"_extractPropertyFromString",value:function(e,t){var n=e.replace(/['|"|\]]/g,"").replace(/\[/g,".").split("."),r=t;return n.forEach(function(e){r=r[e]}),n=null,r}},{key:"_extractChildren",value:function(e){var t=this;s.default.customTags.length>0&&(e.HTML=this._replaceTags(s.default.customTags,e.HTML));var n=e.HTML.match(/<child[^>][\s\S]*?tag=['|"](\S*)['|"][\s\S]*?><\/child>/g);n&&n.forEach(function(n,r){var i=(0,v.default)(n),o=i.child[0].attr,a=o.tag;delete o.tag;var u=t.children[r];u&&u.___omi_constructor_name===a?u._childRender(n):!function(){var i={},l={},c={},d={},f=null,h=null;Object.keys(o).forEach(function(n){var r=o[n];if(0===n.indexOf("on")){var a=e[r];a&&(i[n]=a.bind(e))}else"omi-id"===n?f=r:"name"===n?h=r:"group-data"===n?(e._omiGroupDataCounter.hasOwnProperty(r)?e._omiGroupDataCounter[r]++:e._omiGroupDataCounter[r]=0,d=t._extractPropertyFromString(r,e)[e._omiGroupDataCounter[r]]):0===n.indexOf("data-")?l[t._capitalize(n.replace("data-",""))]=r:"data"===n&&(c=t._extractPropertyFromString(r,e))});var p=s.default.getClassFromString(a);if(!p)throw"Can't find Class called ["+a+"]";var v=new p(Object.assign(i,e.childrenData[r],l,c,d),!1);v._omiChildStr=n,v.parent=e,v.___omi_constructor_name=a,v._dataset={},v.install(),f&&(s.default.mapping[f]=v),h&&(e[h]=v),u?e.children[r]=v:e.children.push(v),v._childRender(n,!0)}()})}}]),e}();t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,n.trim()+t+",$1"+t+" ").replace(/\s+/g," "),n+r)})}function o(e,t){var n=document.getElementById(s.default.STYLEPREFIX+t),r=document.getElementsByTagName("head")[0];n&&n.parentNode===r&&r.removeChild(n);var i=document.createElement("style");r.appendChild(i),i.setAttribute("type","text/css"),i.setAttribute("id",s.default.STYLEPREFIX+t),window.ActiveXObject?i.styleSheet.cssText=e:i.textContent=e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=r(a);t.default={scoper:i,addStyle:o}},function(e,t){"use strict";function n(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=('|")([\s\S]*?)\([\s\S]*?\)/g,function(e,n,r,i){return 0===i.indexOf("Omi.instances[")?e:e.replace(/=(['|"])/,"=$1Omi.instances["+t+"].")})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,s){"object"===o(t)&&"undefined"!=typeof e?e.exports=s():(r=s,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)))}(void 0,function(){"use strict";function e(e){!l&&f.createRange&&(l=f.createRange(),l.selectNode(f.body));var t;return l&&l.createContextualFragment?t=l.createContextualFragment(e):(t=f.createElement("body"),t.innerHTML=e),t.childNodes[0]}function t(e,t){var n=e.nodeName,r=t.nodeName;return n===r||!!(t.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function n(e,t){return t&&t!==d?f.createElementNS(t,e):f.createElement(e)}function r(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function i(e,t){var n,r,i,o,a,s,u=t.attributes;for(n=u.length-1;n>=0;--n)r=u[n],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,s=e.getAttributeNS(o,i),s!==a&&e.setAttributeNS(o,i,a)):(s=e.getAttribute(i),s!==a&&e.setAttribute(i,a));for(u=e.attributes,n=u.length-1;n>=0;--n)r=u[n],r.specified!==!1&&(i=r.name,o=r.namespaceURI,o?(i=r.localName||i,p(t,o,i)||e.removeAttributeNS(o,i)):p(t,null,i)||e.removeAttribute(i))}function o(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n,""))}function a(){}function s(e){return e.id}function u(i){return function(o,u,l){function c(e){C?C.push(e):C=[e]}function d(e,t){if(e.nodeType===m)for(var n=e.firstChild;n;){var r=void 0;t&&(r=T(n))?c(r):(O(n),n.firstChild&&d(n,t)),n=n.nextSibling}}function h(e,t,n){A(e)!==!1&&(t&&t.removeChild(e),O(e),d(e,n))}function p(e){if(e.nodeType===m)for(var t=e.firstChild;t;){var n=T(t);n&&(P[n]=t),p(t),t=t.nextSibling}}function _(e){w(e);for(var n=e.firstChild;n;){var r=n.nextSibling,i=T(n);if(i){var o=P[i];o&&t(n,o)&&(n.parentNode.replaceChild(o,n),b(o,n))}_(n),n=r}}function b(e,n,r){var a,s=T(n);if(s&&delete P[s],!u.isSameNode||!u.isSameNode(o)){if(!r){if(k(e,n)===!1)return;if(i(e,n),x(e),L(e,n)===!1)return}if("TEXTAREA"!==e.nodeName){var l,d,p,S,C=n.firstChild,w=e.firstChild;e:for(;C;){for(p=C.nextSibling,l=T(C);w;){if(d=w.nextSibling,C.isSameNode&&C.isSameNode(w)){C=p,w=d;continue e}a=T(w);var A=w.nodeType,O=void 0;if(A===C.nodeType&&(A===m?(l?l!==a&&((S=P[l])?w.nextSibling===S?O=!1:(e.insertBefore(S,w),d=w.nextSibling,a?c(a):h(w,e,!0),w=S):O=!1):a&&(O=!1),O=O!==!1&&t(w,C),O&&b(w,C)):A!==y&&A!=g||(O=!0,w.nodeValue=C.nodeValue)),O){C=p,w=d;continue e}a?c(a):h(w,e,!0),w=d}if(l&&(S=P[l])&&t(S,C))e.appendChild(S),b(S,C);else{var M=E(C);M!==!1&&(M&&(C=M),C.actualize&&(C=C.actualize(e.ownerDocument||f)),e.appendChild(C),_(C))}C=p,w=d}for(;w;)d=w.nextSibling,(a=T(w))?c(a):h(w,e,!0),w=d}var N=v[e.nodeName];N&&N(e,n)}}if(l||(l={}),"string"==typeof u)if("#document"===o.nodeName||"HTML"===o.nodeName){var S=u;u=f.createElement("html"),u.innerHTML=S}else u=e(u);var C,T=l.getNodeKey||s,E=l.onBeforeNodeAdded||a,w=l.onNodeAdded||a,k=l.onBeforeElUpdated||a,x=l.onElUpdated||a,A=l.onBeforeNodeDiscarded||a,O=l.onNodeDiscarded||a,L=l.onBeforeElChildrenUpdated||a,M=l.childrenOnly===!0,P={};p(o);var N=o,I=N.nodeType,j=u.nodeType;if(!M)if(I===m)j===m?t(o,u)||(O(o),N=r(o,n(u.nodeName,u.namespaceURI))):N=u;else if(I===y||I===g){if(j===I)return N.nodeValue=u.nodeValue,N;N=u}if(N===u)O(o);else if(b(N,u,M),C)for(var H=0,U=C.length;H<U;H++){var D=P[C[H]];D&&h(D,D.parentNode,!1)}return!M&&N!==o&&o.parentNode&&(N.actualize&&(N=N.actualize(o.ownerDocument||f)),o.parentNode.replaceChild(N,o)),N}}var l,c,d="http://www.w3.org/1999/xhtml",f="undefined"==typeof document?void 0:document,h=f?f.body||f.createElement("div"):{};c=h.hasAttributeNS?function(e,t,n){return e.hasAttributeNS(t,n)}:h.hasAttribute?function(e,t,n){return e.hasAttribute(n)}:function(e,t,n){return null!=e.getAttributeNode(t,n)};var p=c,v={OPTION:function(e,t){o(e,t,"selected")},INPUT:function(e,t){o(e,t,"checked"),o(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),p(t,null,"value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;if(e.value!==n&&(e.value=n),e.firstChild){if(""===n&&e.firstChild.nodeValue===e.placeholder)return;e.firstChild.nodeValue=n}},SELECT:function(e,t){if(!p(t,null,"multiple")){for(var n=-1,r=0,i=t.firstChild;i;){var o=i.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(p(i,null,"selected")){n=r;break}r++}i=i.nextSibling}e.selectedIndex=r}}},m=1,y=3,g=8,_=u(i);return _})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,i=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=function(e,t){function o(e,n,r,o){if(n=n.toLowerCase(),o=!!o,o||c.push(n),t.start){var a=[];r.replace(i,function(e,t){var n=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:"";a.push({name:t,value:n,escaped:n.replace(/(^|[^\\])"/g,'$1\\"')})}),t.start&&t.start(n,a,o)}}function a(e,n){if(n)for(var r=c.length-1;r>=0&&c[r]!=n;r--);else var r=0;if(r>=0){for(var i=c.length-1;i>=r;i--)t.end&&t.end(c[i]);c.length=r}}var s,u,l,c=[],d=e;for(c.last=function(){return this[this.length-1]};e;){if(u=!0,c.last())e=e.replace(new RegExp("([\\s\\S]*?)</"+c.last()+"[^>]*>"),function(e,n){return t.chars&&t.chars(n),""}),a("",c.last());else if(0==e.indexOf("</")?(l=e.match(r),l&&(e=e.substring(l[0].length),l[0].replace(r,a),u=!1)):0==e.indexOf("<")&&(l=e.match(n),l&&(e=e.substring(l[0].length),l[0].replace(n,o),u=!1)),u){s=e.indexOf("<");var f=s<0?e:e.substring(0,s);e=s<0?"":e.substring(s),t.chars&&t.chars(f)}if(e==d)throw"Parse Error: "+e;d=e}a()},a=!1,s=a?console.log.bind(console):function(){};Array.prototype.reduce||(Array.prototype.reduce=function(e){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var t,n=Object(this),r=n.length>>>0,i=0;if(2==arguments.length)t=arguments[1];else{for(;i<r&&!(i in n);)i++;if(i>=r)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<r;i++)i in n&&(t=e(t,n[i],i,n));return t});var u=function(e){var t=[],n={node:"root",child:[]};return o(e,{start:function(e,r,i){s(e,r,i);var o={node:"element",tag:e};if(0!==r.length&&(o.attr=r.reduce(function(e,t){var n=t.name,r=t.value;return e[n]=r,e},{})),i){var a=t[0]||n;void 0===a.child&&(a.child=[]),a.child.push(o)}else t.unshift(o)},end:function(e){s(e);var r=t.shift();if(r.tag!==e&&console.error("invalid state: mismatch end tag"),0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}},chars:function(e){s(e);var r={node:"text",text:e};if(0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}}}),n};t.default=u},function(e,t,n){var r,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*!
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Omi=t():e.Omi=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(1),o=r(i),a=n(7),u=r(a),s=n(2),l=r(s);o.default.template=u.default.render,o.default.Component=l.default,window.Omi?e.exports=window.Omi:(window.Omi=o.default,e.exports=o.default)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":a(t))&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":a(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push({key:n,value:e[n]});return t}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u={};u.instances={},u._instanceId=0,u.getInstanceId=function(){return u._instanceId++},u.customTags=[],u.mapping={},u.STYLEPREFIX="omi_style_",u.STYLESCOPEDPREFIX="omi_scoped_","function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),function(){var e=Array.prototype.slice;try{e.call(document.documentElement)}catch(t){Array.prototype.slice=function(t,n){if(n="undefined"!=typeof n?n:this.length,"[object Array]"===Object.prototype.toString.call(this))return e.call(this,t,n);var r,i,o=[],a=this.length,u=t||0;u=u>=0?u:a+u;var s=n?n:a;if(n<0&&(s=a+n),i=s-u,i>0)if(o=new Array(i),this.charAt)for(r=0;r<i;r++)o[r]=this.charAt(u+r);else for(r=0;r<i;r++)o[r]=this[u+r];return o}}}();var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();u.create=function(e,t,a){var l=t,c=u.Component;return arguments.length>2&&(l=a,c=t),u[e]=function(t){function a(t,i){return n(this,a),this.___omi_constructor_name=e,r(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i))}return i(a,t),s(a,o(l)),a}(c),u.customTags.push(e),u[e]},u.mixIndex=function(e,t){for(var n=e.length,r=t||"index",i=0;i<n;i++){var o=e[i];"object"===("undefined"==typeof o?"undefined":a(o))?o[r]=i:(e[i]={value:o},e[i][r]=i)}return e},u.$=function(e,t){return t?t.querySelector(e):document.querySelector(e)},u.$$=function(e,t){return t?Array.prototype.slice.call(t.querySelectorAll(e)):Array.prototype.slice.call(document.querySelectorAll(e))},u.getClassFromString=function(e){if(0!==e.indexOf(".")){for(var t=e.split("."),n=t.length,r=u[t[0]],i=1;i<n;i++)r=r[t[i]];return r}return u[e]},u.makeHTML=function(e,t){u[e]=t,u.customTags.push(e)},u.render=function(e,t,n){return e.renderTo="string"==typeof t?document.querySelector(t):t,e._omi_increment=n,e.install(),e._render(!0),e._childrenInstalled(e),e.installed(),e},u.get=function(e){return u.mapping[e]},u.plugins={},u.extendPlugin=function(e,t){u.plugins[e]=t},u.getParameters=function(e,t,n){var r={},i=function(){},o={stringType:function(e){return e},numberType:function(e){return Number(e)},booleanType:function(e){return"true"===e||"false"!==e&&Boolean(e)},functionType:function(e){if(!e)return i;var n=t[e.replace(/Omi.instances\[\d\]./,"")];return n?n.bind(t):(console.warn("You do not define [ "+e+" ] method in following component"),void console.warn(t))}};return Object.keys(n).forEach(function(t){n[t].forEach(function(n){var i=e.getAttribute(n);null!==i&&(r[n]=o[t](i))})}),r},u.mixIndexToArray=function(e,t){e.forEach(function(e,n){e[t||"index"]=n})},e.exports=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=r(a),s=n(3),l=r(s),c=n(4),d=r(c),f=n(5),h=r(f),p=n(6),v=r(p),m=function(){function e(t,n){i(this,e);var r=Object.prototype.toString.call(t),o="[object Object]"!==r&&"[object Undefined]"!==r;o?(this.renderTo="string"==typeof t?document.querySelector(t):t,this._hidden=this.renderTo.querySelector(".omi_scoped__hidden_data"),this.id=this._hidden.dataset.omiId,this.data=JSON.parse(this._hidden.value)):(this.data=t||{},this._omi_server_rendering=n,this.id=this._omi_server_rendering?1e6+u.default.getInstanceId():u.default.getInstanceId()),this.refs={},this.children=[],this.childrenData=[],this.HTML=null,this._addedItems=[],this._omi_order=[],u.default.instances[this.id]=this,this.dataFirst=!0,this._omi_scoped_attr=u.default.STYLESCOPEDPREFIX+this.id,this._preCSS=null,this._omiGroupDataCounter={},(this._omi_server_rendering||o)&&(this.install(),this._render(!0),this._childrenInstalled(this),this.installed())}return o(e,[{key:"install",value:function(){}},{key:"installed",value:function(){}},{key:"uninstall",value:function(){}},{key:"afterUpdate",value:function(){}},{key:"beforeUpdate",value:function(){}},{key:"render",value:function(){}},{key:"style",value:function(){}},{key:"update",value:function(){if(this.beforeUpdate(),this._childrenBeforeUpdate(this),this.renderTo)this._render();else if(this._omi_removed){var e=this._createHiddenNode();this.node.parentNode.replaceChild(e,this.node),this.node=e}else(0,h.default)(this.node,(0,d.default)(this._childRender(this._omiChildStr),this.id)),this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm();this._renderAddedChildren(),this._childrenAfterUpdate(this),this.afterUpdate()}},{key:"_childrenBeforeUpdate",value:function(e){var t=this;e.children.forEach(function(e){e.beforeUpdate(),t._childrenBeforeUpdate(e)})}},{key:"_childrenAfterUpdate",value:function(e){var t=this;e.children.forEach(function(e){t._childrenAfterUpdate(e),e.afterUpdate()})}},{key:"setData",value:function(e,t){this.data=e,t&&this.update()}},{key:"removeChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.remove()}},{key:"restoreChild",value:function(e){var t=e;"number"==typeof e&&(t=this.children[e]),t.restore()}},{key:"setComponentOrder",value:function(e){var t=this;e.forEach(function(e,n){t._omi_order[n]=e}),this.update()}},{key:"addComponent",value:function(e,t,n){this._addedItems.push({position:e,el:t,component:n}),this.update()}},{key:"removeComponent",value:function(e){for(var t=0,n=this._addedItems.length;t<n;t++)if(e.id===this._addedItems[t].component.id){this._addedItems.splice(t,1);break}this.update()}},{key:"remove",value:function(){this._omi_removed=!0,this.update(),this.uninstall()}},{key:"restore",value:function(){this._omi_removed=!1,this.update(),this.installed()}},{key:"_renderAddedChildren",value:function(){var e=this;this._addedItems.forEach(function(t){var n="string"==typeof t.el?e.node.querySelector(t.el):t.el;t.component.install(),t.component._render(!0),t.component.installed(),t.component._childrenInstalled(t.component),n.insertAdjacentHTML(t.position,t.component.HTML)}),this.children.forEach(function(e){e._renderAddedChildren()})}},{key:"_render",value:function(e){var t=this;if(this._omi_removed){var n=this._createHiddenNode();return void(e?this.renderTo&&this.renderTo.appendChild(n):(this.node.parentNode.replaceChild(n,this.node),this.node=n))}this._generateHTMLCSS(),this._extractChildren(this),e&&this.children.forEach(function(e,n){t._omi_order[n]=n}),this.children.forEach(function(e,n){t.HTML=t.HTML.replace(e._omiChildStr,t.children[t._omi_order[n]].HTML)}),this.HTML=(0,d.default)(this.HTML,this.id),e?this.renderTo&&(this._omi_increment?this.renderTo.insertAdjacentHTML("beforeend",this.HTML):this.renderTo.innerHTML=this.HTML):""!==this.HTML?(0,h.default)(this.node,this.HTML):(0,h.default)(this.node,this._createHiddenNode()),this.renderTo&&(this.node=document.querySelector("["+this._omi_scoped_attr+"]"),this._queryElements(this),this._fixForm())}},{key:"_childRender",value:function(e,t){var n=this;return this._omi_removed?(this.HTML='<input type="hidden" omi_scoped_'+this.id+" >",this.HTML):(this._mergeData(e),this._generateHTMLCSS(),this._extractChildren(this),t&&this.children.forEach(function(e,t){n._omi_order[t]=t}),this.children.forEach(function(e,t){n.HTML=n.HTML.replace(e._omiChildStr,n.children[n._omi_order[t]].HTML)}),this.HTML=(0,d.default)(this.HTML,this.id),this.HTML)}},{key:"_queryElements",value:function(e){e._mixRefs(),e._execPlugins(),e.children.forEach(function(t){t.node=e.node.querySelector("["+u.default.STYLESCOPEDPREFIX+t.id+"]"),e._queryElements(t)})}},{key:"_mixRefs",value:function(){var e=this,t=u.default.$$("*[ref]",this.node);t.forEach(function(t){t.hasAttribute(e._omi_scoped_attr)&&(e.refs[t.getAttribute("ref")]=t)});var n=this.node.getAttribute("ref");n&&(this.refs[n]=this.node)}},{key:"_execPlugins",value:function(){var e=this;Object.keys(u.default.plugins).forEach(function(t){var n=u.default.$$("*["+t+"]",e.node);n.forEach(function(n){n.hasAttribute(e._omi_scoped_attr)&&u.default.plugins[t](n,e)}),e.node.hasAttribute(t)&&u.default.plugins[t](e.node,e)})}},{key:"_childrenInstalled",value:function(e){var t=this;e.children.forEach(function(e){t._childrenInstalled(e),e.installed()})}},{key:"_fixForm",value:function(){u.default.$$("input",this.node).forEach(function(e){var t=e.type.toLowerCase();""===e.getAttribute("value")&&(e.value=""),"checked"!==t&&"radio"!==t||(e.hasAttribute("checked")?e.checked="checked":e.checked=!1)}),u.default.$$("textarea",this.node).forEach(function(e){e.value=e.getAttribute("value")}),u.default.$$("select",this.node).forEach(function(e){var t=e.getAttribute("value");if(t)u.default.$$("option",e).forEach(function(e){t===e.getAttribute("value")&&e.setAttribute("selected","selected")});else{var n=u.default.$$("option",e)[0];n&&n.setAttribute("selected","selected")}})}},{key:"_replaceTags",value:function(e,t){var n=e.join("|"),r=new RegExp("<("+n+"+)((?:\\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)>","g");return t.replace(r,function(e,t){var n=e.length-2;return n>=0&&e.lastIndexOf("/>")===e.length-2?e.replace("<"+t,'<child tag="'+t+'"').substr(0,e.length+10)+"></child>":e.lastIndexOf(">")===e.length-1?e.replace("<"+t,'<child tag="'+t+'"')+"</child>":void 0})}},{key:"_createHiddenNode",value:function(){var e=document.createElement("input");return e.setAttribute("type","hidden"),e.setAttribute(this._omi_scoped_attr,""),e}},{key:"_mergeData",value:function(e){this.dataFirst?this.data=Object.assign({},this._getDataset(e),this.data):this.data=Object.assign({},this.data,this._getDataset(e))}},{key:"_generateHTMLCSS",value:function(){this.CSS=(this.style()||"").replace(/<\/?style>/g,""),this.CSS&&(this.CSS=l.default.scoper(this.CSS,"["+this._omi_scoped_attr+"]"),this.CSS===this._preCSS||this._omi_server_rendering||(l.default.addStyle(this.CSS,this.id),this._preCSS=this.CSS));var e=this.render();this.HTML=this._scopedAttr(u.default.template(e?e:"",this.data),this._omi_scoped_attr).trim(),this._omi_server_rendering&&(this.HTML='\r\n<style id="'+u.default.STYLEPREFIX+this.id+'">\r\n'+this.CSS+"\r\n</style>\r\n"+this.HTML,this.HTML+='\r\n<input type="hidden" data-omi-id="'+this.id+'" class="'+u.default.STYLESCOPEDPREFIX+"_hidden_data\" value='"+JSON.stringify(this.data)+"' />\r\n")}},{key:"_scopedAttr",value:function(e,t){return e.replace(/<[^\/]([A-Za-z]*)[^>]*>/g,function(e){var n=e.split(" ")[0].replace(">","");return e.replace(n,n+" "+t)})}},{key:"_getDataset",value:function(e){var t=this,n=(0,v.default)(e),r=n.child[0].attr;return Object.keys(r).forEach(function(e){0===e.indexOf("data-")&&(t._dataset[t._capitalize(e.replace("data-",""))]=r[e])}),this._dataset}},{key:"_capitalize",value:function(e){return e=e.toLowerCase(),e=e.replace(/\b\w+\b/g,function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}).replace(/-/g,""),e.substring(0,1).toLowerCase()+e.substring(1)}},{key:"_extractPropertyFromString",value:function(e,t){var n=e.replace(/['|"|\]]/g,"").replace(/\[/g,".").split("."),r=t;return n.forEach(function(e){r=r[e]}),n=null,r}},{key:"_extractChildren",value:function(e){var t=this;u.default.customTags.length>0&&(e.HTML=this._replaceTags(u.default.customTags,e.HTML));var n=e.HTML.match(/<child[^>][\s\S]*?tag=['|"](\S*)['|"][\s\S]*?><\/child>/g);n&&n.forEach(function(n,r){var i=(0,v.default)(n),o=i.child[0].attr,a=o.tag;delete o.tag;var s=t.children[r];s&&s.___omi_constructor_name===a?s._childRender(n):!function(){var i={},l={},c={},d={},f=null,h=null;Object.keys(o).forEach(function(n){var r=o[n];if(0===n.indexOf("on")){var a=e[r];a&&(i[n]=a.bind(e))}else"omi-id"===n?f=r:"name"===n?h=r:"group-data"===n?(e._omiGroupDataCounter.hasOwnProperty(r)?e._omiGroupDataCounter[r]++:e._omiGroupDataCounter[r]=0,d=t._extractPropertyFromString(r,e)[e._omiGroupDataCounter[r]]):0===n.indexOf("data-")?l[t._capitalize(n.replace("data-",""))]=r:"data"===n&&(c=t._extractPropertyFromString(r,e))});var p=u.default.getClassFromString(a);if(!p)throw"Can't find Class called ["+a+"]";var v=new p(Object.assign(i,e.childrenData[r],l,c,d),!1);v._omiChildStr=n,v.parent=e,v.___omi_constructor_name=a,v._dataset={},v.install(),f&&(u.default.mapping[f]=v),h&&(e[h]=v),s?e.children[r]=v:e.children.push(v),v._childRender(n,!0)}()})}}]),e}();t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,n.trim()+t+",$1"+t+" ").replace(/\s+/g," "),n+r)})}function o(e,t){var n=document.getElementById(u.default.STYLEPREFIX+t),r=document.getElementsByTagName("head")[0];n&&n.parentNode===r&&r.removeChild(n);var i=document.createElement("style");r.appendChild(i),i.setAttribute("type","text/css"),i.setAttribute("id",u.default.STYLEPREFIX+t),window.ActiveXObject?i.styleSheet.cssText=e:i.textContent=e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),u=r(a);t.default={scoper:i,addStyle:o}},function(e,t){"use strict";function n(e,t,n){return e.split(t).map(function(e){return e.replace(new RegExp(n,"g"),t)}).join(n)}function r(e){return JSON.stringify(e).replace(/(^"|"$)/g,"")}function i(e){return e=n(e,"'",'"'),n(r(e),"'",'"')}function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function a(e,t){return String.prototype.endsWith?String.prototype.endsWith.call(e,t):e.substr(e.length-1,1)===t}function u(e,t){return e.replace(/<[\s\S]*?[^=]>/g,function(e){return e.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=('|"|{)([\s\S]*)('|"|})/g,function(e,n,r,u,s){if(0===u.indexOf("Omi.instances[")||0===u.indexOf("new Function("))return e;if("{"===r){var l="("+u+").bind(Omi.instances["+t+"])(event)",c="on"+n+"=\"new Function('event', '"+o(i(l))+"')(event)\"";return c.split("\n").map(function(e){return a(e,";")?e:e+";"}).join("")}return u.match(/.*?\(.*?\)/)?e.replace(/=(['|"])/,"=$1Omi.instances["+t+"]."):e})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=u},function(e,t,n){var r,i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(a,u){"object"===o(t)&&"undefined"!=typeof e?e.exports=u():(r=u,i="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==i&&(e.exports=i)))}(void 0,function(){"use strict";function e(e){!l&&f.createRange&&(l=f.createRange(),l.selectNode(f.body));var t;return l&&l.createContextualFragment?t=l.createContextualFragment(e):(t=f.createElement("body"),t.innerHTML=e),t.childNodes[0]}function t(e,t){var n=e.nodeName,r=t.nodeName;return n===r||!!(t.actualize&&n.charCodeAt(0)<91&&r.charCodeAt(0)>90)&&n===r.toUpperCase()}function n(e,t){return t&&t!==d?f.createElementNS(t,e):f.createElement(e)}function r(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function i(e,t){var n,r,i,o,a,u,s=t.attributes;for(n=s.length-1;n>=0;--n)r=s[n],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,u=e.getAttributeNS(o,i),u!==a&&e.setAttributeNS(o,i,a)):(u=e.getAttribute(i),u!==a&&e.setAttribute(i,a));for(s=e.attributes,n=s.length-1;n>=0;--n)r=s[n],r.specified!==!1&&(i=r.name,o=r.namespaceURI,o?(i=r.localName||i,p(t,o,i)||e.removeAttributeNS(o,i)):p(t,null,i)||e.removeAttribute(i))}function o(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n,""))}function a(){}function u(e){return e.id}function s(i){return function(o,s,l){function c(e){C?C.push(e):C=[e]}function d(e,t){if(e.nodeType===m)for(var n=e.firstChild;n;){var r=void 0;t&&(r=T(n))?c(r):(O(n),n.firstChild&&d(n,t)),n=n.nextSibling}}function h(e,t,n){A(e)!==!1&&(t&&t.removeChild(e),O(e),d(e,n))}function p(e){if(e.nodeType===m)for(var t=e.firstChild;t;){var n=T(t);n&&(P[n]=t),p(t),t=t.nextSibling}}function _(e){E(e);for(var n=e.firstChild;n;){var r=n.nextSibling,i=T(n);if(i){var o=P[i];o&&t(n,o)&&(n.parentNode.replaceChild(o,n),b(o,n))}_(n),n=r}}function b(e,n,r){var a,u=T(n);if(u&&delete P[u],!s.isSameNode||!s.isSameNode(o)){if(!r){if(x(e,n)===!1)return;if(i(e,n),k(e),L(e,n)===!1)return}if("TEXTAREA"!==e.nodeName){var l,d,p,S,C=n.firstChild,E=e.firstChild;e:for(;C;){for(p=C.nextSibling,l=T(C);E;){if(d=E.nextSibling,C.isSameNode&&C.isSameNode(E)){C=p,E=d;continue e}a=T(E);var A=E.nodeType,O=void 0;if(A===C.nodeType&&(A===m?(l?l!==a&&((S=P[l])?E.nextSibling===S?O=!1:(e.insertBefore(S,E),d=E.nextSibling,a?c(a):h(E,e,!0),E=S):O=!1):a&&(O=!1),O=O!==!1&&t(E,C),O&&b(E,C)):A!==y&&A!=g||(O=!0,E.nodeValue=C.nodeValue)),O){C=p,E=d;continue e}a?c(a):h(E,e,!0),E=d}if(l&&(S=P[l])&&t(S,C))e.appendChild(S),b(S,C);else{var M=w(C);M!==!1&&(M&&(C=M),C.actualize&&(C=C.actualize(e.ownerDocument||f)),e.appendChild(C),_(C))}C=p,E=d}for(;E;)d=E.nextSibling,(a=T(E))?c(a):h(E,e,!0),E=d}var N=v[e.nodeName];N&&N(e,n)}}if(l||(l={}),"string"==typeof s)if("#document"===o.nodeName||"HTML"===o.nodeName){var S=s;s=f.createElement("html"),s.innerHTML=S}else s=e(s);var C,T=l.getNodeKey||u,w=l.onBeforeNodeAdded||a,E=l.onNodeAdded||a,x=l.onBeforeElUpdated||a,k=l.onElUpdated||a,A=l.onBeforeNodeDiscarded||a,O=l.onNodeDiscarded||a,L=l.onBeforeElChildrenUpdated||a,M=l.childrenOnly===!0,P={};p(o);var N=o,j=N.nodeType,I=s.nodeType;if(!M)if(j===m)I===m?t(o,s)||(O(o),N=r(o,n(s.nodeName,s.namespaceURI))):N=s;else if(j===y||j===g){if(I===j)return N.nodeValue=s.nodeValue,N;N=s}if(N===s)O(o);else if(b(N,s,M),C)for(var H=0,U=C.length;H<U;H++){var D=P[C[H]];D&&h(D,D.parentNode,!1)}return!M&&N!==o&&o.parentNode&&(N.actualize&&(N=N.actualize(o.ownerDocument||f)),o.parentNode.replaceChild(N,o)),N}}var l,c,d="http://www.w3.org/1999/xhtml",f="undefined"==typeof document?void 0:document,h=f?f.body||f.createElement("div"):{};c=h.hasAttributeNS?function(e,t,n){return e.hasAttributeNS(t,n)}:h.hasAttribute?function(e,t,n){return e.hasAttribute(n)}:function(e,t,n){return null!=e.getAttributeNode(t,n)};var p=c,v={OPTION:function(e,t){o(e,t,"selected")},INPUT:function(e,t){o(e,t,"checked"),o(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),p(t,null,"value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;if(e.value!==n&&(e.value=n),e.firstChild){if(""===n&&e.firstChild.nodeValue===e.placeholder)return;e.firstChild.nodeValue=n}},SELECT:function(e,t){if(!p(t,null,"multiple")){for(var n=-1,r=0,i=t.firstChild;i;){var o=i.nodeName;if(o&&"OPTION"===o.toUpperCase()){if(p(i,null,"selected")){n=r;break}r++}i=i.nextSibling}e.selectedIndex=r}}},m=1,y=3,g=8,_=s(i);return _})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,r=/^<\/([-A-Za-z0-9_]+)[^>]*>/,i=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,o=function(e,t){function o(e,n,r,o){if(n=n.toLowerCase(),o=!!o,o||c.push(n),t.start){var a=[];r.replace(i,function(e,t){var n=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:"";a.push({name:t,value:n,escaped:n.replace(/(^|[^\\])"/g,'$1\\"')})}),t.start&&t.start(n,a,o)}}function a(e,n){if(n)for(var r=c.length-1;r>=0&&c[r]!=n;r--);else var r=0;if(r>=0){for(var i=c.length-1;i>=r;i--)t.end&&t.end(c[i]);c.length=r}}var u,s,l,c=[],d=e;for(c.last=function(){return this[this.length-1]};e;){if(s=!0,c.last())e=e.replace(new RegExp("([\\s\\S]*?)</"+c.last()+"[^>]*>"),function(e,n){return t.chars&&t.chars(n),""}),a("",c.last());else if(0==e.indexOf("</")?(l=e.match(r),l&&(e=e.substring(l[0].length),l[0].replace(r,a),s=!1)):0==e.indexOf("<")&&(l=e.match(n),l&&(e=e.substring(l[0].length),l[0].replace(n,o),s=!1)),s){u=e.indexOf("<");var f=u<0?e:e.substring(0,u);e=u<0?"":e.substring(u),t.chars&&t.chars(f)}if(e==d)throw"Parse Error: "+e;d=e}a()},a=!1,u=a?console.log.bind(console):function(){};Array.prototype.reduce||(Array.prototype.reduce=function(e){if(null==this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var t,n=Object(this),r=n.length>>>0,i=0;if(2==arguments.length)t=arguments[1];else{for(;i<r&&!(i in n);)i++;if(i>=r)throw new TypeError("Reduce of empty array with no initial value");t=n[i++]}for(;i<r;i++)i in n&&(t=e(t,n[i],i,n));return t});var s=function(e){var t=[],n={node:"root",child:[]};return o(e,{start:function(e,r,i){u(e,r,i);var o={node:"element",tag:e};if(0!==r.length&&(o.attr=r.reduce(function(e,t){var n=t.name,r=t.value;return e[n]=r,e},{})),i){var a=t[0]||n;void 0===a.child&&(a.child=[]),a.child.push(o)}else t.unshift(o)},end:function(e){u(e);var r=t.shift();if(r.tag!==e&&console.error("invalid state: mismatch end tag"),0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}},chars:function(e){u(e);var r={node:"text",text:e};if(0===t.length)n.child.push(r);else{var i=t[0];void 0===i.child&&(i.child=[]),i.child.push(r)}}}),n};t.default=s},function(e,t,n){var r,i,o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/
!function(n,s){"object"===a(t)&&t&&"string"!=typeof t.nodeName?s(t):(i=[t],r=s,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o)))}(void 0,function(e){function t(e){return"function"==typeof e}function n(e){return m(e)?"array":"undefined"==typeof e?"undefined":a(e)}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"===("undefined"==typeof e?"undefined":a(e))&&t in e}function o(e,t){return y.call(e,t)}function s(e){return!o(g,e)}function u(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return _[e]})}function l(t,n){function i(){if(y&&!g)for(;v.length;)delete p[v.pop()];else v=[];y=!1,g=!1}function o(e){if("string"==typeof e&&(e=e.split(S,2)),!m(e)||2!==e.length)throw new Error("Invalid tags: "+e);a=new RegExp(r(e[0])+"\\s*"),u=new RegExp("\\s*"+r(e[1])),l=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var a,u,l,h=[],p=[],v=[],y=!1,g=!1;o(n||e.tags);for(var _,w,k,x,A,O,L=new f(t);!L.eos();){if(_=L.pos,k=L.scanUntil(a))for(var M=0,P=k.length;M<P;++M)x=k.charAt(M),s(x)?v.push(p.length):g=!0,p.push(["text",x,_,_+1]),_+=1,"\n"===x&&i();if(!L.scan(a))break;if(y=!0,w=L.scan(E)||"name",L.scan(b),"="===w?(k=L.scanUntil(C),L.scan(C),L.scanUntil(u)):"{"===w?(k=L.scanUntil(l),L.scan(T),L.scanUntil(u),w="&"):k=L.scanUntil(u),!L.scan(u))throw new Error("Unclosed tag at "+L.pos);if(A=[w,k,_,L.pos],p.push(A),"#"===w||"^"===w)h.push(A);else if("/"===w){if(O=h.pop(),!O)throw new Error('Unopened section "'+k+'" at '+_);if(O[1]!==k)throw new Error('Unclosed section "'+O[1]+'" at '+_)}else"name"===w||"{"===w||"&"===w?g=!0:"="===w&&o(k)}if(O=h.pop())throw new Error('Unclosed section "'+O[1]+'" at '+L.pos);return d(c(p))}function c(e){for(var t,n,r=[],i=0,o=e.length;i<o;++i)t=e[i],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function d(e){for(var t,n,r=[],i=r,o=[],a=0,s=e.length;a<s;++a)switch(t=e[a],t[0]){case"#":case"^":i.push(t),o.push(t),i=t[4]=[];break;case"/":n=o.pop(),n[5]=t[2],i=o.length>0?o[o.length-1][4]:r;break;default:i.push(t)}return r}function f(e){this.string=e,this.tail=e,this.pos=0}function h(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function p(){this.cache={}}var v=Object.prototype.toString,m=Array.isArray||function(e){return"[object Array]"===v.call(e)},y=RegExp.prototype.test,g=/\S/,_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},b=/\s*/,S=/\s+/,C=/\s*=/,T=/\s*\}/,E=/#|\^|\/|>|\{|&|=|!/;f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},h.prototype.push=function(e){return new h(e,this)},h.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var o,a,s=this,u=!1;s;){if(e.indexOf(".")>0)for(n=s.view,o=e.split("."),a=0;null!=n&&a<o.length;)a===o.length-1&&(u=i(n,o[a])),n=n[o[a++]];else n=s.view[e],u=i(s.view,e);if(u)break;s=s.parent}r[e]=n}return t(n)&&(n=n.call(this.view)),n},p.prototype.clearCache=function(){this.cache={}},p.prototype.parse=function(e,t){var n=this.cache,r=n[e];return null==r&&(r=n[e]=l(e,t)),r},p.prototype.render=function(e,t,n){var r=this.parse(e),i=t instanceof h?t:new h(t);return this.renderTokens(r,i,n,e)},p.prototype.renderTokens=function(e,t,n,r){for(var i,o,a,s="",u=0,l=e.length;u<l;++u)a=void 0,i=e[u],o=i[0],"#"===o?a=this.renderSection(i,t,n,r):"^"===o?a=this.renderInverted(i,t,n,r):">"===o?a=this.renderPartial(i,t,n,r):"&"===o?a=this.unescapedValue(i,t):"name"===o?a=this.escapedValue(i,t):"text"===o&&(a=this.rawValue(i)),void 0!==a&&(s+=a);return s},p.prototype.renderSection=function(e,n,r,i){function o(e){return s.render(e,n,r)}var s=this,u="",l=n.lookup(e[1]);if(l){if(m(l))for(var c=0,d=l.length;c<d;++c)u+=this.renderTokens(e[4],n.push(l[c]),r,i);else if("object"===("undefined"==typeof l?"undefined":a(l))||"string"==typeof l||"number"==typeof l)u+=this.renderTokens(e[4],n.push(l),r,i);else if(t(l)){if("string"!=typeof i)throw new Error("Cannot use higher-order sections without the original template");l=l.call(n.view,i.slice(e[3],e[5]),o),null!=l&&(u+=l)}else u+=this.renderTokens(e[4],n,r,i);return u}},p.prototype.renderInverted=function(e,t,n,r){var i=t.lookup(e[1]);if(!i||m(i)&&0===i.length)return this.renderTokens(e[4],t,n,r)},p.prototype.renderPartial=function(e,n,r){if(r){var i=t(r)?r(e[1]):r[e[1]];return null!=i?this.renderTokens(this.parse(i),n,r,i):void 0}},p.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},p.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);if(null!=r)return e.escape(r)},p.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.3.0",e.tags=["{{","}}"];var w=new p;return e.clearCache=function(){return w.clearCache()},e.parse=function(e,t){return w.parse(e,t)},e.render=function(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return w.render(e,t,r)},e.to_html=function(n,r,i,o){var a=e.render(n,r,i);return t(o)?void o(a):a},e.escape=u,e.Scanner=f,e.Context=h,e.Writer=p,e})}])});
!function(n,u){"object"===a(t)&&t&&"string"!=typeof t.nodeName?u(t):(i=[t],r=u,o="function"==typeof r?r.apply(t,i):r,!(void 0!==o&&(e.exports=o)))}(void 0,function(e){function t(e){return"function"==typeof e}function n(e){return m(e)?"array":"undefined"==typeof e?"undefined":a(e)}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"===("undefined"==typeof e?"undefined":a(e))&&t in e}function o(e,t){return y.call(e,t)}function u(e){return!o(g,e)}function s(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return _[e]})}function l(t,n){function i(){if(y&&!g)for(;v.length;)delete p[v.pop()];else v=[];y=!1,g=!1}function o(e){if("string"==typeof e&&(e=e.split(S,2)),!m(e)||2!==e.length)throw new Error("Invalid tags: "+e);a=new RegExp(r(e[0])+"\\s*"),s=new RegExp("\\s*"+r(e[1])),l=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var a,s,l,h=[],p=[],v=[],y=!1,g=!1;o(n||e.tags);for(var _,E,x,k,A,O,L=new f(t);!L.eos();){if(_=L.pos,x=L.scanUntil(a))for(var M=0,P=x.length;M<P;++M)k=x.charAt(M),u(k)?v.push(p.length):g=!0,p.push(["text",k,_,_+1]),_+=1,"\n"===k&&i();if(!L.scan(a))break;if(y=!0,E=L.scan(w)||"name",L.scan(b),"="===E?(x=L.scanUntil(C),L.scan(C),L.scanUntil(s)):"{"===E?(x=L.scanUntil(l),L.scan(T),L.scanUntil(s),E="&"):x=L.scanUntil(s),!L.scan(s))throw new Error("Unclosed tag at "+L.pos);if(A=[E,x,_,L.pos],p.push(A),"#"===E||"^"===E)h.push(A);else if("/"===E){if(O=h.pop(),!O)throw new Error('Unopened section "'+x+'" at '+_);if(O[1]!==x)throw new Error('Unclosed section "'+O[1]+'" at '+_)}else"name"===E||"{"===E||"&"===E?g=!0:"="===E&&o(x)}if(O=h.pop())throw new Error('Unclosed section "'+O[1]+'" at '+L.pos);return d(c(p))}function c(e){for(var t,n,r=[],i=0,o=e.length;i<o;++i)t=e[i],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function d(e){for(var t,n,r=[],i=r,o=[],a=0,u=e.length;a<u;++a)switch(t=e[a],t[0]){case"#":case"^":i.push(t),o.push(t),i=t[4]=[];break;case"/":n=o.pop(),n[5]=t[2],i=o.length>0?o[o.length-1][4]:r;break;default:i.push(t)}return r}function f(e){this.string=e,this.tail=e,this.pos=0}function h(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function p(){this.cache={}}var v=Object.prototype.toString,m=Array.isArray||function(e){return"[object Array]"===v.call(e)},y=RegExp.prototype.test,g=/\S/,_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},b=/\s*/,S=/\s+/,C=/\s*=/,T=/\s*\}/,w=/#|\^|\/|>|\{|&|=|!/;f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},h.prototype.push=function(e){return new h(e,this)},h.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var o,a,u=this,s=!1;u;){if(e.indexOf(".")>0)for(n=u.view,o=e.split("."),a=0;null!=n&&a<o.length;)a===o.length-1&&(s=i(n,o[a])),n=n[o[a++]];else n=u.view[e],s=i(u.view,e);if(s)break;u=u.parent}r[e]=n}return t(n)&&(n=n.call(this.view)),n},p.prototype.clearCache=function(){this.cache={}},p.prototype.parse=function(e,t){var n=this.cache,r=n[e];return null==r&&(r=n[e]=l(e,t)),r},p.prototype.render=function(e,t,n){var r=this.parse(e),i=t instanceof h?t:new h(t);return this.renderTokens(r,i,n,e)},p.prototype.renderTokens=function(e,t,n,r){for(var i,o,a,u="",s=0,l=e.length;s<l;++s)a=void 0,i=e[s],o=i[0],"#"===o?a=this.renderSection(i,t,n,r):"^"===o?a=this.renderInverted(i,t,n,r):">"===o?a=this.renderPartial(i,t,n,r):"&"===o?a=this.unescapedValue(i,t):"name"===o?a=this.escapedValue(i,t):"text"===o&&(a=this.rawValue(i)),void 0!==a&&(u+=a);return u},p.prototype.renderSection=function(e,n,r,i){function o(e){return u.render(e,n,r)}var u=this,s="",l=n.lookup(e[1]);if(l){if(m(l))for(var c=0,d=l.length;c<d;++c)s+=this.renderTokens(e[4],n.push(l[c]),r,i);else if("object"===("undefined"==typeof l?"undefined":a(l))||"string"==typeof l||"number"==typeof l)s+=this.renderTokens(e[4],n.push(l),r,i);else if(t(l)){if("string"!=typeof i)throw new Error("Cannot use higher-order sections without the original template");l=l.call(n.view,i.slice(e[3],e[5]),o),null!=l&&(s+=l)}else s+=this.renderTokens(e[4],n,r,i);return s}},p.prototype.renderInverted=function(e,t,n,r){var i=t.lookup(e[1]);if(!i||m(i)&&0===i.length)return this.renderTokens(e[4],t,n,r)},p.prototype.renderPartial=function(e,n,r){if(r){var i=t(r)?r(e[1]):r[e[1]];return null!=i?this.renderTokens(this.parse(i),n,r,i):void 0}},p.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},p.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);if(null!=r)return e.escape(r)},p.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.3.0",e.tags=["{{","}}"];var E=new p;return e.clearCache=function(){return E.clearCache()},e.parse=function(e,t){return E.parse(e,t)},e.render=function(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return E.render(e,t,r)},e.to_html=function(n,r,i,o){var a=e.render(n,r,i);return t(o)?void o(a):a},e.escape=s,e.Scanner=f,e.Context=h,e.Writer=p,e})}])});

@@ -68,2 +68,23 @@ <h2 id="条件判断">条件判断</h2>

}
```
```
### 方式三
```js
class ConditionTest extends Omi.Component {
constructor(data) {
super(data);
}
render() {
return `
${this.data.isVip
?"<div>you are VIP.</div>"
:"<div>you are not VIP.</div>"
}
`;
}
}
```
当然可以使用${ }里面写javascript代码进行输出。

@@ -19,6 +19,9 @@ <h2 id="Hello World">Hello World</h2>

style () {
//注意,return中的<style></style>包裹是可选的。主要是为了识别为JSX文件可以有CSS高亮。
return `
<style>
h1{
cursor:pointer;
}
</style>
`;

@@ -25,0 +28,0 @@ }

@@ -74,2 +74,18 @@ <h2 id="循环遍历">循环遍历</h2>

<a href="http://alloyteam.github.io/omi/website/redirect.html?type=list2" target="_blank">点击这里→在线试试</a>
<a href="http://alloyteam.github.io/omi/website/redirect.html?type=list2" target="_blank">点击这里→在线试试</a>
如果想在循环里加些判断呢?比如需要把id为偶数的隐藏起来:
```js
render() {
return `<div>
<ul>
${this.data.items.map(item =>
`<li style="display:${item.id%2===0?'none':'block'};" id="${item.id}">${item.text}</li>`
).join('')}
</ul>
</div>`;
}
```
所以模板字符串还是非常方便,随着ES继续发展下去,模板引擎估计会慢慢消失。所以omi提供了 omi.lite.js 版本不包含任何模板引擎。

@@ -8,2 +8,12 @@ import Omi from '../../src/index.js';

//render() {
// return `<div>
// <ul>
// ${this.data.items.map(item =>
// `<li id="${item.id}">${item.text}</li>`
// ).join('')}
// </ul>
// </div>`;
//}
render() {

@@ -13,3 +23,3 @@ return `<div>

${this.data.items.map(item =>
`<li id="${item.id}">${item.text}</li>`
`<li style="display:${item.id%2===0?'none':'block'};" id="${item.id}">${item.text}</li>`
).join('')}

@@ -19,3 +29,2 @@ </ul>

}
//render () {

@@ -22,0 +31,0 @@ // return `<div>

{
"name": "omi",
"version": "0.4.2",
"version": "0.4.3",
"description": "Open and modern framework for building user interfaces.",

@@ -16,2 +16,3 @@ "main": "dist/omi.js",

"group_data": "webpack -w",
"jsx-like-event":"webpack -w",
"loop": "webpack -w",

@@ -18,0 +19,0 @@ "plugin": "webpack -w",

@@ -35,3 +35,3 @@ import Omi from 'omi';

<div>
<div omi-finger class="touchArea" ref="touchArea" onTap="handleTap" onSwipe="handleSwipe" >
<div omi-finger class="touchArea" ref="touchArea" tap="handleTap" swipe="handleSwipe" >
Tap or Swipe Me!

@@ -38,0 +38,0 @@ </div>

/*!
* omi-finger v0.1.0 by dntzhang
* omi-finger v0.1.3 by dntzhang
* Omi / AlloyFinger integration. Support touch and gesture events in your Omi project.

@@ -23,5 +23,3 @@ * Github: https://github.com/AlloyTeam/omi

var getHandler = function(name, dom, instance) {
var evtName ='on'+ name.substring(0, 1).toUpperCase() + name.substring(1);
var value = dom.getAttribute(evtName);
var value = dom.getAttribute(name);
if (value === null) {

@@ -28,0 +26,0 @@ return noop;

{
"name": "omi-finger",
"version": "0.1.2",
"version": "0.1.3",
"description": "AlloyFinger / Omi integration. Support touch and gesture events in your Omi project. ",

@@ -5,0 +5,0 @@ "main": "omi-finger.js",

@@ -43,3 +43,3 @@ ## omi-finger

<div>
<div omi-finger ref="touchArea" onTap="handleTap" onSwipe="handleSwipe" >
<div omi-finger ref="touchArea" tap="handleTap" swipe="handleSwipe" >
Tap or Swipe Me!

@@ -46,0 +46,0 @@ </div>

@@ -66,2 +66,9 @@ <p align="center">

## CDN
* [https://unpkg.com/omi@0.4.2/dist/omi.min.js](https://unpkg.com/omi@0.4.2/dist/omi.min.js)
* [https://unpkg.com/omi@0.4.2/dist/omi.js](https://unpkg.com/omi@0.4.2/dist/omi.js)
* [https://unpkg.com/omi@0.4.2/dist/omi.lite.min.js](https://unpkg.com/omi@0.4.2/dist/omi.lite.min.js)
* [https://unpkg.com/omi@0.4.2/dist/omi.lite.js](https://unpkg.com/omi@0.4.2/dist/omi.lite.js)
## [中文](https://github.com/AlloyTeam/omi#中文--english) | English

@@ -119,2 +126,9 @@

## CDN
* [https://unpkg.com/omi@0.4.2/dist/omi.min.js](https://unpkg.com/omi@0.4.2/dist/omi.min.js)
* [https://unpkg.com/omi@0.4.2/dist/omi.js](https://unpkg.com/omi@0.4.2/dist/omi.js)
* [https://unpkg.com/omi@0.4.2/dist/omi.lite.min.js](https://unpkg.com/omi@0.4.2/dist/omi.lite.min.js)
* [https://unpkg.com/omi@0.4.2/dist/omi.lite.js](https://unpkg.com/omi@0.4.2/dist/omi.lite.js)
## Contributors

@@ -124,2 +138,4 @@

|---|---|---|
| [CodeFalling](https://github.com/CodeFalling) | ![](https://avatars3.githubusercontent.com/u/5436704?v=3&s=60) | alibaba |
| [abell123456](https://github.com/abell123456) | ![](https://avatars1.githubusercontent.com/u/2232380?v=3&s=60) | alibaba |
| [Aresn](https://github.com/icarusion) | ![](https://avatars3.githubusercontent.com/u/5370542?v=3&s=60) | TalkingCoder |

@@ -126,0 +142,0 @@ | [pasturn](https://github.com/pasturn) | ![](https://avatars2.githubusercontent.com/u/6126885?v=3&s=60) | Mars Holding |

@@ -118,3 +118,3 @@ var del = require('del'),

gulp.watch(ENV + '/**').on('change', browserSync.reload);
gulp.watch(['src/component/**/*.js', 'src/js/*.js', 'common/*.js'], function () {
gulp.watch(['src/component/**/*.**', 'src/js/*.js', 'common/*.js'], function () {
runSequence(

@@ -121,0 +121,0 @@ 'webpack',

@@ -28,2 +28,3 @@ {

"run-sequence": "^1.2.2",
"string-loader": "0.0.1",
"webpack": "^1.14.0",

@@ -30,0 +31,0 @@ "webpack-stream": "^3.2.0"

import Omi from 'omi';
const tpl = require('./index.html');
const css = require('./index.css');
class Footer extends Omi.Component {

@@ -9,21 +12,7 @@ constructor (data) {

style () {
return `
.footer{
position:fixed;
height:45px;
line-height: 45px;
width:100%;
bottom:0;
color:white;
background-color:black;
z-index:100;
}
`;
return css;
}
render () {
return `
<div class="footer">
I am footer
</div>`;
return tpl;
}

@@ -30,0 +19,0 @@ }

@@ -32,3 +32,5 @@ var path = require('path');

exclude:/node_modules/
}
},
{ test: /\.html$/, loader: "string" },
{ test: /\.css$/, loader: "string" }
]

@@ -35,0 +37,0 @@ },

@@ -0,9 +1,51 @@

function exchange(str, a, b) {
return str.split(a).map(function(item){return item.replace(new RegExp(b, 'g'), a)}).join(b);
}
function safeDoubleQuote(str) {
return JSON.stringify(str).replace(/(^"|"$)/g, '');
}
function safeSingleQuote(str) {
str = exchange(str, "'", '"');
return exchange(safeDoubleQuote(str), "'", '"');
}
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
function endsWith(str,end) {
if (String.prototype.endsWith) {
return String.prototype.endsWith.call(str, end);
} else {
return str.substr(str.length-1,1) === end;
}
}
function scopedEvent(tpl,id) {
return tpl.replace(/<[\s\S]*?>/g, function (item) {
return item.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=('|")([\s\S]*?)\([\s\S]*?\)/g, function (eventStr, b, c, d) {
if (d.indexOf( 'Omi.instances[')===0){
return tpl.replace(/<[\s\S]*?[^=]>/g, function (item) {
return item.replace(/on(abort|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|dblclick|drag|dragend|dragenter|dragleave|dragover|dragstart|drop|durationchange|emptied|ended|error|focus|input|invalid|keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|mousedown|mouseenter|mouseleave|mousemove|mouseout|mouseover|mouseup|mousewheel|pause|play|playing|progress|ratechange|reset|resize|scroll|seeked|seeking|select|show|stalled|submit|suspend|timeupdate|toggle|volumechange|waiting|autocomplete|autocompleteerror|beforecopy|beforecut|beforepaste|copy|cut|paste|search|selectstart|wheel|webkitfullscreenchange|webkitfullscreenerror|touchstart|touchmove|touchend|touchcancel|pointerdown|pointerup|pointercancel|pointermove|pointerover|pointerout|pointerenter|pointerleave|Abort|Blur|Cancel|CanPlay|CanPlayThrough|Change|Click|Close|ContextMenu|CueChange|DblClick|Drag|DragEnd|DragEnter|DragLeave|DragOver|DragStart|Drop|DurationChange|Emptied|Ended|Error|Focus|Input|Invalid|KeyDown|KeyPress|KeyUp|Load|LoadedData|LoadedMetadata|LoadStart|MouseDown|MouseEnter|MouseLeave|MouseMove|MouseOut|MouseOver|MouseUp|MouseWheel|Pause|Play|Playing|Progress|RateChange|Reset|Resize|Scroll|Seeked|Seeking|Select|Show|Stalled|Submit|Suspend|TimeUpdate|Toggle|VolumeChange|Waiting|AutoComplete|AutoCompleteError|BeforeCopy|BeforeCut|BeforePaste|Copy|Cut|Paste|Search|SelectStart|Wheel|WebkitFullScreenChange|WebkitFullScreenError|TouchStart|TouchMove|TouchEnd|TouchCancel|PointerDown|PointerUp|PointerCancel|PointerMove|PointerOver|PointerOut|PointerEnter|PointerLeave)=('|"|{)([\s\S]*)('|"|})/g, function (eventStr, eventName, open, str, close) {
if (str.indexOf('Omi.instances[') === 0 || str.indexOf('new Function(') === 0){
return eventStr;
}else {
return eventStr.replace(/=(['|"])/, '=$1Omi.instances[' + id + '].');
}
if (open === '{') {
// JSX-like event bind
const funcBody = `(${str}).bind(Omi.instances[${id}])(event)`;
const result = `on${eventName}="new Function('event', '${escapeHtml(safeSingleQuote(funcBody))}')(event)"`;
return result.split('\n').map(function(line) {
return endsWith(line, ';') ? line : line + ';';
}).join('');
} else {
if (!str.match(/.*?\(.*?\)/)) {
// if is not JSX-like event and is not a function call (func(xxx, ttt))
return eventStr;
}
}
return eventStr.replace(/=(['|"])/, '=$1Omi.instances[' + id + '].');
});

@@ -13,2 +55,2 @@ });

export default scopedEvent;
export default scopedEvent;

@@ -8,4 +8,7 @@ import Omi from './omi.js';

Omi.Component = Component;
window.Omi=Omi;
module.exports = Omi;
if(window.Omi){
module.exports = window.Omi;
}else {
window.Omi = Omi;
module.exports = Omi;
}

@@ -10,3 +10,7 @@ import Omi from './omi.js';

window.Omi=Omi;
module.exports = Omi;
if(window.Omi){
module.exports = window.Omi;
}else {
window.Omi = Omi;
module.exports = Omi;
}

@@ -20,2 +20,18 @@ import scopedEvent from '../../src/event.js';

});
});
});
describe("jsx-like event binding", function() {
var result = scopedEvent("<div onclick={function(e){console.log(this)}}>sfsdf </div>",1);
it("and so is a spec", function() {
expect(result).toBe(`<div onclick="new Function('event', '(function(e){console.log(this)}).bind(Omi.instances[1])(event)')(event)";>sfsdf </div>`);
});
});
describe("jsx-like event binding with quote", function() {
var result = scopedEvent('<div onclick={function(e){console.log("string with sigal quote \' and double quote \"")}}>sfsdf </div>',1);
it("and so is a spec", function() {
expect(result).toBe(`<div onclick="new Function('event', '(function(e){console.log(&quot;string with sigal quote \\&#039; and double quote &quot;&quot;)}).bind(Omi.instances[1])(event)')(event)";>sfsdf </div>`);
});
});

@@ -75,3 +75,3 @@ var path = require('path');

// Avoid publishing files when compilation fails
new webpack.BannerPlugin(" Omi v0.4.2 By dntzhang \r\n Github: https://github.com/AlloyTeam/omi\r\n MIT Licensed."),
new webpack.BannerPlugin(" Omi v0.4.3 By dntzhang \r\n Github: https://github.com/AlloyTeam/omi\r\n MIT Licensed."),
new webpack.NoErrorsPlugin()

@@ -78,0 +78,0 @@ ],

@@ -49,6 +49,6 @@ import Omi from '../../src/index.js';

codes[i].innerHTML = html;
codes[i].classList.add('language-js');
codes[i].classList&&codes[i].classList.add('language-js');
}
Omi.$$('pre').forEach((item)=> {
item.classList.add('language-js');
item.classList&&item.classList.add('language-js');
})

@@ -96,2 +96,3 @@

return `
<style>
.content{

@@ -116,5 +117,4 @@ width: 80%;

}
}
</style>
`;

@@ -121,0 +121,0 @@ }

@@ -36,2 +36,3 @@ import Omi from '../../src/index.js';

return `
<style>
.main{

@@ -48,5 +49,4 @@ position: absolute;

}
}
</style>
`;

@@ -53,0 +53,0 @@ }

import Omi from '../../src/index.js';
import OmiFinger from '../../plugins/omi-finger/omi-finger.js';
OmiFinger.init();
class Head extends Omi.Component {

@@ -10,4 +13,4 @@ constructor (data) {

this.data.isEnLan = this.data.lan === 'en';
document.body.addEventListener('click',()=>{
this.removeClass(Omi.get('sidebar').node,'show');
document.body.addEventListener('touchend',()=>{
this.removeClass(Omi.get('sidebar').node,'show');
},false);

@@ -21,2 +24,6 @@ }

handleTouchEnd(evt){
evt.stopPropagation();
}
toggleClass(element, className) {

@@ -47,2 +54,3 @@ if (!element || !className) {

return `
<style>
.head{

@@ -126,2 +134,3 @@ position:fixed;

}
</style>
`;

@@ -133,3 +142,3 @@ }

<div class="head bord-btm">
<div class="m_menu" onclick="toggleMenus(event)"> <img src="../asset/menu.png" alt="" /></div>
<div class="m_menu" omi-finger tap="toggleMenus" touchEnd="handleTouchEnd"> <img src="../asset/menu.png" alt="" /></div>
<div class="logo_box">

@@ -136,0 +145,0 @@ <a href="https://github.com/AlloyTeam/omi">Omi</a>

@@ -46,2 +46,3 @@ import Omi from '../../src/index.js';

return `
<style>
li.title{

@@ -73,2 +74,3 @@ font-size: 16px;

}
</style>
`;

@@ -75,0 +77,0 @@ }

import Omi from '../../src/index.js';
import config from '../js/config.js';
import OmiFinger from '../../plugins/omi-finger/omi-finger.js';
OmiFinger.init();
class Pager extends Omi.Component {

@@ -28,4 +31,2 @@ constructor (data) {

}
}

@@ -43,9 +44,23 @@

handleTap(evt){
let dir = evt.target.getAttribute('data-dir');
let name= evt.target.getAttribute('data-name');
this.goto(name,dir);
}
render () {
this.updatePager();
return `
if(config.isMobile) {
return `
<div class="pager">
{{#preName}} <a class="pre" href="#" onclick="goto('{{preMd}}','pre')">←{{preName}}</a>{{/preName}}
{{#nextName}}<a class="next" href="#" onclick="goto('{{nextMd}}','next')">{{nextName}}→</a> {{/nextName}}
{{#preName}} <a class="pre" href="#" omi-finger tap="handleTap" data-dir="pre" data-name="{{preMd}}">←{{preName}}</a>{{/preName}}
{{#nextName}}<a class="next" href="#" omi-finger tap="handleTap" data-dir="next" data-name="{{nextMd}}">{{nextName}}→</a> {{/nextName}}
</div>`;
}else{
return`
<div class="pager">
{{#preName}} <a class="pre" href="#" onclick="goto('{{preMd}}','pre')">←{{preName}}</a>{{/preName}}
{{#nextName}}<a class="next" href="#" onclick="goto('{{nextMd}}','next')">{{nextName}}→</a> {{/nextName}}
</div>`;
}
}

@@ -55,3 +70,3 @@

return `
<style>
.pager {

@@ -81,2 +96,3 @@ width:85%;

}
</style>
`;

@@ -83,0 +99,0 @@ }

@@ -19,2 +19,3 @@ import Omi from '../../src/index.js';

return `
<style>
@media only screen and (max-width: 768px) {

@@ -37,8 +38,5 @@ .list{

transform: translateX(0%) translateZ(0);
}
}
}
.list{

@@ -56,2 +54,3 @@ width:200px;

}
</style>
`;

@@ -58,0 +57,0 @@ }

@@ -14,44 +14,44 @@ let config = {

list: [
{'name': '安装', md: 'installation'},
{
'name': 'Hello World',
md: 'hello_world',
//1,5-6,8
highlight: {
2: '6',
5: '4,6'
}
},
{
'name': '组件',
md: 'components',
highlight: {
2: '3,9,34'
}
},
{
'name': '组件通讯', md: 'communication',
highlight: {
0: '34',
1: '5,11'
}
},
{'name': '生命周期', md: 'lifecycle'},
{'name': '事件处理', md: 'events'},
{'name': '条件判断', md: 'condition'},
{
'name': '循环遍历', md: 'loop',
highlight: {
1: '9-11'
}
},
{'name': '表单', md: 'form'},
{'name': '继承', md: 'inherit'},
//{'name': '容器系统'},
{'name': '模板切换', md: 'template'},
{'name': '获取DOM节点', md: 'get_dom'},
{'name': '插件体系', md: 'plugin'},
//{'name': '服务器端渲染'},
{'name': 'Omi的理念', md: 'thinking_in_omi'}
]
{'name': '安装', md: 'installation'},
{
'name': 'Hello World',
md: 'hello_world',
//1,5-6,8
highlight: {
2: '6',
5: '4,6'
}
},
{
'name': '组件',
md: 'components',
highlight: {
2: '3,9,34'
}
},
{
'name': '组件通讯', md: 'communication',
highlight: {
0: '34',
1: '5,11'
}
},
{'name': '生命周期', md: 'lifecycle'},
{'name': '事件处理', md: 'events'},
{'name': '条件判断', md: 'condition'},
{
'name': '循环遍历', md: 'loop',
highlight: {
1: '9-11'
}
},
{'name': '表单', md: 'form'},
{'name': '继承', md: 'inherit'},
//{'name': '容器系统'},
{'name': '模板切换', md: 'template'},
{'name': '获取DOM节点', md: 'get_dom'},
{'name': '插件体系', md: 'plugin'},
//{'name': '服务器端渲染'},
{'name': 'Omi的理念', md: 'thinking_in_omi'}
]
}

@@ -64,19 +64,19 @@ ],

list: [
{'name': 'Installation', md: 'installation'},
{'name': 'Hello World', md: 'hello_world'},
{'name': 'Components', md: 'components'},
{'name': 'Communication', md: 'communication'},
{'name': 'Lifecycle', md: 'lifecycle'},
{'name': 'Handling Events', md: 'events'},
{'name': 'Conditional Rendering', md: 'condition'},
{'name': 'Loop', md: 'loop'},
//{'name': 'Lists and Keys'},
{'name': 'Forms', md: 'form'},
{'name': 'Inheritance', md: 'inherit'},
{'name': 'Templates', md: 'template'},
{'name': 'Get DOM', md: 'get_dom'},
{'name': 'Plugin', md: 'plugin'}
//{'name': 'Sever-side Rendering'},
//{'name': 'Thinking In Omi'}
]
{'name': 'Installation', md: 'installation'},
{'name': 'Hello World', md: 'hello_world'},
{'name': 'Components', md: 'components'},
{'name': 'Communication', md: 'communication'},
{'name': 'Lifecycle', md: 'lifecycle'},
{'name': 'Handling Events', md: 'events'},
{'name': 'Conditional Rendering', md: 'condition'},
{'name': 'Loop', md: 'loop'},
//{'name': 'Lists and Keys'},
{'name': 'Forms', md: 'form'},
{'name': 'Inheritance', md: 'inherit'},
{'name': 'Templates', md: 'template'},
{'name': 'Get DOM', md: 'get_dom'},
{'name': 'Plugin', md: 'plugin'},
//{'name': 'Sever-side Rendering'},
{'name': 'Thinking in Omi', md: 'thinking_in_omi'}
]
}

@@ -83,0 +83,0 @@ ]

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc