kendo-ui-core
Version:
Kendo UI is everything you need to build sites and apps with HTML5 & JavaScript. Kendo UI Core is the free and open-source version of Kendo UI that provides access to the web's best UI widgets and key framework features, essential for developing great exp
9 lines • 47.1 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`./dist-AH6B3-_t.js`),require(`./core-R4j5Vh3b.js`),require(`./kendo.popup.js`),require(`./kendo.icons.js`),require(`./kendo.actionsheet.js`),require(`./filter-expression-no-eval--xfq8dEO.js`),require(`./kendo.data.js`),require(`./kendo.label.js`);const e=require(`./dropdowns-loader-il0OSuIC.js`),t={id:`list`,name:`List`,category:`framework`,depends:[`data`,`popup`,`label`,`icons`,`actionsheet`],hidden:!0};(function(t,n){var r=window.kendo,i=r.ui,a=r._outerHeight,o=/^\d+(\.\d+)?%$/i,s=i.Widget,c=r.keys,l=r.support,u=r.htmlEncode,d=r._activeElement,f=r._outerWidth,p=r.data.ObservableArray,m=`id`,h=`change`,g=`k-focus`,_=`k-hover`,v=`k-selected`,ee=`k-list`,te=`k-table`,ne=`k-data-table`,y=`k-list-ul`,b=`k-table-list`,re=`.k-list-group-sticky-header`,ie=`.k-table-group-sticky-header`,ae=`.k-list-item-group-label`,x=`.k-list-item`,S=`.k-table-row`,oe=`open`,C=`close`,w=`cascade`,T=`select`,E=`click`,se=`mouseleave`,ce=`mouseenter`,D=`activate`,O=`deactivate`,k=`dataBinding`,A=`dataBound`,j=`selectedItemChange`,M=`selected`,le=`requestStart`,ue=`requestEnd`,de=`blur`,N=`focus`,fe=`focusout`,P=t.extend,pe=Array.isArray,me=l.browser,he=`k-hidden`,F=`width`,I=`text`,ge=`value`,_e=me.msie,ve=/"/g,L={ComboBox:[`DropDownList`,`MultiColumnComboBox`],DropDownList:[`ComboBox`,`MultiColumnComboBox`],MultiColumnComboBox:[`ComboBox`,`DropDownList`]},ye=`<div class='k-list'/>`,be=`<div class="k-no-data"></div>`,xe=`<div class="k-list-footer"></div>`,Se=`<div class="k-table-footer"><span class="k-table-td"></span></div>`,Ce=`mousedown`,we=`action`,R=`-list`,Te=`_listbox`,z=`aria-labelledby`,B=`aria-label`,V=`aria-activedescendant`,Ee=`aria-autocomplete`,H=`aria-controls`,U=`aria-live`,W=`aria-expanded`,G=`aria-hidden`,De=`aria-multiselectable`,K=`aria-selected`,q=`.k-table-group-row`,Oe=`.k-actionsheet-titlebar`,J=r.ui.DataBoundWidget.extend({init:function(e,n){var i=this,a;s.fn.init.call(i,e,n),e=i.element,n=i.options,i._isSelect=e.is(T),i._isSelect&&i.element[0].length&&(n.dataSource||(n.dataTextField=n.dataTextField||I,n.dataValueField=n.dataValueField||ge)),n.adaptiveMode===`auto`&&(i.largeMQL=r.mediaQuery(`large`),i.mediumMQL=r.mediaQuery(`medium`),i.smallMQL=r.mediaQuery(`small`)),i._bindLoader(),i._listSize=r.cssProperties.getValidClass({widget:`List`,propName:`size`,value:n.size}),i._filterHeader(),i.list=t(ye).addClass(i._listSize),a=e.attr(m),a||=r.guid(),i.list.attr(m,a+R),n.columns&&n.columns.length&&(i.list.removeClass(ee).addClass(ne),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:n,messages:{noData:`No data found.`,clear:`clear`,filterInputPlaceholder:`Filter`},adaptiveMode:`none`},_getUlElement:function(){return this.list.find(`.${y}, .${b}`).first()},_isTableVariant:function(){return this.options.columns&&this.options.columns.length},_getFixedGroupHeaderSelector:function(){return this._isTableVariant()?ie:re},setOptions:function(e){s.fn.setOptions.call(this,e),e&&e.enable!==n&&(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 t=this;t._initLoader=e.t.bind(t),t._initLoader()},focus:function(){this._focused.trigger(N)},readonly:function(e){this._editable({readonly:e===n?!0:e,disable:!1}),this.label&&this.label.floatingLabel&&this.label.floatingLabel.readonly(e===n?!0:e)},enable:function(e){this._editable({readonly:!1,disable:!(e=e===n?!0:e)}),this.label&&this.label.floatingLabel&&this.label.floatingLabel.enable(e=e===n?!0:e)},_label:function(){var e=this,n=e.options,i=t.isPlainObject(n.label)?n.label:{content:n.label};e.label=new r.ui.Label(null,t.extend({},i,{widget:e,floatCheck:e._floatCheck.bind(e)})),e._inputLabel=e.label.element,e._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 e=this,n=t(e.header),i=e.options.headerTemplate;if(r.destroy(n),n.remove(),!i){e.header=null;return}n=t((typeof i==`function`?i:r.template(i))({})),e.header=n[0]?n:null,e.list.parent.length>0&&e.list.before(n)},_filterHeader:function(){this.filterTemplate=`<div class="k-list-filter"><span class="k-searchbox k-input" type="text" autocomplete="off">`+r.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=t(`<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 e=this,n,i=t(e.columnsHeader);r.destroy(i),i.remove();for(var a=`<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:r.template(f),m=u.width,h=parseInt(m,10),g=``;m&&!isNaN(h)&&(g+=`${r.attr(`style-width`)}="${h}${o.test(m)?`%`:`px`}"`),s+=`<col `+g+`/>`,c+=`<th class='k-table-th'>`,c+=p(u),c+=`</th>`}s+=`</colgroup>`,c+=`</tr>`,a+=s,a+=`<thead class='k-table-thead'>`,a+=c,a+=`</thead></table></div></div>`,n=t(a),r.applyStylesFromKendoAttributes(n,[`width`]),e.columnsHeader=i=n,e.list.prepend(i)},_noData:function(){var e=this,n=t(e.noData),i=e.options.noDataTemplate===!0?()=>u(e.options.messages.noData):e.options.noDataTemplate;if(r.destroy(n),n.remove(),!i){e.noData=null;return}e.noData=t(be).attr(U,`polite`).hide().appendTo(e.list),e.noDataTemplate=typeof i==`function`?i:r.template(i)},_footer:function(){var e=this,n=t(e.footer),i=e.options.footerTemplate,a=this.options.columns&&this.options.columns.length?Se:xe;if(r.destroy(n),n.remove(),!i){e.footer=null;return}e.footer=t(a).appendTo(e.list),e.footerTemplate=typeof i==`function`?i:r.template(i)},_listOptions:function(e){var n=this,i=n.options,a=i.virtual,o={change:n._listChange.bind(n)},s=n._listBound.bind(n),c=n._focused,l=n.element.attr(`id`),d=t(`label[for="`+n.element.attr(`id`)+`"]`),f=c.attr(z);return!f&&d.length&&(f=d.attr(`id`)||n._generateLabelId(d,l||r.guid())),a=typeof a==`object`?a:{},e=t.extend({autoBind:!1,selectable:!0,dataSource:n.dataSource,click:n._click.bind(n),activate:n._activateItem.bind(n),columns:i.columns,deactivate:n._deactivateItem.bind(n),dataBinding:function(){n.trigger(k)},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(B),ariaLabelledBy:f,ariaLive:n._isFilterEnabled()?`polite`:`off`,listSize:n._listSize},e,a,o),e.template||=t=>u(r.getter(e.dataTextField)(t)),e},_initList:function(e){let t=this,n=e&&e.skipValueUpdate,i=t.list.attr(m),a=i?i.replace(R,``):r.guid(),o=t._listOptions({selectedItemChange:t._listChange&&t._listChange.bind(t),id:a+Te});t.options.virtual?(t.listView=new r.ui.VirtualList(t.list,Object.assign(o,{height:t._hasActionSheet()?362:t.options.height})),t.list.addClass(`k-virtual-list`)):t.listView=new r.ui.StaticList(t.list,o),t.listView.bind(`listBound`,t._listBound.bind(t)),n||t._setListValue()},_setListValue:function(e){e||=this.options.value,e!==n&&this.listView.value(e).done(this._updateSelectionState.bind(this))},_updateSelectionState:t.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(he)},_showClear:function(){this._clear&&this._clear.removeClass(he)},_clearValue:function(){this._clearText(),this._accessor(``),this.listView.value([]),this._isSelect&&(this._customOption=n),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(e,n){var r=this,i=r.options,a=i.filterFields&&e&&e.logic&&e.filters&&e.filters.length,o=r.dataSource,s=P({},o.filter()||{}),c=e||s.filters&&s.filters.length&&!e,l=$(s,i.dataTextField);if(this._clearFilterExpressions(s),(e||l)&&r.trigger(`filtering`,{filter:e}))return t.Deferred().reject().promise();var u={filters:[],logic:`and`};a?u.filters.push(e):this._pushFilterExpression(u,e),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(e){t(this.noData).toggle(e)},_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 e=this,n=e.options.messages.clear;e._clear||=t(`<span unselectable="on" class="k-clear-value" title="${n}">${r.ui.icon(`x`)}</span>`).attr({role:`button`,tabIndex:-1}),e.options.clearButton||e._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=!r.trim(e).length),this._isFilterEnabled()?this._filter({word:e,open:!0}):this._searchByWord(e))},current:function(e){return this._focus(e)},items:function(){let e=this._getUlElement();return e.length?e.children():t()},destroy:function(){var e=this,t=e.ns;s.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(e){var r=this;if(e===n)return r.listView.selectedDataItems()[0];if(typeof e!=`number`){if(r.options.virtual)return r.dataSource.getByUid(t(e).data(`uid`));e=t(r.items()).index(e)}return r.dataSource.flatView()[e]},_activateItem:function(){var e=this.listView.focus();e&&this.popup.visible()&&this._focused.add(this.filterInput).attr(V,e.attr(`id`))},_deactivateItem:function(){this._focused.add(this.filterInput).removeAttr(V)},_accessors:function(){var e=this,t=e.element,n=e.options,i=r.getter,a=t.attr(r.attr(`text-field`)),o=t.attr(r.attr(`value-field`));!n.dataTextField&&a&&(n.dataTextField=a),!n.dataValueField&&o&&(n.dataValueField=o),e._text=i(n.dataTextField),e._value=i(n.dataValueField)},_aria:function(e){var t=this,r=t.options,i=t._focused,a;r.suggest!==n&&(a=r.filter===`none`?r.suggest===!0?`inline`:`none`:r.suggest===!0?`both`:`list`,i.attr(Ee,a));let o=t.list.find(`.${y}, .${b}`).first(),s=t.list.find(`.${y}, .${b}`),c=t._isFilterEnabled()?`polite`:`off`;if(o.length)e=e?e+` `+o[0].id:o[0].id,i.attr({"aria-controls":e}),t.filterInput&&t.filterInput.length>0&&t.filterInput.attr(H,e),s.attr(U,c);else if(r.virtual&&t.listView&&t.listView.options&&typeof t.listView.options.id==`string`){var l=t.listView.options.id;e=e?e+` `+l:l,i.attr({"aria-controls":e}),t.filterInput&&t.filterInput.length>0&&t.filterInput.attr(H,e)}t._ariaLabel(t._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,t=e.selectedIndex,r=e.options.value,i=e.value(),a;e._isSelect&&!e.listView.bound()&&r&&(i=r),(e._isValueChanged(i)||e._valueBeforeCascade!==n&&e._isValueChanged(e._valueBeforeCascade)&&e._userTriggered||t!==n&&t!==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=t,e._typing||e.element.trigger(h),e.trigger(h)),e.typing=!1},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,t=e.options,i=e.element.is(`[disabled]`);t.enable!==n&&(t.enabled=t.enable),!t.enabled||i?e.enable(!1):e.readonly(r.isPresent(t.readonly)?t.readonly:e.element.is(`[readonly]`))},_dataValue:function(e){var t=this._value(e);return t===n&&(t=this._text(e)),t},_offsetHeight:function(){var e=0;return this.listView.content.parent().prevAll(`:visible`).each(function(){var n=t(this);e+=a(n,!0)}),e},_height:function(e){var n=this,r=n.list,i=n.options.height,o=n.popup.visible(),s=this.options.columns&&this.options.columns.length,c,l;if(e||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}i=n.listView.content[0].scrollHeight>i?i:`auto`,l.height(i),i!==`auto`&&(c=n._offsetHeight(),i-=c,s&&(i=i-(a(t(n.footer))||0)-(a(t(n.columnsHeader))||0))),s?n.listView.content.outerHeight(i):n.listView.content.parent().outerHeight(i),o||r.parent().hide()}return i},_openHandler:function(e){var t;this._adjustListWidth(),this.trigger(oe)?e.preventDefault():(this._focused.attr(W,!0),this.list.find(`.${y}, .${b}`).attr(G,!1),t=this.listView.focus(),t&&this._focused.add(this.filterInput).attr(V,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(F)&&n||e._hasActionSheet()))return i=window.getComputedStyle?window.getComputedStyle(r[0],null):0,a=parseFloat(i&&i.width)||f(r),i&&me.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(F,n),!0},_closeHandler:function(e){e.closeButton&&this._onCloseButtonPressed(),this.trigger(C)?e.preventDefault():(this._focused.attr(W,!1),this.list.find(`.${y}, .${b}`).attr(G,!0),this._focused.add(this.filterInput).removeAttr(V))},_focusItem:function(){var e=this.listView,t=!e.focus(),r=Z(e.select());r===n&&this.options.highlightFirst&&t&&(r=0),r===n?t&&e.scrollToIndex(0):e.focus(r)},_calculateGroupPadding:function(e){var n=this.listView.content.prev(this._getFixedGroupHeaderSelector()),i=0,a=`right`,o;if(n[0]&&n[0].style.display!==`none`){var s=this.list.find(`.${y}, .${b}`);if(s.length>1?s.each(function(){var e=t(this).children(x).first();if(e.length)return o=e,!1}):o=this._getUlElement().children(x).first(),!o||!o.length)return;e!==`auto`&&(i=r.support.scrollbar()),this.element.parents(`.k-rtl`).length&&(a=`left`),i+=parseFloat(o.css(`border-`+a+`-width`),10)+parseFloat(o.children(ae).css(`padding-`+a),10),n.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,n=l.isRtl(t.wrapper),i=r.support.scrollbar();t.columnsHeader.css(n?`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(D,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 e=this;e._isFilterEnabled()&&(e._filterHeader(),e.options.adaptiveMode===`auto`&&(e.mediumMQL.mediaQueryList.matches||e.smallMQL.mediaQueryList.matches)?(e.popup.element.find(Oe).append(t(e.actionSheetFilterTemplate)).find(`.k-searchbox`).append(e.filterInput),e._enable()):e.options.popupFilter&&e.list.parent().prepend(t(e.filterTemplate)).find(`.k-searchbox`).append(e.filterInput),e._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 i.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:l.isRtl(e.wrapper),autosize:e.options.autoWidth,autowidth:e.options.autoWidth,activate:()=>{this._refreshFloatingLabel()},deactivate:()=>{this._refreshFloatingLabel()}})),e._postCreatePopup()},_onActionSheetCreate:t.noop,_onCloseButtonPressed:t.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 i.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">`+r.html.renderButton(`<button tabindex="-1" ${r.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(Ce+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(e){t(e.currentTarget).toggleClass(_,e.type===ce)},_toggle:function(e,t){var r=this,i=l.mobileOS&&(l.touch||l.MSPointers||l.pointers);e=e===n?!r.popup.visible():e,!t&&!i&&r._focused[0]!==d()&&(r._prevent=!0,r._focused.trigger(N),r._prevent=!1),r[e?oe:C]()},_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(le,e._requestStartHandler).unbind(ue,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,t){return e!==n&&e!==``&&e!==null&&(t===`boolean`?(typeof e!=`boolean`&&(e=e.toString().toLowerCase()===`true`),e=!!e):t===`number`?e=Number(e):t===`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}),r.ui.List=J,i.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 t=this;return e===n?t.selectedIndex:t._select(e).done(function(){t._cascadeValue=t._old=t._accessor(),t._oldIndex=t.selectedIndex,t._refreshFloatingLabel()})},_accessor:function(e,t){return this[this._isSelect?`_accessorSelect`:`_accessorInput`](e,t)},_accessorInput:function(e){var t=this.element[0];if(e===n)return t.value;e===null&&(e=``),t.value=e},_accessorSelect:function(e,t){var r=this.element[0],i;if(e===n)return Q(r).value||``;Q(r).selected=!1,t===n&&(t=-1),i=e!==null&&e!==``,i&&t==-1?this._custom(e):e?r.value=e:r.selectedIndex=t},_syncValueAndText:function(){return!0},_custom:function(e){var n=this,r=n.element,i=n._customOption;i||(i=t(`<option/>`),n._customOption=i,r.append(i)),i.text(e),i[0].selected=!0},_dataSource:function(){var e=this,t=e.element,n=e.options,i=n.dataSource||{},a;i=Array.isArray(i)?{data:i}:i,e._isSelect&&(a=t[0].selectedIndex,a>-1&&(n.index=a),i.select=t,i.fields=[{field:n.dataTextField},{field:n.dataValueField}]),e.dataSource?e._unbindDataSource():(e._requestStartHandler=e._showBusy,e._requestEndHandler=e._hideBusy,e._errorHandler=function(){e._hideBusy()}),e.dataSource=r.data.DataSource.create(i).bind(le,e._requestStartHandler).bind(ue,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===c.DOWN,a=t.options.virtual,o,s,l,u,f;if(r===c.UP||i){if(e.altKey)t.toggle(i);else{let r=t.list.find(`.${y}, .${b}`);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?(u=t._nextItem(),(a&&u<=0||!t._focus()&&!u)&&t._lastItem()):(u=t._prevItem(),(a&&u>=n.dataSource.total()-1||!t._focus()&&!u)&&t._firstItem())),f=t._getNormalizedSelectCandidate(t._get(t._focus())||u||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(),s=!0}else if(r===c.ENTER||r===c.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]===d(),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===c.TAB?t.wrapper.focusout():m&&typeof m.done==`function`?m.done(function(){t._blur()}):t._blur(),t.close(),s=!0}else if(r===c.ESC)t.popup.visible()&&(e.preventDefault(),e.stopPropagation()),t.close(),s=!0;else if(t.popup.visible()&&(r===c.PAGEDOWN||r===c.PAGEUP)){e.preventDefault();var _=r===c.PAGEDOWN?1:-1;n.scrollWith(_*n.screenHeight()),s=!0}return s},_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,t,r){var i=this,a=i.element,o=a[0],s=e.length,c=``,l,d,f,p,m=0;for(t&&(c=t);m<s;m++)l=`<option`,d=e[m],f=i._text(d),p=i._value(d),p!==n&&(p+=``,p.indexOf(`"`)!==-1&&(p=p.replace(ve,`"`)),l+=` value="`+p+`"`),l+=`>`,f!==n&&(l+=u(f)),l+=`</option>`,c+=l;a.html(c),r!==n&&(o.value=r,o.value&&!r&&(o.selectedIndex=-1)),o.selectedIndex!==-1&&(l=Q(o),l&&l.setAttribute(M,M))},_reset:function(){var e=this,n=e.element,r=n.attr(`form`),i=r?t(`#`+r):n.closest(`form`);i[0]&&(e._resetHandler=function(){setTimeout(function(){e.options._removeDataItems&&(e.listView._dataItems=[]),e.value(e._initial),e.options._shouldRefresh&&(e.text(e._initial),e.refresh())})},e._form=i.on(`reset`,e._resetHandler))},_parentWidget:function(){var e=this.options.name;if(this.options.cascadeFrom){var n=t(`#`+this.options.cascadeFrom),r=n.data(`kendo`+e);if(!r)for(var i=0;i<L[e].length&&(r=n.data(`kendo`+L[e][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(A,function(){e._toggleCascadeOnFocus(),r.popup.visible()&&r._focused.trigger(N)}),r.value()||e.enable(!1))}},_toggleCascadeOnFocus:function(){var e=this,t=e._parentWidget(),n=_e&&t instanceof i.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,t){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=t===n?r.value():t,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=r.ui.DataBoundWidget.extend({init:function(e,n){if(s.fn.init.call(this,e,n),this.element.on(E+X,x+`, `+S,this._click.bind(this)).on(ce+X,x+`, `+S,function(){t(this).addClass(_)}).on(se+X,x+`, `+S,function(){t(this).removeClass(_)}),l.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 e=t(`<div class="k-table-group-sticky-header"><span class="k-table-th"></span></div>`);this.content.before(e),this.header=e.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(t(`<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=r.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,D,O,k,A,j,we],_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(z,r)):(e.attr(`role`,a.aria&&a.aria.role||`listbox`),a&&a.ariaLabel?e.attr(B,a.ariaLabel):a&&a.ariaLabelledBy&&e.attr(z,a.ariaLabelledBy),this.options.selectable===`multiple`&&e.attr(De,!0)),a.ariaLive&&e.attr(U,a.ariaLive),e.addClass(i._isTableVariant()?`${b} ${te}`:y)},_isTableVariant:function(){return this.options.columns&&this.options.columns.length},_createInitialUl:function(){let e=this,n=e.options,r=t(`<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(B,n.ariaLabel):n&&n.ariaLabelledBy&&r.attr(z,n.ariaLabelledBy),n.ariaLive&&r.attr(U,n.ariaLive),n.selectable===`multiple`&&r.attr(De,!0),r.addClass(e._isTableVariant()?`${b} ${te}`:y),this.content.append(r)},setDataSource:function(e){var t=this,n=e||{},i;n=Array.isArray(n)?{data:n}:n,n=r.data.DataSource.create(n),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(n.filter()),t.dataSource=n.bind(h,t._refreshHandler),t._fixedHeader()},_touchHandlers:function(){var e=this,n=this.options.columns&&this.options.columns.length?S:x,r,i,a=function(e){return(e.originalEvent||e).changedTouches[0].pageY};e.element.on(`touchstart`+X,function(e){r=a(e)}),e.element.on(`touchend`+X,function(o){o.isDefaultPrevented()||(i=a(o),Math.abs(i-r)<10&&(e._touchTriggered=!0,e._triggerClick(t(o.target).closest(n).get(0))))})},skip:function(){return this.dataSource.skip()},setOptions:function(e){s.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),s.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===n)return this._dataItems.slice();this._dataItems=e,this._values=this._getValues(e)},_getValues:function(e){var n=this._valueGetter;return t.map(e,function(e){return n(e)})},focusNext:function(){var e=this,n=e.focus(),r=e.items(),i;if(n)i=r.index(n[0]);else{var a=e.select();i=a.length?a[0]:-1}i+=1,i>=r.length?e.focus(t()):e.focus(r[i])},focusPrev:function(){var e=this,n=e.focus(),r=e.items(),i;if(n)i=r.index(n[0]);else{var a=e.select();i=a.length?a[0]:r.length}--i,i<0?e.focus(t()):e.focus(r[i])},focusFirst:function(){this.focus(this.items()[0])},focusLast:function(){this.focus(Z(this.items()))},focus:function(e){var r=this,i=r._optionID,a;if(e===n)return r._current;e=Z(r._get(e)),e=t(this.items()[e]),r._current&&(r._current.removeClass(g).removeAttr(m),r.trigger(O)),a=!!e[0],a&&(e.addClass(g),r.scroll(e),e.attr(`id`,i)),r._current=a?e:null,r.trigger(D)},focusIndex:function(){var e=this.focus();return e?this.items().index(e):n},skipUpdate:function(e){this._skipUpdate=e},select:function(e){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(e===n)return o.slice();e=r._get(e),e.length===1&&e[0]===-1&&(e=[]);var f=t.Deferred().resolve(),p=r.isFiltered();return p&&!a&&r._deselectFiltered(e)?f:a&&!p&&t.inArray(Z(e),o)!==-1&&t.inArray(Z(e),c)!==-1?(r._dataItems.length&&r._view.length&&(r._dataItems=[r._view[o[0]].item]),f):(d=r._deselect(e),u=d.removed,e=d.indices,e.length&&(a&&(e=[Z(e)]),l=r._select(e)),(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(e){var r=this,i=r._valueDeferred,a;return e===n?r._values.slice():(r.setValue(e),(!i||i.state()===`resolved`)&&(r._valueDeferred=i=t.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 e=[];return this.content.children(`ul`).each(function(){t(this).children(x+`, `+S).each(function(){e.push(this)})}),t(e)},_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(e){let n=this,r=t(e),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(e)},_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=r.getter(this.options.dataValueField)},_deselect:function(e){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(e=e.slice(),i===!0||!e.length){for(;l<a.length;l++)t(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<e.length;){if(d=e[l],!t(r[d]).hasClass(v)){l++;continue}for(;u<a.length;){if(f=a[u],f===d){t(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),e.splice(l,1),s.splice(u,1),p+=1,--l,--u;break}u++}l++}return{indices:e,removed:c}},_deselectFiltered:function(e){let n=this.items();for(var r,i,a,o=[],s=0;s<e.length;s++)i=e[s],r=this._view[i].item,a=this._dataItemPosition(r,this._values),a>-1&&(o.push(this.removeAt(a)),t(n[i]).removeClass(v));return o.length?(this.trigger(h,{added:[],removed:o}),!0):!1},_select:function(e){let n=this,r=n.items().toArray(),i=n._view,a,o,s=[],c=0;for(Z(e)!==-1&&n.focus(e);c<e.length;c++)o=e[c],a=i[o],!(o===-1||!a)&&(a=a.item,n._selectedIndices.push(o),n._dataItems.push(a),n._values.push(n._valueGetter(a)),t(r[o]).addClass(v).attr(K,!0),s.push({dataItem:a}));return s},getElementIndex:function(e){return t(e).data(`offset-index`)},_get:function(e){return typeof e==`number`?e=[e]:pe(e)||(e=this.getElementIndex(e),e=[e===n?-1:e]),e},_templates:function(){var e,t=this.options,n={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():I,a=e=>u(r.getter(i)(e));n[`column`+t]=e.template||a}),n)e=n[i],e&&typeof e!=`function`&&(n[i]=r.template(e));this.templates=n},_normalizeIndices:function(e){for(var t=[],r=0;r<e.length;r++)e[r]!==n&&t.push(e[r]);return t},_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 e=this.content[0].scrollTop,n=this.content.children(`ul`);if(n.length===0)return null;if(e===0&&this._view&&this._view.length>0)return this._view[0];let r=[],i=0;if(n.each(function(e){let n=t(this),a=n.children(),o=parseFloat(n.css(`gap`))||0;e>0&&(i+=parseFloat(n.css(`margin-top`))||0),a.each(function(e){let n=t(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,e<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>e)return this._view[t(i.element).data(`offset-index`)]}return this._view[t(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,l=n.descriptionField,d=n.actionField,f=c&&i&&i[c],p=l&&i&&i[l],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="`+u(i[d])+`"`),r+=`>`,o?r+=this._renderColumns(i):r+=t._renderItemContent(i,f,p),r+`</li>`},_renderItemContent:function(e,t,n){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+=r.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`,n=r.getter(t)(e);o+=u(n)}if(o+=`</span>`,n){let t=e[a.descriptionField];t&&(o+=`<span class="k-list-item-description">`+u(t)+`</span>`)}return o},_renderColumns:function(e){let t=``;for(let n=0;n<this.options.columns.length;n++){let i=this.options.columns[n].width,a=parseInt(i,10),s=``;i&&!isNaN(a)&&(s+=`${r.attr(`style-width`)}="${a}${o.test(i)?`%`:`px`}"`),t+=`<span class='k-table-td' `+s+`>`,t+=this.templates[`column`+n](e),t+=`</span>`}return t},_generateGroupId:function(e,t){let r=(t===null||t===n?``:String(t)).replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-_]/g,``);return this._optionID+`-group-`+e+`-`+r},_renderGroupedItem:function(e,n){let i=this,a=i.options,o=a.groupIconField,s=a.columns&&a.columns.length,c=i._generateGroupId(n,e.value),l=``;if(o&&e.items&&e.items.length>0){let t=e.items[0][o];t&&(l=`<span class="k-list-item-icon-wrapper" role="presentation">`+r.ui.icon({icon:t,iconClass:`k-list-item-icon`,attr:{"aria-hidden":`true`}})+`</span>`)}let d;return d=i.templates.groupTemplate?i.templates.groupTemplate(e.value):u(e.value),{element:t(`
<li class='${s?`k-table-group-row`:`k-list-group-item`}' role='presentation' id='${c}'>
${l}
<span class='${s?`k-table-th`:`k-list-item-text`}'>
${d}
</span>
</li>
`),groupId:c}},_render:function(){let e=this,n=this.isGrouped(),i=``,a,o=0,s,c=[],l=this.dataSource.view(),u=this.value(),d,f;e._current=null;let p=[];if(n){e.options.columns&&e.options.columns.length;for(let t=0;t<l.length;t++){d=l[t],f=!0;let n=e._generateGroupId(t,d.value);if(p.push(n),i+=`<ul unselectable='on' data-group-id='`+n+`'>`,t>0||e.options.fixedGroupHeader===!1){let n=e._renderGroupedItem(d,t);i+=n.element.prop(`outerHTML`)}for(let t=0;t<d.items.length;t++)s={selected:e._selected(d.items[t],u),item:d.items[t],group:d.value,newGroup:f,isLastGroupedItem:t===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=t(i),r.applyStylesFromKendoAttributes(a,[`width`,`background-color`]),this.content.empty().append(a),this.content.find(`ul`).each((e,r)=>{this._applyUlAttributes(t(r),e,n,p[e])}),n&&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()),!r.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(k),t._fixedHeader(),t._render(),t.bound(!0),i||n===`remove`?(a=Ae(t._dataItems,e.items),a.changed.length&&(i?t.trigger(j,{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(A)},bound:function(e){if(e===n)return this._bound;this._bound=e},isGrouped:function(){return(this.dataSource.group()||[]).length}});i.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(e){return!(!e||t.isEmptyObject(e)||e.filters&&!e.filters.length)}function $(e,n){var r,i=!1;return e.filters&&=(r=t.grep(e.filters,function(e){return i=$(e,n),e.filters?e.filters.length:e.field!=n}),!i&&e.filters.length!==r.length&&(i=!0),r),i}r.cssProperties.registerPrefix(`List`,`k-list-`)})(window.kendo.jQuery);var n=kendo;exports.__meta__=t,exports.default=n;
//# sourceMappingURL=kendo.list.js.map