mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-03 01:01:41 +00:00
27 lines
18 KiB
JavaScript
Executable File
27 lines
18 KiB
JavaScript
Executable File
/**
|
|
* Kendo UI v2021.1.224 (http://www.telerik.com/kendo-ui)
|
|
* Copyright 2021 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
|
|
*
|
|
* Kendo UI commercial licenses may be obtained at
|
|
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
|
|
* If you do not own a commercial license, this file shall be governed by the trial license terms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
!function(t,define){define("util/text-metrics.min",["kendo.core.min"],t)}(function(){!function(t){function e(t){return(t+"").replace(r,d)}function i(t){var e,i=[];for(e in t)i.push(e+t[e]);return i.sort().join("")}function n(t){var e,i=2166136261;for(e=0;e<t.length;++e)i+=(i<<1)+(i<<4)+(i<<7)+(i<<8)+(i<<24),i^=t.charCodeAt(e);return i>>>0}function o(){return{width:0,height:0,baseline:0}}function a(t,e,i){return p.current.measure(t,e,i)}var s,r,d,l,c,p;window.kendo.util=window.kendo.util||{},s=kendo.Class.extend({init:function(t){this._size=t,this._length=0,this._map={}},put:function(t,e){var i=this._map,n={key:t,value:e};i[t]=n,this._head?(this._tail.newer=n,n.older=this._tail,this._tail=n):this._head=this._tail=n,this._length>=this._size?(i[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++},get:function(t){var e=this._map[t];if(e)return e===this._head&&e!==this._tail&&(this._head=e.newer,this._head.older=null),e!==this._tail&&(e.older&&(e.older.newer=e.newer,e.newer.older=e.older),e.older=this._tail,e.newer=null,this._tail.newer=e,this._tail=e),e.value}}),r=/\r?\n|\r|\t/g,d=" ",l={baselineMarkerSize:1},"undefined"!=typeof document&&(c=document.createElement("div"),c.style.cssText="position: absolute !important; top: -4000px !important; width: auto !important; height: auto !important;padding: 0 !important; margin: 0 !important; border: 0 !important;line-height: normal !important; visibility: hidden !important; white-space: pre!important;"),p=kendo.Class.extend({init:function(e){this._cache=new s(1e3),this.options=t.extend({},l,e)},measure:function(t,a,s){var r,d,l,p,u,h,f,m,v;if(void 0===s&&(s={}),!t)return o();if(r=i(a),d=n(t+r),l=this._cache.get(d))return l;p=o(),u=s.box||c,h=this._baselineMarker().cloneNode(!1);for(f in a)m=a[f],void 0!==m&&(u.style[f]=m);return v=s.normalizeText!==!1?e(t):t+"",u.textContent=v,u.appendChild(h),document.body.appendChild(u),v.length&&(p.width=u.offsetWidth-this.options.baselineMarkerSize,p.height=u.offsetHeight,p.baseline=h.offsetTop+this.options.baselineMarkerSize),p.width>0&&p.height>0&&this._cache.put(d,p),u.parentNode.removeChild(u),p},_baselineMarker:function(){var t=document.createElement("div");return t.style.cssText="display: inline-block; vertical-align: baseline;width: "+this.options.baselineMarkerSize+"px; height: "+this.options.baselineMarkerSize+"px;overflow: hidden;",t}}),p.current=new p,kendo.deepExtend(kendo.util,{LRUCache:s,TextMetrics:p,measureText:a,objectKey:i,hashKey:n,normalizeText:e})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(t,e,i){(i||e)()}),function(t,define){define("kendo.gantt.editors.min",["kendo.data.min","kendo.popup.min","kendo.window.min","kendo.gantt.data.min","kendo.grid.min","kendo.datetimepicker.min","kendo.numerictextbox.min"],t)}(function(){return function(t,e){var i=window.kendo,n=i.ui,o=i.support.browser,a=i.Observable,s=n.Widget,r=i._outerWidth,d=t.extend({F10:121},i.keys),l=t.proxy,c=t.extend,p=t.isPlainObject,u=".kendoGantt",h="p0",f="tabIndex",m="click",v="width",g="string",b="aria-activedescendant",k="action-option-focused",w=".",y={down:{origin:"bottom left",position:"top left"},up:{origin:"top left",position:"bottom left"}},_=i.template('<div class="#=styles.popupWrapper#"><ul class="#=styles.popupList#" role="listbox">#for(var i = 0, l = actions.length; i < l; i++){#<li class="#=styles.item#" data-action="#=actions[i].data#" role="option">#=actions[i].text#</span>#}#</ul></div>'),x={buttonDelete:"k-gantt-delete",buttonCancel:"k-gantt-cancel",buttonSave:"k-gantt-update",focused:"k-state-focused",gridContent:"k-grid-content",hovered:"k-state-hover",item:"k-item",popupWrapper:"k-list-container",popupList:"k-list k-reset",popup:{form:"k-popup-edit-form",editForm:"k-gantt-edit-form",formContainer:"k-edit-form-container",resourcesFormContainer:"k-resources-form-container",message:"k-popup-message",buttonsContainer:"k-edit-buttons k-state-default",button:"k-button",editField:"k-edit-field",editLabel:"k-edit-label",resourcesField:"k-gantt-resources"},primary:"k-primary",toolbar:{appendButton:"k-gantt-create"}},C=function(e,n){var o={name:n.field,title:n.title},a=n.model.fields[n.field].validation;a&&p(a)&&a.message&&(o[i.attr("dateCompare-msg")]=a.message),t('<input type="text" required '+i.attr("type")+'="date" '+i.attr("role")+'="datetimepicker" '+i.attr("bind")+'="value:'+n.field+'" '+i.attr("validate")+"='true' />").attr(o).appendTo(e),t("<span "+i.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(e)},T=function(e,i){t('<a href="#" class="'+i.styles.button+'">'+i.messages.assignButton+"</a>").click(i.click).appendTo(e)},F=a.extend({init:function(t,e){a.fn.init.call(this),this.element=t,this.options=c(!0,{},this.options,e),this._popup()},options:{direction:"down",navigatable:!1},destroy:function(){clearTimeout(this._focusTimeout),this.popup.destroy(),this.element.off(u),this.list.off(u),this.unbind()},_adjustListWidth:function(){var t,e,i=this.list,n=i[0].style.width,a=this.element,s=r(i);!i.data(v)&&n||(t=window.getComputedStyle?window.getComputedStyle(a[0],null):0,e=t?parseFloat(t.width):r(a),t&&(o.mozilla||o.msie)&&(e+=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)+parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth)),n="border-box"!==i.css("box-sizing")?e-(r(i)-i.width()):e,s>n&&(n=s),i.css({fontFamily:a.css("font-family"),width:n}).data(v,n))},_current:function(t){var e=this.list.find(w+x.focused),i=e[t]();i.length&&(e.removeClass(x.focused).removeAttr("id"),i.addClass(x.focused).attr("id",k),this.list.find("ul").removeAttr(b).attr(b,k))},_popup:function(){var e=this,n="li"+w+x.item,o=this.options.messages.actions,a=this.options.navigatable;this.list=t(_({styles:x,actions:[{data:"add",text:o.addChild},{data:"insert-before",text:o.insertBefore},{data:"insert-after",text:o.insertAfter}]})),this.element.append(this.list),this.popup=new i.ui.Popup(this.list,c({anchor:this.element,open:function(){e._adjustListWidth()},animation:this.options.animation},y[this.options.direction])),this.element.on(m+u,function(n){var o=t(this),s=o.attr(i.attr("action"));n.preventDefault(),s?e.trigger("command",{type:s}):(e.popup.open(),a&&e.list.find("li:first").addClass(x.focused).attr("id",k).end().find("ul").attr({TABINDEX:0,"aria-activedescendant":k}).focus())}),this.list.find(n).hover(function(){t(this).addClass(x.hovered)},function(){t(this).removeClass(x.hovered)}).end().on(m+u,n,function(){e.trigger("command",{type:t(this).attr(i.attr("action"))}),e.popup.close()}),a&&(this.popup.bind("close",function(){e.list.find(n).removeClass(x.focused).end().find("ul").attr(f,0),e.element.parents("["+i.attr("role")+'="gantt"]').find(w+x.gridContent+" > table:first").focus()}),this.list.find("ul").on("keydown"+u,function(t){var i=t.keyCode;switch(i){case d.UP:t.preventDefault(),e._current("prev");break;case d.DOWN:t.preventDefault(),e._current("next");break;case d.ENTER:e.list.find(w+x.focused).click();break;case d.ESC:t.preventDefault(),e.popup.close()}}))}}),D={desktop:{dateRange:C,resources:T}},E=i.Observable.extend({init:function(t,e){i.Observable.fn.init.call(this),this.element=t,this.options=c(!0,{},this.options,e),this.createButton=this.options.createButton},fields:function(e,i,n){var o,a=this,s=this.options,r=s.messages.editor,d=s.resources,l=function(t){t.preventDefault(),d.editor(a.container.find(w+x.popup.resourcesField),i)};return s.editable.template?o=t.map(i.fields,function(t,e){return{field:e}}):(o=[{field:"title",title:r.title},{field:"start",title:r.start,editor:e.dateRange},{field:"end",title:r.end,editor:e.dateRange},{field:"percentComplete",title:r.percentComplete,format:h}],n&&o.splice.apply(o,[1,0].concat([{field:"plannedStart",title:r.plannedStart,editor:e.dateRange},{field:"plannedEnd",title:r.plannedEnd,editor:e.dateRange}])),i.get(d.field)&&o.push({field:d.field,title:r.resources,messages:r,editor:e.resources,click:l,styles:x.popup})),o},_buildEditTemplate:function(t,e,n){var o,a,s,r,d=this.options.resources,l=this.options.editable.template,p=c({},i.Template,this.options.templateSettings),u=p.paramName,h=x.popup,f="";if(l)typeof l===g&&(l=i.unescape(l)),f+=i.template(l,p)(t);else for(o=0,a=e.length;o<a;o++)s=e[o],f+='<div class="'+h.editLabel+'"><label for="'+s.field+'">'+(s.title||s.field||"")+"</label></div>",s.field===d.field&&(f+='<div class="'+h.resourcesField+'" style="display:none"></div>'),!t.editable||t.editable(s.field)?(n.push(s),f+="<div "+i.attr("container-for")+'="'+s.field+'" class="'+h.editField+'"></div>'):(r="#:",s.field?(s=i.expr(s.field,u),r+=s+"==null?'':"+s):r+="''",r+="#",r=i.template(r,p),f+='<div class="'+h.editField+'">'+r(t)+"</div>");return f}}),S=E.extend({destroy:function(){this.close(),this.unbind()},close:function(){var t=this,e=function(){t.editable&&(t.editable.destroy(),t.editable=null,t.container=null),t.popup&&(t.popup.destroy(),t.popup=null)};this.editable&&this.container.is(":visible")?(t.trigger("close",{window:t.container}),this.container.data("kendoWindow").bind("deactivate",e).close()):e()},editTask:function(t,e){this.editable=this._createPopupEditor(t,e)},showDialog:function(e){var n,o,a,s,r=e.buttons,d=x.popup,l=i.format('<div class="{0}"><div class="{1}"><p class="{2}">{3}</p><div class="{4}">',d.form,d.formContainer,d.message,e.text,d.buttonsContainer);for(n=0,o=r.length;n<o;n++)l+=this.createButton(r[n]);l+="</div></div></div>",a=this.element,this.popup&&this.popup.destroy(),s=this.popup=t(l).appendTo(a).eq(0).on("click",w+d.button,function(e){e.preventDefault(),s.close();var i=t(e.currentTarget).index();r[i].click()}).kendoWindow({modal:!0,autoFocus:!1,resizable:!1,draggable:!1,title:e.title,visible:!1,deactivate:function(){this.destroy(),a.focus()}}).getKendoWindow(),s.center().open(),s.element.find(".k-primary").focus()},_createPopupEditor:function(e,n){var o,a,s=this,r={},d=this.options.messages,l=x.popup,p=i.format('<div {0}="{1}" class="{2} {3}"><div class="{4}">',i.attr("uid"),e.uid,l.form,l.editForm,l.formContainer),h=this.fields(D.desktop,e,n),f=[];return p+=this._buildEditTemplate(e,h,f),p+='<div class="'+l.buttonsContainer+'">',p+=this.createButton({name:"update",text:d.save,className:x.primary}),p+=this.createButton({name:"cancel",text:d.cancel}),s.options.editable.destroy!==!1&&(p+=this.createButton({name:"delete",text:d.destroy})),p+="</div></div></div>",o=this.container=t(p).appendTo(this.element).eq(0).kendoWindow(c({modal:!0,resizable:!1,draggable:!0,title:d.editor.editorTitle,visible:!1,close:function(t){t.userTriggered&&s.trigger("cancel",{container:o,model:e})&&t.preventDefault()}},r)),a=o.kendoEditable({fields:f,model:e,clearContainer:!1,validateOnBlur:!0,target:s.options.target}).data("kendoEditable"),i.cycleForm(o),this.trigger("edit",{container:o,model:e})?s.trigger("cancel",{container:o,model:e}):(o.data("kendoWindow").center().open(),o.on(m+u,w+x.buttonCancel,function(t){t.preventDefault(),t.stopPropagation(),s.trigger("cancel",{container:o,model:e})}),o.on(m+u,w+x.buttonSave,function(t){var i,a,r,d,l;for(t.preventDefault(),t.stopPropagation(),i=s.fields(D.desktop,e,n),a={},d=0,l=i.length;d<l;d++)r=i[d].field,a[r]=e.get(r);s.trigger("save",{container:o,model:e,updateInfo:a})}),o.on(m+u,w+x.buttonDelete,function(t){t.preventDefault(),t.stopPropagation(),s.trigger("remove",{container:o,model:e})})),a}}),B=s.extend({init:function(t,e){s.fn.init.call(this,t,e),this.wrapper=this.element,this.model=this.options.model,this.resourcesField=this.options.resourcesField,this.createButton=this.options.createButton,this._initContainer(),this._attachHandlers()},events:["save"],close:function(){this.window.bind("deactivate",l(this.destroy,this)).close()},destroy:function(){this._dettachHandlers(),this.grid.destroy(),this.grid=null,this.window.destroy(),this.window=null,s.fn.destroy.call(this),i.destroy(this.wrapper),this.element=this.wrapper=null},open:function(){this.window.center().open()},_attachHandlers:function(){var e=this.grid,n=this._cancelProxy=l(this._cancel,this);this.container.on(m+u,w+x.buttonCancel,this._cancelProxy),this._saveProxy=l(this._save,this),this.container.on(m+u,w+x.buttonSave,this._saveProxy),this.window.bind("close",function(t){t.userTriggered&&n(t)}),e.wrapper.on(m+u,"input[type='checkbox']",function(){var n=t(this),o=t(n).closest("tr"),a=e.dataSource.getByUid(o.attr(i.attr("uid"))),s=t(n).is(":checked")?1:"";a.set("value",s)})},_cancel:function(t){t.preventDefault(),this.close()},_createButtons:function(){var t,e,i=this.options.buttons,n='<div class="'+x.popup.buttonsContainer+'">';for(t=0,e=i.length;t<e;t++)n+=this.createButton(i[t]);n+="</div>",this.container.append(n)},_dettachHandlers:function(){this._cancelProxy=null,this._saveProxy=null,this.container.off(u),this.grid.wrapper.off()},_initContainer:function(){var e=this,n=x.popup,o=i.format('<div class="{0} {1}"><div class="{2} {3}"></div></div>"',n.form,n.editForm,n.formContainer,n.resourcesFormContainer);o=t(o),this.container=o.find(w+n.resourcesFormContainer),this.window=o.kendoWindow({modal:!0,resizable:!1,draggable:!0,visible:!1,title:this.options.messages.resourcesEditorTitle,open:function(){e.grid.resize(!0)}}).data("kendoWindow"),this._resourceGrid(),this._createButtons()},_resourceGrid:function(){var e=this,n=this.options.messages,o=t('<div id="resources-grid"/>').appendTo(this.container);this.grid=new i.ui.Grid(o,{columns:[{field:"name",title:n.resourcesHeader,template:"<label><input type='checkbox' value='#=name#'# if (value > 0 && value !== null) {#checked='checked'# } #/>#=name#</labe>"},{field:"value",title:n.unitsHeader,template:function(t){var e=t.format,n=null!==t.value?t.value:"";return e?i.toString(n,e):n}}],height:280,sortable:!0,editable:!0,filterable:!0,dataSource:{data:e.options.data,schema:{model:{id:"id",fields:{id:{from:"id"},name:{from:"name",type:"string",editable:!1},value:{from:"value",type:"number",validation:this.options.unitsValidation},format:{from:"format",type:"string"}}}}},save:function(t){var e=!!t.values.value;t.container.parent().find("input[type='checkbox']").prop("checked",e)}})},_save:function(t){t.preventDefault(),this._updateModel(),this.wrapper.is(w+x.popup.resourcesField)||this.trigger("save",{container:this.wrapper,model:this.model}),this.close()},_updateModel:function(){var t,e,i,n=[],o=this.grid.dataSource.data();for(e=0,i=o.length;e<i;e++)t=o[e].get("value"),null!==t&&t>0&&n.push(o[e]);this.model[this.resourcesField]=n}});i.gantt={TaskDropDown:F,Editor:E,PopupEditor:S,ResourceEditor:B}}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,i){(i||e)()});
|
|
//# sourceMappingURL=kendo.gantt.editors.min.js.map
|