/*! * * SpreadJS Library 10.0.0 * * Copyright(c) GrapeCity, Inc. All rights reserved. * * Licensed under the SpreadJS Commercial License. * spread.sales@grapecity.com * http://spread.grapecity.com/Pages/Spread-JS-License/ * * */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CardLayout=e():(t.GC=t.GC||{},t.GC.Spread=t.GC.Spread||{},t.GC.Spread.Views=t.GC.Spread.Views||{},t.GC.Spread.Views.Plugins=t.GC.Spread.Views.Plugins||{},t.GC.Spread.Views.Plugins.CardLayout=e())}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="/assets/",e(0)}([function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(){function e(t,n,r,i,o){var a,u,c,l,f,h,s,d,p,g=this,v=t.data,_=g.gGHH_(v),m=g.gGFH_(v),w=g.gLI_()[et],y=v.groupDescriptor.footer,b=t.path;if(_>o){if(p=!1,s=q.gRE_(g.grid.uid,et,null,{area:ot,path:b})){d=s.querySelector(".gc-grouping-toggle");var S=d&&d.getBoundingClientRect();k.call(g,{left:S.left,top:S.top,width:S.width,height:S.height},{left:n,top:r},!0)&&(p=!0)}return{area:et,row:-1,column:-1,groupInfo:{path:b,area:ot,onGroupExpandToggle:p}}}if(o-=_,t.isBottomLevel)return h=g.hTGC_(t,et,i,o,{width:w.contentWidth,height:w.contentHeight}),h?h:{area:et,row:-1,column:-1,groupInfo:{path:b,area:at}};for(a=t.children,c=0,l=a.length;l>c;c++){if(u=a[c],f=u.collapsed?_+(y.collapseWithGroup?0:m):u.height,f>=o)return e.call(g,a[c],n,r,i,o);o-=f}return null}function i(t){var e=this,n=e.gLI_()[et],r=e.options,i=r.direction,a=r.rightToLeft&&i===rt;return{left:a?t.offsetLeft:-t.offsetLeft,top:-t.offsetTop,renderedRows:o.call(e,i,n,t,!0)}}function o(t,e,n,r){var i=this,o={start:t===rt?n.offsetLeft:n.offsetTop,end:t===rt?n.offsetLeft+e.width:n.offsetTop+e.height};return i.grid.data.groups?L.call(i,o,r):C.call(i,o,n,r)}function a(){var t=this;if(t.cachedContainerSizeWithoutScrollBar_)return t.cachedContainerSizeWithoutScrollBar_;var e=t.grid.gCI_(),n=e.contentRect;return t.cachedContainerSizeWithoutScrollBar_={width:n.width,height:n.height},t.cachedContainerSizeWithoutScrollBar_}function u(){var t=this;if(t.cachedContainerSizeWithScrollBar_)return t.cachedContainerSizeWithScrollBar_;t.updateCardSize_();var e=t.options.direction,n=t.options.showScrollBar,r=a.call(t),i=r.width,o=r.height,u=Y.gSS(t.grid);return t.grid.data.groups?n&&!c.call(t)&&(e===rt?(t.hasScrollBars_={vertical:!1,horizontal:!0},o-=u.height):(t.hasScrollBars_={vertical:!0,horizontal:!1},i-=u.width)):n&&!l.call(t)&&(e===rt?(t.hasScrollBars_={vertical:!1,horizontal:!0},o-=u.height):(t.hasScrollBars_={vertical:!0,horizontal:!1},i-=u.width)),t.cachedContainerSizeWithScrollBar_={width:i,height:o},t.updateCardSize_(),t.cachedContainerSizeWithScrollBar_}function c(){var t,e=this,n=e.direction,r=a.call(e),i=n===rt?r.width:r.height,o=0,u=e.grid.data.groups,c=u.length;for(t=0;c>t&&(o+=f.call(e,u[t],i,0),!(o>i));t++);return i>=o}function l(){var t=this,e=t.grid,n=e.data.itemCount,r=a.call(t),i=Math.floor(r.height/t.cardHeight_),o=Math.floor(r.width/t.cardWidth_);return i*o>=n}function f(t,e,n){if(!t)return 0;var r,i,o,u,c=this,l=c.options,h=l.direction,s=n;if(s>e)return s;var d=a.call(c);r=h===rt?Math.floor(d.height/c.cardHeight_):Math.floor(d.width/c.cardWidth_);var p=t.groupDescriptor;i=p.footer;var g=c.gGHH_(t),v=c.gGFH_(t);if(s+=g,s>e)return s;if(p.collapsed)i&&i.visible&&!i.collapseWithGroup&&(s+=v);else{if(t.isBottomLevel){if(u=t.itemCount,s+=Math.ceil(u/r)*c.gRH_(),s>e)return s}else for(u=t.groups.length,o=0;u>o;o++)if(s=f.call(c,t.groups[o],e,s),s>e)return s;s+=v}return s}function h(){var t=this.options.rowTemplate;if(t){if(X.isString(t)&&t.length>1&&"#"===t[0]){var e=document.getElementById(t.slice(1));return e.innerHTML}return t}return s.call(this)}function s(){var t=this,e=t.grid.columns,n=0;$.each(e,function(t){t.visible&&(n+=1)});var r=Math.floor(t.cardHeight_/n),i="