UNPKG

visop

Version:

A simple CLI for scaffolding visible operation projects.

1 lines 10.4 kB
webpackJsonp([18],{"2d3o":function(n,t,e){(n.exports=e("FZ+f")(!1)).push([n.i,"\n.board-column {\n min-width: 300px;\n min-height: 100px;\n height: auto;\n overflow: hidden;\n background: #f0f0f0;\n border-radius: 3px;\n}\n.board-column .board-column-header {\n height: 50px;\n line-height: 50px;\n overflow: hidden;\n padding: 0 20px;\n text-align: center;\n background: #333;\n color: #fff;\n border-radius: 3px 3px 0 0;\n}\n.board-column .board-column-content {\n height: auto;\n overflow: hidden;\n border: 10px solid transparent;\n min-height: 60px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.board-column .board-column-content .board-item {\n cursor: pointer;\n width: 100%;\n height: 64px;\n margin: 5px 0;\n background-color: #fff;\n text-align: left;\n line-height: 54px;\n padding: 5px 10px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-box-shadow: 0px 1px 3px 0 rgba(0, 0, 0, 0.2);\n box-shadow: 0px 1px 3px 0 rgba(0, 0, 0, 0.2);\n}\n",""])},"60G1":function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=e("DAYN"),o={name:"dragKanban-demo",components:{draggable:e.n(i).a},props:{headerText:{type:String,default:"Header"},options:{type:Object,default:function(){return{}}},list:{type:Array,default:function(){return[]}}}},r={render:function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"board-column"},[e("div",{staticClass:"board-column-header"},[n._v("\n "+n._s(n.headerText)+"\n ")]),n._v(" "),e("draggable",{staticClass:"board-column-content",attrs:{list:n.list,options:n.options}},n._l(n.list,function(t){return e("div",{key:t.id,staticClass:"board-item"},[n._v("\n "+n._s(t.name)+" "+n._s(t.id)+"\n ")])}))],1)},staticRenderFns:[]};var a={name:"dragKanban-demo",components:{Kanban:e("VU/8")(o,r,!1,function(n){e("DQct")},null,null).exports},data:function(){return{options:{group:"mission"},list1:[{name:"Mission",id:1},{name:"Mission",id:2},{name:"Mission",id:3},{name:"Mission",id:4}],list2:[{name:"Mission",id:5},{name:"Mission",id:6},{name:"Mission",id:7}],list3:[{name:"Mission",id:8},{name:"Mission",id:9},{name:"Mission",id:10}]}}},s={render:function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"components-container board"},[e("Kanban",{key:1,staticClass:"kanban todo",attrs:{list:n.list1,options:n.options,"header-text":"Todo"}}),n._v(" "),e("Kanban",{key:2,staticClass:"kanban working",attrs:{list:n.list2,options:n.options,"header-text":"Working"}}),n._v(" "),e("Kanban",{key:3,staticClass:"kanban done",attrs:{list:n.list3,options:n.options,"header-text":"Done"}})],1)},staticRenderFns:[]};var l=e("VU/8")(a,s,!1,function(n){e("vzJ1")},null,null);t.default=l.exports},DAYN:function(n,t,e){"use strict";var i=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n};function o(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}return Array.from(n)}!function(){function t(n){function t(n){n.parentElement.removeChild(n)}function e(n,t,e){var i=0===e?n.children[0]:n.children[e-1].nextSibling;n.insertBefore(t,i)}function r(n,t){var e=this;this.$nextTick(function(){return e.$emit(n.toLowerCase(),t)})}var a=["Start","Add","Remove","Update","End"],s=["Choose","Sort","Filter","Clone"],l=["Move"].concat(a,s).map(function(n){return"on"+n}),d=null;return{name:"draggable",props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(n){return n}},element:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1,init:!1}},render:function(n){var t=this.$slots.default;if(t&&1===t.length){var e=t[0];e.componentOptions&&"transition-group"===e.componentOptions.tag&&(this.transitionMode=!0)}var i=t,r=this.$slots.footer;r&&(i=t?[].concat(o(t),o(r)):[].concat(o(r)));var a=null,s=function(n,t){a=function(n,t,e){return void 0==e?n:((n=null==n?{}:n)[t]=e,n)}(a,n,t)};if(s("attrs",this.$attrs),this.componentData){var l=this.componentData,d=l.on,c=l.props;s("on",d),s("props",c)}return n(this.element,a,i)},mounted:function(){var t=this;if(this.noneFunctionalComponentMode=this.element.toLowerCase()!==this.$el.nodeName.toLowerCase(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter element value or remove transition-group. Current element value: "+this.element);var e={};a.forEach(function(n){e["on"+n]=function(n){var t=this;return function(e){null!==t.realList&&t["onDrag"+n](e),r.call(t,n,e)}}.call(t,n)}),s.forEach(function(n){e["on"+n]=r.bind(t,n)});var o=i({},this.options,e,{onMove:function(n,e){return t.onDragMove(n,e)}});!("draggable"in o)&&(o.draggable=">*"),this._sortable=new n(this.rootContainer,o),this.computeIndexes()},beforeDestroy:function(){this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},isCloning:function(){return!!this.options&&!!this.options.group&&"clone"===this.options.group.pull},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(n){for(var t in n)-1==l.indexOf(t)&&this._sortable.option(t,n[t])},deep:!0},realList:function(){this.computeIndexes()}},methods:{getChildrenNodes:function(){if(this.init||(this.noneFunctionalComponentMode=this.noneFunctionalComponentMode&&1==this.$children.length,this.init=!0),this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var n=this.$slots.default;return this.transitionMode?n[0].child.$slots.default:n},computeIndexes:function(){var n=this;this.$nextTick(function(){n.visibleIndexes=function(n,t,e){if(!n)return[];var i=n.map(function(n){return n.elm}),r=[].concat(o(t)).map(function(n){return i.indexOf(n)});return e?r.filter(function(n){return-1!==n}):r}(n.getChildrenNodes(),n.rootContainer.children,n.transitionMode)})},getUnderlyingVm:function(n){var t=function(n,t){return n.map(function(n){return n.elm}).indexOf(t)}(this.getChildrenNodes()||[],n);return-1===t?null:{index:t,element:this.realList[t]}},getUnderlyingPotencialDraggableComponent:function(n){var t=n.__vue__;return t&&t.$options&&"transition-group"===t.$options._componentTag?t.$parent:t},emitChanges:function(n){var t=this;this.$nextTick(function(){t.$emit("change",n)})},alterList:function(n){if(this.list)n(this.list);else{var t=[].concat(o(this.value));n(t),this.$emit("input",t)}},spliceList:function(){var n=arguments,t=function(t){return t.splice.apply(t,n)};this.alterList(t)},updatePosition:function(n,t){var e=function(e){return e.splice(t,0,e.splice(n,1)[0])};this.alterList(e)},getRelatedContextFromMoveEvent:function(n){var t=n.to,e=n.related,o=this.getUnderlyingPotencialDraggableComponent(t);if(!o)return{component:o};var r=o.realList,a={list:r,component:o};if(t!==e&&r&&o.getUnderlyingVm){var s=o.getUnderlyingVm(e);if(s)return i(s,a)}return a},getVmIndex:function(n){var t=this.visibleIndexes,e=t.length;return n>e-1?e:t[n]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(n){if(this.noTransitionOnDrag&&this.transitionMode){this.getChildrenNodes()[n].data=null;var t=this.getComponent();t.children=[],t.kept=void 0}},onDragStart:function(n){this.context=this.getUnderlyingVm(n.item),n.item._underlying_vm_=this.clone(this.context.element),d=n.item},onDragAdd:function(n){var e=n.item._underlying_vm_;if(void 0!==e){t(n.item);var i=this.getVmIndex(n.newIndex);this.spliceList(i,0,e),this.computeIndexes();var o={element:e,newIndex:i};this.emitChanges({added:o})}},onDragRemove:function(n){if(e(this.rootContainer,n.item,n.oldIndex),this.isCloning)t(n.clone);else{var i=this.context.index;this.spliceList(i,1);var o={element:this.context.element,oldIndex:i};this.resetTransitionData(i),this.emitChanges({removed:o})}},onDragUpdate:function(n){t(n.item),e(n.from,n.item,n.oldIndex);var i=this.context.index,o=this.getVmIndex(n.newIndex);this.updatePosition(i,o);var r={element:this.context.element,oldIndex:i,newIndex:o};this.emitChanges({moved:r})},computeFutureIndex:function(n,t){if(!n.element)return 0;var e=[].concat(o(t.to.children)).filter(function(n){return"none"!==n.style.display}),i=e.indexOf(t.related),r=n.component.getVmIndex(i);return-1!=e.indexOf(d)||!t.willInsertAfter?r:r+1},onDragMove:function(n,t){var e=this.move;if(!e||!this.realList)return!0;var o=this.getRelatedContextFromMoveEvent(n),r=this.context,a=this.computeFutureIndex(o,n);return i(r,{futureIndex:a}),i(n,{relatedContext:o,draggedContext:r}),e(n,t)},onDragEnd:function(n){this.computeIndexes(),d=null}}}}Array.from||(Array.from=function(n){return[].slice.call(n)});var r=e("Lokx");n.exports=t(r)}()},DQct:function(n,t,e){var i=e("2d3o");"string"==typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);e("rjj0")("6ada1cd8",i,!0)},cZEu:function(n,t,e){(n.exports=e("FZ+f")(!1)).push([n.i,"\n.board {\n width: 1000px;\n margin-left: 20px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-pack: distribute;\n justify-content: space-around;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.kanban.todo .board-column-header {\n background: #4A9FF9;\n}\n.kanban.working .board-column-header {\n background: #f9944a;\n}\n.kanban.done .board-column-header {\n background: #2ac06d;\n}\n",""])},vzJ1:function(n,t,e){var i=e("cZEu");"string"==typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);e("rjj0")("0cb6a813",i,!0)}});