@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 21.7 kB
JavaScript
module.exports=function(t){function e(n){if(i[n])return i[n].exports;var a=i[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}({0:function(t,e,i){i(1605),t.exports=i(1605)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},20:function(t,e){t.exports=require("../kendo.core")},1057:function(t,e){t.exports=require("jquery")},1605:function(t,e,i){var n,a,s;(function(r){!function(r,define){a=[i(20)],n=r,s="function"==typeof n?n.apply(e,a):n,!(void 0!==s&&(t.exports=s))}(function(){return function(t,e){var i=window.kendo,n=i.keys,a=t.extend,s=t.proxy,o=".kendoOrgChartView",d="blur",l="click",h="collapse",c="expand",u="focus",p="keydown",g="menu",f="select",m=".",_=" ",v=",",k="#",C="string",I="tabindex",x="id",b="uid",y="px",T="plus",S="minus",G="aria-owns",E="aria-selected",H={wrapper:"k-orgchart",container:"k-orgchart-container",line:"k-orgchart-line",lineVertical:"k-orgchart-line-v",lineHorizontal:"k-orgchart-line-h",lineVerticalTop:"k-orgchart-line-v-top",group:"k-orgchart-group",groupVertical:"k-orgchart-group-v",groupHorizontal:"k-orgchart-group-h",nodesGroup:"k-orgchart-node-group",nodesGroupContainer:"k-orgchart-node-group-container",nodeContainer:"k-orgchart-node-container",node:"k-orgchart-node",card:"k-orgchart-card",cardMenu:"k-orgchart-card-menu",button:"k-orgchart-button",focused:"k-state-focus",plusIcon:"k-i-plus",menuItem:"k-item",avatarPreview:"k-orgchart-avatar-preview",update:"k-orgchart-update",cancel:"k-orgchart-cancel",vstack:"k-vstack",hstack:"k-hstack"},w='<div role="tree" aria-orientation="horizontal" aria-label="#: label #" class="k-orgchart-group k-orgchart-level-1 k-pos-absolute k-hstack k-justify-content-center"></div>',L='<div role="group" id="#: guid #" class="k-orgchart-level-#: level # k-orgchart-group k-pos-absolute k-justify-content-around"></div>',V='<div role="treeitem" # if(data.hasChildren && data.guid) { #aria-owns="#: guid #" # if(!!data.expanded) { #aria-expanded="true" # } else { #aria-expanded="false" # } ## } #aria-keyshortcuts="Enter" aria-level="#: level #" aria-selected="false" class="k-orgchart-node-group-container">',P='<div class="k-orgchart-node-container k-justify-content-around" style="width:100%"></div>',j='<div role="group" class="k-orgchart-node-container k-justify-content-around k-hstack" style="width:100%"></div>',N='<div class="k-orgchart-node k-vstack k-align-items-center"></div>',W='<button aria-label="#: label #" tabindex="-1" class="k-orgchart-button k-button k-button-icon"><span class="k-icon k-i-#: buttonSign #"></span></button>',F='<div class="k-card-body k-hstack" style="border-color:#: color #"># if(!!data.avatar) { #<div class="k-avatar-circle k-avatar k-avatar-md"><div class="k-avatar-image"><img alt="#: name #" src="#: avatar #"></div></div># } #<div class="k-vstack k-card-title-wrap"><div class="k-card-title k-text-ellipsis">#: name #</div># if(data.title) { #<span class="k-spacer"></span><div class="k-card-subtitle k-text-ellipsis">#: title #</div># } #</div># if(editable) { #<span class="k-spacer"></span><div class="k-card-body-actions"><button class="k-button k-flat k-button-icon k-orgchart-card-menu" role="button" aria-label="#: menuLabel #" tabindex="-1"><span class="k-icon k-i-more-vertical"></span></button></div># } #</div>',q='<div role="treeitem" data-uid="#: uid #" # if(data.hasChildren && data.guid) { #aria-owns="#: guid #" # if(!!data.expanded) { #aria-expanded="true" # } else { #aria-expanded="false" # } ## } #class="k-orgchart-card k-card # if(!!data.cssClass) { ##: data.cssClass ## } #" aria-keyshortcuts="Enter" aria-level="#: level #" aria-selected="false"></div>',D='<div role="treeitem" data-uid="#: uid #" aria-level="#: level #" aria-selected="false" aria-keyshortcuts="Enter" class="k-orgchart-card k-card # if(!!data.cssClass) { ##: data.cssClass ## } #"></div>',O=i.Observable.extend({init:function(t,e){this.element=t,this.options=e||{},i.Observable.fn.init.call(this),this._attachEvents()},events:[h,c,f,g],destroy:function(){i.ui.Widget.fn.destroy.call(this),this.element.off(o)},collapse:function(){return!1},expand:function(){return!1},jqueryGroupElement:function(t){if(t){var e=this._processItem(t);return e.hasClass(H.nodesGroupContainer)||(e=e.closest(m+H.nodesGroupContainer)),e&&e.length?e:null}},jqueryItemElement:function(t){if(t){var e=this._processItem(t);return e.hasClass(H.card)||(e=e.closest(m+H.card)),e&&e.length?e:null}},refresh:function(){this._cacheFocused(),this._clearContent(),this._generateItemsTree(),this._calculateLevels(),this._render()},select:function(t){var e=this._getToSelect(t),i=this.element.find("[tabindex=0]");e&&(i.removeAttr(I).removeClass(H.focused).attr(E,!1),e.attr(I,"0").addClass(H.focused).trigger("focus").attr(E,!0))},_attachEvents:function(){var t=m+H.card+v+m+H.nodesGroupContainer;this.element.on(p+o,t,s(this._onKeyDown,this)).on(l+o,t,s(this._onSelect,this)).on(l+o,m+H.button,s(this._onButtonClick,this)).on(u+o,t,s(this._onFocus,this)).on(d+o,m+H.focused,s(this._onBlur,this))},_cacheFocused:function(){var t=this.element.find("[tabindex='0']"),e=this._dataItems(t);t.length&&e&&e.length&&!this._idTabIndex&&(this._idTabIndex=e[0].get(x),this._shouldRestoreSelection=!!t.hasClass(H.focused))},_calculateDimensions:function(){var t=this.element.find(m+this._selector).first();this._buttonHeight||(this._buttonHeight=this.element.find(m+H.button).first().outerHeight()),this._spacing||(this._spacing=this.element.find(m+H.lineVertical).first().outerHeight()),this._itemWidth||(this._itemWidth=this._calculateItemWidth()),this._itemHeight||(this._itemHeight=t.outerHeight(!0))},_calculateItemWidth:function(){return!1},_calculateLevel:function(){return!1},_calculateLevels:function(){return!1},_clearContent:function(){this.element.empty()},_dataItem:function(t){var e=this.jqueryItemElement(t);if(e&&e.data(b))return this.dataSource.getByUid(e.data(b))},_dataItems:function(){return!1},_generateItemsTree:function(){return!1},_getToSelect:function(){return!1},_groupIsVertical:function(){return!1},_keyCollapse:function(){return!1},_keyExpand:function(){return!1},_keyNext:function(){return!1},_keyPrev:function(){return!1},_keyEnter:function(){return!1},_keyEscape:function(){return!1},_keyEnd:function(){var t=this.element.find(m+H.card).last(),e=this.element.find("[tabindex=0]");e[0]!==t[0]&&this.trigger(f,{item:t,dataItems:[this._dataItem(t)]})},_keyHome:function(){var t=this.element.find(m+H.card).first(),e=this.element.find("[tabindex=0]");e[0]!==t[0]&&this.trigger(f,{item:t,dataItems:[this._dataItem(t)]})},_onBlur:function(){this.element.find(m+H.focused).removeClass(H.focused)},_onKeyDown:function(t){var e,a=t.keyCode,s=this.element.find("[tabindex=0]"),r=i.support.isRtl(this.element),o=r?[n.LEFT]:[n.RIGHT],d=r?[n.RIGHT]:[n.LEFT],l=n.DOWN,h=n.UP;s&&(e=this._groupIsVertical(s),e&&(o.push(n.DOWN),d.push(n.UP)),a===n.HOME?this._keyHome():a===n.END?this._keyEnd():o.indexOf(a)>-1?(t.preventDefault(),t.stopPropagation(),this._keyNext(s)):d.indexOf(a)>-1?(t.preventDefault(),t.stopPropagation(),this._keyPrev(s)):a===l?(t.preventDefault(),t.stopPropagation(),this._keyExpand(s)):a===h?(t.preventDefault(),t.stopPropagation(),this._keyCollapse(s)):a===n.ENTER?this._keyEnter(s):a===n.ESC&&this._keyEscape(s))},_onButtonClick:function(e){var i,n=this,a=t(e.currentTarget),r=a.find(m+H.plusIcon).length>0,o=a.siblings(m+this._selector),d=this._dataItems(o);if(r){if(n.trigger(c,{item:o,dataItems:d}))return}else if(n.trigger(h,{item:o,dataItems:d}))return;for(i=0;i<d.length;i++)n.dataSource.toggleChildren(d[i],r).then(s(this.refresh,this))},_onFocus:function(){return!1},_onSelect:function(){return!1},_orientation:function(){return!1},_processItem:function(e){var n;return t.type(e)===C?n=this.element.find(e):i.isElement(e)?n=t(e):e instanceof r&&(n=e),n},_render:function(){var e,n=this._itemsTree,a=t(i.template(w)({label:this.options.messages.label})),s=this.element,r=this._total,o=s.closest(m+H.wrapper).css("padding-left");s.append(a),this._renderGroup(a,n,1,this._total,0),e=r*this._itemWidth+(r-1)*this._spacing,a.width(e),s.width(e+ +o.split(y)[0]),this._setHeight(),this._restoreSelection()},_renderNode:function(e,n,s,r,o){var d,l,h=this.options.messages,c=this.options.cardsColors||i.getSeriesColors(),u=t(N);return l=t(e(a(!0,{},s,{menuLabel:h.menuLabel,level:r,guid:o,editable:!!this.options.editable,color:c[r-1]||c[0]}))),s.attributes&&l.attr(JSON.parse(JSON.stringify(s.attributes))),d=t(n(a(!0,{},s,{menuLabel:h.menuLabel,level:r,guid:o,editable:!!this.options.editable,color:c[r-1]||c[0]}))),l.append(d),u.append(l),u},_renderGroup:function(){return!1},_restoreSelection:function(){var t,e;this._idTabIndex?(t=this.dataSource.get(this._idTabIndex),e=t?this._getToFocus(t):this.element.find(m+this._selector).first(),e.attr(I,"0"),this._idTabIndex=null):(e=this.element.find(m+this._selector).first(),e.attr(I,"0")),this._shouldRestoreSelection&&(this._shouldRestoreSelection=!1,this._preventTriggerSelect=!0,e.trigger("focus"),e.addClass(H.focused))},_setHeight:function(){var e,i=this._selector,n=this.element.find(m+H.button+v+m+i),a=Number.MAX_VALUE,s=0;this._calculateDimensions(),e=this._buttonHeight,this.element.find(m+H.lineVerticalTop).height(this._spacing+e/2),n.each(function(e,i){var n=t(i).offset().top,r=n+t(i).outerHeight(!0);n<a&&(a=n),r>s&&(s=r)}),this.element.height(s-a)}}),M=O.extend({init:function(t,e){O.fn.init.call(this,t,e),this._selector=H.card},collapse:function(t){var e=this.jqueryItemElement(t);e&&this.dataSource.toggleChildren(this._dataItem(e),!1).then(s(this.refresh,this))},expand:function(t){var e=this.jqueryItemElement(t);e&&this.dataSource.toggleChildren(this._dataItem(e),!0).then(s(this.refresh,this))},_calculateItemWidth:function(){return this.element.find(m+this._selector).first().outerWidth(!0)},_calculateLevel:function(t,e){var i,n,a,s=t.length,r=this._maxColumnsPerLevel,o=!1,d=!1;for((!r[e]||r[e]<s)&&(i=r[e],d=!0,r[e]=s),n=0;n<s;n++)a=t[n],a.hasChildren&&(o=!0,a.expanded&&this._calculateLevel(a.children,e+1));!o&&d&&e>0&&(d=!1,r[e]=i||1)},_calculateLevels:function(){var t,e=this._itemsTree,i=this._maxColumnsPerLevel=[],n=1;for(this._calculateLevel(e,0),t=0;t<i.length;t++)n*=i[t];this._total=n},_dataItems:function(t){var e=this.dataSource.getByUid(t.data(b));return e?[e]:null},_generateItemsTree:function(){this._itemsTree=this.dataSource.itemsTree()},_getToFocus:function(t){return this.element.find("[data-uid='"+t.get(b)+"']")},_getToSelect:function(t){return this.jqueryItemElement(t)},_groupIsVertical:function(t){var e=t.closest(m+H.group);return e.hasClass(H.groupVertical)},_keyCollapse:function(t){var e,i,n=this._dataItem(t);n.expanded?this.trigger(h,{item:t,dataItems:[n]})||this.collapse(t):n.parentId&&(e=this.dataSource.get(n.parentId).get(b),i=this.element.find("[data-uid='"+e+"']"),this.trigger(f,{item:i,dataItems:[this._dataItem(i)]}))},_keyEnter:function(t){t.find(m+H.cardMenu).length>0&&this.trigger(g,t)},_keyExpand:function(t){var e,i=this._dataItem(t),n=this.element.find(k+t.attr(G));i.hasChildren&&(i.expanded?(e=n.find(m+this._selector).first(),this.trigger(f,{item:e,dataItems:[this._dataItem(e)]})):this.trigger(c,{item:t,dataItems:[i]})||this.expand(t))},_keyNext:function(t){var e=this._dataItem(t),i=t.parent().next(m+H.node).find(m+H.card),n=this.element.find(k+t.attr(G));!i.length&&e.hasChildren&&e.expanded&&(i=n.find(m+H.card).first()),0===i.length||i.hasClass(H.focused)||this.trigger(f,{item:i,dataItems:[this._dataItem(i)]})},_keyPrev:function(t){var e,i=this._dataItem(t),n=t.parent().prev(m+H.node).find(m+H.card);!n.length&&i.parentId&&(e=this.dataSource.get(i.parentId).get(b),n=this.element.find("[data-uid='"+e+"']")),0===n.length||n.hasClass(H.focused)||this.trigger(f,{item:n,dataItems:[this._dataItem(n)]})},_onFocus:function(i){var n=t(i.currentTarget),a=t(i.target);if(this._preventTriggerSelect)return i.stopPropagation(),this._preventTriggerSelect=!1,e;if(a.hasClass(H.cardMenu)){if(a.closest("[tabindex='0']").length>0)return i.stopPropagation(),e;this._preventTriggerSelect=!0}n.hasClass(H.card)||(n=n.closest(m+H.card)),n.hasClass(H.focused)||this.trigger(f,{item:n,dataItems:[this._dataItem(n)]})},_onSelect:function(e){var i=t(e.currentTarget),n=i.hasClass(H.card)?i:i.closest(m+H.card),a=t(e.target).hasClass(H.cardMenu)?t(e.target):t(e.target).closest(m+H.cardMenu);a.length>0||i.hasClass(H.focused)||this.trigger(f,{item:n,dataItems:[this._dataItem(n)]})},_orientation:function(e,i,n){var a=t("<div>").addClass(H.line+_+H.lineVertical);n&&i>1?(e.addClass(H.groupVertical+_+H.vstack),e.find(m+H.nodeContainer).addClass(H.vstack),0===e.find(m+H.button).length||1===e.find(m+H.card).length?(e.find(m+H.card).before(a.clone()),e.find(m+H.node).first().find(m+H.lineVertical).addClass(H.lineVerticalTop)):i>1&&e.find(m+H.card).first().before(a.clone())):(e.addClass(H.groupHorizontal+_+H.hstack),e.find(m+H.nodeContainer).addClass(H.hstack),i>1&&e.find(m+H.card).before(a.clone().addClass(H.lineVerticalTop)))},_renderGroup:function(e,i,n,a,s){var r,o=!0;r=t(P),e.append(r),o=this._renderInner(r,i,n,a,s),this._orientation(e,n,o)},_renderInner:function(e,n,a,s,r){var o,d,l,h,c,u,p,g,f,v=i.template(W),k=i.template(q),C=s/n.length,I=!0,x=t("<div>").addClass(H.line+_+H.lineVertical),b=t("<div>").addClass(H.line+_+H.lineHorizontal),G=this.options.messages;for(f=this.options.template?"function"==typeof this.options.template?this.options.template:i.template(this.options.template):i.template(F),o=0;o<n.length;o++)d=n[o],l=i.guid(),h=this._renderNode(k,f,d,a,l),d.hasChildren&&(h.append(x.clone()),c=t(v({buttonSign:d.expanded?S:T,label:d.expanded?G.collapse:G.expand})),h.append(c)),e.append(h),this._calculateDimensions(),p=this._itemWidth,g=this._spacing,d.hasChildren&&(I=!1,d.expanded&&(u=this._renderInnerGroup(d,C,r,o,a,l))),u&&u.hasClass(H.groupHorizontal)&&d.expanded&&d.children&&d.children.length>1&&c.after(b.clone().css({width:(C-C/d.children.length)*(p+g)+y,"margin-top":this._buttonHeight/-2+y}));return C>1&&!I&&e.find(m+H.node).width((C-1)*(g+p)),I},_renderInnerGroup:function(e,n,a,s,r,o){var d,l=this._itemWidth,h=this._spacing,c=n*l+(n-1)*h,u=s*n*l+a,p=i.template(L),g=i.support.isRtl(this.element)?"right":"left",f=r*(this._itemHeight+this._buttonHeight+h)+h*(r-1)-this._buttonHeight/2;return s>0&&(u+=s*n*h),d=t(p({guid:o,level:r+1})),d.css({width:c+y,top:f+y}),d.css(g,u+y),this.element.append(d),this._renderGroup(d,e.children,r+1,n,u),d}}),R=O.extend({init:function(t,e){O.fn.init.call(this,t,e),this._selector=H.nodesGroupContainer},collapse:function(t){var e,i,n=this.jqueryGroupElement(t);if(n)for(e=this._dataItems(n),i=0;i<e.length;i++)this.dataSource.toggleChildren(e[i],!1).then(s(this.refresh,this))},expand:function(t){var e,i,n=this.jqueryGroupElement(t);if(n)for(e=this._dataItems(n),i=0;i<e.length;i++)this.dataSource.toggleChildren(e[i],!0).then(s(this.refresh,this))},_dataItems:function(t){var e,i,n,a=this.dataSource,s=[];return t.hasClass(H.card)?(i=a.getByUid(t.data(b)),i&&s.push(i)):t.hasClass(H.nodesGroupContainer)&&(this._groupFocused=!0,e=t.find(m+H.card),e.each(function(t,e){n=a.getByUid(e.getAttribute("data-uid")),n&&s.push(n)})),s},_calculateItemWidth:function(){var t=this.element.find(m+this._selector).first(),e=this.element.find(m+H.card).first().outerWidth(!0),i=+t.css("padding-left").split(y)[0],n=+t.css("border-left").split(y)[0];return e+2*i+2*n},_calculateLevel:function(t,e){var i,n,a,s=t.length,r=!1,o=0;for(this._maxColumnsPerLevel[e]=this._maxColumnsPerLevel[e]||0,this._maxGroups[e]=this._maxGroups[e]||0,n=0;n<s;n++)a=t[n],i=a.items.length,i>o&&(o=i),a=t[n],a.hasChildren&&(r=!0,a.expanded&&this._calculateLevel(a.children,e+1));s>this._maxGroups[e]&&(this._maxGroups[e]=s),r||(o=1),o>this._maxColumnsPerLevel[e]&&(this._maxColumnsPerLevel[e]=o)},_calculateLevels:function(){var t,e,i=this._itemsTree,n=this._maxColumnsPerLevel=[],a=this._maxGroups=[],s=1;for(this._calculateLevel(i,0),t=n.length-1;t>=0;t--)e=n[t]*a[t],s>n[t]?s*=a[t]:s<e&&(s=e);this._total=s},_generateItemsTree:function(){this._itemsTree=this.dataSource.groupedItemsTree(this.options.groupField)},_getToFocus:function(t){return this._groupFocused?(this._groupFocused=!1,this.element.find("[data-uid='"+t.get(b)+"']").closest(m+H.nodesGroupContainer)):this.element.find("[data-uid='"+t.get(b)+"']")},_getToSelect:function(t){var e=this.jqueryItemElement(t);return e||this.jqueryGroupElement(t)},_groupIsVertical:function(t){var e=t.closest(m+H.nodeContainer);return e.hasClass(H.vstack)},_keyCollapse:function(t){var e,i,n=[];n=this._dataItems(t),i=n.some(function(t){return t.expanded}),i?(t.hasClass(H.card)&&(t=t.closest(m+H.nodesGroupContainer),n=this._dataItems(t)),this.trigger(h,{item:t,dataItems:n})||this.collapse(t)):n[0].parentId&&(e=this.dataSource.get(n[0].parentId).get(b),this.trigger(f,{item:this.element.find("[data-uid='"+e+"']").closest(m+this._selector),dataItems:n}))},_keyEnter:function(t){var e,i=[];t.hasClass(H.card)&&t.find(m+H.cardMenu).length>0?this.trigger(g,t):(e=t.find(m+H.card).first(),i=this._dataItems(e),this.trigger(f,{item:e,dataItems:i}))},_keyEscape:function(t){if(t.hasClass(H.card)){var e=t.closest(m+H.nodesGroupContainer),i=this._dataItems(e);this.trigger(f,{item:e,dataItems:i})}},_keyExpand:function(t){var e,i,n,a=t.attr(G)||t.closest(m+this._selector).attr(G),s=this.element.find(k+a),r=this._dataItems(t);e=r.some(function(t){return t.hasChildren}),e&&(i=r.some(function(t){return t.expanded}),i?(n=s.find(m+this._selector).first(),this.trigger(f,{item:n,dataItems:this._dataItems(n)})):(t.hasClass(H.card)&&(t=t.closest(m+H.nodesGroupContainer),r=this._dataItems(t)),this.trigger(c,{item:t,dataItems:r})||this.expand(t)))},_keyNext:function(t){var e,i=this.element.find(k+t.attr(G)),n=this._dataItems(t),a=n.some(function(t){return t.hasChildren}),s=n.some(function(t){return t.expanded});e=t.hasClass(H.card)?t.parent().next(m+H.node).find(m+H.card):t.parent().next(m+H.nodesGroup).find(m+H.nodesGroupContainer),!e.length&&a&&s&&(e=i.find(m+this._selector).first()),0!==e.length&&this.trigger(f,{item:e,dataItems:this._dataItems(e)})},_keyPrev:function(t){var e,i,n=this._dataItems(t);i=t.hasClass(H.card)?t.parent().prev(m+H.node).find(m+H.card):t.parent().prev(m+H.nodesGroup).find(m+H.nodesGroupContainer),!i.length&&n[0].parentId&&(e=this.dataSource.get(n[0].parentId).get(b),i=this.element.find("[data-uid='"+e+"']").closest(m+this._selector)),0!==i.length&&this.trigger(f,{item:i,dataItems:this._dataItems(i)})},_onFocus:function(i){var n,a,s=t(i.target);if(this._preventTriggerSelect)return i.stopPropagation(),this._preventTriggerSelect=!1,e;if(s.hasClass(H.cardMenu)){if(s.closest("[tabindex='0']").length>0)return i.stopPropagation(),e;this._preventTriggerSelect=!0}s.hasClass(H.card)||s.hasClass(H.nodesGroupContainer)||(a=s.closest(m+H.card),a.length||(a=s.closest(m+H.nodesGroupContainer)),s=a),0!==s.length&&(n=this._dataItems(s),s.hasClass(H.focused)||(i.stopPropagation(),this.trigger(f,{item:s,dataItems:n})))},_onSelect:function(e){var i,n,a=t(e.target),s=this.element.find("[tabindex=0]");a.hasClass(H.card)||a.hasClass(H.nodesGroupContainer)||(n=a.closest(m+H.card),n.length||(n=a.closest(m+H.nodesGroupContainer)),a=n),0!==a.length&&s[0]!==a[0]&&(i=this._dataItems(a),this.trigger(f,{item:a,dataItems:i}))},_orientation:function(e,i,n){var a=t("<div>").addClass(H.line+_+H.lineVertical+_+H.lineVerticalTop);e.addClass(H.hstack),i>1&&e.find(m+H.nodesGroupContainer).before(a.clone()),n&&i>1?(e.find(m+H.nodeContainer).removeClass(H.hstack),e.find(m+H.nodeContainer).addClass(H.vstack)):e.addClass(H.groupHorizontal)},_renderChildren:function(e,n,a,s,r,o,d){var l,h,c,u,p,g,f,m=i.template(W),v=i.template(L),k=t("<div>").addClass(H.line+_+H.lineVertical),C=t("<div>").addClass(H.line+_+H.lineHorizontal),I=this.options.messages,x=!0,b=i.support.isRtl(this.element)?"right":"left";return e.hasChildren&&(x=!1,r.append(k.clone()),h=t(m({buttonSign:e.expanded?S:T,label:e.expanded?I.collapse:I.expand})),r.append(h),this._calculateDimensions(),g=this._itemWidth,f=this._spacing,e.expanded&&(p=g*a+(a-1)*f,c=n*a*g+o,u=s*(this._itemHeight+this._buttonHeight+f)+f*(s-1)-this._buttonHeight/2,n>0&&(c+=n*a*f),l=t(v({guid:d,level:s+1})),l.css({width:p+y,top:u+y}),l.css(b,c+y),this.element.append(l),this._renderGroup(l,e.children,s+1,a,c))),l&&e.expanded&&e.children&&e.children.length>1&&h.after(C.clone().css({width:(a-a/e.children.length)*(g+f)+y,"margin-top":this._buttonHeight/-2+y})),x},_renderGroup:function(t,e,n,s,r){var o,d,l,h,c,u,p,g=!0,f=s/e.length;for(l=0;l<e.length;l++)h=i.guid(),u=e[l],o=this._renderNodesContainer(t,a(!0,{},u,{guid:h,level:n})),d=o.closest(m+H.nodesGroup),this._renderItems(o,u.items,n,h),c=this._renderChildren(u,l,f,n,d,r,h),g&&(g=c);p=this._itemWidth*f+(f-1)*this._spacing,t.find(m+H.nodesGroup).width(p),this._orientation(t,n,g)},_renderItems:function(t,e,n,a){var s,r,o,d,l=i.template(D);for(d=this.options.template?"function"==typeof this.options.template?this.options.template:i.template(this.options.template):i.template(F),s=0;s<e.length;s++)r=e[s],o=this._renderNode(l,d,r,n,a),t.append(o)},_renderNodesContainer:function(e,n){var a,s=i.template(V),r=t('<div class="k-orgchart-node-group k-align-items-center k-vstack">'),o=t(j),d=t(s(n));return a="function"==typeof this.options.groupHeaderTemplate?this.options.groupHeaderTemplate:i.template(this.options.groupHeaderTemplate),d.append(a({value:n.value,field:n.field})),d.append(o),r.append(d),e.append(r),o}});i.orgChart={View:O,SingleView:M,GroupedView:R}}(window.kendo.jQuery),window.kendo},i(3))}).call(e,i(1057))}});