Socket
Socket
Sign inDemoInstall

ngx-cron-jobs

Package Overview
Dependencies
17
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.6 to 0.4.7

32

bundles/ngx-cron-jobs.umd.js

@@ -17,2 +17,15 @@ (function (global, factory) {

})();
var OptionType = {};
OptionType.minute = 0;
OptionType.hour = 1;
OptionType.day = 2;
OptionType.week = 3;
OptionType.month = 4;
OptionType.year = 5;
OptionType[OptionType.minute] = "minute";
OptionType[OptionType.hour] = "hour";
OptionType[OptionType.day] = "day";
OptionType[OptionType.week] = "week";
OptionType[OptionType.month] = "month";
OptionType[OptionType.year] = "year";
var DataService = (function () {

@@ -95,8 +108,8 @@ function DataService() {

{ value: 0, label: 'Please select' },
{ value: 1, label: 'Minute' },
{ value: 2, label: 'Hour' },
{ value: 3, label: 'Day' },
{ value: 4, label: 'Week' },
{ value: 5, label: 'Month' },
{ value: 6, label: 'Year' }
{ value: 1, type: OptionType.minute, label: 'Minute' },
{ value: 2, type: OptionType.hour, label: 'Hour' },
{ value: 3, type: OptionType.day, label: 'Day' },
{ value: 4, type: OptionType.week, label: 'Week' },
{ value: 5, type: OptionType.month, label: 'Month' },
{ value: 6, type: OptionType.year, label: 'Year' }
];

@@ -541,3 +554,8 @@ this._hours = [];

});
this.baseFrequencyData = this.dataService.baseFrequency;
var /** @type {?} */ baseFreq = this.dataService.baseFrequency;
if (this.config.option) {
baseFreq = baseFreq.filter(function (x) { return !(_this.config.option.hasOwnProperty(OptionType[x.type])
&& !_this.config.option[OptionType[x.type]]); });
}
this.baseFrequencyData = baseFreq;
this.daysOfMonthData = this.dataService.daysOfMonth;

