nativescript-accordion
Advanced tools
Comparing version 6.0.0-alpha.2 to 6.0.0-alpha.3
@@ -82,8 +82,8 @@ "use strict"; | ||
_this._getHasHeader = function () { | ||
var length = _this._headerTemplatesInternal ? _this._headerTemplatesInternal.length : 0; | ||
return !!(_this.headerTemplate || (length > 0)); | ||
var contains = _this._headerTemplatesInternal && _this._headerTemplatesInternal.length > 0; | ||
return !!(_this.headerTemplate || contains); | ||
}; | ||
_this._getHasFooter = function () { | ||
var length = _this._footerTemplatesInternal ? _this._footerTemplatesInternal.length : 0; | ||
return !!(_this.footerTemplate || (length > 0)); | ||
var contains = _this._footerTemplatesInternal && _this._footerTemplatesInternal.length > 0; | ||
return !!(_this.headerTemplate || contains); | ||
}; | ||
@@ -90,0 +90,0 @@ return _this; |
@@ -43,2 +43,4 @@ import { AfterContentInit, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, InjectionToken, IterableDiffer, IterableDiffers, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core'; | ||
footerTemplateSelector: string | ((item: any, index: number, items: any) => string); | ||
_getHasHeader: any; | ||
_getHasFooter: any; | ||
refresh(): void; | ||
@@ -45,0 +47,0 @@ on(event: 'headerLoading', callback: (args: EventData) => void, thisArg?: any): any; |
@@ -74,6 +74,9 @@ "use strict"; | ||
AccordionItemsComponent.prototype.setItemTemplates = function () { | ||
this.headerTemplate = this.itemTemplateQuery; | ||
this.itemHeaderTemplate = this.itemTemplateQuery; | ||
this.itemContentTemplate = this.itemTemplateQuery; | ||
this.footerTemplate = this.itemTemplateQuery; | ||
this.accordionItemsView._getHasHeader = function () { | ||
return false; | ||
}; | ||
this.accordionItemsView._getHasFooter = function () { | ||
return false; | ||
}; | ||
if (this._templateHeaderMap) { | ||
@@ -89,2 +92,7 @@ var templates_1 = []; | ||
} | ||
if (templates_1.length > 0) { | ||
this.accordionItemsView._getHasHeader = function () { | ||
return true; | ||
}; | ||
} | ||
this.accordionItemsView.headerTemplates = templates_1; | ||
@@ -129,2 +137,7 @@ } | ||
} | ||
if (templates_4.length > 0) { | ||
this.accordionItemsView._getHasFooter = function () { | ||
return true; | ||
}; | ||
} | ||
this.accordionItemsView.footerTemplates = templates_4; | ||
@@ -131,0 +144,0 @@ } |
{ | ||
"name": "nativescript-accordion", | ||
"version": "6.0.0-alpha.2", | ||
"version": "6.0.0-alpha.3", | ||
"description": "A layout which supports expanding and collapsing child views", | ||
@@ -5,0 +5,0 @@ "main": "accordion", |
@@ -77,2 +77,7 @@ module.exports = function accordion(Vue) { | ||
if (headerTemplates.length > 0) { | ||
this.$refs.accordion.setAttribute('_getHasHeader', () => { | ||
return false; | ||
}); | ||
} | ||
const itemContentTemplates = this.$templates.getKeyedTemplates().filter(item => { | ||
@@ -107,2 +112,9 @@ if (item.key === 'content') { | ||
if (footerTemplates.length > 0) { | ||
this.$refs.accordion.setAttribute('_getHasFooter', () => { | ||
return false; | ||
}); | ||
} | ||
this.$refs.accordion.setAttribute( | ||
@@ -109,0 +121,0 @@ '_headerTemplatesInternal', |
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
175883
3486