New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@progress/kendo-angular-buttons

Package Overview
Dependencies
Maintainers
1
Versions
1087
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress/kendo-angular-buttons - npm Package Compare versions

Comparing version

to
0.14.1

dist/es/util.d.ts

2

dist/cdn/js/kendo-angular-buttons.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("rxjs/Subject")):"function"==typeof define&&define.amd?define(["@angular/core","rxjs/Subject"],e):"object"==typeof exports?exports.KendoAngularButtons=e(require("@angular/core"),require("rxjs/Subject")):t.KendoAngularButtons=e(t["@angular/core"],t["rxjs/Subject"])}(this,function(t,e){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var o=n(1);e.Button=o.ButtonDirective;var i=n(5);e.ButtonGroup=i.ButtonGroupComponent;var r=n(6);e.ButtonsModule=r.ButtonsModule},function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},r=this&&this.__param||function(t,e){return function(n,o){e(n,o,t)}},s=n(2),c=n(3),u=function(){function t(t,e,n){this.service=n,this.togglable=!1,this.primary=!1,this.isDisabled=!1,this.isIcon=!1,this.selected=!1,this.tabIndex=0,this.element=t.nativeElement,this.renderer=e}return Object.defineProperty(t.prototype,"icon",{set:function(t){var e=this;this.iconSetter(t,function(){e.isIcon=!0;var n="k-icon k-i-"+t;e.addIcon(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{set:function(t){this.iconSetter(t,this.addIcon.bind(this))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{set:function(t){this.iconSetter(t,this.addImgIcon.bind(this))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{set:function(t){this.isDisabled=t,this.renderer.setElementProperty(this.element,"disabled",t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){var t=0;return"undefined"!=typeof document&&(t=this.element.innerText.length),this.resolveClasses({"k-button":!0,"k-state-disabled":this.isDisabled,"k-primary":this.primary,"k-state-active":this.selected,"k-button-icontext":this.isIcon&&t,"k-button-icon":this.isIcon&&!t})},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){!this.disabled&&this.service&&this.service.click(this),this.service||(this.selected=!this.selected)},t.prototype.ngOnDestroy=function(){this.removeNode()},t.prototype.setAttribute=function(t,e){this.renderer.setElementAttribute(this.element,t,e)},t.prototype.resolveClasses=function(t){var e="";return Object.keys(t).forEach(function(n){e+=t[n]?n+" ":""}),e},t.prototype.addImgIcon=function(t){this.imageNode=this.imageNode||document.createElement("img"),this.imageNode.src=t,this.imageNode.className="k-image",this.imageNode.setAttribute("role","presentation"),this.element.insertBefore(this.imageNode,this.element.firstChild)},t.prototype.addIcon=function(t){this.iconNode?this.iconNode.className=t:(this.iconNode=document.createElement("span"),this.iconNode.className=t,this.iconNode.setAttribute("role","presentation"),this.element.insertBefore(this.iconNode,this.element.firstChild))},t.prototype.iconSetter=function(t,e){void 0===t?this.removeNode():e(t)},t.prototype.removeNode=function(){this.imageNode&&this.element.removeChild(this.imageNode),this.iconNode&&this.element.removeChild(this.iconNode)},o([s.Input(),i("design:type",Boolean)],t.prototype,"togglable",void 0),o([s.Input(),i("design:type",Boolean)],t.prototype,"primary",void 0),o([s.Input(),i("design:type",String),i("design:paramtypes",[String])],t.prototype,"icon",null),o([s.Input(),i("design:type",Boolean)],t.prototype,"selected",void 0),o([s.Input(),i("design:type",Number)],t.prototype,"tabIndex",void 0),o([s.Input(),i("design:type",String),i("design:paramtypes",[String])],t.prototype,"iconClass",null),o([s.Input(),i("design:type",String),i("design:paramtypes",[String])],t.prototype,"imageUrl",null),o([s.Input(),i("design:type",Boolean),i("design:paramtypes",[Boolean])],t.prototype,"disabled",null),o([s.HostBinding("class"),i("design:type",String)],t.prototype,"className",null),o([s.HostListener("click"),i("design:type",Function),i("design:paramtypes",[]),i("design:returntype",void 0)],t.prototype,"onClick",null),t=o([s.Directive({selector:"button[kendoButton]"}),r(2,s.Optional()),i("design:paramtypes",[s.ElementRef,s.Renderer,c.KendoButtonService])],t)}();e.ButtonDirective=u},function(e,n){e.exports=t},function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},r=n(2),s=n(4),c=function(){function t(){this.buttonClicked=new s.Subject,this.buttonClicked$=this.buttonClicked.asObservable()}return t.prototype.click=function(t){this.buttonClicked.next(t)},t=o([r.Injectable(),i("design:paramtypes",[])],t)}();e.KendoButtonService=c},function(t,n){t.exports=e},function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},r=n(1),s=n(2),c=n(3),u="aria-checked",l="role",a="tabindex",p=function(){function t(t){this.service=t,this.selection="multiple"}return Object.defineProperty(t.prototype,"className",{get:function(){return"k-button-group"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"getRole",{get:function(){return this.isSelectionSingle()?"radiogroup":"group"},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.subscription=this.service.buttonClicked$.subscribe(function(e){t.isSelectionSingle()?(t.deactivate(t.buttons.filter(function(t){return t!==e})),e.selected=!0):e.selected=!e.selected,e.setAttribute(u,e.selected.toString()),e.setAttribute(a,e.tabIndex.toString())})},t.prototype.ngAfterContentInit=function(){var t=this.isSelectionSingle(),e=t?"radio":"checkbox",n=!1;this.buttons.forEach(function(o){o.setAttribute(u,o.selected.toString()),o.setAttribute(l,e),!t||o.selected?o.setAttribute(a,o.tabIndex.toString()):t&&!o.selected&&o.setAttribute(a,"-1"),n=n||o.selected}),t&&!n&&(this.buttons.first.setAttribute(a,this.buttons.first.tabIndex.toString()),this.buttons.last.setAttribute(a,this.buttons.last.tabIndex.toString()))},t.prototype.ngAfterViewChecked=function(){this.buttons.length&&(this.buttons.first.renderer.setElementClass(this.buttons.first.element,"k-group-start",!0),this.buttons.last.renderer.setElementClass(this.buttons.last.element,"k-group-end",!0))},t.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},t.prototype.ngAfterContentChecked=function(){this.verifySettings()},t.prototype.deactivate=function(t){t.forEach(function(t){t.selected=!1,t.setAttribute(u,t.selected.toString()),t.setAttribute(a,"-1")})},t.prototype.verifySettings=function(){if(s.isDevMode()&&this.isSelectionSingle()&&this.buttons.filter(function(t){return t.selected}).length>1)throw new Error("Having multiple selected buttons with single selection mode is not supported")},t.prototype.isSelectionSingle=function(){return"single"===this.selection},o([s.Input("disabled"),i("design:type",Boolean)],t.prototype,"disabled",void 0),o([s.Input("selection"),i("design:type",String)],t.prototype,"selection",void 0),o([s.ContentChildren(r.ButtonDirective),i("design:type",s.QueryList)],t.prototype,"buttons",void 0),o([s.HostBinding("class"),i("design:type",String)],t.prototype,"className",null),o([s.HostBinding("attr.role"),i("design:type",String)],t.prototype,"getRole",null),t=o([s.Component({providers:[c.KendoButtonService],selector:"kendo-button-group",template:'\n <ng-content select="[kendoButton]"></ng-content>\n '}),i("design:paramtypes",[c.KendoButtonService])],t)}();e.ButtonGroupComponent=p},function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},r=n(2),s=n(1),c=n(5),u=[s.ButtonDirective,c.ButtonGroupComponent],l=function(){function t(){}return t=o([r.NgModule({declarations:[u],exports:[u]}),i("design:paramtypes",[])],t)}();e.ButtonsModule=l}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("rxjs/Subject")):"function"==typeof define&&define.amd?define(["@angular/core","rxjs/Subject"],t):"object"==typeof exports?exports.KendoAngularButtons=t(require("@angular/core"),require("rxjs/Subject")):e.KendoAngularButtons=t(e["@angular/core"],e["rxjs/Subject"])}(this,function(e,t){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var i=n(1);t.Button=i.ButtonDirective;var o=n(6);t.ButtonGroup=o.ButtonGroupComponent;var r=n(7);t.ButtonsModule=r.ButtonsModule},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}},s=n(2),c=n(3),l=n(5),u=function(){function e(e,t,n){this.service=n,this.togglable=!1,this.primary=!1,this.isDisabled=!1,this.isIcon=!1,this.selected=!1,this.tabIndex=0,this.element=e.nativeElement,this.renderer=t}return Object.defineProperty(e.prototype,"icon",{set:function(e){var t=this;this.iconSetter(e,function(){t.isIcon=!0;var n="k-icon k-i-"+e;t.addIcon(n)})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{set:function(e){this.iconSetter(e,this.addIcon.bind(this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{set:function(e){this.iconSetter(e,this.addImgIcon.bind(this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{set:function(e){this.isDisabled=e,this.renderer.setElementProperty(this.element,"disabled",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){var e=0;return l.isDocumentAvailable()&&(e=this.element.innerText.length),this.resolveClasses({"k-button":!0,"k-state-disabled":this.isDisabled,"k-primary":this.primary,"k-state-active":this.selected,"k-button-icontext":this.isIcon&&e,"k-button-icon":this.isIcon&&!e})},enumerable:!0,configurable:!0}),e.prototype.onClick=function(){!this.disabled&&this.service&&this.service.click(this),this.service||(this.selected=!this.selected)},e.prototype.ngOnDestroy=function(){this.removeNode()},e.prototype.setAttribute=function(e,t){this.renderer.setElementAttribute(this.element,e,t)},e.prototype.resolveClasses=function(e){var t="";return Object.keys(e).forEach(function(n){t+=e[n]?n+" ":""}),t},e.prototype.addImgIcon=function(e){var t=this.renderer;this.imageNode?t.setElementProperty(this.imageNode,"src",e):l.isDocumentAvailable()&&(this.imageNode=this.createFirstChildElement("img"),t.setElementProperty(this.imageNode,"src",e),t.setElementProperty(this.imageNode,"className","k-image"),t.setElementAttribute(this.imageNode,"role","presentation"))},e.prototype.addIcon=function(e){var t=this.renderer;this.iconNode?t.setElementProperty(this.iconNode,"className",e):l.isDocumentAvailable()&&(this.iconNode=this.createFirstChildElement("span"),t.setElementProperty(this.iconNode,"className",e),t.setElementAttribute(this.iconNode,"role","presentation"))},e.prototype.createFirstChildElement=function(e){var t=this.renderer.createElement(this.element,e);return t!==this.element.firstChild&&this.renderer.invokeElementMethod(this.element,"insertBefore",[t,this.element.firstChild]),t},e.prototype.iconSetter=function(e,t){void 0===e?this.removeNode():t(e)},e.prototype.removeNode=function(){this.imageNode&&this.renderer.invokeElementMethod(this.element,"removeChild",[this.imageNode]),this.iconNode&&this.renderer.invokeElementMethod(this.element,"removeChild",[this.iconNode])},i([s.Input(),o("design:type",Boolean)],e.prototype,"togglable",void 0),i([s.Input(),o("design:type",Boolean)],e.prototype,"primary",void 0),i([s.Input(),o("design:type",String),o("design:paramtypes",[String])],e.prototype,"icon",null),i([s.Input(),o("design:type",Boolean)],e.prototype,"selected",void 0),i([s.Input(),o("design:type",Number)],e.prototype,"tabIndex",void 0),i([s.Input(),o("design:type",String),o("design:paramtypes",[String])],e.prototype,"iconClass",null),i([s.Input(),o("design:type",String),o("design:paramtypes",[String])],e.prototype,"imageUrl",null),i([s.Input(),o("design:type",Boolean),o("design:paramtypes",[Boolean])],e.prototype,"disabled",null),i([s.HostBinding("class"),o("design:type",String)],e.prototype,"className",null),i([s.HostListener("click"),o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],e.prototype,"onClick",null),e=i([s.Directive({selector:"button[kendoButton]"}),r(2,s.Optional()),o("design:paramtypes",[s.ElementRef,s.Renderer,c.KendoButtonService])],e)}();t.ButtonDirective=u},function(t,n){t.exports=e},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),s=n(4),c=function(){function e(){this.buttonClicked=new s.Subject,this.buttonClicked$=this.buttonClicked.asObservable()}return e.prototype.click=function(e){this.buttonClicked.next(e)},e=i([r.Injectable(),o("design:paramtypes",[])],e)}();t.KendoButtonService=c},function(e,n){e.exports=t},function(e,t){"use strict";t.isDocumentAvailable=function(){return"undefined"!=typeof document}},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(1),s=n(2),c=n(3),l="aria-checked",u="role",a="tabindex",p=function(){function e(e){this.service=e,this.selection="multiple"}return Object.defineProperty(e.prototype,"className",{get:function(){return"k-button-group"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getRole",{get:function(){return this.isSelectionSingle()?"radiogroup":"group"},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.subscription=this.service.buttonClicked$.subscribe(function(t){e.isSelectionSingle()?(e.deactivate(e.buttons.filter(function(e){return e!==t})),t.selected=!0):t.selected=!t.selected,t.setAttribute(l,t.selected.toString()),t.setAttribute(a,t.tabIndex.toString())})},e.prototype.ngAfterContentInit=function(){var e=this.isSelectionSingle(),t=e?"radio":"checkbox",n=!1;this.buttons.forEach(function(i){i.setAttribute(l,i.selected.toString()),i.setAttribute(u,t),!e||i.selected?i.setAttribute(a,i.tabIndex.toString()):e&&!i.selected&&i.setAttribute(a,"-1"),n=n||i.selected}),e&&!n&&(this.buttons.first.setAttribute(a,this.buttons.first.tabIndex.toString()),this.buttons.last.setAttribute(a,this.buttons.last.tabIndex.toString()))},e.prototype.ngAfterViewChecked=function(){this.buttons.length&&(this.buttons.first.renderer.setElementClass(this.buttons.first.element,"k-group-start",!0),this.buttons.last.renderer.setElementClass(this.buttons.last.element,"k-group-end",!0))},e.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.deactivate=function(e){e.forEach(function(e){e.selected=!1,e.setAttribute(l,e.selected.toString()),e.setAttribute(a,"-1")})},e.prototype.verifySettings=function(){if(s.isDevMode()&&this.isSelectionSingle()&&this.buttons.filter(function(e){return e.selected}).length>1)throw new Error("Having multiple selected buttons with single selection mode is not supported")},e.prototype.isSelectionSingle=function(){return"single"===this.selection},i([s.Input("disabled"),o("design:type",Boolean)],e.prototype,"disabled",void 0),i([s.Input("selection"),o("design:type",String)],e.prototype,"selection",void 0),i([s.ContentChildren(r.ButtonDirective),o("design:type",s.QueryList)],e.prototype,"buttons",void 0),i([s.HostBinding("class"),o("design:type",String)],e.prototype,"className",null),i([s.HostBinding("attr.role"),o("design:type",String)],e.prototype,"getRole",null),e=i([s.Component({providers:[c.KendoButtonService],selector:"kendo-button-group",template:'\n <ng-content select="[kendoButton]"></ng-content>\n '}),o("design:paramtypes",[c.KendoButtonService])],e)}();t.ButtonGroupComponent=p},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var o,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(s=(r<3?o(s):r>3?o(t,n,s):o(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=n(2),s=n(1),c=n(6),l=[s.ButtonDirective,c.ButtonGroupComponent],u=function(){function e(){}return e=i([r.NgModule({declarations:[l],exports:[l]}),o("design:paramtypes",[])],e)}();t.ButtonsModule=u}])});

@@ -57,2 +57,5 @@ import { ElementRef, Renderer, OnDestroy } from '@angular/core';

ngOnDestroy(): void;
/**
* @hidden
*/
setAttribute(attribute: string, value: string): void;

@@ -62,4 +65,5 @@ private resolveClasses(classes);

private addIcon(classNames);
private createFirstChildElement(tagName);
private iconSetter(icon, insertIcon);
private removeNode();
}
import { Directive, ElementRef, HostBinding, HostListener, Input, Renderer, Optional } from '@angular/core';
import { KendoButtonService } from './button.service';
import { isDocumentAvailable } from './util';
/**

@@ -83,3 +84,3 @@ * Represents the Kendo UI Button component for Angular.

var textContent = 0;
if (typeof document !== 'undefined') {
if (isDocumentAvailable()) {
textContent = this.element.innerText.length;

@@ -113,2 +114,5 @@ }

};
/**
* @hidden
*/
ButtonDirective.prototype.setAttribute = function (attribute, value) {

@@ -125,19 +129,31 @@ this.renderer.setElementAttribute(this.element, attribute, value);

ButtonDirective.prototype.addImgIcon = function (imageUrl) {
this.imageNode = this.imageNode || document.createElement('img');
this.imageNode.src = imageUrl;
this.imageNode.className = 'k-image';
this.imageNode.setAttribute('role', 'presentation');
this.element.insertBefore(this.imageNode, this.element.firstChild);
var renderer = this.renderer;
if (this.imageNode) {
renderer.setElementProperty(this.imageNode, 'src', imageUrl);
}
else if (isDocumentAvailable()) {
this.imageNode = this.createFirstChildElement('img');
renderer.setElementProperty(this.imageNode, 'src', imageUrl);
renderer.setElementProperty(this.imageNode, 'className', 'k-image');
renderer.setElementAttribute(this.imageNode, 'role', 'presentation');
}
};
ButtonDirective.prototype.addIcon = function (classNames) {
var renderer = this.renderer;
if (this.iconNode) {
this.iconNode.className = classNames;
renderer.setElementProperty(this.iconNode, 'className', classNames);
}
else {
this.iconNode = document.createElement('span');
this.iconNode.className = classNames;
this.iconNode.setAttribute('role', 'presentation');
this.element.insertBefore(this.iconNode, this.element.firstChild);
else if (isDocumentAvailable()) {
this.iconNode = this.createFirstChildElement('span');
renderer.setElementProperty(this.iconNode, 'className', classNames);
renderer.setElementAttribute(this.iconNode, 'role', 'presentation');
}
};
ButtonDirective.prototype.createFirstChildElement = function (tagName) {
var node = this.renderer.createElement(this.element, tagName);
if (node !== this.element.firstChild) {
this.renderer.invokeElementMethod(this.element, 'insertBefore', [node, this.element.firstChild]);
}
return node;
};
ButtonDirective.prototype.iconSetter = function (icon, insertIcon) {

@@ -153,6 +169,6 @@ if (icon === undefined) {

if (this.imageNode) {
this.element.removeChild(this.imageNode);
this.renderer.invokeElementMethod(this.element, 'removeChild', [this.imageNode]);
}
if (this.iconNode) {
this.element.removeChild(this.iconNode);
this.renderer.invokeElementMethod(this.element, 'removeChild', [this.iconNode]);
}

@@ -159,0 +175,0 @@ };

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

{"__symbolic":"module","version":1,"metadata":{"ButtonDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"button[kendoButton]"}]}],"members":{"togglable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"primary":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"selected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"iconClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"imageUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./button.service","name":"KendoButtonService"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"setAttribute":[{"__symbolic":"method"}],"resolveClasses":[{"__symbolic":"method"}],"addImgIcon":[{"__symbolic":"method"}],"addIcon":[{"__symbolic":"method"}],"iconSetter":[{"__symbolic":"method"}],"removeNode":[{"__symbolic":"method"}]}}}}
{"__symbolic":"module","version":1,"metadata":{"ButtonDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"button[kendoButton]"}]}],"members":{"togglable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"primary":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"selected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"iconClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"imageUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./button.service","name":"KendoButtonService"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"setAttribute":[{"__symbolic":"method"}],"resolveClasses":[{"__symbolic":"method"}],"addImgIcon":[{"__symbolic":"method"}],"addIcon":[{"__symbolic":"method"}],"createFirstChildElement":[{"__symbolic":"method"}],"iconSetter":[{"__symbolic":"method"}],"removeNode":[{"__symbolic":"method"}]}}}}

@@ -57,2 +57,5 @@ import { ElementRef, Renderer, OnDestroy } from '@angular/core';

ngOnDestroy(): void;
/**
* @hidden
*/
setAttribute(attribute: string, value: string): void;

@@ -62,4 +65,5 @@ private resolveClasses(classes);

private addIcon(classNames);
private createFirstChildElement(tagName);
private iconSetter(icon, insertIcon);
private removeNode();
}
"use strict";
var core_1 = require('@angular/core');
var button_service_1 = require('./button.service');
var util_1 = require('./util');
/**

@@ -84,3 +85,3 @@ * Represents the Kendo UI Button component for Angular.

var textContent = 0;
if (typeof document !== 'undefined') {
if (util_1.isDocumentAvailable()) {
textContent = this.element.innerText.length;

@@ -114,2 +115,5 @@ }

};
/**
* @hidden
*/
ButtonDirective.prototype.setAttribute = function (attribute, value) {

@@ -126,19 +130,31 @@ this.renderer.setElementAttribute(this.element, attribute, value);

ButtonDirective.prototype.addImgIcon = function (imageUrl) {
this.imageNode = this.imageNode || document.createElement('img');
this.imageNode.src = imageUrl;
this.imageNode.className = 'k-image';
this.imageNode.setAttribute('role', 'presentation');
this.element.insertBefore(this.imageNode, this.element.firstChild);
var renderer = this.renderer;
if (this.imageNode) {
renderer.setElementProperty(this.imageNode, 'src', imageUrl);
}
else if (util_1.isDocumentAvailable()) {
this.imageNode = this.createFirstChildElement('img');
renderer.setElementProperty(this.imageNode, 'src', imageUrl);
renderer.setElementProperty(this.imageNode, 'className', 'k-image');
renderer.setElementAttribute(this.imageNode, 'role', 'presentation');
}
};
ButtonDirective.prototype.addIcon = function (classNames) {
var renderer = this.renderer;
if (this.iconNode) {
this.iconNode.className = classNames;
renderer.setElementProperty(this.iconNode, 'className', classNames);
}
else {
this.iconNode = document.createElement('span');
this.iconNode.className = classNames;
this.iconNode.setAttribute('role', 'presentation');
this.element.insertBefore(this.iconNode, this.element.firstChild);
else if (util_1.isDocumentAvailable()) {
this.iconNode = this.createFirstChildElement('span');
renderer.setElementProperty(this.iconNode, 'className', classNames);
renderer.setElementAttribute(this.iconNode, 'role', 'presentation');
}
};
ButtonDirective.prototype.createFirstChildElement = function (tagName) {
var node = this.renderer.createElement(this.element, tagName);
if (node !== this.element.firstChild) {
this.renderer.invokeElementMethod(this.element, 'insertBefore', [node, this.element.firstChild]);
}
return node;
};
ButtonDirective.prototype.iconSetter = function (icon, insertIcon) {

@@ -154,6 +170,6 @@ if (icon === undefined) {

if (this.imageNode) {
this.element.removeChild(this.imageNode);
this.renderer.invokeElementMethod(this.element, 'removeChild', [this.imageNode]);
}
if (this.iconNode) {
this.element.removeChild(this.iconNode);
this.renderer.invokeElementMethod(this.element, 'removeChild', [this.iconNode]);
}

@@ -160,0 +176,0 @@ };

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

{"__symbolic":"module","version":1,"metadata":{"ButtonDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"button[kendoButton]"}]}],"members":{"togglable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"primary":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"selected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"iconClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"imageUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./button.service","name":"KendoButtonService"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"setAttribute":[{"__symbolic":"method"}],"resolveClasses":[{"__symbolic":"method"}],"addImgIcon":[{"__symbolic":"method"}],"addIcon":[{"__symbolic":"method"}],"iconSetter":[{"__symbolic":"method"}],"removeNode":[{"__symbolic":"method"}]}}}}
{"__symbolic":"module","version":1,"metadata":{"ButtonDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"button[kendoButton]"}]}],"members":{"togglable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"primary":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"icon":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"selected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"iconClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"imageUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["class"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./button.service","name":"KendoButtonService"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"setAttribute":[{"__symbolic":"method"}],"resolveClasses":[{"__symbolic":"method"}],"addImgIcon":[{"__symbolic":"method"}],"addIcon":[{"__symbolic":"method"}],"createFirstChildElement":[{"__symbolic":"method"}],"iconSetter":[{"__symbolic":"method"}],"removeNode":[{"__symbolic":"method"}]}}}}
{
"name": "@progress/kendo-angular-buttons",
"description": "Buttons Package for Angular 2",
"version": "0.14.0",
"version": "0.14.1",
"publishConfig": {

@@ -41,9 +41,9 @@ "registry": "https://registry.npm.telerik.com"

"devDependencies": {
"@angular/common": "2.2.1",
"@angular/core": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@angular/common": "~2.2.0",
"@angular/core": "~2.2.0",
"@angular/compiler": "~2.2.0",
"@angular/compiler-cli": "~2.2.0",
"@angular/platform-browser": "~2.2.0",
"@angular/platform-browser-dynamic": "~2.2.0",
"@angular/platform-server": "~2.2.0",
"@progress/kendo-angular-tasks": "^6.0.0",

@@ -50,0 +50,0 @@ "@telerik/kendo-theme-default": "^1.24.0",