@taldor-ltd/tld-angular-fnd
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -258,2 +258,38 @@ (function (global, factory) { | ||
var EmailValidator = /** @class */ (function () { | ||
/** פונקציונליות שבודקת האם התעודת זהות שהוזנה תקינה */ | ||
function EmailValidator() { | ||
} | ||
EmailValidator_1 = EmailValidator; | ||
EmailValidator.prototype.validate = function (c) { | ||
var value = c.value; | ||
if (value !== undefined && value !== null && value.length > 0) { | ||
var valid = true; | ||
var regexp = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/); | ||
valid = regexp.test(value); | ||
if (!valid) { | ||
return { | ||
email: true | ||
}; | ||
} | ||
return null; | ||
} | ||
}; | ||
var EmailValidator_1; | ||
EmailValidator = EmailValidator_1 = __decorate([ | ||
core.Directive({ | ||
selector: '[tldEmail]', | ||
providers: [ | ||
{ | ||
provide: forms.NG_VALIDATORS, | ||
useExisting: EmailValidator_1, | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
/** פונקציונליות שבודקת האם התעודת זהות שהוזנה תקינה */ | ||
], EmailValidator); | ||
return EmailValidator; | ||
}()); | ||
var TldNgFormsModule = /** @class */ (function () { | ||
@@ -265,6 +301,8 @@ function TldNgFormsModule() { | ||
declarations: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
exports: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
@@ -279,4 +317,192 @@ imports: [ | ||
// 1. make sure ts.config contains this config under "paths": | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.containsElements = function () { | ||
if (this.length > 0) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
Array.prototype.any = function (predicate) { | ||
if (predicate === void 0) { predicate = null; } | ||
if (predicate === null) { | ||
if (this.length > 0) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
else { | ||
return this.reduce(function (accumulator, currentValue) { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return true; | ||
}, false); | ||
} | ||
}; | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.firstOrDefault = function (predicate) { | ||
return this.reduce(function (accumulator, currentValue) { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return accumulator; | ||
}, null); | ||
}; | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.first = function (predicate) { | ||
var element = this.reduce(function (accumulator, currentValue) { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return accumulator; | ||
}, null); | ||
if (element === null) { | ||
throw new Error('Sequence contains no elements'); | ||
} | ||
return element; | ||
}; | ||
Array.prototype.sum = function (predicate) { | ||
var sum = 0; | ||
sum = this.reduce(function (accumulator, currentValue) { return accumulator + predicate(currentValue); }, 0); | ||
return sum; | ||
}; | ||
Array.prototype.where = function (predicate) { | ||
return this.filter(function (currentValue) { return predicate(currentValue); }); | ||
}; | ||
Array.prototype.min = function (predicate) { | ||
if (!this || this.length === 0) { | ||
return undefined; | ||
} | ||
var minValue; | ||
minValue = this.reduce(function (accumulator, currentValue) { return Math.min(accumulator, predicate(currentValue)); }, null); | ||
return minValue; | ||
}; | ||
Array.prototype.max = function (predicate) { | ||
if (!this || this.length === 0) { | ||
return undefined; | ||
} | ||
var maxValue; | ||
maxValue = this.reduce(function (accumulator, currentValue) { return Math.max(accumulator, predicate(currentValue)); }, null); | ||
return maxValue; | ||
}; | ||
Array.prototype.average = function (predicate) { | ||
var avg = 0; | ||
avg = this.reduce(function (accumulator, currentValue) { return accumulator + predicate(currentValue); }, 0) / this.length; | ||
return avg; | ||
}; | ||
Array.prototype.orderBy = function (predicate) { | ||
return this.sort(function (a, b) { | ||
if (predicate(a) > predicate(b)) { | ||
return 1; | ||
} | ||
if (predicate(a) < predicate(b)) { | ||
return -1; | ||
} | ||
return 0; | ||
}); | ||
}; | ||
Array.prototype.orderByDesc = function (predicate) { | ||
return this.sort(function (a, b) { | ||
if (predicate(a) > predicate(b)) { | ||
return -1; | ||
} | ||
if (predicate(a) < predicate(b)) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
}; | ||
Array.prototype.take = function (top) { | ||
return this.filter(function (u, i) { return i < top; }); | ||
}; | ||
Array.prototype.select = function (predicate) { | ||
return this.map(function (currentValue) { return predicate(currentValue); }); | ||
}; | ||
Array.prototype.count = function (predicate) { | ||
return (this.filter(function (currentValue) { return predicate(currentValue); })).length; | ||
}; | ||
// distinct? | ||
// const uniqueNames = Array.from(new Set(this.map((currentValue: any) => predicate(currentValue)))); | ||
Array.prototype.split = function (predicate) { | ||
return this.reduce(function (_a, element) { | ||
var _b = __read(_a, 2), pass = _b[0], fail = _b[1]; | ||
return predicate(element) | ||
? [__spread(pass, [element]), fail] | ||
: [pass, __spread(fail, [element])]; | ||
}, [[], []]); | ||
}; | ||
Array.prototype.groupBy = function (predicate) { | ||
var group; | ||
return this.reduce(function (groupedList, element) { | ||
group = groupedList.find(function (x) { return x.key === predicate(element); }); | ||
if (!group) { | ||
groupedList.push({ | ||
'key': predicate(element), | ||
'values': [element] | ||
}); | ||
} | ||
else { | ||
group.values.push(element); | ||
} | ||
return groupedList; | ||
}, []); | ||
}; | ||
// Function.prototype.callDelayed = function(previousThis: any, ...args: any) { | ||
// if (typeof this !== 'function') { | ||
// throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
// } | ||
// const boundTargetFunction = this; | ||
// setTimeout(() => { | ||
// boundTargetFunction.call(previousThis, ...args); | ||
// }, 0); | ||
// }; | ||
// Function.prototype.callDelayedTimout = function(previousThis: any, timeout: number, ...args: any) { | ||
// if (typeof this !== 'function') { | ||
// throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
// } | ||
// const boundTargetFunction = this; | ||
// setTimeout(() => { | ||
// boundTargetFunction.call(previousThis, ...args); | ||
// }, timeout); | ||
// }; | ||
Function.prototype['applyDelayed'] = function (previousThis, args) { | ||
if (typeof this !== 'function') { | ||
throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
} | ||
var boundTargetFunction = this; | ||
setTimeout(function () { | ||
boundTargetFunction.apply(previousThis, args); | ||
}, 0); | ||
}; | ||
Function.prototype['applyDelayedTimout'] = function (previousThis, timeout, args) { | ||
if (typeof this !== 'function') { | ||
throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
} | ||
var boundTargetFunction = this; | ||
setTimeout(function () { | ||
boundTargetFunction.apply(previousThis, args); | ||
}, timeout); | ||
}; | ||
var TldExtensionsModule = /** @class */ (function () { | ||
function TldExtensionsModule() { | ||
} | ||
TldExtensionsModule = __decorate([ | ||
core.NgModule({ | ||
imports: [ | ||
common.CommonModule | ||
] | ||
}) | ||
], TldExtensionsModule); | ||
return TldExtensionsModule; | ||
}()); | ||
exports.TldExtensionsModule = TldExtensionsModule; | ||
exports.TldNgFormsModule = TldNgFormsModule; | ||
exports.ɵa = IsraeliIdValidator; | ||
exports.ɵb = EmailValidator; | ||
@@ -283,0 +509,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@taldor-ltd/tld-angular-fnd",["exports","@angular/core","@angular/common","@angular/forms"],t):t(((e=e||self)["taldor-ltd"]=e["taldor-ltd"]||{},e["taldor-ltd"]["tld-angular-fnd"]={}),e.ng.core,e.ng.common,e.ng.forms)}(this,(function(e,t,r,o){"use strict"; | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@taldor-ltd/tld-angular-fnd",["exports","@angular/core","@angular/common","@angular/forms"],r):r(((t=t||self)["taldor-ltd"]=t["taldor-ltd"]||{},t["taldor-ltd"]["tld-angular-fnd"]={}),t.ng.core,t.ng.common,t.ng.forms)}(this,(function(t,r,n,e){"use strict"; | ||
/*! ***************************************************************************** | ||
@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
and limitations under the License. | ||
***************************************************************************** */function n(e,t,r,o){var n,l=arguments.length,i=l<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(l<3?n(i):l>3?n(t,r,i):n(t,r))||i);return l>3&&i&&Object.defineProperty(t,r,i),i}var l=function(){function e(){this.tldIsraeliId=!0}var r;return r=e,e.prototype.validate=function(e){var t=e.value;if(this.tldIsraeliId&&null!=t&&t.length>0){var r=!0,o=0,n=void 0;if(9!==t.length)r=!1;else{for(var l=0;l<t.length;l++)isNaN(t[l])&&(r=!1),o+=(n=+t[l]*(l%2+1))>9?n-9:n;o%10!=0&&(r=!1)}if(!r)return{israeliId:!0}}return null},n([t.Input()],e.prototype,"tldIsraeliId",void 0),e=r=n([t.Directive({selector:"[tldIsraeliId]",providers:[{provide:o.NG_VALIDATORS,useExisting:r,multi:!0}]})],e)}(),i=function(){function e(){}return e=n([t.NgModule({declarations:[l],exports:[l],imports:[r.CommonModule]})],e)}();e.TldNgFormsModule=i,e.ɵa=l,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */function o(t,r,n,e){var o,u=arguments.length,i=u<3?r:null===e?e=Object.getOwnPropertyDescriptor(r,n):e;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,r,n,e);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(u<3?o(i):u>3?o(r,n,i):o(r,n))||i);return u>3&&i&&Object.defineProperty(r,n,i),i}function u(t,r){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,o,u=n.call(t),i=[];try{for(;(void 0===r||r-- >0)&&!(e=u.next()).done;)i.push(e.value)}catch(t){o={error:t}}finally{try{e&&!e.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}return i}function i(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(u(arguments[r]));return t}var l=function(){function t(){this.tldIsraeliId=!0}var n;return n=t,t.prototype.validate=function(t){var r=t.value;if(this.tldIsraeliId&&null!=r&&r.length>0){var n=!0,e=0,o=void 0;if(9!==r.length)n=!1;else{for(var u=0;u<r.length;u++)isNaN(r[u])&&(n=!1),e+=(o=+r[u]*(u%2+1))>9?o-9:o;e%10!=0&&(n=!1)}if(!n)return{israeliId:!0}}return null},o([r.Input()],t.prototype,"tldIsraeliId",void 0),t=n=o([r.Directive({selector:"[tldIsraeliId]",providers:[{provide:e.NG_VALIDATORS,useExisting:n,multi:!0}]})],t)}(),a=function(){function t(){}var n;return n=t,t.prototype.validate=function(t){var r=t.value;if(null!=r&&r.length>0){return new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/).test(r)?null:{email:!0}}},t=n=o([r.Directive({selector:"[tldEmail]",providers:[{provide:e.NG_VALIDATORS,useExisting:n,multi:!0}]})],t)}(),c=function(){function t(){}return t=o([r.NgModule({declarations:[l,a],exports:[l,a],imports:[n.CommonModule]})],t)}();Array.prototype.containsElements=function(){return this.length>0},Array.prototype.any=function(t){return void 0===t&&(t=null),null===t?this.length>0:this.reduce((function(r,n){return!r&&t(n)&&(r=n),!0}),!1)},Array.prototype.firstOrDefault=function(t){return this.reduce((function(r,n){return!r&&t(n)&&(r=n),r}),null)},Array.prototype.first=function(t){var r=this.reduce((function(r,n){return!r&&t(n)&&(r=n),r}),null);if(null===r)throw new Error("Sequence contains no elements");return r},Array.prototype.sum=function(t){return this.reduce((function(r,n){return r+t(n)}),0)},Array.prototype.where=function(t){return this.filter((function(r){return t(r)}))},Array.prototype.min=function(t){if(this&&0!==this.length)return this.reduce((function(r,n){return Math.min(r,t(n))}),null)},Array.prototype.max=function(t){if(this&&0!==this.length)return this.reduce((function(r,n){return Math.max(r,t(n))}),null)},Array.prototype.average=function(t){return this.reduce((function(r,n){return r+t(n)}),0)/this.length},Array.prototype.orderBy=function(t){return this.sort((function(r,n){return t(r)>t(n)?1:t(r)<t(n)?-1:0}))},Array.prototype.orderByDesc=function(t){return this.sort((function(r,n){return t(r)>t(n)?-1:t(r)<t(n)?1:0}))},Array.prototype.take=function(t){return this.filter((function(r,n){return n<t}))},Array.prototype.select=function(t){return this.map((function(r){return t(r)}))},Array.prototype.count=function(t){return this.filter((function(r){return t(r)})).length},Array.prototype.split=function(t){return this.reduce((function(r,n){var e=u(r,2),o=e[0],l=e[1];return t(n)?[i(o,[n]),l]:[o,i(l,[n])]}),[[],[]])},Array.prototype.groupBy=function(t){var r;return this.reduce((function(n,e){return(r=n.find((function(r){return r.key===t(e)})))?r.values.push(e):n.push({key:t(e),values:[e]}),n}),[])},Function.prototype.applyDelayed=function(t,r){if("function"!=typeof this)throw new Error(this+"cannot be bound as it's not callable");var n=this;setTimeout((function(){n.apply(t,r)}),0)},Function.prototype.applyDelayedTimout=function(t,r,n){if("function"!=typeof this)throw new Error(this+"cannot be bound as it's not callable");var e=this;setTimeout((function(){e.apply(t,n)}),r)};var f=function(){function t(){}return t=o([r.NgModule({imports:[n.CommonModule]})],t)}();t.TldExtensionsModule=f,t.TldNgFormsModule=c,t.ɵa=l,t.ɵb=a,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=taldor-ltd-tld-angular-fnd.umd.min.js.map |
export * from './src/app/modules/tld-ng-forms/tld-ng-forms.module'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWxkb3ItbHRkL3RsZC1hbmd1bGFyLWZuZC8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvREFBb0QsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vc3JjL2FwcC9tb2R1bGVzL3RsZC1uZy1mb3Jtcy90bGQtbmctZm9ybXMubW9kdWxlJztcbiJdfQ== | ||
export * from './src/app/modules/tld-extensions/tld-extensions.module'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWxkb3ItbHRkL3RsZC1hbmd1bGFyLWZuZC8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvREFBb0QsQ0FBQztBQUNuRSxjQUFjLHdEQUF3RCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zcmMvYXBwL21vZHVsZXMvdGxkLW5nLWZvcm1zL3RsZC1uZy1mb3Jtcy5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvYXBwL21vZHVsZXMvdGxkLWV4dGVuc2lvbnMvdGxkLWV4dGVuc2lvbnMubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2FwcC9tb2R1bGVzL3RsZC1leHRlbnNpb25zL2V4dGVuc2lvbnMvX3RsZC5leHRlbnNpb25zJztcblxuIl19 |
@@ -5,2 +5,3 @@ import * as tslib_1 from "tslib"; | ||
import { IsraeliIdValidator } from './validators/israeli-id.directive'; | ||
import { EmailValidator } from './validators/email.directive'; | ||
let TldNgFormsModule = class TldNgFormsModule { | ||
@@ -11,6 +12,8 @@ }; | ||
declarations: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
exports: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
@@ -23,2 +26,2 @@ imports: [ | ||
export { TldNgFormsModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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ZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBJc3JhZWxpSWRWYWxpZGF0b3IgfSBmcm9tICcuL3ZhbGlkYXRvcnMvaXNyYWVsaS1pZC5kaXJlY3RpdmUnO1xuaW1wb3J0IHsgRW1haWxWYWxpZGF0b3IgfSBmcm9tICcuL3ZhbGlkYXRvcnMvZW1haWwuZGlyZWN0aXZlJztcblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBbXG4gICAgSXNyYWVsaUlkVmFsaWRhdG9yLFxuICAgIEVtYWlsVmFsaWRhdG9yXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBJc3JhZWxpSWRWYWxpZGF0b3IsXG4gICAgRW1haWxWYWxpZGF0b3JcbiAgXSxcbiAgaW1wb3J0czogW1xuICAgIENvbW1vbk1vZHVsZVxuICBdXG59KVxuZXhwb3J0IGNsYXNzIFRsZE5nRm9ybXNNb2R1bGUgeyB9XG4iXX0= |
@@ -5,3 +5,4 @@ /** | ||
export * from './public_api'; | ||
export { EmailValidator as ɵb } from './src/app/modules/tld-ng-forms/validators/email.directive'; | ||
export { IsraeliIdValidator as ɵa } from './src/app/modules/tld-ng-forms/validators/israeli-id.directive'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFsZG9yLWx0ZC10bGQtYW5ndWxhci1mbmQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdGFsZG9yLWx0ZC90bGQtYW5ndWxhci1mbmQvIiwic291cmNlcyI6WyJ0YWxkb3ItbHRkLXRsZC1hbmd1bGFyLWZuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDO0FBRTdCLE9BQU8sRUFBQyxrQkFBa0IsSUFBSSxFQUFFLEVBQUMsTUFBTSxnRUFBZ0UsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8q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bGlkYXRvcnMvaXNyYWVsaS1pZC5kaXJlY3RpdmUnOyJdfQ== |
export * from './src/app/modules/tld-ng-forms/tld-ng-forms.module'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWxkb3ItbHRkL3RsZC1hbmd1bGFyLWZuZC8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvREFBb0QsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vc3JjL2FwcC9tb2R1bGVzL3RsZC1uZy1mb3Jtcy90bGQtbmctZm9ybXMubW9kdWxlJztcbiJdfQ== | ||
export * from './src/app/modules/tld-extensions/tld-extensions.module'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWxkb3ItbHRkL3RsZC1hbmd1bGFyLWZuZC8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvREFBb0QsQ0FBQztBQUNuRSxjQUFjLHdEQUF3RCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zcmMvYXBwL21vZHVsZXMvdGxkLW5nLWZvcm1zL3RsZC1uZy1mb3Jtcy5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvYXBwL21vZHVsZXMvdGxkLWV4dGVuc2lvbnMvdGxkLWV4dGVuc2lvbnMubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2FwcC9tb2R1bGVzL3RsZC1leHRlbnNpb25zL2V4dGVuc2lvbnMvX3RsZC5leHRlbnNpb25zJztcblxuIl19 |
@@ -5,2 +5,3 @@ import * as tslib_1 from "tslib"; | ||
import { IsraeliIdValidator } from './validators/israeli-id.directive'; | ||
import { EmailValidator } from './validators/email.directive'; | ||
var TldNgFormsModule = /** @class */ (function () { | ||
@@ -12,6 +13,8 @@ function TldNgFormsModule() { | ||
declarations: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
exports: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
@@ -26,2 +29,2 @@ imports: [ | ||
export { TldNgFormsModule }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGxkLW5nLWZvcm1zLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWxkb3ItbHRkL3RsZC1hbmd1bGFyLWZuZC8iLCJzb3VyY2VzIjpbInNyYy9hcHAvbW9kdWxlcy90bGQtbmctZm9ybXMvdGxkLW5nLWZvcm1zLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFhdkU7SUFBQTtJQUFnQyxDQUFDO0lBQXBCLGdCQUFnQjtRQVg1QixRQUFRLENBQUM7WUFDUixZQUFZLEVBQUU7Z0JBQ1osa0JBQWtCO2FBQ25CO1lBQ0QsT0FBTyxFQUFFO2dCQUNQLGtCQUFrQjthQUNuQjtZQUNELE9BQU8sRUFBRTtnQkFDUCxZQUFZO2FBQ2I7U0FDRixDQUFDO09BQ1csZ0JBQWdCLENBQUk7SUFBRCx1QkFBQztDQUFBLEFBQWpDLElBQWlDO1NBQXBCLGdCQUFnQiIsInNvdXJjZXNDb250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FBWSxFQUFFO2dCQUNaLGtCQUFrQjtnQkFDbEIsY0FBYzthQUNmO1lBQ0QsT0FBTyxFQUFFO2dCQUNQLGtCQUFrQjtnQkFDbEIsY0FBYzthQUNmO1lBQ0QsT0FBTyxFQUFFO2dCQUNQLFlBQVk7YUFDYjtTQUNGLENBQUM7T0FDVyxnQkFBZ0IsQ0FBSTtJQUFELHVCQUFDO0NBQUEsQUFBakMsSUFBaUM7U0FBcEIsZ0JBQWdCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBJc3JhZWxpSWRWYWxpZGF0b3IgfSBmcm9tICcuL3ZhbGlkYXRvcnMvaXNyYWVsaS1pZC5kaXJlY3RpdmUnO1xuaW1wb3J0IHsgRW1haWxWYWxpZGF0b3IgfSBmcm9tICcuL3ZhbGlkYXRvcnMvZW1haWwuZGlyZWN0aXZlJztcblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBbXG4gICAgSXNyYWVsaUlkVmFsaWRhdG9yLFxuICAgIEVtYWlsVmFsaWRhdG9yXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBJc3JhZWxpSWRWYWxpZGF0b3IsXG4gICAgRW1haWxWYWxpZGF0b3JcbiAgXSxcbiAgaW1wb3J0czogW1xuICAgIENvbW1vbk1vZHVsZVxuICBdXG59KVxuZXhwb3J0IGNsYXNzIFRsZE5nRm9ybXNNb2R1bGUgeyB9XG4iXX0= |
@@ -5,3 +5,4 @@ /** | ||
export * from './public_api'; | ||
export { EmailValidator as ɵb } from './src/app/modules/tld-ng-forms/validators/email.directive'; | ||
export { IsraeliIdValidator as ɵa } from './src/app/modules/tld-ng-forms/validators/israeli-id.directive'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza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RlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuXG5leHBvcnQge0VtYWlsVmFsaWRhdG9yIGFzIMm1Yn0gZnJvbSAnLi9zcmMvYXBwL21vZHVsZXMvdGxkLW5nLWZvcm1zL3ZhbGlkYXRvcnMvZW1haWwuZGlyZWN0aXZlJztcbmV4cG9ydCB7SXNyYWVsaUlkVmFsaWRhdG9yIGFzIMm1YX0gZnJvbSAnLi9zcmMvYXBwL21vZHVsZXMvdGxkLW5nLWZvcm1zL3ZhbGlkYXRvcnMvaXNyYWVsaS1pZC5kaXJlY3RpdmUnOyJdfQ== |
@@ -60,2 +60,35 @@ import { __decorate } from 'tslib'; | ||
var EmailValidator_1; | ||
let EmailValidator = EmailValidator_1 = | ||
/** פונקציונליות שבודקת האם התעודת זהות שהוזנה תקינה */ | ||
class EmailValidator { | ||
validate(c) { | ||
const value = c.value; | ||
if (value !== undefined && value !== null && value.length > 0) { | ||
let valid = true; | ||
const regexp = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/); | ||
valid = regexp.test(value); | ||
if (!valid) { | ||
return { | ||
email: true | ||
}; | ||
} | ||
return null; | ||
} | ||
} | ||
}; | ||
EmailValidator = EmailValidator_1 = __decorate([ | ||
Directive({ | ||
selector: '[tldEmail]', | ||
providers: [ | ||
{ | ||
provide: NG_VALIDATORS, | ||
useExisting: EmailValidator_1, | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
/** פונקציונליות שבודקת האם התעודת זהות שהוזנה תקינה */ | ||
], EmailValidator); | ||
let TldNgFormsModule = class TldNgFormsModule { | ||
@@ -66,6 +99,8 @@ }; | ||
declarations: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
exports: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
@@ -78,2 +113,187 @@ imports: [ | ||
// 1. make sure ts.config contains this config under "paths": | ||
// | ||
// "@extensions/*" : [ | ||
// "node_modules/@taldor-ltd/tld-angular-fnd/app/extensions/*.extensions.ts" | ||
// ] | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.containsElements = function () { | ||
if (this.length > 0) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
Array.prototype.any = function (predicate = null) { | ||
if (predicate === null) { | ||
if (this.length > 0) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
else { | ||
return this.reduce((accumulator, currentValue) => { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return true; | ||
}, false); | ||
} | ||
}; | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.firstOrDefault = function (predicate) { | ||
return this.reduce((accumulator, currentValue) => { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return accumulator; | ||
}, null); | ||
}; | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.first = function (predicate) { | ||
const element = this.reduce((accumulator, currentValue) => { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return accumulator; | ||
}, null); | ||
if (element === null) { | ||
throw new Error('Sequence contains no elements'); | ||
} | ||
return element; | ||
}; | ||
Array.prototype.sum = function (predicate) { | ||
let sum = 0; | ||
sum = this.reduce((accumulator, currentValue) => accumulator + predicate(currentValue), 0); | ||
return sum; | ||
}; | ||
Array.prototype.where = function (predicate) { | ||
return this.filter(currentValue => predicate(currentValue)); | ||
}; | ||
Array.prototype.min = function (predicate) { | ||
if (!this || this.length === 0) { | ||
return undefined; | ||
} | ||
let minValue; | ||
minValue = this.reduce((accumulator, currentValue) => Math.min(accumulator, predicate(currentValue)), null); | ||
return minValue; | ||
}; | ||
Array.prototype.max = function (predicate) { | ||
if (!this || this.length === 0) { | ||
return undefined; | ||
} | ||
let maxValue; | ||
maxValue = this.reduce((accumulator, currentValue) => Math.max(accumulator, predicate(currentValue)), null); | ||
return maxValue; | ||
}; | ||
Array.prototype.average = function (predicate) { | ||
let avg = 0; | ||
avg = this.reduce((accumulator, currentValue) => accumulator + predicate(currentValue), 0) / this.length; | ||
return avg; | ||
}; | ||
Array.prototype.orderBy = function (predicate) { | ||
return this.sort((a, b) => { | ||
if (predicate(a) > predicate(b)) { | ||
return 1; | ||
} | ||
if (predicate(a) < predicate(b)) { | ||
return -1; | ||
} | ||
return 0; | ||
}); | ||
}; | ||
Array.prototype.orderByDesc = function (predicate) { | ||
return this.sort((a, b) => { | ||
if (predicate(a) > predicate(b)) { | ||
return -1; | ||
} | ||
if (predicate(a) < predicate(b)) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
}; | ||
Array.prototype.take = function (top) { | ||
return this.filter((u, i) => i < top); | ||
}; | ||
Array.prototype.select = function (predicate) { | ||
return this.map(currentValue => predicate(currentValue)); | ||
}; | ||
Array.prototype.count = function (predicate) { | ||
return (this.filter(currentValue => predicate(currentValue))).length; | ||
}; | ||
// distinct? | ||
// const uniqueNames = Array.from(new Set(this.map((currentValue: any) => predicate(currentValue)))); | ||
Array.prototype.split = function (predicate) { | ||
return this.reduce(([pass, fail], element) => { | ||
return predicate(element) | ||
? [[...pass, element], fail] | ||
: [pass, [...fail, element]]; | ||
}, [[], []]); | ||
}; | ||
Array.prototype.groupBy = function (predicate) { | ||
let group; | ||
return this.reduce((groupedList, element) => { | ||
group = groupedList.find(x => x.key === predicate(element)); | ||
if (!group) { | ||
groupedList.push({ | ||
'key': predicate(element), | ||
'values': [element] | ||
}); | ||
} | ||
else { | ||
group.values.push(element); | ||
} | ||
return groupedList; | ||
}, []); | ||
}; | ||
// Function.prototype.callDelayed = function(previousThis: any, ...args: any) { | ||
// if (typeof this !== 'function') { | ||
// throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
// } | ||
// const boundTargetFunction = this; | ||
// setTimeout(() => { | ||
// boundTargetFunction.call(previousThis, ...args); | ||
// }, 0); | ||
// }; | ||
// Function.prototype.callDelayedTimout = function(previousThis: any, timeout: number, ...args: any) { | ||
// if (typeof this !== 'function') { | ||
// throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
// } | ||
// const boundTargetFunction = this; | ||
// setTimeout(() => { | ||
// boundTargetFunction.call(previousThis, ...args); | ||
// }, timeout); | ||
// }; | ||
Function.prototype['applyDelayed'] = function (previousThis, args) { | ||
if (typeof this !== 'function') { | ||
throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
} | ||
const boundTargetFunction = this; | ||
setTimeout(() => { | ||
boundTargetFunction.apply(previousThis, args); | ||
}, 0); | ||
}; | ||
Function.prototype['applyDelayedTimout'] = function (previousThis, timeout, args) { | ||
if (typeof this !== 'function') { | ||
throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
} | ||
const boundTargetFunction = this; | ||
setTimeout(() => { | ||
boundTargetFunction.apply(previousThis, args); | ||
}, timeout); | ||
}; | ||
let TldExtensionsModule = class TldExtensionsModule { | ||
}; | ||
TldExtensionsModule = __decorate([ | ||
NgModule({ | ||
imports: [ | ||
CommonModule | ||
] | ||
}) | ||
], TldExtensionsModule); | ||
/** | ||
@@ -83,3 +303,3 @@ * Generated bundle index. Do not edit. | ||
export { TldNgFormsModule, IsraeliIdValidator as ɵa }; | ||
export { TldExtensionsModule, TldNgFormsModule, IsraeliIdValidator as ɵa, EmailValidator as ɵb }; | ||
//# sourceMappingURL=taldor-ltd-tld-angular-fnd.js.map |
@@ -1,2 +0,2 @@ | ||
import { __decorate } from 'tslib'; | ||
import { __decorate, __read, __spread } from 'tslib'; | ||
import { Input, Directive, NgModule } from '@angular/core'; | ||
@@ -60,2 +60,38 @@ import { CommonModule } from '@angular/common'; | ||
var EmailValidator = /** @class */ (function () { | ||
/** פונקציונליות שבודקת האם התעודת זהות שהוזנה תקינה */ | ||
function EmailValidator() { | ||
} | ||
EmailValidator_1 = EmailValidator; | ||
EmailValidator.prototype.validate = function (c) { | ||
var value = c.value; | ||
if (value !== undefined && value !== null && value.length > 0) { | ||
var valid = true; | ||
var regexp = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/); | ||
valid = regexp.test(value); | ||
if (!valid) { | ||
return { | ||
email: true | ||
}; | ||
} | ||
return null; | ||
} | ||
}; | ||
var EmailValidator_1; | ||
EmailValidator = EmailValidator_1 = __decorate([ | ||
Directive({ | ||
selector: '[tldEmail]', | ||
providers: [ | ||
{ | ||
provide: NG_VALIDATORS, | ||
useExisting: EmailValidator_1, | ||
multi: true, | ||
}, | ||
], | ||
}) | ||
/** פונקציונליות שבודקת האם התעודת זהות שהוזנה תקינה */ | ||
], EmailValidator); | ||
return EmailValidator; | ||
}()); | ||
var TldNgFormsModule = /** @class */ (function () { | ||
@@ -67,6 +103,8 @@ function TldNgFormsModule() { | ||
declarations: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
exports: [ | ||
IsraeliIdValidator | ||
IsraeliIdValidator, | ||
EmailValidator | ||
], | ||
@@ -81,2 +119,188 @@ imports: [ | ||
// 1. make sure ts.config contains this config under "paths": | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.containsElements = function () { | ||
if (this.length > 0) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
Array.prototype.any = function (predicate) { | ||
if (predicate === void 0) { predicate = null; } | ||
if (predicate === null) { | ||
if (this.length > 0) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
else { | ||
return this.reduce(function (accumulator, currentValue) { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return true; | ||
}, false); | ||
} | ||
}; | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.firstOrDefault = function (predicate) { | ||
return this.reduce(function (accumulator, currentValue) { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return accumulator; | ||
}, null); | ||
}; | ||
// add extension method implementations into the prototype here: | ||
Array.prototype.first = function (predicate) { | ||
var element = this.reduce(function (accumulator, currentValue) { | ||
if (!accumulator && predicate(currentValue)) { | ||
accumulator = currentValue; | ||
} | ||
return accumulator; | ||
}, null); | ||
if (element === null) { | ||
throw new Error('Sequence contains no elements'); | ||
} | ||
return element; | ||
}; | ||
Array.prototype.sum = function (predicate) { | ||
var sum = 0; | ||
sum = this.reduce(function (accumulator, currentValue) { return accumulator + predicate(currentValue); }, 0); | ||
return sum; | ||
}; | ||
Array.prototype.where = function (predicate) { | ||
return this.filter(function (currentValue) { return predicate(currentValue); }); | ||
}; | ||
Array.prototype.min = function (predicate) { | ||
if (!this || this.length === 0) { | ||
return undefined; | ||
} | ||
var minValue; | ||
minValue = this.reduce(function (accumulator, currentValue) { return Math.min(accumulator, predicate(currentValue)); }, null); | ||
return minValue; | ||
}; | ||
Array.prototype.max = function (predicate) { | ||
if (!this || this.length === 0) { | ||
return undefined; | ||
} | ||
var maxValue; | ||
maxValue = this.reduce(function (accumulator, currentValue) { return Math.max(accumulator, predicate(currentValue)); }, null); | ||
return maxValue; | ||
}; | ||
Array.prototype.average = function (predicate) { | ||
var avg = 0; | ||
avg = this.reduce(function (accumulator, currentValue) { return accumulator + predicate(currentValue); }, 0) / this.length; | ||
return avg; | ||
}; | ||
Array.prototype.orderBy = function (predicate) { | ||
return this.sort(function (a, b) { | ||
if (predicate(a) > predicate(b)) { | ||
return 1; | ||
} | ||
if (predicate(a) < predicate(b)) { | ||
return -1; | ||
} | ||
return 0; | ||
}); | ||
}; | ||
Array.prototype.orderByDesc = function (predicate) { | ||
return this.sort(function (a, b) { | ||
if (predicate(a) > predicate(b)) { | ||
return -1; | ||
} | ||
if (predicate(a) < predicate(b)) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
}; | ||
Array.prototype.take = function (top) { | ||
return this.filter(function (u, i) { return i < top; }); | ||
}; | ||
Array.prototype.select = function (predicate) { | ||
return this.map(function (currentValue) { return predicate(currentValue); }); | ||
}; | ||
Array.prototype.count = function (predicate) { | ||
return (this.filter(function (currentValue) { return predicate(currentValue); })).length; | ||
}; | ||
// distinct? | ||
// const uniqueNames = Array.from(new Set(this.map((currentValue: any) => predicate(currentValue)))); | ||
Array.prototype.split = function (predicate) { | ||
return this.reduce(function (_a, element) { | ||
var _b = __read(_a, 2), pass = _b[0], fail = _b[1]; | ||
return predicate(element) | ||
? [__spread(pass, [element]), fail] | ||
: [pass, __spread(fail, [element])]; | ||
}, [[], []]); | ||
}; | ||
Array.prototype.groupBy = function (predicate) { | ||
var group; | ||
return this.reduce(function (groupedList, element) { | ||
group = groupedList.find(function (x) { return x.key === predicate(element); }); | ||
if (!group) { | ||
groupedList.push({ | ||
'key': predicate(element), | ||
'values': [element] | ||
}); | ||
} | ||
else { | ||
group.values.push(element); | ||
} | ||
return groupedList; | ||
}, []); | ||
}; | ||
// Function.prototype.callDelayed = function(previousThis: any, ...args: any) { | ||
// if (typeof this !== 'function') { | ||
// throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
// } | ||
// const boundTargetFunction = this; | ||
// setTimeout(() => { | ||
// boundTargetFunction.call(previousThis, ...args); | ||
// }, 0); | ||
// }; | ||
// Function.prototype.callDelayedTimout = function(previousThis: any, timeout: number, ...args: any) { | ||
// if (typeof this !== 'function') { | ||
// throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
// } | ||
// const boundTargetFunction = this; | ||
// setTimeout(() => { | ||
// boundTargetFunction.call(previousThis, ...args); | ||
// }, timeout); | ||
// }; | ||
Function.prototype['applyDelayed'] = function (previousThis, args) { | ||
if (typeof this !== 'function') { | ||
throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
} | ||
var boundTargetFunction = this; | ||
setTimeout(function () { | ||
boundTargetFunction.apply(previousThis, args); | ||
}, 0); | ||
}; | ||
Function.prototype['applyDelayedTimout'] = function (previousThis, timeout, args) { | ||
if (typeof this !== 'function') { | ||
throw new Error(this + 'cannot be bound as it\'s not callable'); | ||
} | ||
var boundTargetFunction = this; | ||
setTimeout(function () { | ||
boundTargetFunction.apply(previousThis, args); | ||
}, timeout); | ||
}; | ||
var TldExtensionsModule = /** @class */ (function () { | ||
function TldExtensionsModule() { | ||
} | ||
TldExtensionsModule = __decorate([ | ||
NgModule({ | ||
imports: [ | ||
CommonModule | ||
] | ||
}) | ||
], TldExtensionsModule); | ||
return TldExtensionsModule; | ||
}()); | ||
/** | ||
@@ -86,3 +310,3 @@ * Generated bundle index. Do not edit. | ||
export { TldNgFormsModule, IsraeliIdValidator as ɵa }; | ||
export { TldExtensionsModule, TldNgFormsModule, IsraeliIdValidator as ɵa, EmailValidator as ɵb }; | ||
//# sourceMappingURL=taldor-ltd-tld-angular-fnd.js.map |
{ | ||
"name": "@taldor-ltd/tld-angular-fnd", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Shared Angular functionality to all Taldor developers", | ||
@@ -5,0 +5,0 @@ "private": false, |
export * from './src/app/modules/tld-ng-forms/tld-ng-forms.module'; | ||
export * from './src/app/modules/tld-extensions/tld-extensions.module'; | ||
export * from './src/app/modules/tld-extensions/extensions/_tld.extensions'; |
@@ -5,2 +5,3 @@ /** | ||
export * from './public_api'; | ||
export { EmailValidator as ɵb } from './src/app/modules/tld-ng-forms/validators/email.directive'; | ||
export { IsraeliIdValidator as ɵa } from './src/app/modules/tld-ng-forms/validators/israeli-id.directive'; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"TldNgFormsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"ɵa"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":4}]}]}],"members":{}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":4,"character":1},"arguments":[{"selector":"[tldIsraeliId]","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALIDATORS","line":9,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵa"},"multi":true}]}]}],"members":{"tldIsraeliId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"validate":[{"__symbolic":"method"}]}}},"origins":{"TldNgFormsModule":"./src/app/modules/tld-ng-forms/tld-ng-forms.module","ɵa":"./src/app/modules/tld-ng-forms/validators/israeli-id.directive"},"importAs":"@taldor-ltd/tld-angular-fnd"} | ||
{"__symbolic":"module","version":4,"exports":[{"from":"./src/app/modules/tld-extensions/extensions/_tld.extensions"}],"metadata":{"TldNgFormsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"ɵb"}],"exports":[{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"ɵb"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":15,"character":4}]}]}],"members":{}},"TldExtensionsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":4}]}]}],"members":{}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":4,"character":1},"arguments":[{"selector":"[tldIsraeliId]","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALIDATORS","line":9,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵa"},"multi":true}]}]}],"members":{"tldIsraeliId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"validate":[{"__symbolic":"method"}]}},"ɵb":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":4,"character":1},"arguments":[{"selector":"[tldEmail]","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALIDATORS","line":9,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵb"},"multi":true}]}]}],"members":{"validate":[{"__symbolic":"method"}]}}},"origins":{"TldNgFormsModule":"./src/app/modules/tld-ng-forms/tld-ng-forms.module","TldExtensionsModule":"./src/app/modules/tld-extensions/tld-extensions.module","ɵa":"./src/app/modules/tld-ng-forms/validators/israeli-id.directive","ɵb":"./src/app/modules/tld-ng-forms/validators/email.directive"},"importAs":"@taldor-ltd/tld-angular-fnd"} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1600518
40
51661
2
0