UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

10 lines 48.9 kB
/* @license */ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`kendo.data.min.js`),require(`kendo.popup.min.js`),require(`kendo.label.min.js`),require(`kendo.icons.min.js`),require(`kendo.actionsheet.min.js`),require(`kendo.core.min.js`)):typeof define==`function`&&define.amd?define([`exports`,`kendo.data.min`,`kendo.popup.min`,`kendo.label.min`,`kendo.icons.min`,`kendo.actionsheet.min`,`kendo.core.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.List={}),e.kendo._globals.Data,e.kendo._globals.Popup,e.kendo._globals.Label,e.kendo._globals.Icons,e.kendo._globals.Actionsheet,e.kendo._globals.Core))})(this,function(e,t,n,r,i,a,o){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let s=kendo.jQuery,c=`k-loading`,l=`k-input-inner`,u=`aria-busy`;function d(){let e=this;e._loading=s(`<span></span>`).addClass(`k-icon k-i-loading k-input-loading-icon`).attr(`role`,`presentation`),e._showBusy=m.bind(e),e._hideBusy=h.bind(e),e._toggleLoader=f.bind(e),e._showBusyHandler=p.bind(e)}function f(e){let t=this,n=t.wrapper.hasClass(c),r=t.wrapper.find(`.k-input-values`),i=t.options.name.toLowerCase()===`multiselect`;if(t._loading)if(e&&!n)if(t.wrapper.addClass(c),t._suffixContainer){let e=t.wrapper.find(`.k-input-separator`);s(e[e.length-1]).before(t._loading)}else if(t._arrow)t._arrow.before(t._loading);else if(r.length>0&&i)t._loading.insertAfter(r);else{let e=t.element.hasClass(l)?t.element:t.wrapper.find(`.${l}`);t._loading.insertAfter(e)}else n&&(t.wrapper.removeClass(c),t._loading.remove())}function p(){let e=this;e._focused?e._focused.attr(u,!0):(e.element.hasClass(l)?e.element:e.wrapper.find(`.${l}`)).attr(u,!0),e._toggleLoader(!0),e._hideClear()}function m(e){let t=this;e&&e.isDefaultPrevented()||(t._request=!0,!t._busy&&(t._busy=setTimeout(t._showBusyHandler,100)))}function h(){let e=this;clearTimeout(e._busy),e._toggleLoader(!1),e._busy=null,e._request&&=!1,e._focused?e._focused.attr(u,!1):(e.element.hasClass(l)?e.element:e.wrapper.find(`.${l}`)).attr(u,!0),e._toggleCloseVisibility?e._toggleCloseVisibility():e._showClear()}let g={id:`list`,name:`List`,category:`framework`,depends:[`data`,`popup`,`label`,`icons`,`actionsheet`],hidden:!0};(function(e,t){var n=window.kendo,r=n.ui,i=n._outerHeight,a=/^\d+(\.\d+)?%$/i,o=r.Widget,s=n.keys,c=n.support,l=n.htmlEncode,u=n._activeElement,f=n._outerWidth,p=n.data.ObservableArray,m=`id`,h=`change`,g=`k-focus`,_=`k-hover`,v=`k-selected`,ee=`k-list`,y=`k-table`,te=`k-data-table`,b=`k-list-ul`,x=`k-table-list`,ne=`.k-list-group-sticky-header`,re=`.k-table-group-sticky-header`,ie=`.k-list-item-group-label`,S=`.k-list-item`,C=`.k-table-row`,ae=`open`,oe=`close`,w=`cascade`,T=`select`,E=`click`,se=`mouseleave`,D=`mouseenter`,O=`activate`,k=`deactivate`,A=`dataBinding`,j=`dataBound`,ce=`selectedItemChange`,le=`selected`,ue=`requestStart`,M=`requestEnd`,de=`blur`,N=`focus`,fe=`focusout`,P=e.extend,pe=Array.isArray,F=c.browser,I=`k-hidden`,L=`width`,R=`text`,me=`value`,he=F.msie,ge=/"/g,z={ComboBox:[`DropDownList`,`MultiColumnComboBox`],DropDownList:[`ComboBox`,`MultiColumnComboBox`],MultiColumnComboBox:[`ComboBox`,`DropDownList`]},_e=`<div class='k-list'/>`,ve=`<div class="k-no-data"></div>`,ye=`<div class="k-list-footer"></div>`,be=`<div class="k-table-footer"><span class="k-table-td"></span></div>`,xe=`mousedown`,Se=`action`,B=`-list`,Ce=`_listbox`,V=`aria-labelledby`,H=`aria-label`,U=`aria-activedescendant`,we=`aria-autocomplete`,W=`aria-controls`,G=`aria-live`,Te=`aria-expanded`,Ee=`aria-hidden`,De=`aria-multiselectable`,K=`aria-selected`,q=`.k-table-group-row`,Oe=`.k-actionsheet-titlebar`,J=n.ui.DataBoundWidget.extend({init:function(t,r){var i=this,a;o.fn.init.call(i,t,r),t=i.element,r=i.options,i._isSelect=t.is(T),i._isSelect&&i.element[0].length&&(r.dataSource||(r.dataTextField=r.dataTextField||R,r.dataValueField=r.dataValueField||me)),r.adaptiveMode===`auto`&&(i.largeMQL=n.mediaQuery(`large`),i.mediumMQL=n.mediaQuery(`medium`),i.smallMQL=n.mediaQuery(`small`)),i._bindLoader(),i._listSize=n.cssProperties.getValidClass({widget:`List`,propName:`size`,value:r.size}),i._filterHeader(),i.list=e(_e).addClass(i._listSize),a=t.attr(m),a||=n.guid(),i.list.attr(m,a+B),r.columns&&r.columns.length&&(i.list.removeClass(ee).addClass(te),i.list.removeClass(i._listSize),i._columnsHeader()),i._header(),i._noData(),i._footer(),i._accessors(),i._initValue()},options:{valuePrimitive:!1,footerTemplate:``,headerTemplate:``,noDataTemplate:!0,size:t,messages:{noData:`No data found.`,clear:`clear`,filterInputPlaceholder:`Filter`},adaptiveMode:`none`},_getUlElement:function(){return this.list.find(`.${b}, .${x}`).first()},_isTableVariant:function(){return this.options.columns&&this.options.columns.length},_getFixedGroupHeaderSelector:function(){return this._isTableVariant()?re:ne},setOptions:function(e){o.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable),e.columns&&e.columns.length&&this._columnsHeader(),this._header(),this._noData(),this._footer(),this._renderFooter(),this._renderNoData(),e.label&&this._inputLabel?this.label.setOptions(e.label):e.label===!1?(this.label._unwrapFloating(),this._inputLabel.remove(),delete this._inputLabel):e.label&&this._label()},_bindLoader:function(){let e=this;e._initLoader=d.bind(e),e._initLoader()},focus:function(){this._focused.trigger(N)},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1}),this.label&&this.label.floatingLabel&&this.label.floatingLabel.readonly(e===t?!0:e)},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)}),this.label&&this.label.floatingLabel&&this.label.floatingLabel.enable(e=e===t?!0:e)},_label:function(){var t=this,r=t.options,i=e.isPlainObject(r.label)?r.label:{content:r.label};t.label=new n.ui.Label(null,e.extend({},i,{widget:t,floatCheck:t._floatCheck.bind(t)})),t._inputLabel=t.label.element,t._refreshFloatingLabel()},_floatCheck:function(){return this.listView?!(this.value()||this.text&&this.text())&&!this.popup.visible():!0},_refreshFloatingLabel:function(){var e=this;e.label&&e.label.floatingLabel&&e.label.floatingLabel.refresh()},_header:function(){var t=this,r=e(t.header),i=t.options.headerTemplate;if(n.destroy(r),r.remove(),!i){t.header=null;return}r=e((typeof i==`function`?i:n.template(i))({})),t.header=r[0]?r:null,t.list.parent.length>0&&t.list.before(r)},_filterHeader:function(){this.filterTemplate=`<div class="k-list-filter"><span class="k-searchbox k-input" type="text" autocomplete="off">`+n.ui.icon({icon:`search`,iconClass:`k-input-icon`})+`</span></div>`,this.actionSheetFilterTemplate=`<div class="k-actionsheet-titlebar-group k-actionsheet-filter">${this.filterTemplate}</div>`,this._isFilterEnabled()&&(this.filterInput=e(`<input class="k-input-inner" type="text" />`).attr({placeholder:this.element.attr(`placeholder`)||this.options.messages.filterInputPlaceholder,title:this.options.filterTitle||this.element.attr(`title`),role:`searchbox`,"aria-label":this.options.filterTitle,"aria-haspopup":`listbox`,"aria-autocomplete":`list`}))},_columnsHeader:function(){var t=this,r,i=e(t.columnsHeader);n.destroy(i),i.remove();for(var o=`<div class='k-table-header'><div class='k-table-header-wrap'><table class='k-table' role='presentation'>`,s=`<colgroup>`,c=`<tr class='k-table-row'>`,l=0;l<this.options.columns.length;l++){var u=this.options.columns[l],d=u.title||u.field||``,f=u.headerTemplate||(()=>d),p=typeof f==`function`?f:n.template(f),m=u.width,h=parseInt(m,10),g=``;m&&!isNaN(h)&&(g+=`${n.attr(`style-width`)}="${h}${a.test(m)?`%`:`px`}"`),s+=`<col `+g+`/>`,c+=`<th class='k-table-th'>`,c+=p(u),c+=`</th>`}s+=`</colgroup>`,c+=`</tr>`,o+=s,o+=`<thead class='k-table-thead'>`,o+=c,o+=`</thead></table></div></div>`,r=e(o),n.applyStylesFromKendoAttributes(r,[`width`]),t.columnsHeader=i=r,t.list.prepend(i)},_noData:function(){var t=this,r=e(t.noData),i=t.options.noDataTemplate===!0?()=>l(t.options.messages.noData):t.options.noDataTemplate;if(n.destroy(r),r.remove(),!i){t.noData=null;return}t.noData=e(ve).attr(G,`polite`).hide().appendTo(t.list),t.noDataTemplate=typeof i==`function`?i:n.template(i)},_footer:function(){var t=this,r=e(t.footer),i=t.options.footerTemplate,a=this.options.columns&&this.options.columns.length?be:ye;if(n.destroy(r),r.remove(),!i){t.footer=null;return}t.footer=e(a).appendTo(t.list),t.footerTemplate=typeof i==`function`?i:n.template(i)},_listOptions:function(t){var r=this,i=r.options,a=i.virtual,o={change:r._listChange.bind(r)},s=r._listBound.bind(r),c=r._focused,u=r.element.attr(`id`),d=e(`label[for="`+r.element.attr(`id`)+`"]`),f=c.attr(V);return!f&&d.length&&(f=d.attr(`id`)||r._generateLabelId(d,u||n.guid())),a=typeof a==`object`?a:{},t=e.extend({autoBind:!1,selectable:!0,dataSource:r.dataSource,click:r._click.bind(r),activate:r._activateItem.bind(r),columns:i.columns,deactivate:r._deactivateItem.bind(r),dataBinding:function(){r.trigger(A)},dataBound:s,height:i.height,dataValueField:i.dataValueField,dataTextField:i.dataTextField,groupTemplate:i.groupTemplate,fixedGroupTemplate:i.fixedGroupTemplate,fixedGroupHeader:i.fixedGroupHeader,template:i.template,ariaLabel:c.attr(H),ariaLabelledBy:f,ariaLive:r._isFilterEnabled()?`polite`:`off`,listSize:r._listSize},t,a,o),t.template||=e=>l(n.getter(t.dataTextField)(e)),t},_initList:function(e){let t=this,r=e&&e.skipValueUpdate,i=t.list.attr(m),a=i?i.replace(B,``):n.guid(),o=t._listOptions({selectedItemChange:t._listChange&&t._listChange.bind(t),id:a+Ce});t.options.virtual?(t.listView=new n.ui.VirtualList(t.list,Object.assign(o,{height:t._hasActionSheet()?362:t.options.height})),t.list.addClass(`k-virtual-list`)):t.listView=new n.ui.StaticList(t.list,o),t.listView.bind(`listBound`,t._listBound.bind(t)),r||t._setListValue()},_setListValue:function(e){e||=this.options.value,e!==t&&this.listView.value(e).done(this._updateSelectionState.bind(this))},_updateSelectionState:e.noop,_listMousedown:function(e){(!this.filterInput||this.filterInput[0]!==e.target)&&e.preventDefault()},_isFilterEnabled:function(){var e=this.options.filter;return e&&e!==`none`},_hideClear:function(){var e=this;e._clear&&e._clear.addClass(I)},_showClear:function(){this._clear&&this._clear.removeClass(I)},_clearValue:function(){this._clearText(),this._accessor(``),this.listView.value([]),this._isSelect&&(this._customOption=t),this._isFilterEnabled()&&!this.options.enforceMinLength&&(this._filter({word:``,open:!1}),this.options.highlightFirst&&this.listView.focus(0)),this._change()},_clearText:function(){this.text(``)},_clearFilter:function(){this.options.virtual||this.listView.bound(!1),this._filterSource()},_filterSource:function(t,n){var r=this,i=r.options,a=i.filterFields&&t&&t.logic&&t.filters&&t.filters.length,o=r.dataSource,s=P({},o.filter()||{}),c=t||s.filters&&s.filters.length&&!t,l=$(s,i.dataTextField);if(this._clearFilterExpressions(s),(t||l)&&r.trigger(`filtering`,{filter:t}))return e.Deferred().reject().promise();var u={filters:[],logic:`and`};a?u.filters.push(t):this._pushFilterExpression(u,t),je(s)&&(u.logic===s.logic?u.filters=u.filters.concat(s.filters):u.filters.push(s)),r._cascading&&this.listView.setDSFilter(u);var d=P({},{page:c?1:o.page(),pageSize:c?o.options.pageSize:o.pageSize(),sort:o.sort(),filter:o.filter(),group:o.group(),aggregate:o.aggregate()},{filter:u});return o[n?`read`:`query`](o._mergeState(d))},_pushFilterExpression:function(e,t){je(t)&&t.value!==``&&e.filters.push(t)},_clearFilterExpressions:function(e){if(e.filters){for(var t,n=0;n<e.filters.length;n++)`fromFilter`in e.filters[n]&&(t=n);isNaN(t)||e.filters.splice(t,1)}},_renderNoData:function(){var e=this,t=e.noData;t&&t.html(e.noDataTemplate({instance:e}))},_toggleNoData:function(t){e(this.noData).toggle(t)},_toggleHeader:function(e){var t=this.listView.content.prev(this._getFixedGroupHeaderSelector());this.options.fixedGroupHeader===!1&&(e=!1),t.toggle(e)},_renderFooter:function(){var e=this,t=e.footer?this.options.columns&&this.options.columns.length?e.footer.children().first():e.footer:null;t&&t.html(e.footerTemplate({instance:e}))},_allowOpening:function(){return this.options.noDataTemplate||this.dataSource.flatView().length},_initValue:function(){var e=this,t=e.options.value;t===null?(t=e._accessor(),e.options.value=t):e.element.val(t),e._old=t},_ignoreCase:function(){var e=this,t=e.dataSource.reader.model,n;t&&t.fields&&(n=t.fields[e.options.dataTextField],n&&n.type&&n.type!==`string`&&(e.options.ignoreCase=!1))},_focus:function(e){return this.listView.focus(e)},_filter:function(e){var t=this,n=t.options,r=e.word,i=n.filterFields,a=n.dataTextField,o;if(i&&i.length){o={logic:`or`,filters:[],fromFilter:!0};for(var s=0;s<i.length;s++)this._pushFilterExpression(o,t._buildExpression(r,i[s]))}else o=t._buildExpression(r,a);t._open=e.open,t._filterSource(o)},_buildExpression:function(e,t){var n=this,r=n.options,i=r.ignoreCase,a=n.dataSource.options.accentFoldingFiltering;return{value:i?a?e.toLocaleLowerCase(a):e.toLowerCase():e,field:t,operator:r.filter,ignoreCase:i}},_clearButton:function(){var t=this,r=t.options.messages.clear;t._clear||=e(`<span unselectable="on" class="k-clear-value" title="${r}">${n.ui.icon(`x`)}</span>`).attr({role:`button`,tabIndex:-1}),t.options.clearButton||t._clear.remove(),this._hideClear()},search:function(e){var t=this.options;e=typeof e==`string`?e:this._inputValue(),clearTimeout(this._typingTimeout),(!t.enforceMinLength&&!e.length||e.length>=t.minLength)&&(this._state=`filter`,this.listView&&(this.listView._emptySearch=!n.trim(e).length),this._isFilterEnabled()?this._filter({word:e,open:!0}):this._searchByWord(e))},current:function(e){return this._focus(e)},items:function(){let t=this._getUlElement();return t.length?t.children():e()},destroy:function(){var e=this,t=e.ns;o.fn.destroy.call(e),e._unbindDataSource(),(e.largeMQL||e.mediumMQL||e.smallMQL)&&(e.largeMQL.destroy(),e.mediumMQL.destroy(),e.smallMQL.destroy()),e.listView.destroy(),e.list.off(t),e.popup.destroy(),e._form&&e._form.off(`reset`,e._resetHandler),e.label&&e.label.destroy()},dataItem:function(n){var r=this;if(n===t)return r.listView.selectedDataItems()[0];if(typeof n!=`number`){if(r.options.virtual)return r.dataSource.getByUid(e(n).data(`uid`));n=e(r.items()).index(n)}return r.dataSource.flatView()[n]},_activateItem:function(){var e=this.listView.focus();e&&this.popup.visible()&&this._focused.add(this.filterInput).attr(U,e.attr(`id`))},_deactivateItem:function(){this._focused.add(this.filterInput).removeAttr(U)},_accessors:function(){var e=this,t=e.element,r=e.options,i=n.getter,a=t.attr(n.attr(`text-field`)),o=t.attr(n.attr(`value-field`));!r.dataTextField&&a&&(r.dataTextField=a),!r.dataValueField&&o&&(r.dataValueField=o),e._text=i(r.dataTextField),e._value=i(r.dataValueField)},_aria:function(e){var n=this,r=n.options,i=n._focused,a;r.suggest!==t&&(a=r.filter===`none`?r.suggest===!0?`inline`:`none`:r.suggest===!0?`both`:`list`,i.attr(we,a));let o=n.list.find(`.${b}, .${x}`).first(),s=n.list.find(`.${b}, .${x}`),c=n._isFilterEnabled()?`polite`:`off`;if(o.length)e=e?e+` `+o[0].id:o[0].id,i.attr({"aria-controls":e}),n.filterInput&&n.filterInput.length>0&&n.filterInput.attr(W,e),s.attr(G,c);else if(r.virtual&&n.listView&&n.listView.options&&typeof n.listView.options.id==`string`){var l=n.listView.options.id;e=e?e+` `+l:l,i.attr({"aria-controls":e}),n.filterInput&&n.filterInput.length>0&&n.filterInput.attr(W,e)}n._ariaLabel(n._focused)},_blur:function(){var e=this;e._change(),e.close(),e._userTriggered=!1},_isValueChanged:function(e){return e!==Y(this._old,typeof e)},_change:function(){var e=this,n=e.selectedIndex,r=e.options.value,i=e.value(),a;e._isSelect&&!e.listView.bound()&&r&&(i=r),(e._isValueChanged(i)||e._valueBeforeCascade!==t&&e._isValueChanged(e._valueBeforeCascade)&&e._userTriggered||n!==t&&n!==e._oldIndex&&!e.listView.isFiltered()&&!e.options.virtual)&&(a=!0),a&&(e._old===null||e._old===``||i===``?e._valueBeforeCascade=e._old=i:e.dataItem()?e._valueBeforeCascade=e._old=e.options.dataValueField?e.dataItem()[e.options.dataValueField]:e.dataItem():e._valueBeforeCascade=e._old=null,e._oldIndex=n,e._typing||e.element.trigger(h),e.trigger(h)),e.typing=!1},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,r=e.options,i=e.element.is(`[disabled]`);r.enable!==t&&(r.enabled=r.enable),!r.enabled||i?e.enable(!1):e.readonly(n.isPresent(r.readonly)?r.readonly:e.element.is(`[readonly]`))},_dataValue:function(e){var n=this._value(e);return n===t&&(n=this._text(e)),n},_offsetHeight:function(){var t=0;return this.listView.content.parent().prevAll(`:visible`).each(function(){var n=e(this);t+=i(n,!0)}),t},_height:function(t){var n=this,r=n.list,a=n.options.height,o=n.popup.visible(),s=this.options.columns&&this.options.columns.length,c,l;if(t||n.options.noDataTemplate){if(l=r.parent().add(r.closest(`.k-animation-container`).add(r.closest(`.k-child-animation-container`))).show(),!r.parent().is(`:visible`)){l.hide();return}a=n.listView.content[0].scrollHeight>a?a:`auto`,l.height(a),a!==`auto`&&(c=n._offsetHeight(),a-=c,s&&(a=a-(i(e(n.footer))||0)-(i(e(n.columnsHeader))||0))),s?n.listView.content.outerHeight(a):n.listView.content.parent().outerHeight(a),o||r.parent().hide()}return a},_openHandler:function(e){var t;this._adjustListWidth(),this.trigger(ae)?e.preventDefault():(this._focused.attr(Te,!0),this.list.find(`.${b}, .${x}`).attr(Ee,!1),t=this.listView.focus(),t&&this._focused.add(this.filterInput).attr(U,t.attr(`id`)))},_adjustListWidth:function(){var e=this,t=e.list.parent(),n=t[0].style.width,r=e.wrapper,i,a;if(!(!t.data(L)&&n||e._hasActionSheet()))return i=window.getComputedStyle?window.getComputedStyle(r[0],null):0,a=parseFloat(i&&i.width)||f(r),i&&F.msie&&(a+=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth)),n=t.css(`box-sizing`)===`border-box`?a:a-(f(t)-t.width()),t.css({fontFamily:r.css(`font-family`),width:e.options.autoWidth?`auto`:n,minWidth:n,whiteSpace:e.options.autoWidth?`nowrap`:`normal`}).data(L,n),!0},_closeHandler:function(e){e.closeButton&&this._onCloseButtonPressed(),this.trigger(oe)?e.preventDefault():(this._focused.attr(Te,!1),this.list.find(`.${b}, .${x}`).attr(Ee,!0),this._focused.add(this.filterInput).removeAttr(U))},_focusItem:function(){var e=this.listView,n=!e.focus(),r=Z(e.select());r===t&&this.options.highlightFirst&&n&&(r=0),r===t?n&&e.scrollToIndex(0):e.focus(r)},_calculateGroupPadding:function(t){var r=this.listView.content.prev(this._getFixedGroupHeaderSelector()),i=0,a=`right`,o;if(r[0]&&r[0].style.display!==`none`){var s=this.list.find(`.${b}, .${x}`);if(s.length>1?s.each(function(){var t=e(this).children(S).first();if(t.length)return o=t,!1}):o=this._getUlElement().children(S).first(),!o||!o.length)return;t!==`auto`&&(i=n.support.scrollbar()),this.element.parents(`.k-rtl`).length&&(a=`left`),i+=parseFloat(o.css(`border-`+a+`-width`),10)+parseFloat(o.children(ie).css(`padding-`+a),10),r.css(`padding-`+a,i)}},_calculatePopupHeight:function(e){var t=this._height(this.dataSource.flatView().length||e);this._calculateGroupPadding(t),this._calculateColumnsHeaderPadding(t)},_calculateColumnsHeaderPadding:function(e){if(this.options.columns&&this.options.columns.length){var t=this,r=c.isRtl(t.wrapper),i=n.support.scrollbar();t.columnsHeader.css(r?`padding-left`:`padding-right`,e===`auto`?0:i)}},_refreshScroll:function(){var e=this.listView,t=e.element.height()>e.content.height();this.options.autoWidth&&e.content.css({overflowX:`hidden`,overflowY:t?`scroll`:`auto`})},_hasActionSheet:function(){return this.options.adaptiveMode===`auto`&&(this.mediumMQL.mediaQueryList.matches||this.smallMQL.mediaQueryList.matches)},_resizePopup:function(e){this.options.virtual||this._hasActionSheet()||(this.popup.element.is(`:visible`)?this._calculatePopupHeight(e):(this.popup.one(`open`,(function(e){return(function(t){t.isDefaultPrevented()||this._calculatePopupHeight(e)}).bind(this)}).call(this,e)),this.popup.one(O,this._refreshScroll.bind(this))))},_popup:function(){var e=this;e.list.wrap(`<div>`),e.options.adaptiveMode===`auto`?(e.largeMQL.onEnter(e._createPopup.bind(e)),e.mediumMQL.onEnter(e._createActionSheet.bind(e)),e.smallMQL.onEnter(()=>{(!e.popup||!e.popup.fullscreen)&&e._createActionSheet(),e.popup.fullscreen(!0)})):e._createPopup()},_addFilterHeader:function(){var t=this;t._isFilterEnabled()&&(t._filterHeader(),t.options.adaptiveMode===`auto`&&(t.mediumMQL.mediaQueryList.matches||t.smallMQL.mediaQueryList.matches)?(t.popup.element.find(Oe).append(e(t.actionSheetFilterTemplate)).find(`.k-searchbox`).append(t.filterInput),t._enable()):t.options.popupFilter&&t.list.parent().prepend(e(t.filterTemplate)).find(`.k-searchbox`).append(t.filterInput),t._enable())},_createPopup:function(){var e=this;e._unboundClick&&=(e.input?e.input.off(E):e.element&&e.element.off(E),!1),e.popup&&(e._cachedFilterValue=e.filterInput?e.filterInput.val():null,e.popup.destroy(),e.popup.wrapper&&e.popup.wrapper.remove(),e._removeFilterHeader(),e._removeStaticHeader()),e.popup=new r.Popup(e.list.parent().addClass(`k-list-container`),P({},e.options.popup,{anchor:e.wrapper,open:e._openHandler.bind(e),close:e._closeHandler.bind(e),animation:e.options.animation,isRtl:c.isRtl(e.wrapper),autosize:e.options.autoWidth,autowidth:e.options.autoWidth,activate:()=>{this._refreshFloatingLabel()},deactivate:()=>{this._refreshFloatingLabel()}})),e._postCreatePopup()},_onActionSheetCreate:e.noop,_onCloseButtonPressed:e.noop,_createActionSheet:function(){var e=this;e.popup&&(e._cachedFilterValue=e.filterInput?e.filterInput.val():null,e.popup.destroy(),e.popup.wrapper&&e.popup.wrapper.remove(),e._removeFilterHeader(),e._removeStaticHeader(),e.list.add(e.list.parent()).css({width:``,height:``,minWidth:``})),e.popup=new r.ActionSheet(e.list.parent(),{headerTemplate:t=>`<div class="k-text-center k-actionsheet-titlebar" ><div class="k-actionsheet-titlebar-group k-hbox"><div class="k-actionsheet-title">`+(e.options.adaptiveTitle||e.options.label?`<div class="k-text-center">${e.options.adaptiveTitle||e.options.label}</div>`:``)+(e.options.adaptiveSubtitle?`<div class="k-actionsheet-subtitle k-text-center">${e.options.adaptiveSubtitle||``}</div>`:``)+`</div>`+(t.closeButton?`<div class="k-actionsheet-actions">`+n.html.renderButton(`<button tabindex="-1" ${n.attr(`ref-actionsheet-close-button`)}></button>`,{icon:`check`,fillMode:`flat`,size:`large`,themeColor:`primary`})+`</div>`:``)+`</div></div>`,open:e._openHandler.bind(e),close:e._closeHandler.bind(e),focusOnActivate:!1,adaptive:!0,appendTo:e.options.popup&&e.options.popup.appendTo||document.body,closeButton:!0,fullscreen:e.smallMQL.mediaQueryList.matches,activate:()=>{this._refreshFloatingLabel()},deactivate:()=>{this._refreshFloatingLabel()},popup:P({},e.options.popup,{autosize:e.options.autoWidth})}),e._postCreatePopup(),e._onActionSheetCreate()},_removeFilterHeader:function(){this.filterInput&&=(this.filterInput.off(this.ns).closest(`.k-list-filter`).remove(),null)},_removeStaticHeader:function(){this.listView.header.remove()},_postCreatePopup:function(){var e=this,t;e._addFilterHeader(),e.filterInput&&e._cachedFilterValue&&e.filterInput.val(e._cachedFilterValue),e.popup.element.prepend(e.header).on(xe+this.ns,this._listMousedown.bind(this)),e.listView&&(t=e.listView.value(),e.listView._clean&&e.listView._clean(),e.tagList&&e.options.virtual&&e.tagList.empty(),e.listView.destroy(),e.listView.content&&this._getUlElement().unwrap(),e._initList({skipValueUpdate:!0}),e.listView.value(t))},_toggleHover:function(t){e(t.currentTarget).toggleClass(_,t.type===D)},_toggle:function(e,n){var r=this,i=c.mobileOS&&(c.touch||c.MSPointers||c.pointers);e=e===t?!r.popup.visible():e,!n&&!i&&r._focused[0]!==u()&&(r._prevent=!0,r._focused.trigger(N),r._prevent=!1),r[e?ae:oe]()},_triggerCascade:function(){var e=this;(!e._cascadeTriggered||e.value()!==Y(e._cascadedValue,typeof e.value()))&&(e._cascadedValue=e.value(),e._cascadeTriggered=!0,e.trigger(w,{userTriggered:e._userTriggered}))},_triggerChange:function(){this._valueBeforeCascade!==this.value()&&this.trigger(h)},_unbindDataSource:function(){var e=this;e.dataSource.unbind(ue,e._requestStartHandler).unbind(M,e._requestEndHandler).unbind(`error`,e._errorHandler)},requireValueMapper:function(e,t){if(((e.value instanceof Array?e.value.length:e.value)||(t instanceof Array?t.length:t))&&e.virtual&&typeof e.virtual.valueMapper!=`function`)throw Error(`ValueMapper is not provided while the value is being set. See http://docs.telerik.com/kendo-ui/controls/editors/combobox/virtualization#the-valuemapper-function`)}});Object.defineProperty(J.prototype,`ul`,{get:function(){return this._getUlElement()},configurable:!0});function Y(e,n){return e!==t&&e!==``&&e!==null&&(n===`boolean`?(typeof e!=`boolean`&&(e=e.toString().toLowerCase()===`true`),e=!!e):n===`number`?e=Number(e):n===`string`&&(e=e.toString())),e}P(J,{inArray:function(e,t){var n,r,i=t.children;if(!e||e.parentNode!==t)return-1;for(n=0,r=i.length;n<r;n++)if(e===i[n])return n;return-1},unifyType:Y}),n.ui.List=J,r.Select=J.extend({init:function(e,t){J.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){var t=this,n;t.options.dataSource=e,t._dataSource(),t.listView.bound()&&(t._initialIndex=null,t.listView._current=null),t.listView.setDataSource(t.dataSource),t.options.autoBind&&t.dataSource.fetch(),n=t._parentWidget(),n&&t._cascadeSelect(n)},close:function(){this.popup.close()},select:function(e){var n=this;return e===t?n.selectedIndex:n._select(e).done(function(){n._cascadeValue=n._old=n._accessor(),n._oldIndex=n.selectedIndex,n._refreshFloatingLabel()})},_accessor:function(e,t){return this[this._isSelect?`_accessorSelect`:`_accessorInput`](e,t)},_accessorInput:function(e){var n=this.element[0];if(e===t)return n.value;e===null&&(e=``),n.value=e},_accessorSelect:function(e,n){var r=this.element[0],i;if(e===t)return Q(r).value||``;Q(r).selected=!1,n===t&&(n=-1),i=e!==null&&e!==``,i&&n==-1?this._custom(e):e?r.value=e:r.selectedIndex=n},_syncValueAndText:function(){return!0},_custom:function(t){var n=this,r=n.element,i=n._customOption;i||(i=e(`<option/>`),n._customOption=i,r.append(i)),i.text(t),i[0].selected=!0},_dataSource:function(){var e=this,t=e.element,r=e.options,i=r.dataSource||{},a;i=Array.isArray(i)?{data:i}:i,e._isSelect&&(a=t[0].selectedIndex,a>-1&&(r.index=a),i.select=t,i.fields=[{field:r.dataTextField},{field:r.dataValueField}]),e.dataSource?e._unbindDataSource():(e._requestStartHandler=e._showBusy,e._requestEndHandler=e._hideBusy,e._errorHandler=function(){e._hideBusy()}),e.dataSource=n.data.DataSource.create(i).bind(ue,e._requestStartHandler).bind(M,e._requestEndHandler).bind(`error`,e._errorHandler)},_firstItem:function(){this.listView.focusFirst()},_lastItem:function(){this.listView.focusLast()},_nextItem:function(){return this.listView.focusNext()},_prevItem:function(){return this.listView.focusPrev()},_getNormalizedDataItem:function(e){var t=this,n=t.listView,r=typeof e==`number`,i=t.optionLabel&&t.optionLabel.length,a=r?i?--e:e:n.getElementIndex(e);return n.dataItemByIndex(a)},_getNormalizedSelectCandidate:function(e){var t=this,n=t.optionLabel&&t.optionLabel.length,r=typeof e==`number`,i=e;return n&&r&&i++,i},_move:function(e){var t=this,n=t.listView,r=e.keyCode,i=r===s.DOWN,a=t.options.virtual,o,c,l,d,f;if(r===s.UP||i){if(e.altKey)t.toggle(i);else{let r=t.list.find(`.${b}, .${x}`);if(!n.bound()&&(!r.length||!r[0].firstChild))return t._fetch||(t.dataSource.one(h,function(){t._fetch=!1,t._move(e)}),t._fetch=!0,t._filterSource()),e.preventDefault(),!0;l=t._focus(),!t._fetch&&(!l||l.hasClass(v))&&(i?(d=t._nextItem(),(a&&d<=0||!t._focus()&&!d)&&t._lastItem()):(d=t._prevItem(),(a&&d>=n.dataSource.total()-1||!t._focus()&&!d)&&t._firstItem())),f=t._getNormalizedSelectCandidate(t._get(t._focus())||d||0),t._select(f,!0).done(function(){var e=function(){t.popup.visible()||t._blur(),t._cascadedValue===null?t._cascadedValue=t.value():t._cascadedValue=t.dataItem()?t.dataItem()[t.options.dataValueField]||t.dataItem():null};t.trigger(T,{dataItem:t._getNormalizedDataItem(f),item:t._focus()})?t._select(l).done(e):e()})}e.preventDefault(),c=!0}else if(r===s.ENTER||r===s.TAB){t.popup.visible()&&e.preventDefault(),l=t._focus(),o=t.dataItem(),!t.popup.visible()&&(!o||t.text()!==t._text(o))&&(l=null);var p=t.filterInput&&t.filterInput[0]===u(),m;if(l){o=n.dataItemByIndex(n.getElementIndex(l));var g=!0;if(o&&(g=t._value(o)!==J.unifyType(t.value(),typeof t._value(o))),g&&t.trigger(T,{dataItem:o,item:l}))return;m=t._select(l)}else t.input&&((t._syncValueAndText()||t._isSelect)&&t._accessor(t.input.val()),t.listView.value(t.input.val()));t._focusElement&&t._focusElement(t.wrapper),p&&r===s.TAB?t.wrapper.focusout():m&&typeof m.done==`function`?m.done(function(){t._blur()}):t._blur(),t.close(),c=!0}else if(r===s.ESC)t.popup.visible()&&(e.preventDefault(),e.stopPropagation()),t.close(),c=!0;else if(t.popup.visible()&&(r===s.PAGEDOWN||r===s.PAGEUP)){e.preventDefault();var _=r===s.PAGEDOWN?1:-1;n.scrollWith(_*n.screenHeight()),c=!0}return c},_fetchData:function(){var e=this,t=!!e.dataSource.view().length;e._request||e.options.cascadeFrom||!e.listView.bound()&&!e._fetch&&!t&&(e._fetch=!0,e.dataSource.fetch().done(function(){e._fetch=!1}))},_options:function(e,n,r){var i=this,a=i.element,o=a[0],s=e.length,c=``,u,d,f,p,m=0;for(n&&(c=n);m<s;m++)u=`<option`,d=e[m],f=i._text(d),p=i._value(d),p!==t&&(p+=``,p.indexOf(`"`)!==-1&&(p=p.replace(ge,`&quot;`)),u+=` value="`+p+`"`),u+=`>`,f!==t&&(u+=l(f)),u+=`</option>`,c+=u;a.html(c),r!==t&&(o.value=r,o.value&&!r&&(o.selectedIndex=-1)),o.selectedIndex!==-1&&(u=Q(o),u&&u.setAttribute(le,le))},_reset:function(){var t=this,n=t.element,r=n.attr(`form`),i=r?e(`#`+r):n.closest(`form`);i[0]&&(t._resetHandler=function(){setTimeout(function(){t.options._removeDataItems&&(t.listView._dataItems=[]),t.value(t._initial),t.options._shouldRefresh&&(t.text(t._initial),t.refresh())})},t._form=i.on(`reset`,t._resetHandler))},_parentWidget:function(){var t=this.options.name;if(this.options.cascadeFrom){var n=e(`#`+this.options.cascadeFrom),r=n.data(`kendo`+t);if(!r)for(var i=0;i<z[t].length&&(r=n.data(`kendo`+z[t][i]),!r);i+=1);return r}},_cascade:function(){var e=this,t=e.options,n=t.cascadeFrom,r;if(n){if(r=e._parentWidget(),!r)return;e._cascadeHandlerProxy=e._cascadeHandler.bind(e),e._cascadeFilterRequests=[],t.autoBind=!1,r.bind(`set`,function(){e.one(`set`,function(t){e._selectedValue=t.value||e._accessor()})}),r.first(w,e._cascadeHandlerProxy),r.listView.bound()?(e._toggleCascadeOnFocus(),e._cascadeSelect(r)):(r.one(j,function(){e._toggleCascadeOnFocus(),r.popup.visible()&&r._focused.trigger(N)}),r.value()||e.enable(!1))}},_toggleCascadeOnFocus:function(){var e=this,t=e._parentWidget(),n=he&&t instanceof r.DropDownList?de:fe;t._focused.add(t.filterInput).on(N,function(){t.unbind(w,e._cascadeHandlerProxy),t.unbind(h,e._cascadeHandlerProxy),t.first(h,e._cascadeHandlerProxy)}),t._focused.add(t.filterInput).on(n,function(){t.unbind(h,e._cascadeHandlerProxy),t.unbind(w,e._cascadeHandlerProxy),t.first(w,e._cascadeHandlerProxy)})},_cascadeHandler:function(e){var t=this._parentWidget(),n=this.value();this._userTriggered=e.userTriggered||t._userTriggered,this.listView.bound()&&this._clearSelection(t,!0),this._cascadeSelect(t,n)},_cascadeChange:function(e){var t=this,n=t._accessor()||t._selectedValue;t._cascadeFilterRequests.length||(t._selectedValue=null),t._userTriggered?t._clearSelection(e,!0):n?(n!==Y(t.listView.value()[0],typeof n)&&t.value(n),(!t.dataSource.view()[0]||t.selectedIndex===-1)&&t._clearSelection(e,!0)):t.dataSource.flatView().length&&t.select(t.options.index),t.enable(),t._triggerCascade(),t._triggerChange(),t._userTriggered=!1},_cascadeSelect:function(e,n){var r=this,i=e.dataItem(),a=i?i[r.options.cascadeFromParentField]||e._value(i):null,o=r.options.cascadeFromField||e.options.dataValueField,s;if(e.options.cascadeOnCustomValue&&a===null&&(!r.options.cascadeFromParentField||r.options.cascadeFromParentField===e.options.dataValueField)&&(a=e.value()),r._valueBeforeCascade=n===t?r.value():n,a||a===0){s=r.dataSource.filter()||{},$(s,o);var c=function(){var t=r._cascadeFilterRequests.shift();t&&r.unbind(`dataBound`,t),t=r._cascadeFilterRequests[0],t&&r.first(`dataBound`,t),r._cascadeChange(e)};r._cascadeFilterRequests.push(c),r._cascadeFilterRequests.length===1&&r.first(`dataBound`,c),r._cascading=!0,r._filterSource({field:o,operator:`eq`,value:a}),r._cascading=!1}else r.enable(!1),r._clearSelection(e),r._triggerCascade(),r._triggerChange(),r._userTriggered=!1;r._refreshFloatingLabel()}});var X=`.StaticList`,ke=n.ui.DataBoundWidget.extend({init:function(t,r){if(o.fn.init.call(this,t,r),this.element.on(E+X,S+`, `+C,this._click.bind(this)).on(D+X,S+`, `+C,function(){e(this).addClass(_)}).on(se+X,S+`, `+C,function(){e(this).removeClass(_)}),c.touch&&this._touchHandlers(),this._isTableVariant()){if(this.element.append(`<div class='k-table-body k-table-scroller' unselectable='on'></div>`),this.content=this.element.children(`.k-table-body`),this.options.fixedGroupHeader!==!1){let t=e(`<div class="k-table-group-sticky-header"><span class="k-table-th"></span></div>`);this.content.before(t),this.header=t.find(`.k-table-th`)}}else this.element.append(`<div class='k-list-content k-list-scroller' unselectable='on'></div>`),this.content=this.element.children(`.k-list-content`),this.options.fixedGroupHeader!==!1&&(this.header=this.content.before(e(`<div class="k-list-group-sticky-header"></div>`).hide()).prev());this.element.children(`.k-list-footer, .k-table-footer`).appendTo(this.element),this._createInitialUl(),this.bound(!1),this._optionID=n.guid(),this._selectedIndices=[],this._view=[],this._dataItems=[],this._values=[];var i=this.options.value;i&&(this._values=Array.isArray(i)?i.slice(0):[i]),this._getter(),this._templates(),this.setDataSource(this.options.dataSource),this._createOnScrollProxy()},options:{name:`StaticList`,dataValueField:null,valuePrimitive:!1,selectable:!0,template:null,groupTemplate:null,fixedGroupTemplate:null,fixedGroupHeader:!0,ariaLabel:null,ariaLabelledBy:null,iconField:null,descriptionField:null,groupIconField:null,actionField:null},events:[E,h,O,k,A,j,ce,Se],_applyUlAttributes:function(e,t,n,r){let i=this,a=i.options;e.attr({tabIndex:-1,"aria-hidden":!0,id:n?`${a.id}-group-${t}`:a.id}),n?(e.attr(`role`,`group`),r&&e.attr(V,r)):(e.attr(`role`,a.aria&&a.aria.role||`listbox`),a&&a.ariaLabel?e.attr(H,a.ariaLabel):a&&a.ariaLabelledBy&&e.attr(V,a.ariaLabelledBy),this.options.selectable===`multiple`&&e.attr(De,!0)),a.ariaLive&&e.attr(G,a.ariaLive),e.addClass(i._isTableVariant()?`${x} ${y}`:b)},_isTableVariant:function(){return this.options.columns&&this.options.columns.length},_createInitialUl:function(){let t=this,n=t.options,r=e(`<ul unselectable='on'></ul>`);r.attr({tabIndex:-1,"aria-hidden":!0,id:n.id,role:n.aria&&n.aria.role||`listbox`}),n&&n.ariaLabel?r.attr(H,n.ariaLabel):n&&n.ariaLabelledBy&&r.attr(V,n.ariaLabelledBy),n.ariaLive&&r.attr(G,n.ariaLive),n.selectable===`multiple`&&r.attr(De,!0),r.addClass(t._isTableVariant()?`${x} ${y}`:b),this.content.append(r)},setDataSource:function(e){var t=this,r=e||{},i;r=Array.isArray(r)?{data:r}:r,r=n.data.DataSource.create(r),t.dataSource?(t.dataSource.unbind(h,t._refreshHandler),i=t.value(),t.value([]),t.bound(!1),t.value(i)):t._refreshHandler=t.refresh.bind(t),t.setDSFilter(r.filter()),t.dataSource=r.bind(h,t._refreshHandler),t._fixedHeader()},_touchHandlers:function(){var t=this,n=this.options.columns&&this.options.columns.length?C:S,r,i,a=function(e){return(e.originalEvent||e).changedTouches[0].pageY};t.element.on(`touchstart`+X,function(e){r=a(e)}),t.element.on(`touchend`+X,function(o){o.isDefaultPrevented()||(i=a(o),Math.abs(i-r)<10&&(t._touchTriggered=!0,t._triggerClick(e(o.target).closest(n).get(0))))})},skip:function(){return this.dataSource.skip()},setOptions:function(e){o.fn.setOptions.call(this,e),this._getter(),this._templates(),this._render(),this.label&&e.label?this.label.setOptions(e.label):this.label&&e.label===!1&&(this.label._unwrapFloating(),this._inputLabel.remove(),delete this._inputLabel)},destroy:function(){this.element.off(X),this._refreshHandler&&this.dataSource.unbind(h,this._refreshHandler),clearTimeout(this._scrollId),o.fn.destroy.call(this)},dataItemByIndex:function(e){return this.dataSource.flatView()[e]},screenHeight:function(){return this.content[0].clientHeight},scrollToIndex:function(e){let t=this.items()[e];t&&this.scroll(t)},scrollWith:function(e){this.content.scrollTop(this.content.scrollTop()+e)},scroll:function(e){if(e){e[0]&&(e=e[0]);var t=this.content[0],n=t.getBoundingClientRect(),r=e.getBoundingClientRect().top-n.top+t.scrollTop,i=e.offsetHeight,a=t.scrollTop,o=t.clientHeight,s=r+i,c=this.header&&this.header.is(`:visible`)?this.header.outerHeight():0;a+c>r?a=Math.max(0,r-c):s>a+o&&(a=s-o),t.scrollTop=a}},selectedDataItems:function(e){if(e===t)return this._dataItems.slice();this._dataItems=e,this._values=this._getValues(e)},_getValues:function(t){var n=this._valueGetter;return e.map(t,function(e){return n(e)})},focusNext:function(){var t=this,n=t.focus(),r=t.items(),i;if(n)i=r.index(n[0]);else{var a=t.select();i=a.length?a[0]:-1}i+=1,i>=r.length?t.focus(e()):t.focus(r[i])},focusPrev:function(){var t=this,n=t.focus(),r=t.items(),i;if(n)i=r.index(n[0]);else{var a=t.select();i=a.length?a[0]:r.length}--i,i<0?t.focus(e()):t.focus(r[i])},focusFirst:function(){this.focus(this.items()[0])},focusLast:function(){this.focus(Z(this.items()))},focus:function(n){var r=this,i=r._optionID,a;if(n===t)return r._current;n=Z(r._get(n)),n=e(this.items()[n]),r._current&&(r._current.removeClass(g).removeAttr(m),r.trigger(k)),a=!!n[0],a&&(n.addClass(g),r.scroll(n),n.attr(`id`,i)),r._current=a?n:null,r.trigger(O)},focusIndex:function(){var e=this.focus();return e?this.items().index(e):t},skipUpdate:function(e){this._skipUpdate=e},select:function(n){var r=this,i=r.options.selectable,a=i!==`multiple`&&i!==!1,o=r._selectedIndices,s=this.content.find(`.k-selected`).first(),c=s.length?[this.items().index(s)]:[-1],l=[],u=[],d;if(n===t)return o.slice();n=r._get(n),n.length===1&&n[0]===-1&&(n=[]);var f=e.Deferred().resolve(),p=r.isFiltered();return p&&!a&&r._deselectFiltered(n)?f:a&&!p&&e.inArray(Z(n),o)!==-1&&e.inArray(Z(n),c)!==-1?(r._dataItems.length&&r._view.length&&(r._dataItems=[r._view[o[0]].item]),f):(d=r._deselect(n),u=d.removed,n=d.indices,n.length&&(a&&(n=[Z(n)]),l=r._select(n)),(l.length||u.length)&&(r._valueComparer=null,r.trigger(h,{added:l,removed:u})),f)},removeAt:function(e){return this._selectedIndices.splice(e,1),this._values.splice(e,1),this._valueComparer=null,{position:e,dataItem:this._dataItems.splice(e,1)[0]}},setValue:function(e){e=Array.isArray(e)||e instanceof p?e.slice(0):[e],this._values=e,this._valueComparer=null},value:function(n){var r=this,i=r._valueDeferred,a;return n===t?r._values.slice():(r.setValue(n),(!i||i.state()===`resolved`)&&(r._valueDeferred=i=e.Deferred()),r.bound()&&(a=r._valueIndices(r._values),r.options.selectable===`multiple`&&r.select(-1),r.select(a),i.resolve()),r._skipUpdate=!1,i)},items:function(){let t=[];return this.content.children(`ul`).each(function(){e(this).children(S+`, `+C).each(function(){t.push(this)})}),e(t)},_click:function(e){if(this._touchTriggered){this._touchTriggered=!1;return}e.isDefaultPrevented()||this._triggerClick(e.currentTarget)},_createOnScrollProxy:function(){this._onScroll=function(){var e=this;clearTimeout(e._scrollId),e._scrollId=setTimeout(function(){e._renderHeader()},50)}.bind(this)},_triggerClick:function(t){let n=this,r=e(t),i=n.getElementIndex(r),a=n.dataItemByIndex(i),o=n.options.actionField;o&&a&&a[o]&&!n.trigger(`action`,{item:r,dataItem:a,action:a[o]})||this.trigger(E,{item:r})||this.select(t)},_valueExpr:function(e,t){var n=this,r=0,i,a=[];if(!n._valueComparer||n._valueType!==e){for(n._valueType=e;r<t.length;r++)a.push(Y(t[r],e));i=(e,t)=>{for(var n=0;n<a.length;n++)if(e===t[n])return n;return-1},n._valueComparer=function(e){return i(e,a)}}return n._valueComparer},_dataItemPosition:function(e,t){var n=this._valueGetter(e);return this._valueExpr(typeof n,t)(n)},_getter:function(){this._valueGetter=n.getter(this.options.dataValueField)},_deselect:function(t){let n=this,r=n.items().toArray(),i=n.options.selectable,a=n._selectedIndices,o=n._dataItems,s=n._values,c=[],l=0,u=0,d,f,p=0;if(t=t.slice(),i===!0||!t.length){for(;l<a.length;l++)e(r[a[l]]).removeClass(v).attr(K,!1),c.push({position:l,dataItem:o[l]});n._values=[],n._dataItems=[],n._selectedIndices=[]}else if(i===`multiple`)for(;l<t.length;){if(d=t[l],!e(r[d]).hasClass(v)){l++;continue}for(;u<a.length;){if(f=a[u],f===d){e(r[f]).removeClass(v).attr(K,!1);var m=this._view[d].item,h=this._dataItemPosition(m,this._values);c.push({position:h,dataItem:m}),o.splice(u,1),a.splice(u,1),t.splice(l,1),s.splice(u,1),p+=1,--l,--u;break}u++}l++}return{indices:t,removed:c}},_deselectFiltered:function(t){let n=this.items();for(var r,i,a,o=[],s=0;s<t.length;s++)i=t[s],r=this._view[i].item,a=this._dataItemPosition(r,this._values),a>-1&&(o.push(this.removeAt(a)),e(n[i]).removeClass(v));return o.length?(this.trigger(h,{added:[],removed:o}),!0):!1},_select:function(t){let n=this,r=n.items().toArray(),i=n._view,a,o,s=[],c=0;for(Z(t)!==-1&&n.focus(t);c<t.length;c++)o=t[c],a=i[o],!(o===-1||!a)&&(a=a.item,n._selectedIndices.push(o),n._dataItems.push(a),n._values.push(n._valueGetter(a)),e(r[o]).addClass(v).attr(K,!0),s.push({dataItem:a}));return s},getElementIndex:function(t){return e(t).data(`offset-index`)},_get:function(e){return typeof e==`number`?e=[e]:pe(e)||(e=this.getElementIndex(e),e=[e===t?-1:e]),e},_templates:function(){var e,t=this.options,r={template:t.template,groupTemplate:t.groupTemplate,fixedGroupTemplate:t.fixedGroupTemplate};for(var i in t.columns&&t.columns.forEach((e,t)=>{var i=e.field?e.field.toString():R,a=e=>l(n.getter(i)(e));r[`column`+t]=e.template||a}),r)e=r[i],e&&typeof e!=`function`&&(r[i]=n.template(e));this.templates=r},_normalizeIndices:function(e){for(var n=[],r=0;r<e.length;r++)e[r]!==t&&n.push(e[r]);return n},_valueIndices:function(e,t){var n=this._view,r=0,i;if(t=t?t.slice():[],!e.length)return[];for(;r<n.length;r++)i=this._dataItemPosition(n[r].item,e),i!==-1&&(t[i]=r);return this._normalizeIndices(t)},_firstVisibleItem:function(){let t=this.content[0].scrollTop,n=this.content.children(`ul`);if(n.length===0)return null;if(t===0&&this._view&&this._view.length>0)return this._view[0];let r=[],i=0;if(n.each(function(t){let n=e(this),a=n.children(),o=parseFloat(n.css(`gap`))||0;t>0&&(i+=parseFloat(n.css(`margin-top`))||0),a.each(function(t){let n=e(this),s=n.outerHeight(!0);(n.hasClass(`k-list-item`)||n.hasClass(`k-table-row`))&&r.push({element:this,top:i,height:s}),i+=s,t<a.length-1&&(i+=o)})}),r.length===0)return null;for(let n=0;n<r.length;n++){let i=r[n];if(i.top+i.height>t)return this._view[e(i.element).data(`offset-index`)]}return this._view[e(r[r.length-1].element).data(`offset-index`)]},_fixedHeader:function(){this.isGrouped()&&this.templates.fixedGroupTemplate&&this.options.fixedGroupHeader!==!1?(this.header&&(this.header.closest(q).length?this.header.closest(q).show():this.header.show()),this.content.scroll(this._onScroll)):(this.header&&(this.header.closest(q).length?this.header.closest(q).hide():this.header.hide()),this.content.off(`scroll`,this._onScroll))},_renderHeader:function(){let e=this,t=e.templates.fixedGroupTemplate;if(!t||!e.header)return;let n=e._firstVisibleItem();n&&n.group.toString().length&&e.header.html(t(n.group))},_renderItem:function(e){let t=this,n=t.options,r=`<li tabindex="-1" role="${n.aria&&n.aria.itemRole||`option`}" unselectable="on" `,i=e.item,a=e.selected,o=n.columns&&n.columns.length,s=e.index%2==1?` k-table-alt-row`:``,c=n.iconField,u=n.descriptionField,d=n.actionField,f=c&&i&&i[c],p=u&&i&&i[u],m=d&&i&&i[d];return o?r+=`class="k-table-row`+s:r+=`class="k-list-item`,a&&(r+=` k-selected`),r+=`" aria-selected="`+(a?`true`:`false`)+`" data-offset-index="`+e.index+`"`,m&&(r+=` data-action="`+l(i[d])+`"`),r+=`>`,o?r+=this._renderColumns(i):r+=t._renderItemContent(i,f,p),r+`</li>`},_renderItemContent:function(e,t,r){let i=this,a=i.options,o=``;if(t){let t=e[a.iconField];t&&(o+=`<span class="k-list-item-icon-wrapper" role="presentation">`,o+=n.ui.icon({icon:t,iconClass:`k-list-item-icon`,attr:{"aria-hidden":`true`}}),o+=`</span>`)}if(o+=`<span class="k-list-item-text">`,i.templates.template)o+=i.templates.template(e);else{let t=a.dataTextField||`text`,r=n.getter(t)(e);o+=l(r)}if(o+=`</span>`,r){let t=e[a.descriptionField];t&&(o+=`<span class="k-list-item-description">`+l(t)+`</span>`)}return o},_renderColumns:function(e){let t=``;for(let r=0;r<this.options.columns.length;r++){let i=this.options.columns[r].width,o=parseInt(i,10),s=``;i&&!isNaN(o)&&(s+=`${n.attr(`style-width`)}="${o}${a.test(i)?`%`:`px`}"`),t+=`<span class='k-table-td' `+s+`>`,t+=this.templates[`column`+r](e),t+=`</span>`}return t},_generateGroupId:function(e,n){let r=(n===null||n===t?``:String(n)).replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-_]/g,``);return this._optionID+`-group-`+e+`-`+r},_renderGroupedItem:function(t,r){let i=this,a=i.options,o=a.groupIconField,s=a.columns&&a.columns.length,c=i._generateGroupId(r,t.value),u=``;if(o&&t.items&&t.items.length>0){let e=t.items[0][o];e&&(u=`<span class="k-list-item-icon-wrapper" role="presentation">`+n.ui.icon({icon:e,iconClass:`k-list-item-icon`,attr:{"aria-hidden":`true`}})+`</span>`)}let d;return d=i.templates.groupTemplate?i.templates.groupTemplate(t.value):l(t.value),{element:e(` <li class='${s?`k-table-group-row`:`k-list-group-item`}' role='presentation' id='${c}'> ${u} <span class='${s?`k-table-th`:`k-list-item-text`}'> ${d} </span> </li> `),groupId:c}},_render:function(){let t=this,r=this.isGrouped(),i=``,a,o=0,s,c=[],l=this.dataSource.view(),u=this.value(),d,f;t._current=null;let p=[];if(r){t.options.columns&&t.options.columns.length;for(let e=0;e<l.length;e++){d=l[e],f=!0;let n=t._generateGroupId(e,d.value);if(p.push(n),i+=`<ul unselectable='on' data-group-id='`+n+`'>`,e>0||t.options.fixedGroupHeader===!1){let n=t._renderGroupedItem(d,e);i+=n.element.prop(`outerHTML`)}for(let e=0;e<d.items.length;e++)s={selected:t._selected(d.items[e],u),item:d.items[e],group:d.value,newGroup:f,isLastGroupedItem:e===d.items.length-1,index:o},c[o]=s,o+=1,i+=this._renderItem(s),f=!1;i+=`</ul>`}}else{i+=`<ul unselectable='on'>`;for(let e=0;e<l.length;e++)s={selected:this._selected(l[e],u),item:l[e],index:e},c[e]=s,i+=this._renderItem(s);i+=`</ul>`}this._view=c,a=e(i),n.applyStylesFromKendoAttributes(a,[`width`,`background-color`]),this.content.empty().append(a),this.content.find(`ul`).each((t,n)=>{this._applyUlAttributes(e(n),t,r,p[t])}),r&&c.length&&this._renderHeader()},_selected:function(e,t){return(!this.isFiltered()||this.options.selectable===`multiple`)&&this._dataItemPosition(e,t)!==-1},setDSFilter:function(e){this._lastDSFilter=P({},e)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!n.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},refresh:function(e){var t=this,n=e&&e.action,r=t.options.skipUpdateOnBind,i=n===`itemchange`,a;t.trigger(A),t._fixedHeader(),t._render(),t.bound(!0),i||n===`remove`?(a=Ae(t._dataItems,e.items),a.changed.length&&(i?t.trigger(ce,{items:a.changed}):t.value(t._getValues(a.unchanged)))):t.isFiltered()||t._skipUpdate||t._emptySearch?(t.focus(0),(t._skipUpdate||t._emptySearch&&t._selectedIndices.length)&&(t._skipUpdate=!1,t._selectedIndices=t._valueIndices(t._values,t._selectedIndices))):!r&&(!n||n===`add`)&&t.value(t._values),t._valueDeferred&&t._valueDeferred.resolve(),t.trigger(j)},bound:function(e){if(e===t)return this._bound;this._bound=e},isGrouped:function(){return(this.dataSource.group()||[]).length}});r.plugin(ke);function Z(e){return e[e.length-1]}function Q(e){var t=e.selectedIndex;return t>-1?e.options[t]:{}}function Ae(e,t){var n=t.length,r=e.length,i,a,o,s,c=[],l=[];if(r)for(o=0;o<r;o++){for(i=e[o],a=!1,s=0;s<n;s++)if(i===t[s]){a=!0,c.push({index:o,item:i});break}a||l.push(i)}return{changed:c,unchanged:l}}function je(t){return!(!t||e.isEmptyObject(t)||t.filters&&!t.filters.length)}function $(t,n){var r,i=!1;return t.filters&&=(r=e.grep(t.filters,function(e){return i=$(e,n),e.filters?e.filters.length:e.field!=n}),!i&&t.filters.length!==r.length&&(i=!0),r),i}n.cssProperties.registerPrefix(`List`,`k-list-`)})(window.kendo.jQuery);var _=kendo;e.__meta__=g,e.default=_}); //# sourceMappingURL=kendo.list.min.js.map