@codebakery/origami
Advanced tools
Comparing version 3.0.0-beta.3 to 3.0.0-beta.4
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@codebakery/origami/forms",["exports","@angular/core","@angular/forms"],t):t((e.codebakery=e.codebakery||{},e.codebakery.origami=e.codebakery.origami||{},e.codebakery.origami.forms={}),e.ng.core,e.ng.forms)}(this,function(e,i,r){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};var s={provide:r.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return t}),multi:!0},t=function(o){function e(e,t,i,r){var n=o.call(this,i,e,r)||this;return n.elementRef=e,n.injector=t,n.validationErrorsKey="validate",n.isWritingValue=!1,n.isUpdatingValidity=!1,n}return function t(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(e,o),Object.defineProperty(e.prototype,"control",{get:function(){return this._control||(this._control=this.injector.get(r.NgControl).control),this._control},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var t=this,i=this.elementRef.nativeElement;if(this.isValidatable(i)){var e=this.control;this.statusSub=e.statusChanges.subscribe(function(){"function"==typeof t.isInvalid?i.invalid=t.isInvalid(e):i.invalid=!!e.invalid&&!!e.dirty}),"function"==typeof i.validate&&e.setValidators(r.Validators.compose([e.validator,function(){return i.validate()?null:((e={})[t.validationErrorsKey]=!0,e);var e}]))}},e.prototype.ngOnDestroy=function(){this.statusSub&&this.statusSub.unsubscribe()},e.prototype.writeValue=function(e){this.isWritingValue=!0;var t=this.elementRef.nativeElement;if(this.isMultiSelectable(t)||this.isSelectable(t)){var i=this.getSelectableProperty(t,e);i&&(t[i]=e)}else this.isCheckedElement(t)?t.checked=Boolean(e):o.prototype.writeValue.call(this,e);this.isWritingValue=!1},e.prototype.onChangedEvent=function(e){if(!this.isWritingValue){var t=this.elementRef.nativeElement,i=!1;switch(e.type){case"selected-items-changed":case"selected-item-changed":i="selectedItems"===(r=this.getSelectableProperty(t))||"selectedItem"===r;break;case"selected-values-changed":case"selected-changed":i="selectedValues"===(r=this.getSelectableProperty(t))||"selected"===r;break;default:i=!0}if(i){var r=void 0;r=this.isMultiSelectable(t)||this.isSelectable(t)?this.getSelectableProperty(t):this.isCheckedElement(t)?"checked":"value",this.onChange(t[r])}}},e.prototype.onInvalidChanged=function(){if(!this.isUpdatingValidity){var e=this.elementRef.nativeElement;this.isValidatable(e)&&this.control&&this.control.invalid!==e.invalid&&(this.isUpdatingValidity=!0,this.control.updateValueAndValidity(),this.isUpdatingValidity=!1)}},e.prototype.isCheckedElement=function(e){return this.isPropertyDefined(e,"checked")},e.prototype.isSelectable=function(e){return this.isPropertyDefined(e,"selected")||this.isPropertyDefined(e,"selectedItem")},e.prototype.isMultiSelectable=function(e){return!!e&&!0===e.multi&&(this.isPropertyDefined(e,"selectedValues")||this.isPropertyDefined(e,"selectedValues"))},e.prototype.isValidatable=function(e){return this.isPropertyDefined(e,"invalid")},e.prototype.isPropertyDefined=function(e,t){return!!e&&t in e},e.prototype.getSelectableProperty=function(e,t){var i=this.isMultiSelectable(e),r=i?"selectedItems":"selectedItem",n=i?"selectedValues":"selected";if("boolean"!=typeof this.useSelectableValueProp){var o=r in e,s=n in e;if(o&&!s)this.useSelectableValueProp=!0;else if(!o&&s)this.useSelectableValueProp=!1;else{if(null==t)return undefined;var a=e[r];try{e[r]=t}catch(l){}this.useSelectableValueProp=e[r]===t,e[r]=a}}return this.useSelectableValueProp?r:n},e.decorators=[{type:i.Directive,args:[{selector:"[ngModel][origami],[formControlName][origami],[formControl][origami]",providers:[s]}]}],e.ctorParameters=function(){return[{type:i.ElementRef},{type:i.Injector},{type:i.Renderer2},{type:Boolean,decorators:[{type:i.Optional},{type:i.Inject,args:[r.COMPOSITION_BUFFER_MODE]}]}]},e.propDecorators={isInvalid:[{type:i.Input}],validationErrorsKey:[{type:i.Input}],onChangedEvent:[{type:i.HostListener,args:["selected-items-changed",["$event"]]},{type:i.HostListener,args:["selected-item-changed",["$event"]]},{type:i.HostListener,args:["selected-values-changed",["$event"]]},{type:i.HostListener,args:["selected-changed",["$event"]]},{type:i.HostListener,args:["checked-changed",["$event"]]},{type:i.HostListener,args:["value-changed",["$event"]]}],onInvalidChanged:[{type:i.HostListener,args:["invalid-changed"]}]},e}(r.DefaultValueAccessor),o=function(){function e(){}return e.decorators=[{type:i.NgModule,args:[{declarations:[t],exports:[t]}]}],e}();e.OrigamiFormsModule=o,e.ORIGAMI_CONTROL_VALUE_ACCESSOR=s,e.OrigamiControlValueAccessor=t,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("@codebakery/origami/forms",["exports","@angular/core","@angular/forms"],t):t((e.codebakery=e.codebakery||{},e.codebakery.origami=e.codebakery.origami||{},e.codebakery.origami.forms={}),e.ng.core,e.ng.forms)}(this,function(e,i,n){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};var a={provide:n.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return t}),multi:!0},t=function(o){function e(e,t,i,n){var r=o.call(this,i,e,n)||this;return r.elementRef=e,r.injector=t,r.renderer=i,r.validationErrorsKey="validate",r.isWritingValue=!1,r.ignoreInvalidChanges=!1,r}return function t(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(e,o),Object.defineProperty(e.prototype,"control",{get:function(){return this._control||(this._control=this.injector.get(n.NgControl).control),this._control},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var t=this,i=this.elementRef.nativeElement;if(this.isValidatable(i)){var e=this.control;this.statusSub=e.statusChanges.subscribe(function(){"function"==typeof t.isInvalid?i.invalid=t.isInvalid(e):i.invalid=!!e.invalid&&!!e.dirty}),this.shouldUseValidate(i)&&e.setValidators(n.Validators.compose([e.validator,function(){return i.validate()?null:((e={})[t.validationErrorsKey]=!0,e);var e}]))}},e.prototype.ngOnDestroy=function(){this.statusSub&&this.statusSub.unsubscribe()},e.prototype.writeValue=function(e){this.isWritingValue=!0;var t=this.elementRef.nativeElement;if(this.isMultiSelectable(t)||this.isSelectable(t)){var i=this.getSelectableProperty(t,e);i&&(t[i]=e)}else this.isCheckedElement(t)?t.checked=Boolean(e):o.prototype.writeValue.call(this,e);this.isWritingValue=!1},e.prototype.onChangedEvent=function(e){if(!this.isWritingValue){var t=this.elementRef.nativeElement,i=!1;switch(e.type){case"selected-items-changed":case"selected-item-changed":i="selectedItems"===(n=this.getSelectableProperty(t))||"selectedItem"===n;break;case"selected-values-changed":case"selected-changed":i="selectedValues"===(n=this.getSelectableProperty(t))||"selected"===n;break;default:i=!0}if(i){var n=void 0;n=this.isMultiSelectable(t)||this.isSelectable(t)?this.getSelectableProperty(t):this.isCheckedElement(t)?"checked":"value",this.onChange(t[n])}}},e.prototype.onInvalidChanged=function(){if(!this.ignoreInvalidChanges){var e=this.elementRef.nativeElement;this.isValidatable(e)&&this.control&&this.control.invalid!==e.invalid&&(this.ignoreInvalidChanges=!0,this.control.updateValueAndValidity(),this.ignoreInvalidChanges=!1)}},e.prototype.isCheckedElement=function(e){return this.isPropertyDefined(e,"checked")},e.prototype.isSelectable=function(e){return this.isPropertyDefined(e,"selected")||this.isPropertyDefined(e,"selectedItem")},e.prototype.isMultiSelectable=function(e){return!!e&&!0===e.multi&&(this.isPropertyDefined(e,"selectedValues")||this.isPropertyDefined(e,"selectedValues"))},e.prototype.isValidatable=function(e){return this.isPropertyDefined(e,"invalid")},e.prototype.shouldUseValidate=function(e){if("function"==typeof e.validate){this.ignoreInvalidChanges=!0;var t=e.invalid;e.validate();var i=e.invalid;e.invalid=!e.invalid,e.validate();var n=e.invalid===i;return e.invalid=t,this.ignoreInvalidChanges=!1,n}return!1},e.prototype.isPropertyDefined=function(e,t){return!!e&&t in e},e.prototype.getSelectableProperty=function(e,t){var i=this.isMultiSelectable(e),n=i?"selectedItems":"selectedItem",r=i?"selectedValues":"selected";if("boolean"!=typeof this.useSelectableValueProp){var o=n in e,a=r in e;if(o&&!a)this.useSelectableValueProp=!0;else if(!o&&a)this.useSelectableValueProp=!1;else{if(null==t)return undefined;var s=e[n];try{e[n]=t}catch(l){}this.useSelectableValueProp=e[n]===t,e[n]=s}}return this.useSelectableValueProp?n:r},e.decorators=[{type:i.Directive,args:[{selector:"[ngModel][origami],[formControlName][origami],[formControl][origami]",providers:[a]}]}],e.ctorParameters=function(){return[{type:i.ElementRef},{type:i.Injector},{type:i.Renderer2},{type:Boolean,decorators:[{type:i.Optional},{type:i.Inject,args:[n.COMPOSITION_BUFFER_MODE]}]}]},e.propDecorators={isInvalid:[{type:i.Input}],validationErrorsKey:[{type:i.Input}],onChangedEvent:[{type:i.HostListener,args:["selected-items-changed",["$event"]]},{type:i.HostListener,args:["selected-item-changed",["$event"]]},{type:i.HostListener,args:["selected-values-changed",["$event"]]},{type:i.HostListener,args:["selected-changed",["$event"]]},{type:i.HostListener,args:["checked-changed",["$event"]]},{type:i.HostListener,args:["value-changed",["$event"]]}],onInvalidChanged:[{type:i.HostListener,args:["invalid-changed"]}]},e}(n.DefaultValueAccessor),o=function(){function e(){}return e.decorators=[{type:i.NgModule,args:[{declarations:[t],exports:[t]}]}],e}();e.OrigamiFormsModule=o,e.ORIGAMI_CONTROL_VALUE_ACCESSOR=a,e.OrigamiControlValueAccessor=t,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=origami-forms.umd.min.js.map |
@@ -105,2 +105,3 @@ /** | ||
this.injector = injector; | ||
this.renderer = renderer; | ||
/** | ||
@@ -122,6 +123,6 @@ * The key to use when reporting that an element's `validate()` function | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
*/ | ||
this.isUpdatingValidity = false; | ||
this.ignoreInvalidChanges = false; | ||
} | ||
@@ -160,7 +161,7 @@ /** | ||
// validity | ||
if (typeof element.validate === 'function') { | ||
if (this.shouldUseValidate(element)) { | ||
control.setValidators(Validators.compose([ | ||
control.validator, | ||
() => { | ||
if (/** @type {?} */ ((element.validate))()) { | ||
if (element.validate()) { | ||
return null; | ||
@@ -275,3 +276,3 @@ } | ||
onInvalidChanged() { | ||
if (!this.isUpdatingValidity) { | ||
if (!this.ignoreInvalidChanges) { | ||
/** @type {?} */ | ||
@@ -282,5 +283,5 @@ const element = this.elementRef.nativeElement; | ||
this.control.invalid !== element.invalid) { | ||
this.isUpdatingValidity = true; | ||
this.ignoreInvalidChanges = true; | ||
this.control.updateValueAndValidity(); | ||
this.isUpdatingValidity = false; | ||
this.ignoreInvalidChanges = false; | ||
} | ||
@@ -330,2 +331,36 @@ } | ||
/** | ||
* @param {?} element | ||
* @return {?} | ||
*/ | ||
shouldUseValidate(element) { | ||
if (typeof element.validate === 'function') { | ||
// Some element's (such as `<vaadin-text-field>`) may not actually mutate | ||
// the `invalid` property when `validate()` is called. In these | ||
// situations, it's possible for Angular to set an element as invalid and | ||
// never be able to recover since the element's `validate()` will always | ||
// report it is invalid. | ||
// | ||
// In these situations, Origami should ignore the element's validate() | ||
// function. | ||
this.ignoreInvalidChanges = true; | ||
/** @type {?} */ | ||
const wasInvalid = element.invalid; | ||
// If the element does mutate `invalid`, ask it to do so first to get a | ||
// baseline. | ||
element.validate(); | ||
/** @type {?} */ | ||
const expected = element.invalid; | ||
element.invalid = !element.invalid; | ||
element.validate(); | ||
/** @type {?} */ | ||
const validateMutatesInvalid = element.invalid === expected; | ||
element.invalid = wasInvalid; | ||
this.ignoreInvalidChanges = false; | ||
return validateMutatesInvalid; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
/** | ||
* Determines whether or not a property is defined anywhere in the provided | ||
@@ -442,7 +477,7 @@ * element's prototype chain. | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
* @type {?} | ||
*/ | ||
OrigamiControlValueAccessor.prototype.isUpdatingValidity; | ||
OrigamiControlValueAccessor.prototype.ignoreInvalidChanges; | ||
/** | ||
@@ -464,4 +499,6 @@ * Indicates whether or not to use the value property or index property for a | ||
OrigamiControlValueAccessor.prototype.injector; | ||
/** @type {?} */ | ||
OrigamiControlValueAccessor.prototype.renderer; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsdWUtYWNjZXNzb3IuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AY29kZWJha2VyeS9vcmlnYW1pL2Zvcm1zLyIsInNvdXJjZXMiOlsic3JjL3ZhbHVlLWFjY2Vzc29yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBRUwsU0FBUyxFQUNULFVBQVUsRUFDVixZQUFZLEVBQ1osTUFBTSxFQUNOLFFBQVEsRUFDUixLQUFLLEVBRUwsUUFBUSxFQUVSLFNBQVMsRUFDVCxVQUFVLEVBQ1gsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixvQkFBb0IsRUFDcEIsaUJBQWlCLEVBQ2pCLFNBQVMsRUFDVCxVQUFVLEVBRVgsTUFBTSxnQkFBZ0IsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFvQ3hCLGFBQWEsOEJBQThCLEdBQWE7SUFDdEQsT0FBTyxFQ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bnRbdmFsdWVQcm9wXTtcbiAgICAgICAgLy8gV2hlbiB0aGUgZWxlbWVudCBoYXMgYm90aCBwcm9wZXJ0aWVzLCB0cnkgdG8gc2V0IGl0IHRvIHRoZSB2YWx1ZVxuICAgICAgICAvLyBwcm9wZXJ0eSBmaXJzdC4gSWYgaXQgZmFpbHMsIHRoZW4gdXNlIHRoZSBpbmRleCBwcm9wZXJ0eVxuICAgICAgICB0cnkge1xuICAgICAgICAgIGVsZW1lbnRbdmFsdWVQcm9wXSA9IHZhbHVlO1xuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgIC8vIENvdWxkIHRocm93IGlmIHRoZSB2YWx1ZSBpcyBhbiB1bmV4cGVjdGVkIHR5cGVcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiB0aGUgdmFsdWUgd2Ugc2V0IGl0IHRvIGlzIHN0aWxsIGFjY3VyYXRlLiBJZiBpdCdzXG4gICAgICAgIC8vIG5vdCB0aGVuIHRoZSBlbGVtZW50IHNpbGVudGx5IHJlamVjdGVkIHRoZSBuZXcgdmFsdWUuXG4gICAgICAgIHRoaXMudXNlU2VsZWN0YWJsZVZhbHVlUHJvcCA9IGVsZW1lbnRbdmFsdWVQcm9wXSA9PT0gdmFsdWU7XG4gICAgICAgIGVsZW1lbnRbdmFsdWVQcm9wXSA9IHByZXZpb3VzVmFsdWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB0aGlzLnVzZVNlbGVjdGFibGVWYWx1ZVByb3AgPyB2YWx1ZVByb3AgOiBpbmRleFByb3A7XG4gIH1cbn1cbiJdfQ== |
@@ -101,2 +101,3 @@ /** | ||
_this.injector = injector; | ||
_this.renderer = renderer; | ||
/** | ||
@@ -118,6 +119,6 @@ * The key to use when reporting that an element's `validate()` function | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
*/ | ||
_this.isUpdatingValidity = false; | ||
_this.ignoreInvalidChanges = false; | ||
return _this; | ||
@@ -174,7 +175,7 @@ } | ||
// validity | ||
if (typeof element.validate === 'function') { | ||
if (this.shouldUseValidate(element)) { | ||
control_1.setValidators(Validators.compose([ | ||
control_1.validator, | ||
function () { | ||
if (/** @type {?} */ ((element.validate))()) { | ||
if (element.validate()) { | ||
return null; | ||
@@ -344,3 +345,3 @@ } | ||
function () { | ||
if (!this.isUpdatingValidity) { | ||
if (!this.ignoreInvalidChanges) { | ||
/** @type {?} */ | ||
@@ -351,5 +352,5 @@ var element = this.elementRef.nativeElement; | ||
this.control.invalid !== element.invalid) { | ||
this.isUpdatingValidity = true; | ||
this.ignoreInvalidChanges = true; | ||
this.control.updateValueAndValidity(); | ||
this.isUpdatingValidity = false; | ||
this.ignoreInvalidChanges = false; | ||
} | ||
@@ -443,2 +444,40 @@ } | ||
/** | ||
* @param {?} element | ||
* @return {?} | ||
*/ | ||
OrigamiControlValueAccessor.prototype.shouldUseValidate = /** | ||
* @param {?} element | ||
* @return {?} | ||
*/ | ||
function (element) { | ||
if (typeof element.validate === 'function') { | ||
// Some element's (such as `<vaadin-text-field>`) may not actually mutate | ||
// the `invalid` property when `validate()` is called. In these | ||
// situations, it's possible for Angular to set an element as invalid and | ||
// never be able to recover since the element's `validate()` will always | ||
// report it is invalid. | ||
// | ||
// In these situations, Origami should ignore the element's validate() | ||
// function. | ||
this.ignoreInvalidChanges = true; | ||
/** @type {?} */ | ||
var wasInvalid = element.invalid; | ||
// If the element does mutate `invalid`, ask it to do so first to get a | ||
// baseline. | ||
element.validate(); | ||
/** @type {?} */ | ||
var expected = element.invalid; | ||
element.invalid = !element.invalid; | ||
element.validate(); | ||
/** @type {?} */ | ||
var validateMutatesInvalid = element.invalid === expected; | ||
element.invalid = wasInvalid; | ||
this.ignoreInvalidChanges = false; | ||
return validateMutatesInvalid; | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
/** | ||
* Determines whether or not a property is defined anywhere in the provided | ||
@@ -575,7 +614,7 @@ * element's prototype chain. | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
* @type {?} | ||
*/ | ||
OrigamiControlValueAccessor.prototype.isUpdatingValidity; | ||
OrigamiControlValueAccessor.prototype.ignoreInvalidChanges; | ||
/** | ||
@@ -597,4 +636,6 @@ * Indicates whether or not to use the value property or index property for a | ||
OrigamiControlValueAccessor.prototype.injector; | ||
/** @type {?} */ | ||
OrigamiControlValueAccessor.prototype.renderer; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsdWUtYWNjZXNzb3IuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AY29kZWJha2VyeS9vcmlnYW1pL2Zvcm1zLyIsInNvdXJjZXMiOlsic3JjL3ZhbHVlLWFjY2Vzc29yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUVMLFNBQVMsRUFDVCxVQUFVLEVBQ1YsWUFBWSxFQUNaLE1BQU0sRUFDTixRQUFRLEVBQ1IsS0FBSyxFQUVMLFFBQVEsRUFFUixTQUFTLEVBQ1QsVUFBVSxFQUNYLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFDTCx1QkFBdUIsRUFDdkIsb0JBQW9CLEVBQ3BCLGlCQUFpQixFQUNqQixTQUFTLEVBQ1QsVUFBVSxFQUVYLE1BQU0sZ0JBQWdCLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0N4QixXQUFhLDhCQUE4QixHQUFhO0lBQ3RELE9BQU8sRUFBRSxpQkFBaUI7S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IGlmIHRoZSB2YWx1ZSBpcyBhbiB1bmV4cGVjdGVkIHR5cGVcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIHRvIHNlZSBpZiB0aGUgdmFsdWUgd2Ugc2V0IGl0IHRvIGlzIHN0aWxsIGFjY3VyYXRlLiBJZiBpdCdzXG4gICAgICAgIC8vIG5vdCB0aGVuIHRoZSBlbGVtZW50IHNpbGVudGx5IHJlamVjdGVkIHRoZSBuZXcgdmFsdWUuXG4gICAgICAgIHRoaXMudXNlU2VsZWN0YWJsZVZhbHVlUHJvcCA9IGVsZW1lbnRbdmFsdWVQcm9wXSA9PT0gdmFsdWU7XG4gICAgICAgIGVsZW1lbnRbdmFsdWVQcm9wXSA9IHByZXZpb3VzVmFsdWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB0aGlzLnVzZVNlbGVjdGFibGVWYWx1ZVByb3AgPyB2YWx1ZVByb3AgOiBpbmRleFByb3A7XG4gIH1cbn1cbiJdfQ== |
@@ -72,2 +72,3 @@ import { Directive, ElementRef, HostListener, Inject, Injector, Input, Optional, Renderer2, forwardRef, NgModule } from '@angular/core'; | ||
this.injector = injector; | ||
this.renderer = renderer; | ||
/** | ||
@@ -89,6 +90,6 @@ * The key to use when reporting that an element's `validate()` function | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
*/ | ||
this.isUpdatingValidity = false; | ||
this.ignoreInvalidChanges = false; | ||
} | ||
@@ -127,7 +128,7 @@ /** | ||
// validity | ||
if (typeof element.validate === 'function') { | ||
if (this.shouldUseValidate(element)) { | ||
control.setValidators(Validators.compose([ | ||
control.validator, | ||
() => { | ||
if (/** @type {?} */ ((element.validate))()) { | ||
if (element.validate()) { | ||
return null; | ||
@@ -242,3 +243,3 @@ } | ||
onInvalidChanged() { | ||
if (!this.isUpdatingValidity) { | ||
if (!this.ignoreInvalidChanges) { | ||
/** @type {?} */ | ||
@@ -249,5 +250,5 @@ const element = this.elementRef.nativeElement; | ||
this.control.invalid !== element.invalid) { | ||
this.isUpdatingValidity = true; | ||
this.ignoreInvalidChanges = true; | ||
this.control.updateValueAndValidity(); | ||
this.isUpdatingValidity = false; | ||
this.ignoreInvalidChanges = false; | ||
} | ||
@@ -297,2 +298,36 @@ } | ||
/** | ||
* @param {?} element | ||
* @return {?} | ||
*/ | ||
shouldUseValidate(element) { | ||
if (typeof element.validate === 'function') { | ||
// Some element's (such as `<vaadin-text-field>`) may not actually mutate | ||
// the `invalid` property when `validate()` is called. In these | ||
// situations, it's possible for Angular to set an element as invalid and | ||
// never be able to recover since the element's `validate()` will always | ||
// report it is invalid. | ||
// | ||
// In these situations, Origami should ignore the element's validate() | ||
// function. | ||
this.ignoreInvalidChanges = true; | ||
/** @type {?} */ | ||
const wasInvalid = element.invalid; | ||
// If the element does mutate `invalid`, ask it to do so first to get a | ||
// baseline. | ||
element.validate(); | ||
/** @type {?} */ | ||
const expected = element.invalid; | ||
element.invalid = !element.invalid; | ||
element.validate(); | ||
/** @type {?} */ | ||
const validateMutatesInvalid = element.invalid === expected; | ||
element.invalid = wasInvalid; | ||
this.ignoreInvalidChanges = false; | ||
return validateMutatesInvalid; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
/** | ||
* Determines whether or not a property is defined anywhere in the provided | ||
@@ -408,2 +443,2 @@ * element's prototype chain. | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2FtaS1mb3Jtcy5qcy5tYXAiLCJzb3VyY2VzIjpbIm5nOi8vQGNvZGViYWtlcnkvb3JpZ2FtaS9mb3Jtcy9zcmMvdmFsdWUtYWNjZXNzb3IudHMiLCJuZzovL0Bjb2RlYmFrZXJ5L29yaWdhbWkvZm9ybXMvc3JjL2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FBQVEsWUFDUixNQUFNLFNBQUMsdUJBQXVCOzs7d0JBdkRoQyxLQUFLO2tDQVNMLEtBQUs7NkJBK0hMLFlBQVksU0FBQyx3QkFBd0IsRUFBRSxDQUFDLFFBQVEsQ0FBQyxjQUNqRCxZQUFZLFNBQUMsdUJBQXVCLEVBQUUsQ0FBQyxRQUFRLENBQUMsY0FDaEQsWUFBWSxTQUFDLHlCQUF5QixFQUFFLENBQUMsUUFBUSxDQUFDLGNBQ2xELFlBQVksU0FBQyxrQkFBa0IsRUFBRSxDQUFDLFFBQVEsQ0FBQyxjQUMzQyxZQUFZLFNBQUMsaUJBQWlCLEVBQUUsQ0FBQyxRQUFRLENBQUMsY0FDMUMsWUFBWSxTQUFDLGVBQWUsRUFBRSxDQUFDLFFBQVEsQ0FBQzsrQkFxRHhDLFlBQVksU0FBQyxpQkFBaUI7Ozs7Ozs7QUMxVGpDOzs7O0FBV0E7OztZQUpDLFFBQVEsU0FBQztnQkFDUixZQUFZLEVBQUUsQ0FBQywyQkFBMkIsQ0FBQztnQkFDM0MsT0FBTyxFQUFFLENBQUMsMkJBQTJCLENBQUM7YUFDdkM7Ozs7Ozs7Ozs7Ozs7OzsifQ== |
@@ -68,2 +68,3 @@ import { __extends } from 'tslib'; | ||
_this.injector = injector; | ||
_this.renderer = renderer; | ||
/** | ||
@@ -85,6 +86,6 @@ * The key to use when reporting that an element's `validate()` function | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
*/ | ||
_this.isUpdatingValidity = false; | ||
_this.ignoreInvalidChanges = false; | ||
return _this; | ||
@@ -141,7 +142,7 @@ } | ||
// validity | ||
if (typeof element.validate === 'function') { | ||
if (this.shouldUseValidate(element)) { | ||
control_1.setValidators(Validators.compose([ | ||
control_1.validator, | ||
function () { | ||
if (/** @type {?} */ ((element.validate))()) { | ||
if (element.validate()) { | ||
return null; | ||
@@ -311,3 +312,3 @@ } | ||
function () { | ||
if (!this.isUpdatingValidity) { | ||
if (!this.ignoreInvalidChanges) { | ||
/** @type {?} */ | ||
@@ -318,5 +319,5 @@ var element = this.elementRef.nativeElement; | ||
this.control.invalid !== element.invalid) { | ||
this.isUpdatingValidity = true; | ||
this.ignoreInvalidChanges = true; | ||
this.control.updateValueAndValidity(); | ||
this.isUpdatingValidity = false; | ||
this.ignoreInvalidChanges = false; | ||
} | ||
@@ -410,2 +411,40 @@ } | ||
/** | ||
* @param {?} element | ||
* @return {?} | ||
*/ | ||
OrigamiControlValueAccessor.prototype.shouldUseValidate = /** | ||
* @param {?} element | ||
* @return {?} | ||
*/ | ||
function (element) { | ||
if (typeof element.validate === 'function') { | ||
// Some element's (such as `<vaadin-text-field>`) may not actually mutate | ||
// the `invalid` property when `validate()` is called. In these | ||
// situations, it's possible for Angular to set an element as invalid and | ||
// never be able to recover since the element's `validate()` will always | ||
// report it is invalid. | ||
// | ||
// In these situations, Origami should ignore the element's validate() | ||
// function. | ||
this.ignoreInvalidChanges = true; | ||
/** @type {?} */ | ||
var wasInvalid = element.invalid; | ||
// If the element does mutate `invalid`, ask it to do so first to get a | ||
// baseline. | ||
element.validate(); | ||
/** @type {?} */ | ||
var expected = element.invalid; | ||
element.invalid = !element.invalid; | ||
element.validate(); | ||
/** @type {?} */ | ||
var validateMutatesInvalid = element.invalid === expected; | ||
element.invalid = wasInvalid; | ||
this.ignoreInvalidChanges = false; | ||
return validateMutatesInvalid; | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
/** | ||
* Determines whether or not a property is defined anywhere in the provided | ||
@@ -543,2 +582,2 @@ * element's prototype chain. | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2FtaS1mb3Jtcy5qcy5tYXAiLCJzb3VyY2VzIjpbIm5nOi8vQGNvZGViYWtlcnkvb3JpZ2FtaS9mb3Jtcy9zcmMvdmFsdWUtYWN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cbiAgICAgIHRoaXMuc3RhdHVzU3ViID0gY29udHJvbC5zdGF0dXNDaGFuZ2VzIS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICBpZiAodHlwZW9mIHRoaXMuaXNJbnZhbGlkID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgZWxlbWVudC5pbnZhbGlkID0gdGhpcy5pc0ludmFsaWQoY29udHJvbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZWxlbWVudC5pbnZhbGlkID0gISFjb250cm9sLmludmFsaWQgJiYgISFjb250cm9sLmRpcnR5O1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgLy8gQWxsb3dzIGN1c3RvbSBlbGVtZW50IHZhbGlkYXRlIGZ1bmN0aW9uIHRvIHVwZGF0ZSBBbmd1bGFyIGNvbnRyb2wnc1xuICAgICAgLy8gdmFsaWRpdHlcbiAgICAgIGlmICh0aGlzLnNob3VsZFVzZVZhbGlkYXRlKGVsZW1lbnQpKSB7XG4gICAgICAgIGNvbnRyb2wuc2V0VmFsaWRhdG9ycyhcbiAgICAgICAgICBWYWxpZGF0b3JzLmNvbXBvc2UoW1xuICAgICAgICAgICAgY29udHJvbC52YWxpZGF0b3IsXG4gICAgICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgICAgIGlmIChlbGVtZW50LnZhbGlkYXRlKCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4geyBbdGhpcy52YWxpZGF0aW9uRXJyb3JzS2V5XTogdHJ1ZSB9O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgXSlcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogTGlmZWN5Y2xlIGNhbGxiYWNrIHRvIGNsZWFuIHVwIHN1YnNjcmlwdGlvbnMuXG4gICAqL1x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EsQ0FBQyxjQUMxQyxZQUFZLFNBQUMsZUFBZSxFQUFFLENBQUMsUUFBUSxDQUFDO21DQXFEeEMsWUFBWSxTQUFDLGlCQUFpQjs7c0NBMVRqQztFQWlIaUQsb0JBQW9COzs7Ozs7QUNqSHJFOzs7Ozs7OztnQkFPQyxRQUFRLFNBQUM7b0JBQ1IsWUFBWSxFQUFFLENBQUMsMkJBQTJCLENBQUM7b0JBQzNDLE9BQU8sRUFBRSxDQUFDLDJCQUEyQixDQUFDO2lCQUN2Qzs7NkJBVkQ7Ozs7Ozs7Ozs7Ozs7OzsifQ== |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"OrigamiFormsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"OrigamiControlValueAccessor"}],"exports":[{"__symbolic":"reference","name":"OrigamiControlValueAccessor"}]}]}],"members":{}},"CheckedElementLike":{"__symbolic":"interface"},"SelectableLike":{"__symbolic":"interface"},"MultiSelectableLike":{"__symbolic":"interface"},"ValidatableLike":{"__symbolic":"interface"},"ORIGAMI_CONTROL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":58,"character":11},"useExisting":{"__symbolic":"reference","name":"OrigamiControlValueAccessor"},"multi":true},"OrigamiControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"DefaultValueAccessor","line":113,"character":49},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":108,"character":1},"arguments":[{"selector":"[ngModel][origami],[formControlName][origami],[formControl][origami]","providers":[{"__symbolic":"reference","name":"ORIGAMI_CONTROL_VALUE_ACCESSOR"}]}]}],"members":{"isInvalid":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":120,"character":3}}]}],"validationErrorsKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":129,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":174,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":175,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/forms","name":"COMPOSITION_BUFFER_MODE","line":175,"character":12}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":171,"character":23},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":172,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":173,"character":14},{"__symbolic":"reference","name":"boolean"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onChangedEvent":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":256,"character":3},"arguments":["selected-items-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":257,"character":3},"arguments":["selected-item-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":258,"character":3},"arguments":["selected-values-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":259,"character":3},"arguments":["selected-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":260,"character":3},"arguments":["checked-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":261,"character":3},"arguments":["value-changed",["$event"]]}]}],"onInvalidChanged":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":314,"character":3},"arguments":["invalid-changed"]}]}],"isCheckedElement":[{"__symbolic":"method"}],"isSelectable":[{"__symbolic":"method"}],"isMultiSelectable":[{"__symbolic":"method"}],"isValidatable":[{"__symbolic":"method"}],"isPropertyDefined":[{"__symbolic":"method"}],"getSelectableProperty":[{"__symbolic":"method"}]}}},"origins":{"OrigamiFormsModule":"./src/forms.module","CheckedElementLike":"./src/value-accessor","SelectableLike":"./src/value-accessor","MultiSelectableLike":"./src/value-accessor","ValidatableLike":"./src/value-accessor","ORIGAMI_CONTROL_VALUE_ACCESSOR":"./src/value-accessor","OrigamiControlValueAccessor":"./src/value-accessor"},"importAs":"@codebakery/origami/forms"} | ||
{"__symbolic":"module","version":4,"metadata":{"OrigamiFormsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"OrigamiControlValueAccessor"}],"exports":[{"__symbolic":"reference","name":"OrigamiControlValueAccessor"}]}]}],"members":{}},"CheckedElementLike":{"__symbolic":"interface"},"SelectableLike":{"__symbolic":"interface"},"MultiSelectableLike":{"__symbolic":"interface"},"ValidatableLike":{"__symbolic":"interface"},"ORIGAMI_CONTROL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":58,"character":11},"useExisting":{"__symbolic":"reference","name":"OrigamiControlValueAccessor"},"multi":true},"OrigamiControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"DefaultValueAccessor","line":113,"character":49},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":108,"character":1},"arguments":[{"selector":"[ngModel][origami],[formControlName][origami],[formControl][origami]","providers":[{"__symbolic":"reference","name":"ORIGAMI_CONTROL_VALUE_ACCESSOR"}]}]}],"members":{"isInvalid":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":120,"character":3}}]}],"validationErrorsKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":129,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":174,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":175,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/forms","name":"COMPOSITION_BUFFER_MODE","line":175,"character":12}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":171,"character":23},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":172,"character":24},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":173,"character":24},{"__symbolic":"reference","name":"boolean"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"onChangedEvent":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":256,"character":3},"arguments":["selected-items-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":257,"character":3},"arguments":["selected-item-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":258,"character":3},"arguments":["selected-values-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":259,"character":3},"arguments":["selected-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":260,"character":3},"arguments":["checked-changed",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":261,"character":3},"arguments":["value-changed",["$event"]]}]}],"onInvalidChanged":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":314,"character":3},"arguments":["invalid-changed"]}]}],"isCheckedElement":[{"__symbolic":"method"}],"isSelectable":[{"__symbolic":"method"}],"isMultiSelectable":[{"__symbolic":"method"}],"isValidatable":[{"__symbolic":"method"}],"shouldUseValidate":[{"__symbolic":"method"}],"isPropertyDefined":[{"__symbolic":"method"}],"getSelectableProperty":[{"__symbolic":"method"}]}}},"origins":{"OrigamiFormsModule":"./src/forms.module","CheckedElementLike":"./src/value-accessor","SelectableLike":"./src/value-accessor","MultiSelectableLike":"./src/value-accessor","ValidatableLike":"./src/value-accessor","ORIGAMI_CONTROL_VALUE_ACCESSOR":"./src/value-accessor","OrigamiControlValueAccessor":"./src/value-accessor"},"importAs":"@codebakery/origami/forms"} |
@@ -82,2 +82,3 @@ import { AfterViewInit, ElementRef, Injector, OnDestroy, Provider, Renderer2 } from '@angular/core'; | ||
protected injector: Injector; | ||
protected renderer: Renderer2; | ||
/** | ||
@@ -115,6 +116,6 @@ * Overrides the logic to determine what to set an element's `invalid` | ||
* Flag that informs the value accessor that it is currently updating an | ||
* element's validity and should ignore additional `invalid` property changes | ||
* until it is complete. | ||
* element and should ignore additional `invalid` property changes until it is | ||
* complete. | ||
*/ | ||
private isUpdatingValidity; | ||
private ignoreInvalidChanges; | ||
/** | ||
@@ -189,2 +190,5 @@ * Indicates whether or not to use the value property or index property for a | ||
isValidatable(element: any): element is ValidatableLike; | ||
shouldUseValidate(element: any): element is { | ||
validate(): void; | ||
}; | ||
/** | ||
@@ -191,0 +195,0 @@ * Determines whether or not a property is defined anywhere in the provided |
{ | ||
"$schema": "./node_modules/ng-packagr/package.schema.json", | ||
"name": "@codebakery/origami", | ||
"version": "3.0.0-beta.3", | ||
"version": "3.0.0-beta.4", | ||
"description": "Angular + Polymer", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
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
1165738
8973