|
- /*!
- App Connect Framework7 v5 plugin
- Version: 1.2.2
- (c) 2023 Wappler.io
- @build 2023-03-02 13:35:47
- */
- Framework7||alert("Framework7 missing!"),dmx.f7={events:new Framework7.Events,init:function(e,t){const o=new Framework7({...t,root:e,routes:Array.isArray(t.routes)?t.routes:Array.isArray(window.routes)?window.routes:[]});return o.initialized?dmx.f7.events.emit("ready",o):o.once("ready",(()=>{dmx.f7.events.emit("ready",o)})),o},ready:function(e){e&&(Framework7.instance?e(Framework7.instance):dmx.f7.events.once("ready",e))}},dmx.config.mapping[".view"]="f7-view",dmx.config.mapping[".page"]="f7-page",dmx.config.mapping[".popup"]="f7-popup",dmx.config.mapping[".login-screen"]="f7-login-screen",dmx.config.mapping[".actions-modal"]="f7-action-sheet",dmx.config.mapping[".progressbar"]="f7-progressbar",dmx.config.mapping[".toggle:not(.toggle-init)"]="f7-toggle",dmx.config.mapping[".ptr-content"]="f7-ptr",dmx.config.mapping[".accordion-item"]="f7-accordion",dmx.config.mapping[".sheet-modal"]="f7-sheet-modal",dmx.Actions({"f7.actions.open":function(e){return new Promise((t=>{Array.isArray(e.buttons)&&e.buttons.forEach((e=>{e.onClick=()=>t(e.text)}));const o=Framework7.instance.actions.create({convertToPopover:!1,...e});o.once("closed",(()=>{t(null),requestAnimationFrame((()=>{o.destroy()}))})),o.open()}))}}),dmx.Actions({"f7.toast.show":function(e){Framework7.instance.toast.create({destroyOnClose:!0,icon:this.parse(e.icon),text:this.parse(e.text),position:this.parse(e.position)||"bottom",horizontalPosition:this.parse(e.horizontalPosition)||"left",closeButton:!!this.parse(e.closeButton),closeButtonColor:this.parse(e.closeButtonColor),closeButtonText:this.parse(e.closeButtonText)||"Ok",closeTimeout:this.parse(e.closeTimeout)||void 0}).open()}}),dmx.Actions({"f7.dialog.alert":function(e){const t=this.parse(e.text),o=this.parse(e.title);return new Promise((e=>{Framework7.instance.dialog.alert(t,o,e)}))},"f7.dialog.confirm":function(e){const t=this.parse(e.text),o=this.parse(e.title);return new Promise((n=>{Framework7.instance.dialog.confirm(t,o,(()=>{e.then?this._exec(e.then).then((()=>n(!0))):n(!0)}),(()=>{e.else?this._exec(e.else).then((()=>n(!1))):n(!1)}))}))},"f7.dialog.prompt":function(e){const t=this.parse(e.text),o=this.parse(e.title),n=this.parse(e.defaultValue);return new Promise((e=>{Framework7.instance.dialog.prompt(t,o,(t=>e(t)),(()=>e(null)),n)}))},"f7.dialog.login":function(e){const t=this.parse(e.text),o=this.parse(e.title);return new Promise((e=>{Framework7.instance.dialog.login(t,o,((t,o)=>e({username:t,password:o})),(()=>e(null)))}))},"f7.dialog.password":function(e){const t=this.parse(e.text),o=this.parse(e.title);return new Promise((e=>{Framework7.instance.dialog.password(t,o,(t=>e(t)),(()=>e(null)))}))},"f7.dialog.preloader":function(e){const t=this.parse(e.title),o=this.parse(e.color);Framework7.instance.dialog.preloader(t,o)},"f7.dialog.close":function(e){Framework7.instance.dialog.close()}}),dmx.Actions({"f7.progressbar.show":function(e){Framework7.instance.progressbar.show(this.parse(e.color))},"f7.progressbar.set":function(e){Framework7.instance.progressbar.set(this.parse(e.progress),this.parse(e.duration))},"f7.progressbar.hide":function(e){Framework7.instance.progressbar.hide()}}),dmx.Actions({"f7.preloader.show":function(e){Framework7.instance.preloader.show()},"f7.preloader.hide":function(e){Framework7.instance.preloader.hide()}}),dmx.Component("f7-app",{initialData:{id:"io.framework7.testapp",name:"Framework7",version:"1.0.0",language:"",theme:"auto",darkTheme:!1,initialized:!1,device:null,online:!1},attributes:{name:{type:String,default:"Framework7"},version:{type:String,default:"1.0.0"},theme:{type:String,default:"auto",enum:["auto","ios","md","aurora"]},language:{type:String,default:void 0},"auto-dark-theme":{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{alert:function(e){this.component&&this.component.dialog.alert(e)},showPreloader:function(e){this.component&&this.component.preloader.show(e)},hidePreloader:function(){this.component&&this.component.preloader.hide()},showProgress:function(e){this.component&&this.component.progressbar.show(e)},setProgress:function(e,t){this.component&&this.component.progressbar.set(e,t)},hideProgress:function(e){this.component&&this.component.progressbar.hide()}},events:{init:Event,resize:Event,orientationchange:Event,online:Event,offline:Event},render:function(e){let t=this.props.theme,o=new URLSearchParams(document.location.search);"auto"==t&&o.has("theme")&&(t=o.get("theme"));const n=this.component=dmx.f7.init(e,{...this.props.params,id:`io.framework7.${this.name}`,name:this.props.name,version:this.props.version,theme:t,autoDarkTheme:this.toBoolean("auto-dark-theme"),view:{stackPages:!0}});this.registerEvents(["init","resize","orientationchange","online","offline"]),n.on("connection",(e=>{this.set("online",e)})),n.on("darkThemeChange",(e=>{this.set("darkTheme",e)})),this.set({id:n.id,name:n.name,version:n.version,language:n.language,theme:n.theme,darkTheme:n.darkTheme,initialized:!0,device:dmx.clone(n.device),online:n.online}),this.$parse()},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-view",{initialData:{},attributes:{animate:{type:[Boolean,String],default:!0},params:{type:Object,default:{}}},methods:{navigate:function(e,t){this.component&&this.component.router.navigate(e,t)},back:function(e,t){this.component&&this.component.router.back(e,t)},refresh:function(){this.component&&this.component.router.refreshPage()},clearHistory:function(){this.component&&this.component.router.clearPreviousHistory()}},events:{init:Event,resize:Event},render:function(e){dmx.f7.ready((t=>{const o=this.component=t.views.create(e,{...this.props.params,animate:this.toBoolean("animate")});this.registerEvents(Object.keys(this.events)),o.on("pageInit",(e=>{if(e.el.dmxComponent)e.el.dmxComponent.set("route",e.route),e.dmxComponent=e.el.dmxComponent;else{const t=new(dmx.Component("f7-page"))(e.el,this);t.set("route",e.route),this.children.push(t),this.set(t.name,t.data),e.dmxComponent=e.el.dmxComponent}})),o.on("pageReinit",(e=>{e.dmxComponent&&e.dmxComponent.set("route",e.route)})),o.on("pageBeforeRemove",(e=>{const t=this.children.findIndex((t=>t.$node==e.el));-1!=t&&(this.del(this.children[t].name),this.children.splice(t,1))}))})),this.$parse()},destroy:function(){this.component&&(this.component.destroy(),delete this.component)},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-page",{initialData:{route:null},render:function(e){this.$parse()}}),dmx.Component("f7-popup",{initialData:{opened:!1},attributes:{backdrop:{type:[Boolean,String],default:!0},"close-by-backdrop-click":{type:[Boolean,String],default:!0},"close-on-escape":{type:[Boolean,String],default:!1},animate:{type:[Boolean,String],default:!0},"swipe-to-close":{type:[Boolean,String],default:!1},opened:{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{open:function(e){this.component&&this.component.open(e)},close:function(e){this.component&&this.component.close(e)}},events:{open:Event,opened:Event,close:Event,closed:Event},render:function(e){e.classList.add("popup"),dmx.f7.ready((t=>{const o=this.component=t.popup.create({...this.props.params,el:e,backdrop:this.toBoolean("backdrop"),closeByBackdropClick:this.toBoolean("close-by-backdrop-click"),closeOnEscape:this.toBoolean("close-on-escape"),animate:this.toBoolean("animate"),swipeToClose:this.toBoolean("swipe-to-close")});this.registerEvents(Object.keys(this.events)),o.on("opened",(()=>{this.set("opened",!0)})),o.on("closed",(()=>{this.set("opened",!1)})),this.toBoolean("opened")&&o.open(!1)})),this.$parse()},update:function(e){this.component&&(this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?this.component.open():this.component.close()),this.set("opened",this.component.opened))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-login-screen",{initialData:{opened:!1},attributes:{animate:{type:[Boolean,String],default:!0},opened:{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{open:function(e){this.component&&this.component.open(e)},close:function(e){this.component&&this.component.close(e)}},events:{open:Event,opened:Event,close:Event,closed:Event},render:function(e){e.classList.add("login-screen"),dmx.f7.ready((t=>{const o=this.component=t.loginScreen.create({...this.props.params,el:e,animate:this.toBoolean("animate")});this.registerEvents(["open","opened","close","closed"]),o.on("opened",(()=>{this.set("opened",!0)})),o.on("closed",(()=>{this.set("opened",!1)})),this.toBoolean("opened")&&o.open(!1)})),this.$parse()},update:function(e){this.component&&(this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?this.component.open():this.component.close()),this.set("opened",this.component.opened))},beforeDestroy:function(){this.f7LoginScreen&&(this.component.destroy(),delete this.component)},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-action-sheet",{initialData:{opened:!1},attributes:{backdrop:{type:[Boolean,String],default:!0},"close-by-backdrop-click":{type:[Boolean,String],default:!0},"close-by-outside-click":{type:[Boolean,String],default:!1},"close-on-escape":{type:[Boolean,String],default:!1},animate:{type:[Boolean,String],default:!0},grid:{type:[Boolean,String],default:!1},"convert-to-popover":{type:[Boolean,String],default:!0},"force-to-popover":{type:[Boolean,String],default:!1},opened:{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{open:function(e){this.component&&this.component.open(e)},close:function(e){this.component&&this.component.close(e)}},events:{open:Event,opened:Event,close:Event,closed:Event},render:function(e){e.classList.add("actions-modal"),dmx.f7.ready((t=>{const o=this.component=t.actions.create({...this.props.params,el:e,backdrop:this.toBoolean("backdrop"),closeByBackdropClick:this.toBoolean("close-by-backdrop-click"),closeByOutsideClick:this.toBoolean("close-by-outside-click"),closeOnEscape:this.toBoolean("close-on-escape"),animate:this.toBoolean("animate"),grid:this.toBoolean("grid"),convertToPopover:this.toBoolean("convert-to-popover")});this.registerEvents(["open","opened","close","closed"]),o.on("opened",(()=>{this.set("opened",!0)})),o.on("closed",(()=>{this.set("opened",!1)})),this.toBoolean("opened")&&o.open(!1)})),this.$parse()},update:function(e){this.component&&(this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?this.component.open():this.component.close()),this.set("opened",this.component.opened))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-gauge",{initialData:{},attributes:{type:{type:String,default:"circle",enum:["circle","semicircle"]},value:{type:Number,default:0},size:{type:Number,default:200},"bg-color":{type:String,default:"transparent"},"border-bg-color":{type:String,default:"#eeeeee"},"border-color":{type:String,default:"#000000"},"border-width":{type:String,default:"10"},"value-text":{type:String,default:null},"value-text-color":{type:String,default:"#000000"},"value-font-size":{type:String,default:"31"},"value-font-weight":{type:String,default:"500"},"label-text":{type:String,default:null},"label-text-color":{type:String,default:"#888888"},"label-font-size":{type:String,default:"14"},"label-font-weight":{type:String,default:"400"},params:{type:Object,default:{}}},methods:{},events:{},render:function(e){e.classList.add("gauge"),dmx.f7.ready((t=>{this.component=t.gauge.create({...this.props.params,el:e,...this.getProps()})}))},update:function(e){this.component&&(dmx.equal(e,this.props)||this.component.update(this.getProps()))},getProps:function(){return{type:this.props.type,value:this.props.value,size:this.props.size,bgColor:this.props["bg-color"],borderBgColor:this.props["border-bg-color"],borderColor:this.props["border-color"],borderWidth:this.props["border-width"],valueText:this.props["value-text"],valueTextColor:this.props["value-text-color"],valueFontSize:this.props["value-font-size"],valueFontWeight:this.props["value-font-weight"],labelText:this.props["label-text"],labelTextColor:this.props["label-text-color"],labelFontSize:this.props["label-font-size"],labelFontWeight:this.props["label-font-weight"]}},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)}}),dmx.Component("f7-messages",{attributes:{"new-messages-first":{type:Boolean,default:!1},messages:{type:Array,default:[]}},methods:{showTyping:function(e){this.component&&this.component.showTyping(e)},hideTyping:function(){this.component&&this.component.hideTyping()},addMessage:function(e,t,o){this.component&&this.component.addMessage(e,t,o)},addMessages:function(e,t,o){this.component&&this.component.addMessages(e,t,o)},removeMessage:function(e){this.component&&this.component.removeMessage(e)},removeMessages:function(e){this.component&&this.component.removeMessages(e)},scroll:function(e,t){this.component&&this.component.scroll(e,t)},renderMessages:function(){this.component&&this.component.renderMessages()},layout:function(){this.component&&this.component.layout()},clear:function(){this.component&&this.component.clear()}},getProps:function(){return Object.entries(this.props).reduce((function(e,t){return e[t[0].replace(/\-(.)?/g,(function(e,t){return t.toUpperCase()}))]=t[1],e}),{})},render:function(e){var t=this;dmx.f7.ready((function(o){t.component=o.messages.create(Object.assign({el:e},t.getProps()))})),this.$parse()},update:function(e){Framework7.instance&&!dmx.equal(e,this.props)&&(this.component.destroy(),this.component=Framework7.instance.messages.create(Object.assign({el:this.$node},this.getProps())))},beforeDestroy:function(){this.component&&(this.component.destroy(),this.component=void 0)}}),dmx.Component("f7-notification",{initialData:{opened:!1},attributes:{icon:{type:String,default:void 0},title:{type:String,default:void 0},"title-right-text":{type:String,default:void 0},subtitle:{type:String,default:void 0},text:{type:String,default:void 0},"close-button":{type:[Boolean,String],default:!1},"close-timeout":{type:Number,default:void 0},"close-on-click":{type:[Boolean,String],default:!1},"swipe-to-close":{type:[Boolean,String],default:!0},"css-class":{type:String,default:void 0},opened:{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{open:function(){this.component&&this.component.open()},close:function(){this.component&&this.component.close()}},events:{open:Event,opened:Event,close:Event,closed:Event,click:Event},render:function(e){dmx.f7.ready((e=>{const t=this.component=e.notification.create(this.getProps());this.registerEvents(["open","opened","close","closed","click"]),t.on("opened",(()=>{this.set("opened",!0)})),t.on("closed",(()=>{this.set("opened",!1)})),this.toBoolean("opened")&&t.open()})),this.$parse()},update:function(e){this.component&&(this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?this.component.open():this.component.close()),this.set("opened",this.component.opened))},beforeDestroy:function(){this.component&&(Framework7.instance.notification.destroy(this.component.el),delete this.component)},getProps:function(){return{...this.props.params,icon:this.props.icon,title:this.props.title,titleRightText:this.props["title-right-text"],subtitle:this.props.subtitle,text:this.props.text,closeButton:this.toBoolean("close-button"),closeTimeout:this.props["close-timeout"],closeOnClick:this.toBoolean("close-on-click"),swipeToClose:this.toBoolean("swipe-to-close"),cssClass:this.props["css-class"]}},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-photo-browser",{initialData:{activeIndex:0,exposed:!1,opened:!1},attributes:{photos:{type:Array,default:[]},exposition:{type:[Boolean,String],default:!0},"exposition-hide-captions":{type:[Boolean,String],default:!1},"swipe-to-close":{type:[Boolean,String],default:!0},"popup-push":{type:[Boolean,String],default:!1},"routable-modals":{type:[Boolean,String],default:!1},url:{type:String,default:"photos/"},type:{type:String,default:"standalone",enum:["standalone","popup","page"]},theme:{type:String,default:"light",enum:["light","dark"]},"captions-theme":{type:String,default:void 0,enum:[void 0,"light","dark"]},navbar:{type:[Boolean,String],default:!0},toolbar:{type:[Boolean,String],default:!0},"page-back-link-text":{type:String,default:"Back"},"page-close-link-text":{type:String,default:"Close"},"navbar-show-count":{type:[Boolean,String],default:void 0},"navbar-of-text":{type:String,default:"of"},"icons-color":{type:String,default:void 0},params:{type:Object,default:{}}},methods:{open:function(e){this.component&&this.component.open(e)},close:function(){this.component&&this.component.close()},expositionToggle:function(){this.component&&this.component.expositionToggle()},expositionEnable:function(){this.component&&this.component.expositionEnable()},expositionDisable:function(){this.component&&this.component.expositionDisable()}},events:{tap:Event,click:Event,doubleTap:Event,doubleClick:Event,slideChange:Event,lazyImageLoad:Event,lazyImageReady:Event,open:Event,opened:Event,close:Event,closed:Event},render:function(e){dmx.f7.ready((e=>{this.createComponent()})),this.$parse()},update:function(e){this.component&&(dmx.equal(e,this.props)||(this.component.destroy(),this.createComponent()),this.set("activeIndex",this.component.activeIndex),this.set("exposed",this.component.exposed),this.set("opened",this.component.opened))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},createComponent:function(){const e=this.component=Framework7.instance.photoBrowser.create({...this.props.params,...this.getProps()});this.registerEvents(Object.keys(this.events)),e.on("opened",(()=>{this.set("opened",!0)})),e.on("closed",(()=>{this.set("opened",!1)}))},getProps:function(){return{photos:this.props.photos,exposition:this.toBoolean("exposition"),expositionHideCaptions:this.toBoolean("exposition-hide-captions"),swipeToClose:this.toBoolean("swipe-to-close"),popupPush:this.toBoolean("popup-push"),routableModals:this.toBoolean("routable-modals"),url:this.props.url,type:this.props.type,theme:this.props.theme,captionsTheme:this.props["captions-theme"],navbar:this.toBoolean("navbar"),toolbar:this.toBoolean("toolbar"),pageBackLinkText:this.props["page-back-link-text"],popupCloseLinkText:this.props["page-close-link-text"],navbarShowCount:this.toBoolean("navbar-show-count"),navbarOfText:this.props["navbar-of-text"],iconsColor:this.props["icons-color"]}},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-progressbar",{initialData:{progress:0},attributes:{progress:{type:Number,default:null},color:{type:String,default:"default",enum:["default","red","green","blue","pink","yellow","orange","purple","deeppurple","lightblue","teal","lime","deeporange","gray","white","black","multi"]},hidden:{type:Boolean,default:!1}},methods:{set:function(e,t){this.component&&this.component.set(e,t)},show:function(){this.component&&this.component.show()},hide:function(){this.component&&this.component.hide()}},render:function(e){e.classList.add("progressbar"),dmx.f7.ready((t=>{this.component={set:t.progressbar.set.bind(t.progressbar,e),show:t.progressbar.show.bind(t.progressbar,e),hide:t.progressbar.hide.bind(t.progressbar,e)},this.update({})}))},update:function(e){this.component&&(e.hidden!=this.props.hidden&&(this.props.hidden?this.component.hide():this.component.show(this.props.progress,this.props.color)),e.color!=this.props.color&&(e.color&&this.$node.classList.remove("color-"+e.color),"default"!=this.props.color&&this.$node.classList.add("color-"+this.props.color)),e.progress!=this.props.progress&&this.component.set(this.props.progress))}}),dmx.Component("f7-toggle",{initialData:{checked:!1},attributes:{checked:{type:Boolean,default:!1},params:{type:Object,default:{}}},methods:{toggle:function(){this.component&&this.component.toggle()}},events:{change:Event},render:function(e){dmx.f7.ready((t=>{const o=this.component=t.toggle.create({...this.props.params,el:e});o.on("change",(()=>{this.set("checked",o.checked)})),o.checked!=this.props.checked&&o.toggle(),this.set("checked",o.checked)})),this.$parse()},update:function(e){this.component&&(e.checked!=this.props.checked&&this.component.checked!=this.props.checked&&this.component.toggle(),this.set("checked",this.component.checked))},beforeDestroy:function(e){this.component&&(Framework7.instance.toggle.destroy(this.component.el),delete this.component)}}),dmx.Component("f7-range",{initialData:{value:null},attributes:{value:{type:Number,default:null},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},label:{type:[Boolean,String],default:!1},"dragable-bar":{type:[Boolean,String],default:!0},"no-draggable-bar":{type:Boolean,default:!1},vertical:{type:[Boolean,String],default:!1},"vertical-reversed":{type:[Boolean,String],default:!1},scale:{type:[Boolean,String],default:!1},"scale-steps":{type:Number,default:5},"scale-sub-steps":{type:Number,default:0},params:{type:Object,default:{}}},methods:{setValue:function(e){this.component&&this.component.setValue(e)}},events:{change:Event,changed:Event},render:function(e){dmx.f7.ready((t=>{const o=this.component=t.range.create({...this.props.params,el:e,value:this.props.value,min:this.props.min,max:this.props.max,step:this.props.step,label:this.toBoolean("label"),draggableBar:!this.props["no-draggable-bar"]&&this.toBoolean("draggable-bar"),vertical:this.toBoolean("vertical"),verticalReversed:this.toBoolean("vertical-reversed"),scale:this.toBoolean("scale"),scaleSteps:this.props["scale-steps"],scaleSubSteps:this.props["scale-sub-steps"]});o.on("change",((e,t)=>{this.set("value",t),this.dispatchEvent("change")})),o.on("changed",(()=>this.dispatchEvent("changed"))),this.set("value",o.value)}))},update:function(e){this.component&&e.value!=this.props.value&&this.component.setValue(this.props.value)},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-range-dual",{extends:"f7-range",initialData:{start:null,end:null},attributes:{"value-start":{type:Number,default:null},"value-end":{type:Number,default:null}},methods:{setValues:function(e,t){this.component&&this.component.setValue([e,t])}},render:function(e){dmx.f7.ready((t=>{const o=this.component=t.range.create({...this.props.params,el:e,dual:!0,value:[this.props["value-start"],this.props["value-end"]],min:this.props.min,max:this.props.max,step:this.props.step,label:this.toBoolean("label"),draggableBar:!this.props["no-draggable-bar"]&&this.toBoolean("draggable-bar"),vertical:this.toBoolean("vertical"),verticalReversed:this.toBoolean("vertical-reversed"),scale:this.toBoolean("scale"),scaleSteps:this.props["scale-steps"],scaleSubSteps:this.props["scale-sub-steps"]});o.on("change",((e,t)=>{this.set("start",e.value[0]),this.set("end",e.value[1]),this.dispatchEvent("change")})),o.on("changed",(()=>this.dispatchEvent("changed"))),this.set("start",o.value[0]),this.set("end",o.value[1])}))},update:function(e){this.component&&(e["value-start"]==this.props["value-start"]&&e["value-end"]==this.props["value-end"]||this.component.setValue([this.props["value-start"],this.props["value-end"]]))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-ptr",{initialData:{refreshing:!1},methods:{done:function(){this.ptr&&this.ptr.done()},refresh:function(){this.ptr&&this.ptr.refresh()}},events:{pullstart:Event,pullmove:Event,pullend:Event,refresh:Event,done:Event},render:function(e){const t=e.classList.contains("ptr-bottom");e.classList.add("ptr-content"),e[(t?"last":"first")+"ElementChild"].classList.contains("ptr-preloader")||(e.insertAdjacentHTML(t?"beforeend":"afterbegin",'<div class="ptr-preloader"><div class="preloader"></div><div class="ptr-arrow"></div></div>'),dmx.f7.ready((t=>t.preloader.init(e.querySelector(".preloader"))))),dmx.f7.ready((t=>{this.ptr=t.ptr.get(e)||t.ptr.create(e),this.ptr.on("pullStart",this.dispatchEvent.bind(this,"pullstart")),this.ptr.on("pullMove",this.dispatchEvent.bind(this,"pullmove")),this.ptr.on("pullEnd",this.dispatchEvent.bind(this,"pullend")),this.ptr.on("refresh",this.dispatchEvent.bind(this,"refresh")),this.ptr.on("done",this.dispatchEvent.bind(this,"done")),this.ptr.on("refresh",(()=>this.set("refreshing",!0))),this.ptr.on("done",(()=>this.set("refershing",!1)))})),this.$parse()}}),dmx.Component("f7-sheet-modal",{initialData:{opened:!1},attributes:{backdrop:{type:[Boolean,String],default:void 0},"close-by-backdrop-click":{type:[Boolean,String],default:!0},"close-by-outside-click":{type:[Boolean,String],default:!1},"close-on-escape":{type:[Boolean,String],default:!1},animate:{type:[Boolean,String],default:!0},"swipe-to-close":{type:[Boolean,String],default:!1},"swipe-to-step":{type:[Boolean,String],default:!1},push:{type:[Boolean,String],default:!1},opened:{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{open:function(e){this.component&&this.component.open(e)},close:function(e){this.component&&this.component.close(e)},stepOpen:function(){this.component&&this.component.stepOpen()},stepClose:function(){this.component&&this.component.stepClose()},stepToggle:function(){this.component&&this.component.stepToggle()},setSwipeSet:function(){this.component&&this.component.setSwipeSet()}},events:{open:Event,opened:Event,close:Event,closed:Event,stepOpen:Event,stepClose:Event,stepProgress:Event},render:function(e){e.classList.add("sheet-modal"),dmx.f7.ready((t=>{const o=this.component=t.sheet.create({...this.props.params,el:e,backdrop:this.toBoolean("backdrop"),closeByOutsideClick:this.toBoolean("close-by-outside-click"),closeOnEscape:this.toBoolean("close-on-escape"),animate:this.toBoolean("animate"),swipeToClose:this.toBoolean("swipe-to-close"),swipeToStep:this.toBoolean("swipe-to-step"),push:this.toBoolean("push")});this.registerEvents(["open","opened","close","closed","stepOpen","stepClose","stepProgress"]),o.on("opened",(()=>{this.set("opened",!0)})),o.on("closed",(()=>{this.set("opened",!1)})),this.toBoolean("opened")&&o.open(!1)})),this.$parse()},update:function(e){this.component&&(this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?this.component.open():this.component.close()),this.set("opened",this.component.opened))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-accordion",{initialData:{opened:!1},attributes:{opened:{type:[Boolean,String],default:!1}},methods:{open:function(){Framework7.instance.accordion.open(this.$node)},close:function(){Framework7.instance.accordion.close(this.$node)},toggle:function(){Framework7.instance.accordion.toggle(this.$node)}},events:{open:Event,opened:Event,close:Event,closed:Event},render:function(e){for(const t of Object.keys(this.events))e.addEventListener(`accordion:${t}`,(()=>{this.dispatchEvent(t)}));e.addEventListener("accordion:opened",(()=>{this.set("opened",!0)})),e.addEventListener("accordion:closed",(()=>{this.set("opened",!1)})),this.toBoolean("opened")&&Framework7.instance.accordion.open(e),this.$parse()},update:function(e){this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?Framework7.instance.accordion.open(this.$node):Framework7.instance.accordion.close(this.$node))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-autocomplete",{initialData:{value:null,opened:!1},ui:{template:'<input id="@@id@@" name="@@id@@" type="text" is="dmx-f7-autocomplete">',extendOf:["dmx-input","f7-5-input"],replaces:"f7-5-input",priority:100},attributes:{limit:{type:Number,default:void 0},preloader:{type:[Boolean,String],default:!1},"preloader-color":{type:String,default:void 0},value:{type:String,default:void 0},"value-property":{ui:{scopeField:"data"},type:String,default:"id"},"text-property":{ui:{scopeField:"data"},type:String,default:"text"},"input-events":{type:String,default:"input"},"highlight-matches":{type:[Boolean,String],default:!0},typeahead:{type:[Boolean,String],default:!1},"dropdown-placeholder-text":{type:String,default:void 0},"update-input-value-on-select":{type:[Boolean,String],default:!0},"expand-input":{type:[Boolean,String],default:!1},data:{type:Array,default:[]},params:{type:Object,default:{}}},methods:{open:function(){this.component&&this.component.open()},close:function(){this.component&&this.component.close()},preloaderShow:function(){this.component&&this.component.preloaderShow()},preloaderHide:function(){this.component&&this.component.preloaderHide()}},events:{change:Event,open:Event,opened:Event,close:Event,closed:Event},render:function(e){dmx.f7.ready((t=>{const o=this.component=t.autocomplete.create({...this.props.params,openIn:"dropdown",inputEl:e,limit:this.props.limit,preloader:this.toBoolean("preloader"),preloaderColor:this.props["preloader-color"],value:Array.isArray(this.props.value)?this.props.value:[this.props.value],valueProperty:this.props["value-property"],textProperty:this.props["text-property"],inputEvents:this.props["input-events"],highlightMatches:this.props["highlight-matches"],typeahead:this.props.typeahead,dropdownPlaceholderText:this.props["dropdown-placeholder-text"],updateInputValueOnSelect:this.props["update-input-value-on-select"],expandInput:this.props["expand-input"],source:this.search.bind(this)});this.registerEvents(["change","open","opened","close","closed"]),o.on("change",(()=>{this.set("value",o.value[0])})),o.on("opened",(()=>{this.set("opened",!0)})),o.on("closed",(()=>{this.set("opened",!1)}))}))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},search:function(e,t){t(e.length?this.props.data.filter((t=>("object"==typeof t&&(t=dmx.parse(this.props["text-property"],dmx.DataScope(t))),"string"==typeof t&&t.toLowerCase().includes(e.toLowerCase())))):[])},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}}),dmx.Component("f7-calendar",{initialData:{value:[],opened:!1},ui:{template:'<input id="@@id@@" name="@@id@@" type="text" is="dmx-f7-calendar">',extendOf:["dmx-input","f7-5-input"],replaces:"f7-5-input",priority:100},attributes:{locale:{type:String,default:void 0},value:{type:Array,default:void 0},"first-day":{type:Number,default:1},"weekend-days":{type:Array,default:[0,6]},multiple:{type:[Boolean,String],default:!1},"range-picker":{type:[Boolean,String],default:!1},"range-picker-min-days":{type:Number,default:1},"range-picker-max-days":{type:Number,default:0},direction:{type:String,default:"horizontal",enum:["horizontal","vertical"],validate:e=>["horizontal","vertical"].includes(e)},"min-date":{type:Date,default:null},"max-date":{type:Date,default:null},"touch-move":{type:[Boolean,String],default:!0},animate:{type:[Boolean,String],default:!0},"close-on-select":{type:[Boolean,String],default:!1},"week-header":{type:[Boolean,String],default:!0},"month-selector":{type:[Boolean,String],default:!0},"month-picker":{type:[Boolean,String],default:!0},"year-selector":{type:[Boolean,String],default:!0},"year-picker":{type:[Boolean,String],default:!0},"year-picker-min":{type:Number,default:void 0},"year-picker-max":{type:Number,default:void 0},"time-picker":{type:[Boolean,String],default:!1},"time-picker-placeholder":{type:String,default:"Select time"},"open-in":{type:String,default:"auto",enum:["auto","popover","sheet","customModal"],validate:e=>["auto","popover","sheet","customModal"].includes(e)},"sheet-push":{type:[Boolean,String],default:!1},"scroll-to-input":{type:[Boolean,String],default:!0},"input-read-only":{type:[Boolean,String],default:!0},"close-by-outside-click":{type:[Boolean,String],default:!0},toolbar:{type:[Boolean,String],default:!0},"toolbar-close-text":{type:String,default:"Done"},header:{type:[Boolean,String],default:!1},"header-placeholder":{type:String,default:"Select date"},"close-by-backdrop-click":{type:[Boolean,String],default:!0},params:{type:Object,default:{}}},methods:{setValue:function(e){},addValue:function(e){},nextMonth:function(e){},prevMonth:function(e){},nextYear:function(){},prevYear:function(){},setYearMonth:function(e,t,o){},open:function(){},close:function(){}},events:{dayclick:Event,change:Event,open:Event,opened:Event,close:Event,closed:Event},render:function(e){dmx.f7.ready((t=>{const o=this.component=t.calendar.create({...this.props.params,inputEl:e,...this.getProps()});this.registerEvents(["change","open","opened","close","closed"]),o.on("opened",(()=>{this.set("opened",!0)})),o.on("closed",(()=>{this.set("opened",!1)}))}))},update:function(e){this.component&&(dmx.equal(e,this.props)||this.component.update(this.getProps()))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},getProps:function(){return{locale:this.props.locale,value:this.props.value,firstDay:this.props["first-day"],weekendDays:this.props["weekend-days"],multiple:this.toBoolean("multiple"),rangePicker:this.toBoolean("range-picker"),rangePickerMinDays:this.props["range-picker-min-days"],rangePickerMaxDays:this.props["range-picker-max-days"],direction:this.props.direction,minDate:this.toDate("min-date"),maxDate:this.toDate("max-date"),touchMove:this.toBoolean("touch-move"),animate:this.toBoolean("animate"),closeOnSelect:this.toBoolean("close-on-select"),weekHeader:this.toBoolean("week-header"),monthSelector:this.toBoolean("month-selector"),monthPicker:this.toBoolean("month-picker"),yearSelector:this.toBoolean("year-selector"),yearPicker:this.toBoolean("year-picker"),yearPickerMin:this.props["year-picker-min"],yearPickerMax:this.props["year-picker-max"],timePicker:this.toBoolean("time-picker"),timePickerPlaceholder:this.props["time-picker-placeholder"],openIn:this.props["open-in"],sheetPush:this.toBoolean("sheet-push"),scrollToInput:this.toBoolean("scroll-to-input"),inputReadOnly:this.toBoolean("input-read-only"),closeByOutsideClick:this.toBoolean("close-by-outside-click"),toolbar:this.toBoolean("toolbar"),toolbarCloseText:this.props["toolbar-close-text"],header:this.toBoolean("header"),headerPlaceholder:this.props["header-placeholder"],closeByBackdropClick:this.toBoolean("close-by-backdrop-click")}},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o},toDate:function(e,t){const o=t?t[e]:this.props[e];let n=null;return o&&(n=new Date(o),"Invalid Date"==n.toString()&&(n=null)),n}}),dmx.Component("f7-picker",{initialData:{value:[],opened:!1},ui:{template:'<input id="@@id@@" name="@@id@@" type="text" is="dmx-f7-picker">',extendOf:["dmx-input","f7-5-input"],replaces:"f7-5-input",priority:100},attributes:{"rotate-effect":{type:[Boolean,String],default:!1},"momentum-ratio":{type:Number,default:7},mousewheel:{type:[Boolean,String],default:!0},"update-values-on-momentum":{type:[Boolean,String],default:!1},"update-values-on-touchmove":{type:[Boolean,String],default:!0},"update-values-on-mousewheel":{type:[Boolean,String],default:!0},"free-mode":{type:[Boolean,String],default:!1},value:{type:Array,default:void 0},cols:{ui:{multiValue:!0,isDynamic:!0,variables:[{name:"textAlign",type:"droplist",title:"Text Align",values:[{value:"left",title:"Left"},{value:"center",title:"Center"},{value:"right",title:"Right"}],objectKey:"textAlign",enclose:"single"},{name:"dataSource",type:"text",title:"Data Source",dataBindings:!0,objectKey:"source"},{name:"valueProperty",type:"text",title:"Value Property",dataBindings:!0,scopeField:"dataSource",objectKey:"valueProperty",enclose:"single"},{name:"displayProperty",type:"text",title:"Display Property",dataBindings:!0,scopeField:"dataSource",objectKey:"displayProperty",enclose:"single"}]},type:Array,default:[]},"open-in":{type:String,default:"auto",enum:["auto","popover","sheet"],validate:e=>["auto","popover","sheet"].includes(e)},backdrop:{type:[Boolean,String],default:void 0},"sheet-push":{type:[Boolean,String],default:!1},"sheet-swipe-to-close":{type:[Boolean,String],default:!1},"scroll-to-input":{type:[Boolean,String],default:!0},"input-read-only":{type:[Boolean,String],default:!0},"close-by-outside-click":{type:[Boolean,String],default:!0},toolbar:{type:[Boolean,String],default:!0},"toolbar-close-text":{type:String,default:"Done"},"routable-modals":{type:[Boolean,String],default:!0},url:{type:String,default:"select/"},opened:{type:[Boolean,String],default:!1},params:{type:Object,default:{}}},methods:{open:function(){this.component&&this.component.open()},close:function(){this.component&&this.component.close()}},events:{change:Event,init:Event,open:Event,opened:Event,close:Event,closed:Event},render:function(e){dmx.f7.ready((e=>{this.createComponent()}))},update:function(e){this.component&&(this.toBoolean("opened",e)!=this.toBoolean("opened")&&(this.toBoolean("opened")?this.component.open():this.component.close()),dmx.equal(e.cols,this.props.cols)||(this.component.destroy(),this.createComponent()))},beforeDestroy:function(){this.component&&(this.component.destroy(),delete this.component)},createComponent:function(){const e=this.component=Framework7.instance.picker.create(this.getParams());this.registerEvents(Object.keys(this.events)),e.on("init",(()=>{this.set("value",e.value)})),e.on("change",(()=>{this.set("value",e.value)})),e.on("opened",(()=>{this.set("opened",!0)})),e.on("closed",(()=>{this.set("closed",!1)})),this.toBoolean("opened")&&e.open()},getParams:function(){return{...this.props.params,inputEl:this.$node,rotateEffect:this.toBoolean("rotate-effect"),momentumRatio:this.props["momentum-ratio"],mousewheel:this.toBoolean("mousewheel"),updateValuesOnMomentum:this.toBoolean("update-values-on-momentum"),updateValuesOnTouchmove:this.toBoolean("update-values-on-touchmove"),updateValuesOnMousewheel:this.toBoolean("update-values-on-mousewheel"),freeMode:this.toBoolean("free-mode"),value:this.props.value,cols:this.getCols(),openIn:this.props["open-in"],backdrop:this.props.backdrop?this.toBoolean("backdrop"):void 0,sheetPush:this.toBoolean("sheet-push"),sheetSwipeToClose:this.toBoolean("sheet-swipe-to-close"),scrollToInput:this.toBoolean("scroll-to-input"),inputReadOnly:this.toBoolean("input-read-only"),closeByOutsideClick:this.toBoolean("close-by-outside-click"),toolbar:this.toBoolean("toolbar"),toolbarCloseText:this.props["toolbar-close-text"],routableModals:this.toBoolean("routable-modals"),url:this.props.url}},getCols:function(){return Array.isArray(this.props.cols)?this.props.cols.map(((e,t)=>(Array.isArray(e.source)&&(e.values=e.source.slice(0),e.valueProperty&&(e.values=e.source.map((t=>t[e.valueProperty]))),e.displayProperty&&(e.displayValues=e.source.map((t=>t[e.displayProperty])))),Array.isArray(e.values)||(e.values=[],console.warn(`Picker ${this.name}: Column ${t+1} has no values`)),dmx.clone(e)))):[]},registerEvents:function(e){for(const t of e)this.component.on(t,(()=>this.dispatchEvent(t)))},toBoolean:function(e,t){const o=t?t[e]:this.props[e];return"string"==typeof o?"false"!=o:!!o}});
- //# sourceMappingURL=../maps/dmxFramework7.js.map
|