@@ -544,0 +562,0 @@ this.daysOfWeekData = this.dataService.getDaysOfWeek(false);

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs/Subject"),require("rxjs/add/operator/takeUntil"),require("rxjs/add/operator/map"),require("rxjs/add/operator/publishReplay"),require("rxjs/add/operator/filter"),require("rxjs/add/operator/do")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms","rxjs/Subject","rxjs/add/operator/takeUntil","rxjs/add/operator/map","rxjs/add/operator/publishReplay","rxjs/add/operator/filter","rxjs/add/operator/do"],t):t(e["ngx-cron-jobs"]={},e.ng.core,e.ng.common,e.ng.forms,e.Rx)}(this,function(e,t,n,a,s){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function a(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(a.prototype=n.prototype,new a)}}(),l=function(){function e(){this.defaultConfig={quartz:!1,bootstrap:!0,multiple:!1},this.defaultValidateConfig={validate:!1},this.daysOfWeekPosix=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],this.daysOfWeekQuartz=[{value:1,label:"Sunday"},{value:2,label:"Monday"},{value:3,label:"Tuesday"},{value:4,label:"Wednesday"},{value:5,label:"Thursday"},{value:6,label:"Friday"},{value:7,label:"Saturday"}],this.numeral=[{value:1,label:"1st"},{value:2,label:"2nd"},{value:3,label:"3rd"},{value:4,label:"4th"},{value:5,label:"5th"},{value:6,label:"6th"},{value:7,label:"7th"},{value:8,label:"8th"},{value:9,label:"9th"},{value:10,label:"10th"},{value:11,label:"11th"},{value:12,label:"12th"},{value:13,label:"13th"},{value:14,label:"14th"},{value:15,label:"15th"},{value:16,label:"16th"},{value:17,label:"17th"},{value:18,label:"18th"},{value:19,label:"19th"},{value:20,label:"20th"},{value:21,label:"21st"},{value:22,label:"22nd"},{value:23,label:"23rd"},{value:24,label:"24th"},{value:25,label:"25th"},{value:26,label:"26th"},{value:27,label:"27th"},{value:28,label:"28th"},{value:29,label:"29th"},{value:30,label:"30th"},{value:31,label:"31st"}],this._months=[{value:1,label:"January"},{value:2,label:"February"},{value:3,label:"March"},{value:4,label:"April"},{value:5,label:"May"},{value:6,label:"June"},{value:7,label:"July"},{value:8,label:"August"},{value:9,label:"September"},{value:10,label:"October"},{value:11,label:"November"},{value:12,label:"December"}],this._baseFrequency=[{value:0,label:"Please select"},{value:1,label:"Minute"},{value:2,label:"Hour"},{value:3,label:"Day"},{value:4,label:"Week"},{value:5,label:"Month"},{value:6,label:"Year"}],this._hours=[];for(e=0;e<24;e++)this._hours.push({value:e,label:""+e});this._minutes=[];for(var e=0;e<60;e+=5)this._minutes.push({value:e,label:""+e})}return Object.defineProperty(e.prototype,"baseFrequency",{get:function(){return this._baseFrequency.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"daysOfMonth",{get:function(){return this.numeral.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"months",{get:function(){return this._months.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hours",{get:function(){return this._hours.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minutes",{get:function(){return this._minutes.slice()},enumerable:!0,configurable:!0}),e.prototype.getConfig=function(e){return void 0===e&&(e={}),Object.assign({},this.defaultConfig,e)},e.prototype.getValidate=function(e){return void 0===e&&(e={}),Object.assign({},this.defaultValidateConfig,e)},e.prototype.getDaysOfWeek=function(e){return void 0===e&&(e=!1),e?this.daysOfWeekQuartz.slice():this.daysOfWeekPosix.slice()},e}();l.decorators=[{type:t.Injectable}],l.ctorParameters=function(){return[]};var i=function(){function e(e){var t=this;this.dataService=e,this.frequencyData=this.dataService.baseFrequency;var n={};["none","minute","hour","day","week","month","year"].forEach(function(e,a){n[e]=t.frequencyData[a].value}),this.baseFrequency=n}return e.prototype.getDefaultFrequency=function(){return{baseFrequency:this.frequencyData[0].value,minutes:[],hours:[],daysOfMonth:[],daysOfWeek:[],months:[]}},e.prototype.getDefaultFrequenceWithDefault=function(){var e=this.getDefaultFrequency();return e.daysOfWeek=this.getDaysOfWeek()[0]?[this.getDaysOfWeek()[0].value]:[],e.daysOfMonth=this.dataService.daysOfMonth[0]?[this.dataService.daysOfMonth[0].value]:[],e.months=this.dataService.months[0]?[this.dataService.months[0].value]:[],e.hours=this.dataService.hours[0]?[this.dataService.hours[0].value]:[],e.minutes=this.dataService.minutes[0]?[this.dataService.minutes[0].value]:[],e},e.prototype.getDaysOfWeek=function(){return this.dataService.getDaysOfWeek(!1)},e.prototype.fromCronWithDefault=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequenceWithDefault();return this.fromCronInternal(t,n)},e.prototype.fromCron=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequency();return this.fromCronInternal(t,n)},e.prototype.fromCronInternal=function(e,t){return 5!==e.length?t:("*"===e[0]&&"*"===e[1]&&"*"===e[2]&&"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.minute:"*"===e[1]&&"*"===e[2]&&"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.hour:"*"===e[2]&&"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.day:"*"===e[2]&&"*"===e[3]?t.baseFrequency=this.baseFrequency.week:"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.month:"*"===e[4]&&(t.baseFrequency=this.baseFrequency.year),"*"!==e[0]&&(t.minutes=this.getValueArray(e[0])),"*"!==e[1]&&(t.hours=this.getValueArray(e[1])),"*"!==e[2]&&(t.daysOfMonth=this.getValueArray(e[2])),"*"!==e[3]&&(t.months=this.getValueArray(e[3])),"*"!==e[4]&&(t.daysOfWeek=this.getValueArray(e[4])),t)},e.prototype.setCron=function(e){var t=["*","*","*","*","*"];return e&&e.baseFrequency?(e.baseFrequency>=this.baseFrequency.hour&&(t[0]=e.minutes.length>0?e.minutes.join(","):"*"),e.baseFrequency>=this.baseFrequency.day&&(t[1]=e.hours.length>0?e.hours.join(","):"*"),e.baseFrequency===this.baseFrequency.week&&(t[4]=e.daysOfWeek.length>0?e.daysOfWeek.join(","):"*"),e.baseFrequency>=this.baseFrequency.month&&(t[2]=e.daysOfMonth.length>0?e.daysOfMonth.join(","):"*"),e.baseFrequency===this.baseFrequency.year&&(t[3]=e.months.length>0?e.months.join(","):"*"),t.join(" ")):""},e.prototype.getValueArray=function(e){return e?e.split(",").map(function(e){return+e}):[]},e}();i.decorators=[{type:t.Injectable}],i.ctorParameters=function(){return[{type:l}]};var o=function(e){function t(t){var n=e.call(this,t)||this;return n.dataService=t,n}return r(t,e),t.prototype.getDaysOfWeek=function(){return this.dataService.getDaysOfWeek(!0)},t.prototype.fromCronWithDefault=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequenceWithDefault();return this.fromCronQuartzInternal(t,n)},t.prototype.fromCron=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequency();return this.fromCronQuartzInternal(t,n)},t.prototype.fromCronQuartzInternal=function(e,t){return 6!==e.length&&7!==e.length?t:("*"===e[1]&&"*"===e[2]&&"*"===e[3]&&"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.minute:"*"===e[2]&&"*"===e[3]&&"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.hour:"*"===e[3]&&"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.day:"?"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.week:"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.month:"?"===e[5]&&(t.baseFrequency=this.baseFrequency.year),"*"!==e[1]&&(t.minutes=this.getValueArray(e[1])),"*"!==e[2]&&(t.hours=this.getValueArray(e[2])),"*"!==e[3]&&"?"!==e[3]&&(t.daysOfMonth=this.getValueArray(e[3])),"*"!==e[4]&&(t.months=this.getValueArray(e[4])),"*"!==e[5]&&"?"!==e[5]&&(t.daysOfWeek=this.getValueArray(e[5])),t)},t.prototype.setCron=function(e){var t=["0","*","*","*","*","?"];return e&&e.baseFrequency?(e.baseFrequency>=this.baseFrequency.hour&&(t[1]=e.minutes.length>0?e.minutes.join(","):"*"),e.baseFrequency>=this.baseFrequency.day&&(t[2]=e.hours.length>0?e.hours.join(","):"*"),e.baseFrequency===this.baseFrequency.week&&(t[3]="?",t[5]=e.daysOfWeek.length>0?e.daysOfWeek.join(","):"*"),e.baseFrequency>=this.baseFrequency.month&&(t[3]=e.daysOfMonth.length>0?e.daysOfMonth.join(","):"*"),e.baseFrequency===this.baseFrequency.year&&(t[4]=e.months.length>0?e.months.join(","):"*"),t.join(" ")):""},t}(i);o.decorators=[{type:t.Injectable}],o.ctorParameters=function(){return[{type:l}]};var u=function(){function e(e,t,n){this.dataService=e,this.injector=t,this.formBuilder=n,this.isValid=!0,this.isDisabled=!1,this.daysOfWeekData=[],this.daysOfMonthData=[],this.monthsData=[],this.hoursData=[],this.minutesData=[],this.isPatching=!1,this.unSubscribe=new s.Subject,this.cronJobsForm=this.formBuilder.group({baseFrequency:0,daysOfWeek:"",daysOfMonth:"",months:"",hours:"",minutes:""}),this.config=this.dataService.getConfig(),this.validate=this.dataService.getValidate(),this.setService()}return e.prototype.ngOnInit=function(){var e=this;this.baseFrequency$=this.cronJobsForm.get("baseFrequency").valueChanges.takeUntil(this.unSubscribe).map(function(e){return+e}).publishReplay(1).refCount(),this.cronJobsForm.valueChanges.takeUntil(this.unSubscribe).filter(function(){return!e.isPatching}).map(function(e){return e.baseFrequency=+e.baseFrequency,e}).subscribe(function(t){t.baseFrequency||(t=e.cronService.getDefaultFrequenceWithDefault(),e.cronJobsForm.patchValue(t,{emitEvent:!1})),e.onChange(e.cronService.setCron(t))}),this.baseFrequencyData=this.dataService.baseFrequency,this.daysOfMonthData=this.dataService.daysOfMonth,this.daysOfWeekData=this.dataService.getDaysOfWeek(!1),this.monthsData=this.dataService.months,this.hoursData=this.dataService.hours,this.minutesData=this.dataService.minutes,this.isPatching=!0,setTimeout(function(){e.cronJobsForm.patchValue(e.cronService.getDefaultFrequenceWithDefault()),e.isPatching=!1})},e.prototype.onBlur=function(){this.onTouched()},e.prototype.ngOnChanges=function(e){var t=this;e.config&&(this.config=this.dataService.getConfig(e.config.currentValue),setTimeout(function(){e.config.previousValue&&e.config.previousValue.quartz===e.config.currentValue.quartz||(t.daysOfWeekData=t.dataService.getDaysOfWeek(t.config.quartz),t.cronJobsForm.patchValue({daysOfWeek:t.daysOfWeekData[0].value}))}),this.setService()),e.validate&&(this.validate=this.dataService.getValidate(e.validate.currentValue))},e.prototype.setService=function(){this.config.quartz?this.cronService=this.injector.get(o):this.cronService=this.injector.get(i)},e.prototype.writeValue=function(e){var t=this;this.isPatching=!0;var n;n=e?this.cronService.fromCronWithDefault(e):this.cronService.getDefaultFrequenceWithDefault(),setTimeout(function(){t.cronJobsForm.patchValue(n),t.isPatching=!1})},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.isDisabled=e,this.isDisabled?this.cronJobsForm.disable():this.cronJobsForm.enable()},e.prototype.getIsValid=function(){return!!this.validate.validate&&this.getValid()},e.prototype.getIsInvalid=function(){return!!this.validate.validate&&!this.getValid()},e.prototype.getValid=function(){return this.formControl?this.formControl.valid:this.isValid},e.prototype.ngOnDestroy=function(){this.unSubscribe.next(),this.unSubscribe.complete()},e}();u.decorators=[{type:t.Component,args:[{selector:"cron-jobs",template:'\n <div class="form-inline" *ngIf="config?.bootstrap" [formGroup]="cronJobsForm">\n <label class="mr-sm-2" for="selectBase">Every: </label>\n <select class="form-control" id="selectBase" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="baseFrequency">\n <option *ngFor="let item of baseFrequencyData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) === 4">on</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) === 4" formControlName="daysOfWeek">\n <option *ngFor="let item of daysOfWeekData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) >= 5">on the</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) >= 5" formControlName="daysOfMonth">\n <option *ngFor="let item of daysOfMonthData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) === 6">of</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) === 6" formControlName="months">\n <option *ngFor="let item of monthsData" [ngValue]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) >= 2">at</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) >= 3" formControlName="hours">\n <option *ngFor="let item of hoursData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) >= 3 ">:</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) >=2" formControlName="minutes">\n <option *ngFor="let item of minutesData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) === 2">past the hour</label>\n </div>\n <div class="cron-wrap" *ngIf="!config?.bootstrap" [formGroup]="cronJobsForm">\n <span>Every: </span>\n <div class="cron-select-wrap">\n <select class="cron-select" formControlName="baseFrequency" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}">\n <option *ngFor="let item of baseFrequencyData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <div class="select-options">\n <span *ngIf="(baseFrequency$ | async) === 4">on </span>\n <div *ngIf="(baseFrequency$ | async) === 4" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select day-of-week-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="daysOfWeek">\n <option *ngFor="let item of daysOfWeekData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) >= 5">on the </span>\n <div *ngIf="(baseFrequency$ | async) >= 5" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select day-of-month-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="daysOfMonth">\n <option *ngFor="let item of daysOfMonthData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) === 6">of </span>\n <div *ngIf="(baseFrequency$ | async) === 6" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select month-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="months">\n <option *ngFor="let item of monthsData" [ngValue]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) >= 3 ">at </span>\n <div *ngIf="(baseFrequency$ | async) >= 3" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select hour-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="hours">\n <option *ngFor="let item of hoursData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) >= 3"> : </span>\n <div *ngIf="(baseFrequency$ | async) >=2" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select minute-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="minutes">\n <option *ngFor="let item of minutesData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) === 2"> past the hour</span>\n </div>\n </div>\n ',styles:["\n :host {\n display: block;\n }\n\n .cron-select-wrap {\n display: inline-block;\n }\n\n .cron-select-wrap .cron-select {\n width: 150px;\n height: 34px;\n padding: 6px 12px;\n margin: 0;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background: #fff none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n -webkit-transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n }\n\n .cron-select-wrap select[multiple] {\n height: 140px;\n }\n\n .select-options {\n display: inline-block;\n }\n "],providers:[i,o,l,{provide:a.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return u}),multi:!0}]}]}],u.ctorParameters=function(){return[{type:l},{type:t.Injector},{type:a.FormBuilder}]},u.propDecorators={config:[{type:t.Input}],validate:[{type:t.Input}],isValid:[{type:t.Input}],formControl:[{type:t.Input}]};var c=function(){return function(){}}();c.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,a.FormsModule,a.ReactiveFormsModule],declarations:[u],exports:[u],providers:[l,i,o]}]}],c.ctorParameters=function(){return[]},e.CronJobsModule=c,e.ɵa=u,e.ɵc=l,e.ɵb=i,e.ɵd=o,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs/Subject"),require("rxjs/add/operator/takeUntil"),require("rxjs/add/operator/map"),require("rxjs/add/operator/publishReplay"),require("rxjs/add/operator/filter"),require("rxjs/add/operator/do")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common","@angular/forms","rxjs/Subject","rxjs/add/operator/takeUntil","rxjs/add/operator/map","rxjs/add/operator/publishReplay","rxjs/add/operator/filter","rxjs/add/operator/do"],t):t(e["ngx-cron-jobs"]={},e.ng.core,e.ng.common,e.ng.forms,e.Rx)}(this,function(e,t,n,a,r){"use strict";var s=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function a(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(a.prototype=n.prototype,new a)}}(),l={};l.minute=0,l.hour=1,l.day=2,l.week=3,l.month=4,l.year=5,l[l.minute]="minute",l[l.hour]="hour",l[l.day]="day",l[l.week]="week",l[l.month]="month",l[l.year]="year";var i=function(){function e(){this.defaultConfig={quartz:!1,bootstrap:!0,multiple:!1},this.defaultValidateConfig={validate:!1},this.daysOfWeekPosix=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],this.daysOfWeekQuartz=[{value:1,label:"Sunday"},{value:2,label:"Monday"},{value:3,label:"Tuesday"},{value:4,label:"Wednesday"},{value:5,label:"Thursday"},{value:6,label:"Friday"},{value:7,label:"Saturday"}],this.numeral=[{value:1,label:"1st"},{value:2,label:"2nd"},{value:3,label:"3rd"},{value:4,label:"4th"},{value:5,label:"5th"},{value:6,label:"6th"},{value:7,label:"7th"},{value:8,label:"8th"},{value:9,label:"9th"},{value:10,label:"10th"},{value:11,label:"11th"},{value:12,label:"12th"},{value:13,label:"13th"},{value:14,label:"14th"},{value:15,label:"15th"},{value:16,label:"16th"},{value:17,label:"17th"},{value:18,label:"18th"},{value:19,label:"19th"},{value:20,label:"20th"},{value:21,label:"21st"},{value:22,label:"22nd"},{value:23,label:"23rd"},{value:24,label:"24th"},{value:25,label:"25th"},{value:26,label:"26th"},{value:27,label:"27th"},{value:28,label:"28th"},{value:29,label:"29th"},{value:30,label:"30th"},{value:31,label:"31st"}],this._months=[{value:1,label:"January"},{value:2,label:"February"},{value:3,label:"March"},{value:4,label:"April"},{value:5,label:"May"},{value:6,label:"June"},{value:7,label:"July"},{value:8,label:"August"},{value:9,label:"September"},{value:10,label:"October"},{value:11,label:"November"},{value:12,label:"December"}],this._baseFrequency=[{value:0,label:"Please select"},{value:1,type:l.minute,label:"Minute"},{value:2,type:l.hour,label:"Hour"},{value:3,type:l.day,label:"Day"},{value:4,type:l.week,label:"Week"},{value:5,type:l.month,label:"Month"},{value:6,type:l.year,label:"Year"}],this._hours=[];for(e=0;e<24;e++)this._hours.push({value:e,label:""+e});this._minutes=[];for(var e=0;e<60;e+=5)this._minutes.push({value:e,label:""+e})}return Object.defineProperty(e.prototype,"baseFrequency",{get:function(){return this._baseFrequency.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"daysOfMonth",{get:function(){return this.numeral.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"months",{get:function(){return this._months.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hours",{get:function(){return this._hours.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minutes",{get:function(){return this._minutes.slice()},enumerable:!0,configurable:!0}),e.prototype.getConfig=function(e){return void 0===e&&(e={}),Object.assign({},this.defaultConfig,e)},e.prototype.getValidate=function(e){return void 0===e&&(e={}),Object.assign({},this.defaultValidateConfig,e)},e.prototype.getDaysOfWeek=function(e){return void 0===e&&(e=!1),e?this.daysOfWeekQuartz.slice():this.daysOfWeekPosix.slice()},e}();i.decorators=[{type:t.Injectable}],i.ctorParameters=function(){return[]};var o=function(){function e(e){var t=this;this.dataService=e,this.frequencyData=this.dataService.baseFrequency;var n={};["none","minute","hour","day","week","month","year"].forEach(function(e,a){n[e]=t.frequencyData[a].value}),this.baseFrequency=n}return e.prototype.getDefaultFrequency=function(){return{baseFrequency:this.frequencyData[0].value,minutes:[],hours:[],daysOfMonth:[],daysOfWeek:[],months:[]}},e.prototype.getDefaultFrequenceWithDefault=function(){var e=this.getDefaultFrequency();return e.daysOfWeek=this.getDaysOfWeek()[0]?[this.getDaysOfWeek()[0].value]:[],e.daysOfMonth=this.dataService.daysOfMonth[0]?[this.dataService.daysOfMonth[0].value]:[],e.months=this.dataService.months[0]?[this.dataService.months[0].value]:[],e.hours=this.dataService.hours[0]?[this.dataService.hours[0].value]:[],e.minutes=this.dataService.minutes[0]?[this.dataService.minutes[0].value]:[],e},e.prototype.getDaysOfWeek=function(){return this.dataService.getDaysOfWeek(!1)},e.prototype.fromCronWithDefault=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequenceWithDefault();return this.fromCronInternal(t,n)},e.prototype.fromCron=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequency();return this.fromCronInternal(t,n)},e.prototype.fromCronInternal=function(e,t){return 5!==e.length?t:("*"===e[0]&&"*"===e[1]&&"*"===e[2]&&"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.minute:"*"===e[1]&&"*"===e[2]&&"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.hour:"*"===e[2]&&"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.day:"*"===e[2]&&"*"===e[3]?t.baseFrequency=this.baseFrequency.week:"*"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.month:"*"===e[4]&&(t.baseFrequency=this.baseFrequency.year),"*"!==e[0]&&(t.minutes=this.getValueArray(e[0])),"*"!==e[1]&&(t.hours=this.getValueArray(e[1])),"*"!==e[2]&&(t.daysOfMonth=this.getValueArray(e[2])),"*"!==e[3]&&(t.months=this.getValueArray(e[3])),"*"!==e[4]&&(t.daysOfWeek=this.getValueArray(e[4])),t)},e.prototype.setCron=function(e){var t=["*","*","*","*","*"];return e&&e.baseFrequency?(e.baseFrequency>=this.baseFrequency.hour&&(t[0]=e.minutes.length>0?e.minutes.join(","):"*"),e.baseFrequency>=this.baseFrequency.day&&(t[1]=e.hours.length>0?e.hours.join(","):"*"),e.baseFrequency===this.baseFrequency.week&&(t[4]=e.daysOfWeek.length>0?e.daysOfWeek.join(","):"*"),e.baseFrequency>=this.baseFrequency.month&&(t[2]=e.daysOfMonth.length>0?e.daysOfMonth.join(","):"*"),e.baseFrequency===this.baseFrequency.year&&(t[3]=e.months.length>0?e.months.join(","):"*"),t.join(" ")):""},e.prototype.getValueArray=function(e){return e?e.split(",").map(function(e){return+e}):[]},e}();o.decorators=[{type:t.Injectable}],o.ctorParameters=function(){return[{type:i}]};var u=function(e){function t(t){var n=e.call(this,t)||this;return n.dataService=t,n}return s(t,e),t.prototype.getDaysOfWeek=function(){return this.dataService.getDaysOfWeek(!0)},t.prototype.fromCronWithDefault=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequenceWithDefault();return this.fromCronQuartzInternal(t,n)},t.prototype.fromCron=function(e){var t=e.trim().replace(/\s+/g," ").split(" "),n=this.getDefaultFrequency();return this.fromCronQuartzInternal(t,n)},t.prototype.fromCronQuartzInternal=function(e,t){return 6!==e.length&&7!==e.length?t:("*"===e[1]&&"*"===e[2]&&"*"===e[3]&&"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.minute:"*"===e[2]&&"*"===e[3]&&"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.hour:"*"===e[3]&&"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.day:"?"===e[3]&&"*"===e[4]?t.baseFrequency=this.baseFrequency.week:"*"===e[4]&&"?"===e[5]?t.baseFrequency=this.baseFrequency.month:"?"===e[5]&&(t.baseFrequency=this.baseFrequency.year),"*"!==e[1]&&(t.minutes=this.getValueArray(e[1])),"*"!==e[2]&&(t.hours=this.getValueArray(e[2])),"*"!==e[3]&&"?"!==e[3]&&(t.daysOfMonth=this.getValueArray(e[3])),"*"!==e[4]&&(t.months=this.getValueArray(e[4])),"*"!==e[5]&&"?"!==e[5]&&(t.daysOfWeek=this.getValueArray(e[5])),t)},t.prototype.setCron=function(e){var t=["0","*","*","*","*","?"];return e&&e.baseFrequency?(e.baseFrequency>=this.baseFrequency.hour&&(t[1]=e.minutes.length>0?e.minutes.join(","):"*"),e.baseFrequency>=this.baseFrequency.day&&(t[2]=e.hours.length>0?e.hours.join(","):"*"),e.baseFrequency===this.baseFrequency.week&&(t[3]="?",t[5]=e.daysOfWeek.length>0?e.daysOfWeek.join(","):"*"),e.baseFrequency>=this.baseFrequency.month&&(t[3]=e.daysOfMonth.length>0?e.daysOfMonth.join(","):"*"),e.baseFrequency===this.baseFrequency.year&&(t[4]=e.months.length>0?e.months.join(","):"*"),t.join(" ")):""},t}(o);u.decorators=[{type:t.Injectable}],u.ctorParameters=function(){return[{type:i}]};var c=function(){function e(e,t,n){this.dataService=e,this.injector=t,this.formBuilder=n,this.isValid=!0,this.isDisabled=!1,this.daysOfWeekData=[],this.daysOfMonthData=[],this.monthsData=[],this.hoursData=[],this.minutesData=[],this.isPatching=!1,this.unSubscribe=new r.Subject,this.cronJobsForm=this.formBuilder.group({baseFrequency:0,daysOfWeek:"",daysOfMonth:"",months:"",hours:"",minutes:""}),this.config=this.dataService.getConfig(),this.validate=this.dataService.getValidate(),this.setService()}return e.prototype.ngOnInit=function(){var e=this;this.baseFrequency$=this.cronJobsForm.get("baseFrequency").valueChanges.takeUntil(this.unSubscribe).map(function(e){return+e}).publishReplay(1).refCount(),this.cronJobsForm.valueChanges.takeUntil(this.unSubscribe).filter(function(){return!e.isPatching}).map(function(e){return e.baseFrequency=+e.baseFrequency,e}).subscribe(function(t){t.baseFrequency||(t=e.cronService.getDefaultFrequenceWithDefault(),e.cronJobsForm.patchValue(t,{emitEvent:!1})),e.onChange(e.cronService.setCron(t))});var t=this.dataService.baseFrequency;this.config.option&&(t=t.filter(function(t){return!(e.config.option.hasOwnProperty(l[t.type])&&!e.config.option[l[t.type]])})),this.baseFrequencyData=t,this.daysOfMonthData=this.dataService.daysOfMonth,this.daysOfWeekData=this.dataService.getDaysOfWeek(!1),this.monthsData=this.dataService.months,this.hoursData=this.dataService.hours,this.minutesData=this.dataService.minutes,this.isPatching=!0,setTimeout(function(){e.cronJobsForm.patchValue(e.cronService.getDefaultFrequenceWithDefault()),e.isPatching=!1})},e.prototype.onBlur=function(){this.onTouched()},e.prototype.ngOnChanges=function(e){var t=this;e.config&&(this.config=this.dataService.getConfig(e.config.currentValue),setTimeout(function(){e.config.previousValue&&e.config.previousValue.quartz===e.config.currentValue.quartz||(t.daysOfWeekData=t.dataService.getDaysOfWeek(t.config.quartz),t.cronJobsForm.patchValue({daysOfWeek:t.daysOfWeekData[0].value}))}),this.setService()),e.validate&&(this.validate=this.dataService.getValidate(e.validate.currentValue))},e.prototype.setService=function(){this.config.quartz?this.cronService=this.injector.get(u):this.cronService=this.injector.get(o)},e.prototype.writeValue=function(e){var t=this;this.isPatching=!0;var n;n=e?this.cronService.fromCronWithDefault(e):this.cronService.getDefaultFrequenceWithDefault(),setTimeout(function(){t.cronJobsForm.patchValue(n),t.isPatching=!1})},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.isDisabled=e,this.isDisabled?this.cronJobsForm.disable():this.cronJobsForm.enable()},e.prototype.getIsValid=function(){return!!this.validate.validate&&this.getValid()},e.prototype.getIsInvalid=function(){return!!this.validate.validate&&!this.getValid()},e.prototype.getValid=function(){return this.formControl?this.formControl.valid:this.isValid},e.prototype.ngOnDestroy=function(){this.unSubscribe.next(),this.unSubscribe.complete()},e}();c.decorators=[{type:t.Component,args:[{selector:"cron-jobs",template:'\n <div class="form-inline" *ngIf="config?.bootstrap" [formGroup]="cronJobsForm">\n <label class="mr-sm-2" for="selectBase">Every: </label>\n <select class="form-control" id="selectBase" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="baseFrequency">\n <option *ngFor="let item of baseFrequencyData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) === 4">on</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) === 4" formControlName="daysOfWeek">\n <option *ngFor="let item of daysOfWeekData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) >= 5">on the</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) >= 5" formControlName="daysOfMonth">\n <option *ngFor="let item of daysOfMonthData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) === 6">of</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) === 6" formControlName="months">\n <option *ngFor="let item of monthsData" [ngValue]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) >= 2">at</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) >= 3" formControlName="hours">\n <option *ngFor="let item of hoursData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) >= 3 ">:</label>\n <select multiple [multiple]="config.multiple" class="form-control" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n *ngIf="(baseFrequency$ | async) >=2" formControlName="minutes">\n <option *ngFor="let item of minutesData" [value]="item.value">{{item.label}}</option>\n </select>\n <label class="mx-sm-2" *ngIf="(baseFrequency$ | async) === 2">past the hour</label>\n </div>\n <div class="cron-wrap" *ngIf="!config?.bootstrap" [formGroup]="cronJobsForm">\n <span>Every: </span>\n <div class="cron-select-wrap">\n <select class="cron-select" formControlName="baseFrequency" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}">\n <option *ngFor="let item of baseFrequencyData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <div class="select-options">\n <span *ngIf="(baseFrequency$ | async) === 4">on </span>\n <div *ngIf="(baseFrequency$ | async) === 4" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select day-of-week-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="daysOfWeek">\n <option *ngFor="let item of daysOfWeekData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) >= 5">on the </span>\n <div *ngIf="(baseFrequency$ | async) >= 5" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select day-of-month-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="daysOfMonth">\n <option *ngFor="let item of daysOfMonthData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) === 6">of </span>\n <div *ngIf="(baseFrequency$ | async) === 6" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select month-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="months">\n <option *ngFor="let item of monthsData" [ngValue]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) >= 3 ">at </span>\n <div *ngIf="(baseFrequency$ | async) >= 3" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select hour-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="hours">\n <option *ngFor="let item of hoursData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) >= 3"> : </span>\n <div *ngIf="(baseFrequency$ | async) >=2" class="cron-select-wrap">\n <select multiple [multiple]="config.multiple" class="cron-select minute-value" (blur)="onBlur()"\n [ngClass]="{\'is-valid\': getIsValid(), \'is-invalid\': getIsInvalid()}"\n formControlName="minutes">\n <option *ngFor="let item of minutesData" [value]="item.value">{{item.label}}</option>\n </select>\n </div>\n <span *ngIf="(baseFrequency$ | async) === 2"> past the hour</span>\n </div>\n </div>\n ',styles:["\n :host {\n display: block;\n }\n\n .cron-select-wrap {\n display: inline-block;\n }\n\n .cron-select-wrap .cron-select {\n width: 150px;\n height: 34px;\n padding: 6px 12px;\n margin: 0;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555;\n background: #fff none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n -webkit-transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;\n }\n\n .cron-select-wrap select[multiple] {\n height: 140px;\n }\n\n .select-options {\n display: inline-block;\n }\n "],providers:[o,u,i,{provide:a.NG_VALUE_ACCESSOR,useExisting:t.forwardRef(function(){return c}),multi:!0}]}]}],c.ctorParameters=function(){return[{type:i},{type:t.Injector},{type:a.FormBuilder}]},c.propDecorators={config:[{type:t.Input}],validate:[{type:t.Input}],isValid:[{type:t.Input}],formControl:[{type:t.Input}]};var h=function(){return function(){}}();h.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,a.FormsModule,a.ReactiveFormsModule],declarations:[c],exports:[c],providers:[i,o,u]}]}],h.ctorParameters=function(){return[]},e.CronJobsModule=h,e.ɵa=c,e.ɵc=i,e.ɵb=o,e.ɵd=u,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ngx-cron-jobs.umd.min.js.map

