(function(){zul.sel.Listitem=zk.$extends(zul.sel.ItemWidget,{getListbox:function(){return this.parent},getListgroup:function(){if(zk.isLoaded("zkex.sel")&&this.parent&&this.parent.hasGroup())for(var a=this;a;a=a.previousSibling)if(a.$instanceof(zkex.sel.Listgroup))return a;return null},setLabel:function(a){this._autoFirstCell().setLabel(a)},getDragOptions_:function(a){var b=a.change;a.change=function(a,e,d){b(a,e,d);if(e=a._dragImg)for(a=jq(a.node).hasClass("z-drop-allow"),d=0;d<e.length;d++)a?jq(e[d]).removeClass("z-icon-times").addClass("z-icon-check"):
jq(e[d]).removeClass("z-icon-check").addClass("z-icon-times")};return this.$supers("getDragOptions_",arguments)},setImage:function(a){this._autoFirstCell().setImage(a)},_autoFirstCell:function(){this.firstChild||this.appendChild(new zul.sel.Listcell);return this.firstChild},domStyle_:function(a){if(zk.isLoaded("zkex.sel")&&(this.$instanceof(zkex.sel.Listgroup)||this.$instanceof(zkex.sel.Listgroupfoot))||a&&a.visible)return this.$supers("domStyle_",arguments);var b=this.$supers("domStyle_",arguments),
c=this.getListgroup();return c&&!c.isOpen()?b+"display:none;":b},domClass_:function(){var a=this.$supers("domClass_",arguments),b=this.getListbox();return b&&jq(this.$n()).hasClass(b=b.getOddRowSclass())?a+" "+b:a},replaceWidget:function(a){this._syncListitems(a);this.$supers("replaceWidget",arguments)},scrollIntoView:function(){var a=this.getListbox()._scrollbar;a?(a.syncSize(),a.scrollToElement(this.$n())):this.$supers("scrollIntoView",arguments)},_updHeaderCM:function(a){var b,c;!this.isSelected()&&
(b=this.getListbox())&&b._headercm&&b._multiple&&void 0!=b.$$selectAll&&(c=b.listhead)&&(c=c.firstChild)&&(c._checked=!1);this.$supers("_updHeaderCM",arguments)},_syncListitems:function(a){var b;if(b=this.getListbox()){b.firstItem.uuid==a.uuid&&(b.firstItem=a);b.lastItem.uuid==a.uuid&&(b.lastItem=a);var c=b._selItems,e,d;(e=this.isSelected())&&c.$remove(this);(d=a.isSelected())&&c.push(a);e!=d&&b._updHeaderCM()}},compareItemPos_:function(a){var b=this._index;a=a._index;return b==a?0:b>a?-1:1},shallFireSizedLaterWhenAddChd_:function(){if("group"==
this.getListbox()._model)return zWatch.listen({onCommandReady:this}),!0;this.$supers("shallFireSizedLaterWhenAddChd_",arguments)},onCommandReady:function(a){zUtl.fireSized(this);zWatch.unlisten({onCommandReady:this})}})})();
