UNPKG

@logo-software/timepicker

Version:

Timepicker helps users select and set a specific time in your timesheet in 24-hour format.

40 lines 25.9 kB
!function(o,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("@angular/forms"),require("@logo-software/popover"),require("@angular/common"),require("moment")):"function"==typeof define&&define.amd?define("@logo-software/timepicker",["exports","@angular/core","@angular/forms","@logo-software/popover","@angular/common","moment"],r):r(((o="undefined"!=typeof globalThis?globalThis:o||self)["logo-software"]=o["logo-software"]||{},o["logo-software"].timepicker={}),o.ng.core,o.ng.forms,o.popover,o.ng.common,o.momentNs)}(this,(function(o,r,t,e,n,a){"use strict";function i(o){if(o&&o.__esModule)return o;var r=Object.create(null);return o&&Object.keys(o).forEach((function(t){if("default"!==t){var e=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(r,t,e.get?e:{enumerable:!0,get:function(){return o[t]}})}})),r.default=o,Object.freeze(r)}var s,l,c=i(a); /** * @license * Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. All Rights Reserved. * * Save to the extent permitted by law, you may not use, copy, modify, * distribute or create derivative works of this material or any part * of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited. * Any reproduction of this material must contain this notice. */o.IconPosition=void 0,(s=o.IconPosition||(o.IconPosition={})).ICON_LEFT="left",s.ICON_RIGHT="right",s.ICON_DEFAULT="left",o.Sizes=void 0,(l=o.Sizes||(o.Sizes={})).LARGE="large",l.MEDIUM="medium",l.SMALL="small",l.DEFAULT="medium";var u=function(){function t(t){var n=this;this.popoverService=t,this.size=o.Sizes.DEFAULT,this.iconPosition=o.IconPosition.ICON_DEFAULT,this.isDisabled=!1,this.hours=[],this.minutes=[],this.selectedHour="00",this.selectedMinute="00",this.time=null,this.ngModelChange=new r.EventEmitter,this.onChange=new r.EventEmitter,this.PopoverPosition=e.PopoverPosition,this.hours=Array.from({length:24},(function(o,r){return r<10?"0"+r:""+r})),this.minutes=Array.from({length:60},(function(o,r){return r<10?"0"+r:""+r})),this.subscribtion||(this.subscribtion=this.popoverService.openWatcher.subscribe((function(o){o||n.setInputTime(n.ngModel)})))}return Object.defineProperty(t.prototype,"ngModel",{get:function(){return this._ngModel},set:function(o){this._ngModel=o.trim(),this.setInputTime(o)},enumerable:!1,configurable:!0}),t.prototype.onResize=function(o){this.popoverService.closePopover()},t.prototype.ngOnDestroy=function(){this.subscribtion.unsubscribe()},t.prototype.setInputTime=function(o){var r=o.trim().split(":");this.selectedHour=r[0],this.selectedMinute=r[1],this.setTime()},t.prototype.showClockSelector=function(){this.popoverService.showPopover("timePopover-"+this.id)},t.prototype.closeClockSelector=function(){this.popoverService.closePopover()},t.prototype.setHour=function(o){this.selectedHour=o.target.value,this.setTime()},t.prototype.setMin=function(o){this.selectedMinute=o.target.value,this.setTime()},t.prototype.setTime=function(){this.time=this.selectedHour+":"+this.selectedMinute},t.prototype.handleWriteTime=function(o){var r=o.target.value.split(":",2);void 0===r[0]||r[0].length<2?this.selectedHour="00":this.selectedHour=r[0],void 0===r[1]||r[1].length<2?this.selectedMinute="00":this.selectedMinute=r[1]},t.prototype.apply=function(){this.ngModelChange.emit(this.time),this.onChange.emit(this.time),this.popoverService.closePopover()},t.prototype.registerOnChange=function(o){},t.prototype.registerOnTouched=function(o){},t.prototype.writeValue=function(o){},t.prototype.setDisabledState=function(o){},t}();u.decorators=[{type:r.Component,args:[{selector:"logo-timepicker",template:'<div class="logo-timepicker {{cssClasses}}">\n <div class="input-w-icon {{iconPosition}} {{size}}">\n <span class="le-time_clock_circle_2"></span>\n <input\n [logoPopover]="\'timePopover-\' + id"\n (keyup)="handleWriteTime($event)"\n [ngModel]="time"\n [placeholder]="\'00:00\'"\n [regexp]="\'^[0-2]{1}$|^[0-2]{1}[0-9]{1}$|^[0-2]{1}[0-9]{1}[0-5]{1}$|^[0-2]{1}[0-9]{1}[0-5]{1}[0-9]{1}$\'"\n [value]="time != null ? time : \'\'"\n [disabled]="isDisabled"\n class="icon-{{iconPosition}} bordered {{size}}"\n id="{{id}}"\n logoMask\n />\n </div>\n <logo-popover\n [hasSearch]="false"\n [id]="\'timePopover-\' + id"\n [isBackClick]="false"\n [position]="PopoverPosition.POPOVER_BOTTOM_LEFT"\n >\n <div class="selection-input">\n <div class="selection">\n <select (change)="setHour($event)" [(ngModel)]="selectedHour" class="popoverSelect" id="{{id}}Hours">\n <option *ngFor="let hour of hours" [value]="hour">{{hour}}</option>\n </select>\n </div>\n <div>:</div>\n <div class="selection">\n <select (change)="setMin($event)" [(ngModel)]="selectedMinute" class="popoverSelect" id="{{id}}Mins">\n <option *ngFor="let min of minutes" [value]="min">{{min}}</option>\n </select>\n </div>\n </div>\n <div class="btn-area">\n <button (click)="apply()" class="approve-btn">Uygula</button>\n </div>\n </logo-popover>\n</div>\n',providers:[{provide:t.NG_VALUE_ACCESSOR,useExisting:r.forwardRef((function(){return u})),multi:!0}],styles:[".dotted{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.logo-tooltip .tip.on-bottom:after,.logo-tooltip .tip.on-top:after{border-left:7px solid transparent;border-right:7px solid transparent}.logo-tooltip .tip.on-left:after,.logo-tooltip .tip.on-right:after{border-top:7px solid transparent;border-bottom:7px solid transparent}.logo-tooltip{position:relative;color:#e94a34;cursor:pointer}.logo-tooltip .tip{position:absolute;width:180px;color:#fff;font-size:14px;font-style:normal;line-height:1.4;text-align:center;border-radius:3px;background:#333;padding:8px 12px;box-sizing:border-box;cursor:auto;z-index:10;opacity:0;visibility:hidden;transition:all .25s ease-in}.logo-tooltip .tip:after{position:absolute;width:0;height:0;content:\"\"}.logo-tooltip .tip.on-top{bottom:25px;left:0}.logo-tooltip .tip.on-top:after{bottom:-7px;left:10px;border-top:7px solid #333}.logo-tooltip .tip.on-right{top:-5px;left:103%}.logo-tooltip .tip.on-right:after{top:37%;left:-7px;border-right:7px solid #333}.logo-tooltip .tip.on-bottom{top:25px;left:0}.logo-tooltip .tip.on-bottom:after{top:-7px;left:10px;border-bottom:7px solid #333}.logo-tooltip .tip.on-left{top:-100%;right:103%}.logo-tooltip .tip.on-left:after{top:37%;right:-7px;border-left:7px solid #333}.logo-tooltip:hover .tip{opacity:1;visibility:visible}.logo-tooltip:hover .tip.on-top{transform:translateY(-15px)}.logo-tooltip:hover .tip.on-right{transform:translateX(15px)}.logo-tooltip:hover .tip.on-bottom{transform:translateY(15px)}.logo-tooltip:hover .tip.on-left{transform:translateX(-15px)}.test{content:\"a\";content:\"ba\";content:\"aa\";content:\"aade\";content:\"abde\"}:root .basic,:root .gray,:root .secondary{color:var(--leds-contrast-90pct)}:root .danger,:root .info,:root .success,:root .warning{color:var(--white)}:root .outline.primary,:root .outline.primary:active,:root .outline.primary:focus,:root .outline.primary:hover{border-color:var(--light-600)}:root .outline.primary:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--primary)}:root .outline.primary:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--primary)}:root .outline.primary:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--primary)}:root .outline.secondary{color:var(--leds-contrast-90pct)}:root .outline.secondary,:root .outline.secondary:active,:root .outline.secondary:focus,:root .outline.secondary:hover{border-color:var(--light-600)}:root .outline.secondary:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--leds-contrast-90pct)}:root .outline.secondary:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--leds-contrast-90pct)}:root .outline.secondary:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--leds-contrast-90pct)}:root .outline.basic{color:var(--leds-contrast-90pct)}:root .outline.basic,:root .outline.basic:active,:root .outline.basic:focus,:root .outline.basic:hover{border-color:var(--light-600)}:root .outline.basic:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--leds-contrast-90pct)}:root .outline.basic:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--leds-contrast-90pct)}:root .outline.basic:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--leds-contrast-90pct)}:root .outline.neutral,:root .outline.neutral:active,:root .outline.neutral:focus,:root .outline.neutral:hover{border-color:var(--light-600)}:root .outline.neutral:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--neutral)}:root .outline.neutral:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--neutral)}:root .outline.neutral:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--neutral)}:root .outline.light{border-color:rgba(var(--light-rgb),.5)}:root .outline.light:active,:root .outline.light:focus,:root .outline.light:hover{border-color:var(--light)}:root .outline.light:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--white)}:root .outline.light:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--white)}:root .outline.light:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--white)}:root .outline.dark,:root .outline.dark:active,:root .outline.dark:focus,:root .outline.dark:hover{border-color:var(--light-600)}:root .outline.dark:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--dark)}:root .outline.dark:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--dark)}:root .outline.dark:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--dark)}:root .outline.gray{color:var(--leds-contrast-90pct)}:root .outline.gray,:root .outline.gray:active,:root .outline.gray:focus,:root .outline.gray:hover{border-color:var(--light-600)}:root .outline.gray:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--leds-contrast-90pct)}:root .outline.gray:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--leds-contrast-90pct)}:root .outline.gray:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--leds-contrast-90pct)}:root .outline.info{color:var(--info)}:root .outline.info,:root .outline.info:active,:root .outline.info:focus,:root .outline.info:hover{border-color:var(--light-600)}:root .outline.info:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--info)}:root .outline.info:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--info)}:root .outline.info:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--info)}:root .outline.danger{color:var(--danger)}:root .outline.danger,:root .outline.danger:active,:root .outline.danger:focus,:root .outline.danger:hover{border-color:var(--light-600)}:root .outline.danger:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--danger)}:root .outline.danger:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--danger)}:root .outline.danger:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--danger)}:root .outline.warning{color:var(--warning)}:root .outline.warning,:root .outline.warning:active,:root .outline.warning:focus,:root .outline.warning:hover{border-color:var(--light-600)}:root .outline.warning:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--warning)}:root .outline.warning:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--warning)}:root .outline.warning:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--warning)}:root .outline.success{color:var(--success)}:root .outline.success,:root .outline.success:active,:root .outline.success:focus,:root .outline.success:hover{border-color:var(--light-600)}:root .outline.success:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--success)}:root .outline.success:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--success)}:root .outline.success:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--success)}:root .ghost.primary:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--primary)}:root .ghost.primary:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--primary)}:root .ghost.primary:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--primary)}:root .ghost.secondary,:root .ghost.secondary:hover{color:var(--leds-contrast-90pct)}:root .ghost.secondary:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover))}:root .ghost.secondary:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--leds-contrast-90pct)}:root .ghost.secondary:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus))}:root .ghost.basic,:root .ghost.basic:hover,:root .ghost.secondary:focus{color:var(--leds-contrast-90pct)}:root .ghost.basic:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover))}:root .ghost.basic:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--leds-contrast-90pct)}:root .ghost.basic:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--leds-contrast-90pct)}:root .ghost.neutral:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--neutral)}:root .ghost.neutral:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--neutral)}:root .ghost.neutral:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--neutral)}:root .ghost.light:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--white)}:root .ghost.light:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--white)}:root .ghost.light:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--white)}:root .ghost.dark:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--dark)}:root .ghost.dark:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--dark)}:root .ghost.dark:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--dark)}:root .ghost.gray,:root .ghost.gray:hover{color:var(--leds-contrast-90pct)}:root .ghost.gray:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover))}:root .ghost.gray:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--leds-contrast-90pct)}:root .ghost.gray:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--leds-contrast-90pct)}:root .ghost.info{color:var(--info)}:root .ghost.info:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--info)}:root .ghost.info:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--info)}:root .ghost.info:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--info)}:root .ghost.danger{color:var(--danger)}:root .ghost.danger:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--danger)}:root .ghost.danger:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--danger)}:root .ghost.danger:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--danger)}:root .ghost.warning{color:var(--warning)}:root .ghost.warning:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--warning)}:root .ghost.warning:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--warning)}:root .ghost.warning:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--warning)}:root .ghost.success{color:var(--success)}:root .ghost.success:hover{background-color:rgba(var(--neutral-500-rgb),var(--ghost-hover));color:var(--success)}:root .ghost.success:active{background-color:rgba(var(--neutral-500-rgb),var(--ghost-active));color:var(--success)}:root .ghost.success:focus{background-color:rgba(var(--neutral-500-rgb),var(--ghost-focus));color:var(--success)}[class*=\" le-\"],[class^=le-]{position:relative}[class*=\" le-\"]:before,[class^=le-]:before{height:100%;top:0;-webkit-mask-size:14px;mask-size:14px}.le-time_clock_circle_2:before{-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='currentColor' xmlns='http://www.w3.org/2000/svg'%3E %3Cg id='time_clock_circle_2'%3E %3Cpath id='Shape' fill-rule='evenodd' clip-rule='evenodd' d='M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C21.994 6.47963 17.5204 2.00597 12 2ZM16.3333 16.3508C16.0192 16.6833 15.4979 16.7061 15.1558 16.4025L11.0233 12.6142C10.85 12.4569 10.7508 12.234 10.75 12V7.41667C10.75 6.95643 11.1231 6.58333 11.5833 6.58333C12.0436 6.58333 12.4167 6.95643 12.4167 7.41667V11.6333L16.2783 15.1733C16.4421 15.3222 16.5399 15.5301 16.5502 15.7511C16.5605 15.9721 16.4825 16.1882 16.3333 16.3517V16.3508Z' fill='%235A5A5A'/%3E %3C/g%3E %3C/svg%3E\");-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;display:inline-block;content:\"\";position:absolute;background:currentColor}:host{display:inline-block}:host logo-popover{width:100%}:host ::ng-deep .selection-input{display:flex;width:160px;align-items:center;justify-content:space-between}:host ::ng-deep .selection-input .selection{width:40%;text-align:center}:host ::ng-deep .selection-input .selection select{width:100%}:host ::ng-deep .selection-input .selection:last-child{position:relative;z-index:1}:host ::ng-deep .btn-area{text-align:center;margin-top:10px}:host ::ng-deep .btn-area button{width:100%}"]}]}],u.ctorParameters=function(){return[{type:e.PopoverService}]},u.propDecorators={id:[{type:r.Input}],size:[{type:r.Input}],iconPosition:[{type:r.Input}],cssClasses:[{type:r.Input}],isDisabled:[{type:r.Input}],ngModelChange:[{type:r.Output}],onChange:[{type:r.Output}],ngModel:[{type:r.Input}],onResize:[{type:r.HostListener,args:["window:resize",["$event"]]}]};Object.create;function g(o,r){var t="function"==typeof Symbol&&o[Symbol.iterator];if(!t)return o;var e,n,a=t.call(o),i=[];try{for(;(void 0===r||r-- >0)&&!(e=a.next()).done;)i.push(e.value)}catch(o){n={error:o}}finally{try{e&&!e.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}return i}function v(){for(var o=[],r=0;r<arguments.length;r++)o=o.concat(g(arguments[r]));return o}Object.create; /** * @license * Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. All Rights Reserved. * * Save to the extent permitted by law, you may not use, copy, modify, * distribute or create derivative works of this material or any part * of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited. * Any reproduction of this material must contain this notice. */ var h,p=function(){function o(){}return o.turkishToLower=function(o){var r=o,t={"İ":"i",I:"ı","Ş":"ş","Ğ":"ğ","Ü":"ü","Ö":"ö","Ç":"ç"};return(r=r.replace(/(([İIŞĞÜÇÖ]))/g,(function(o){return t[o]}))).toLowerCase()},o.turkishToUpper=function(o){var r=o,t={i:"İ","ş":"Ş","ğ":"Ğ","ü":"Ü","ö":"Ö","ç":"Ç","ı":"I"};return(r=r.replace(/(([iışğüçö]))/g,(function(o){return t[o]}))).toUpperCase()},o.union=function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];var t=v(o).flat(1/0),e=function(o,r){return t.indexOf(o)===r};return t.filter(e)},o.findAllIndex=function(o,r){return o.reduce((function(o,t,e){return t===r&&o.push(e),o}),[])},o.removeCharsBetween=function(o,r,t){void 0===t&&(t=1);var e=o.split("");return e.splice(r,t),e.join("")},o}(),d=c,b=function(){function o(o){this.elementRef=o,this.case=null,this.conditions=[],this.ngModelChange=new r.EventEmitter,this.oldValue="",this.defaultChars="^\\wğüşıöçĞÜŞİÖÇ"}return Object.defineProperty(o.prototype,"regexp",{get:function(){return this._regexp},set:function(o){this._regexp=o},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"placeholder",{get:function(){return this._placeholder},set:function(o){this._placeholder=o,void 0!==o&&this.input&&this.setPlaceholder(o),this.maxLength||(this.maxLength=this.placeholder.length)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"maxLength",{get:function(){return this._maxLength},set:function(o){var r=this.elementRef.nativeElement.maxLength,t=r||this._placeholder.length;this._maxLength=null!=o?o:t,o&&this.input&&this.setInputAttributes()},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"extendedChars",{get:function(){return this._extendedChars},set:function(o){this._extendedChars=o,void 0!==o&&this.input&&this.setPlaceholder(this.placeholder)},enumerable:!1,configurable:!0}),o.prototype.ngOnInit=function(){this.input=this.elementRef.nativeElement,this._placeholder&&this.setPlaceholder(this._placeholder)},o.prototype.setPlaceholder=function(o){var r;this.acceptedChars="["+this.defaultChars+this._extendedChars+"]",r=o.match(new RegExp(this.acceptedChars,"g")),this.list=r&&p.union(r).map((function(r){return{what:r,position:p.findAllIndex(o.split(""),r)}})),this.setInputAttributes()},o.prototype.setInputAttributes=function(){this.input.setAttribute("maxLength",this._maxLength),this.input.setAttribute("placeholder",this._placeholder)},o.prototype.clear=function(o){return o.replace(new RegExp(this.acceptedChars,"g"),"")},o.prototype.isValid=function(o){var r=new Date(o);return"[object Date]"===Object.prototype.toString.call(r)&&!isNaN(r.getTime())},o.prototype.onFocus=function(o){this.oldValue=this.input.value},o.prototype.onBlur=function(o){"date"!==this.maskType||this.isValid(this.input.value)||this.emit(this.oldValue)},o.prototype.onKeyDown=function(o){h=this.input.selectionStart,13===o.keyCode&&("date"!==this.maskType||this.isValid(this.input.value)||this.emit(this.oldValue))},o.prototype.emit=function(o){this.input.value=o,this.oldValue=o,this.ngModelChange.emit(o)},o.prototype.conditionCheck=function(){var o=this,r=this.clear(this.input.value);this.conditions.length>0&&this.conditions.forEach((function(t){var e=t.cases.every((function(o){if(r[o.position-1]){var t=new RegExp(o.regexp,"gi").test(r[o.position-1]);return h=t?h+1:h,t}return!1}))?t.placeholder:o._placeholder;o.setPlaceholder(e)}))},o.prototype.mask=function(o){var r=this;return this.clear(o).replace(/./g,(function(o,t){var e=0;return r.list&&r.list.forEach((function(r){r.position.forEach((function(n){o=t===n-1-e?o+r.what:o,e++}))})),o}))},o.prototype.onInput=function(o){var r,t;switch(this.case){case"lower":r=p.turkishToLower(this.input.value);break;case"upper":r=p.turkishToUpper(this.input.value);break;default:r=this.input.value}var e=new RegExp(this._regexp).test(this.clear(r)),n=this.input.selectionEnd-h;if(!e)return o.preventDefault(),this.emit(p.removeCharsBetween(r,h,n)),void this.input.setSelectionRange(h,h);(o.data||"insertFromPaste"===o.inputType)&&(this.conditionCheck(),t=this.mask(r),"date"!==this.maskType||d(t).isValid()||this._maxLength!==this.input.value?this.emit(t):this.emit(this.oldValue),this.input.value.length!==this._maxLength&&(this.list&&this.list.map((function(o){return o.position})).join().split(",").map((function(o){Number(o)>=h+1&&h+n>=Number(o)&&(h+=1)})),this.input.setSelectionRange(h+n,h+n)))},o}(); /** * @license * Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. All Rights Reserved. * * Save to the extent permitted by law, you may not use, copy, modify, * distribute or create derivative works of this material or any part * of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited. * Any reproduction of this material must contain this notice. */b.decorators=[{type:r.Directive,args:[{selector:"[logoMask]",providers:[t.NgModel]}]}],b.ctorParameters=function(){return[{type:r.ElementRef}]},b.propDecorators={ngModel:[{type:r.Input}],maskType:[{type:r.Input}],case:[{type:r.Input}],conditions:[{type:r.Input}],ngModelChange:[{type:r.Output}],regexp:[{type:r.Input}],placeholder:[{type:r.Input}],maxLength:[{type:r.Input}],extendedChars:[{type:r.Input}],onFocus:[{type:r.HostListener,args:["focus",["$event"]]}],onBlur:[{type:r.HostListener,args:["blur",["$event"]]}],onKeyDown:[{type:r.HostListener,args:["keydown",["$event"]]}],onInput:[{type:r.HostListener,args:["input",["$event"]]}]}; /** * @license * Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. All Rights Reserved. * * Save to the extent permitted by law, you may not use, copy, modify, * distribute or create derivative works of this material or any part * of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited. * Any reproduction of this material must contain this notice. */ var f=function(){};f.decorators=[{type:r.NgModule,args:[{declarations:[u,b],imports:[t.FormsModule,n.CommonModule,e.PopoverModule],exports:[u]}]}],o.TimepickerComponent=u,o.TimepickerModule=f,o["ɵa"]=b,Object.defineProperty(o,"__esModule",{value:!0})})); //# sourceMappingURL=logo-software-timepicker.umd.min.js.map