@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 6.76 kB
JavaScript
module.exports=function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){n(1029),t.exports=n(1029)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},1029:function(t,e,n){var o,i,a;!function(r,define){i=[n(1030),n(1031)],o=r,a="function"==typeof o?o.apply(e,i):o,!(void 0!==a&&(t.exports=a))}(function(){return function(t,e){var n,o=window.kendo,i=t.extend,a=t.proxy,r=o.ui.ToolBar,s=o.toolbar.Item,d="click",c="toggle",l="close",m="action",p="change",u=".fileManagerToolbar",g=r.extend({init:function(t,e){var n=this;n._extendOptions(e),r.fn.init.call(n,t,e),n._attachEvents()},events:r.fn.events.concat([m]),defaultTools:{createFolder:{type:"button",text:"New Folder",name:"createFolder",command:"CreateFolderCommand",rules:'{ "remote": true }'},upload:{type:"button",text:"Upload",name:"upload",command:"OpenDialogCommand",options:'{ "type": "uploadDialog" }',rules:'{ "remote": true }'},sortDirection:{type:"buttonGroup",text:"Sort Direction",name:"sortDirection",buttons:[{name:"sortDirectionAsc",icon:"sort-asc-sm",togglable:!0,group:"sortDirection",command:"SortCommand",options:'{ "dir": "asc" }',selected:!0},{name:"sortDirectionDesc",icon:"sort-desc-sm",togglable:!0,group:"sortDirection",command:"SortCommand",options:'{ "dir": "desc" }'}]},sortField:{type:"splitButton",text:"Sort By",name:"sortField",command:"SortCommand",menuButtons:[{name:"nameField",text:"Name",options:'{"field": "name"}',command:"SortCommand"},{name:"typeField",text:"Type",options:'{"field": "extension"}',command:"SortCommand"},{name:"sizeField",text:"Size",options:'{"field": "size"}',command:"SortCommand"},{name:"dateCreatedField",text:"Date created",options:'{"field": "createdUtc"}',command:"SortCommand"},{name:"dateModifiedField",text:"Date modified",options:'{"field": "modifiedUtc"}',command:"SortCommand"}]},changeView:{type:"buttonGroup",text:"Change View",name:"changeView",buttons:[{name:"gridView",icon:"grid-layout",togglable:!0,group:"changeView",command:"ChangeViewCommand",options:"grid"},{name:"listView",icon:"grid",togglable:!0,group:"changeView",command:"ChangeViewCommand",options:"list"}]},spacer:{type:"spacer"},details:{type:"fileManagerDetailsToggle",text:"View Details",name:"details",overflow:"never",command:"TogglePaneCommand",options:'{ "type": "preview" }'},search:{type:"fileManagerSearch",text:"Search",name:"search",command:"SearchCommand",icon:"search",overflow:"never",options:'{ "field": "name", "operator": "startswith" }'}},_attachEvents:function(){var t=this;t.bind(c,a(t._click,t)),t.bind(l,a(t._click,t)),t.bind(d,a(t._click,t)),t.bind(p,a(t._change,t))},_extendOptions:function(t){var e=this,n=t.items?t.items:Object.keys(e.defaultTools);e.options=t,e.options.items=e._extendToolsOptions(n)},_extendToolsOptions:function(e){var n=this,r=n.options.messages;if(e.length)return e.map(function(e){var s,d,c=t.isPlainObject(e)&&1===Object.keys(e).length&&e.name;return e=c?e.name:e,s=t.isPlainObject(e)?e:i({},n.defaultTools[e]),d=s.rules?JSON.parse(s.rules):{},o.deepExtend(s,{id:s.name+"-"+o.guid(),name:s.name,text:r[s.name],attributes:{"aria-label":r[s.name],title:r[s.name],"data-command":s.command,"data-options":s.options},overflow:s.overflow}),"buttonGroup"===s.type&&(s.buttons=s.buttons.map(a(n._mapButtonGroups,n))),"splitButton"===s.type&&(s.menuButtons=s.menuButtons.map(a(n._mapMenuButtons,n))),d.remote&&n.options.filemanager.dataSource.isLocalBinding&&(s.hidden=!0),s},n)},_mapButtonGroups:function(t){var e=this,n=e.options.messages;return"changeView"===t.group&&t.options===e.options.filemanager.options.initialView&&(t.selected=!0),o.deepExtend(t,{attributes:i({},t.attributes,{"aria-label":n[t.name],title:n[t.name],"data-command":t.command,"data-options":t.options})})},_mapMenuButtons:function(t){var e=this,n=e.options.messages;return o.deepExtend(t,{text:n[t.name],attributes:i({},t.attributes,{"aria-label":n[t.name],title:n[t.name],"data-command":t.command,"data-options":t.options})})},_click:function(e){var n=t(e.target).data("command"),o=t(e.target).data("options");n&&this.action({command:n,options:o})},_change:function(e){var n=t(e.target).data("command"),o=t(e.target).data("options");o=i({},o,{value:t(e.target).val()}),n&&this.action({command:n,options:o})},isToolEnabled:function(t){var e,n=this,o=n.options,i=!1;for(e=0;e<o.items.length;e++)if(o.items[e].name==t){i=!0;break}return o.items[t]||i},action:function(t){this.trigger(m,t)},destroy:function(){this.fileManagerSearch&&this.fileManagerSearch.destroy(),r.fn.destroy.call(this)}}),f=s.extend({init:function(e,n){var o=this,i=t("<div class='k-filemanager-search-tool k-textbox'></div>"),a=t("<input class='k-input' autocomplete='off' />"),r=t("<span class='k-input-icon'></span>"),s=t("<span />");o.element=i,o.input=a,o.iconWrapper=r,o.icon=s,o.options=e,o.options.type="fileManagerSearch",o.toolbar=n,o.attributes(),o.renderIcon(),o.addUidAttr(),o.addIdAttr(),o.addOverflowAttr(),o.input.attr({placeholder:o.options.text,title:o.options.text}),o.iconWrapper.append(s),o.element.append(o.input).append(r),o._bindEvents(),o.toolbar.fileManagerSearch=o},attributes:function(){this.options.attributes&&this.input.attr(this.options.attributes)},renderIcon:function(){this.options.icon&&this.icon.addClass("k-icon k-i-"+this.options.icon)},_bindEvents:function(){this._inputHandler=a(this._input,this),this.input.on("input"+u,this._inputHandler)},_input:function(t){this.toolbar.trigger(p,{target:t.target})},destroy:function(){this.element.off(u)}});o.toolbar.registerComponent("fileManagerSearch",f),n=s.extend({init:function(e,n){var i=this,r=t("<div class='k-filemanager-details-toggle'></div>"),s=t("<label>"+e.text+"</label>"),c=t("<input title='"+e.text+"' />");i.element=r,i.input=c,i.label=s,i.options=e,i.toolbar=n,i.attributes(),i.addUidAttr(),i.addIdAttr(),i.addOverflowAttr(),i.element.append(i.label),i.element.append(i.input),i.switchInstance=new o.ui.Switch(i.input,{change:a(i._change,i),messages:{checked:n.options.messages.detailsChecked,unchecked:n.options.messages.detailsUnchecked}}),i.label.on(d+u,a(i._click,i)),i.toolbar.fileManagerDetailsToggle=i},_change:function(t){this.toolbar.trigger(p,{target:t.sender.wrapper.parent()})},_click:function(e){this.switchInstance.toggle(),this.toolbar.trigger(p,{target:t(e.target).parent()})},destroy:function(){this.element.off(u)}}),o.toolbar.registerComponent("fileManagerDetailsToggle",n),i(o.ui.filemanager,{ToolBar:g})}(window.kendo.jQuery),window.kendo},n(3))},1030:function(t,e){t.exports=require("../kendo.toolbar")},1031:function(t,e){t.exports=require("../kendo.switch")}});