ionic-mathlive
Version:
A Ionic-mathlive math.
16 lines (14 loc) • 4.55 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("mathlive"),require("@angular/common"),require("@ionic/angular")):"function"==typeof define&&define.amd?define("ionic-mathlive",["exports","@angular/core","@angular/forms","mathlive","@angular/common","@ionic/angular"],t):t((e=e||self)["ionic-mathlive"]={},e.ng.core,e.ng.forms,e.mathlive,e.ng.common,e.angular)}(this,(function(e,t,n,o,i,r){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function a(e,t,n,o){var i,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(r<3?i(a):r>3?i(t,n,a):i(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}var s=function(){function e(){var e=this;this.disabled=!1,this.onValueChange=new t.EventEmitter,this.onChange=function(){},this.onTouched=function(){},this.writeValue=function(t){e.answer=t.$text(),e.onValueChange.emit(e.answer)}}var i;return i=e,e.prototype.ngAfterViewInit=function(){o.makeMathField(this.mathfield.nativeElement,{onContentDidChange:this.writeValue,virtualKeyboardMode:"onfocus",virtualKeyboards:"all"})},e.prototype.ngOnInit=function(){},Object.defineProperty(e.prototype,"value",{get:function(){return this.answer},set:function(e){this.answer=e,this.onChange(e),this.onTouched()},enumerable:!0,configurable:!0}),e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},a([t.ViewChild("mathfield",{static:!0})],e.prototype,"mathfield",void 0),a([t.Input("answer")],e.prototype,"answer",void 0),a([t.Input()],e.prototype,"disabled",void 0),a([t.Output()],e.prototype,"onValueChange",void 0),e=i=a([t.Component({selector:"ionic-mathlive",template:'<div id="mathfield" class="mathfield" #mathfield ngDefaultControl name="answer" [(ngModel)]="answer">\n\n</div >\n',providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return i})),multi:!0}],styles:["#ML__keyboard{position:absolute;left:0;padding-top:5px;width:100vw;z-index:3;transition:.28s cubic-bezier(0,0,.2,1);bottom:-267px;opacity:0;visibility:hidden;-webkit-backdrop-filter:grayscale(50%);backdrop-filter:grayscale(50%);background-color:rgba(209,213,217,.9);border:1px solid #ddd;font-family:-apple-system,BlinkMacSystemFont,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:400;margin:0;text-shadow:none;box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23)}#ML__keyboard div.alternate-keys{-ms-flex-line-pack:center;-ms-flex-pack:center;-webkit-box-pack:center;-webkit-box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);-webkit-transition:none;align-content:center;background-color:#fff;border-radius:6px;box-shadow:0 14px 28px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.22);display:flex;flex-direction:row;justify-content:center;max-width:50vw;position:unset;text-align:center;transition:none;visibility:hidden;z-index:101}.mathfield{width:60vw;height:10vh;border:1px solid #ddd;padding:5px;margin:auto;border-radius:5px;background-color:#eee}"]})],e)}(),l=function(){function e(){}return e=a([t.NgModule({imports:[i.CommonModule,n.FormsModule,r.IonicModule],exports:[s],declarations:[s]})],e)}();e.IonMathliveComponent=s,e.IonicMathliveModule=l,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ionic-mathlive.umd.min.js.map