@@ -20,2 +20,15 @@ var __extends = (this && this.__extends) || (function () {

import 'rxjs/add/operator/do';
var OptionType = {};
OptionType.minute = 0;
OptionType.hour = 1;
OptionType.day = 2;
OptionType.week = 3;
OptionType.month = 4;
OptionType.year = 5;
OptionType[OptionType.minute] = "minute";
OptionType[OptionType.hour] = "hour";
OptionType[OptionType.day] = "day";
OptionType[OptionType.week] = "week";
OptionType[OptionType.month] = "month";
OptionType[OptionType.year] = "year";
var DataService = (function () {

@@ -98,8 +111,8 @@ function DataService() {

{ value: 0, label: 'Please select' },
{ value: 1, label: 'Minute' },
{ value: 2, label: 'Hour' },
{ value: 3, label: 'Day' },
{ value: 4, label: 'Week' },
{ value: 5, label: 'Month' },
{ value: 6, label: 'Year' }
{ value: 1, type: OptionType.minute, label: 'Minute' },
{ value: 2, type: OptionType.hour, label: 'Hour' },
{ value: 3, type: OptionType.day, label: 'Day' },
{ value: 4, type: OptionType.week, label: 'Week' },
{ value: 5, type: OptionType.month, label: 'Month' },
{ value: 6, type: OptionType.year, label: 'Year' }
];

@@ -544,3 +557,8 @@ this._hours = [];

});
this.baseFrequencyData = this.dataService.baseFrequency;
var /** @type {?} */ baseFreq = this.dataService.baseFrequency;
if (this.config.option) {
baseFreq = baseFreq.filter(function (x) { return !(_this.config.option.hasOwnProperty(OptionType[x.type])
&& !_this.config.option[OptionType[x.type]]); });
}
this.baseFrequencyData = baseFreq;
this.daysOfMonthData = this.dataService.daysOfMonth;

@@ -547,0 +565,0 @@ this.daysOfWeekData = this.dataService.getDaysOfWeek(false);

@@ -11,2 +11,16 @@ import { Component, Injectable, Injector, Input, NgModule, forwardRef } from '@angular/core';

let OptionType = {};
OptionType.minute = 0;
OptionType.hour = 1;
OptionType.day = 2;
OptionType.week = 3;
OptionType.month = 4;
OptionType.year = 5;
OptionType[OptionType.minute] = "minute";
OptionType[OptionType.hour] = "hour";
OptionType[OptionType.day] = "day";
OptionType[OptionType.week] = "week";
OptionType[OptionType.month] = "month";
OptionType[OptionType.year] = "year";
class DataService {

@@ -89,8 +103,8 @@ constructor() {

{ value: 0, label: 'Please select' },
{ value: 1, label: 'Minute' },
{ value: 2, label: 'Hour' },
{ value: 3, label: 'Day' },
{ value: 4, label: 'Week' },
{ value: 5, label: 'Month' },
{ value: 6, label: 'Year' }
{ value: 1, type: OptionType.minute, label: 'Minute' },
{ value: 2, type: OptionType.hour, label: 'Hour' },
{ value: 3, type: OptionType.day, label: 'Day' },
{ value: 4, type: OptionType.week, label: 'Week' },
{ value: 5, type: OptionType.month, label: 'Month' },
{ value: 6, type: OptionType.year, label: 'Year' }
];

@@ -522,3 +536,8 @@ this._hours = [];

});
this.baseFrequencyData = this.dataService.baseFrequency;
let /** @type {?} */ baseFreq = this.dataService.baseFrequency;
if (this.config.option) {
baseFreq = baseFreq.filter(x => !(this.config.option.hasOwnProperty(OptionType[x.type])
&& !this.config.option[OptionType[x.type]]));
}
this.baseFrequencyData = baseFreq;
this.daysOfMonthData = this.dataService.daysOfMonth;

@@ -525,0 +544,0 @@ this.daysOfWeekData = this.dataService.getDaysOfWeek(false);

@@ -1,1 +0,1 @@

{"name":"ngx-cron-jobs","version":"0.4.6","license":"MIT","scripts":{"ng":"ng","start":"ng serve","start:no-sm":"ng serve --sourcemaps=false","build:docs":"ng build --prod -op ./docs --base-href /ngx-cron-jobs/","build:prod":"ng build --prod ","test":"ng test --sourcemaps=false","lint":"ng lint","e2e":"ng e2e","build:lib":"ng-packagr -p ng-package.json"},"repository":{"type":"git","url":"https://github.com/yp2/ngx-cron-jobs"},"bugs":{"url":"https://github.com/yp2/ngx-cron-jobs/issues"},"author":{"name":"Daniel 'yp2' Dereziński","email":"daniel.derezinski@gmail.com"},"contributors":{"name":"Randall Valenciano Fallas","email":"ravf.226@gmail.com"},"keywords":["angular","cron","custom","control"],"private":false,"dependencies":{"@angular/animations":"^5.0.0","@angular/common":"^5.0.0","@angular/compiler":"^5.0.0","@angular/core":"^5.0.0","@angular/forms":"^5.0.0","@angular/http":"^5.0.0","@angular/platform-browser":"^5.0.0","@angular/platform-browser-dynamic":"^5.0.0","@angular/router":"^5.0.0","bootstrap":"4.0.0-beta.2","core-js":"^2.4.1","rxjs":"^5.5.2","zone.js":"^0.8.14"},"devDependencies":{"@angular/cli":"1.5.0","@angular/compiler-cli":"^5.0.0","@angular/language-service":"^5.0.0","@types/jasmine":"~2.5.53","@types/jasminewd2":"~2.0.2","@types/node":"~6.0.60","bootstrap":"4.0.0-beta.2","codelyzer":"~3.2.0","jasmine-core":"~2.6.2","jasmine-marbles":"^0.2.0","jasmine-spec-reporter":"~4.1.0","karma":"~1.7.0","karma-chrome-launcher":"~2.1.1","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^1.2.1","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","ng-packagr":"^1.6.0","protractor":"~5.1.2","rxjs-marbles":"^2.1.0","ts-node":"~3.2.0","tslint":"~5.7.0","typescript":"~2.4.2"},"main":"bundles/ngx-cron-jobs.umd.js","module":"ngx-cron-jobs.es5.js","es2015":"ngx-cron-jobs.js","typings":"ngx-cron-jobs.d.ts","metadata":"ngx-cron-jobs.metadata.json"}
{"name":"ngx-cron-jobs","version":"0.4.7","license":"MIT","scripts":{"ng":"ng","start":"ng serve","start:no-sm":"ng serve --sourcemaps=false","build:docs":"ng build --prod -op ./docs --base-href /ngx-cron-jobs/","build:prod":"ng build --prod ","test":"ng test --sourcemaps=false","lint":"ng lint","e2e":"ng e2e","build:lib":"ng-packagr -p ng-package.json"},"repository":{"type":"git","url":"https://github.com/yp2/ngx-cron-jobs"},"bugs":{"url":"https://github.com/yp2/ngx-cron-jobs/issues"},"author":{"name":"Daniel 'yp2' Dereziński","email":"daniel.derezinski@gmail.com"},"contributors":{"name":"Randall Valenciano Fallas","email":"ravf.226@gmail.com"},"keywords":["angular","cron","custom","control"],"private":false,"dependencies":{"@angular/animations":"^5.0.0","@angular/common":"^5.0.0","@angular/compiler":"^5.0.0","@angular/core":"^5.0.0","@angular/forms":"^5.0.0","@angular/http":"^5.0.0","@angular/platform-browser":"^5.0.0","@angular/platform-browser-dynamic":"^5.0.0","@angular/router":"^5.0.0","bootstrap":"4.0.0-beta.2","core-js":"^2.4.1","rxjs":"^5.5.2","zone.js":"^0.8.14"},"devDependencies":{"@angular/cli":"1.5.0","@angular/compiler-cli":"^5.0.0","@angular/language-service":"^5.0.0","@types/jasmine":"~2.5.53","@types/jasminewd2":"~2.0.2","@types/node":"~6.0.60","bootstrap":"4.0.0-beta.2","codelyzer":"~3.2.0","jasmine-core":"~2.6.2","jasmine-marbles":"^0.2.0","jasmine-spec-reporter":"~4.1.0","karma":"~1.7.0","karma-chrome-launcher":"~2.1.1","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^1.2.1","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","ng-packagr":"^1.6.0","protractor":"~5.1.2","rxjs-marbles":"^2.1.0","ts-node":"~3.2.0","tslint":"~5.7.0","typescript":"~2.4.2"},"main":"bundles/ngx-cron-jobs.umd.js","module":"ngx-cron-jobs.es5.js","es2015":"ngx-cron-jobs.js","typings":"ngx-cron-jobs.d.ts","metadata":"ngx-cron-jobs.metadata.json"}

@@ -57,3 +57,14 @@ [![Build Status](https://travis-ci.org/rvalenciano/ngx-cron-jobs.svg?branch=master)](https://travis-ci.org/rvalenciano/ngx-cron-jobs) [![Maintainability](https://api.codeclimate.com/v1/badges/dc6b973320992074a560/maintainability)](https://codeclimate.com/github/rvalenciano/ngx-cron-jobs/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/dc6b973320992074a560/test_coverage)](https://codeclimate.com/github/rvalenciano/ngx-cron-jobs/test_coverage)

This is an object in your controller you can use to remove options from the user. For example if you would like the user to be able to set Minute, Hour, and Day but not Week, Month, and Year you would create the following object in your controller:
```json
{
quartz: true,
multiple: false,
options : {
minute : false
}
}
```
## Development

@@ -60,0 +71,0 @@

@@ -14,2 +14,3 @@ export interface CronJobsBaseFrequency {

bootstrap?: boolean;
option?: {};
}

@@ -26,6 +27,15 @@ export interface CronJobsFrequency {

value: number;
type?: OptionType;
label: string | number;
}
export declare enum OptionType {
minute = 0,
hour = 1,
day = 2,
week = 3,
month = 4,
year = 5,
}
export interface CronJobsValidationConfig {
validate?: boolean;
}

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 not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc