From d940c009bc721d0c8cff411b8575bfb54fd5d65b Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Tue, 22 Aug 2023 23:29:07 +0200 Subject: [PATCH] work on vue-easy-dnd 1.22 lib include instructions --- amd/build/page-edit-plan.min.js | 2 +- amd/build/page-edit-plan.min.js.map | 2 +- .../vue-easy-dnd/vue-easy-dnd.esm.min.js | 2 +- .../vue-easy-dnd/vue-easy-dnd.esm.min.js.map | 2 +- amd/src/vue-easy-dnd/readme-moodle.txt | 13 +- amd/src/vue-easy-dnd/vue-easy-dnd.esm.js | 3404 +++++++++-------- 6 files changed, 1828 insertions(+), 1597 deletions(-) diff --git a/amd/build/page-edit-plan.min.js b/amd/build/page-edit-plan.min.js index 263a7e0..15cdca4 100644 --- a/amd/build/page-edit-plan.min.js +++ b/amd/build/page-edit-plan.min.js @@ -1,3 +1,3 @@ -define("local_treestudyplan/page-edit-plan",["exports","core/str","core/ajax","core/notification","./vue/vue","./studyplan-editor-components","./treestudyplan-components","./modedit-modal","./util/debugger","./util/string-helper","./studyplan-processor","./downloader","./portal-vue/portal-vue.esm","./bootstrap-vue/bootstrap-vue.esm","./vue-easy-dnd/vue-easy-dnd"],(function(_exports,_str,_ajax,_notification,_vue,_studyplanEditorComponents,_treestudyplanComponents,_modeditModal,_debugger,_stringHelper,_studyplanProcessor,_downloader,_portalVue,_bootstrapVue,_vueEasyDnd){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=function(_contextid,categoryid){_contextid=void 0===_contextid||!Number.isInteger(Number(_contextid))||_contextid<1?1:Number(_contextid);categoryid=void 0!==categoryid&&Number.isInteger(Number(categoryid))?Number(categoryid):0;var app=new _vue.default({el:"#root",data:{create:{studyplan:{name:"",shortname:"",description:"",idnumber:"",slots:4,startdate:"2020-08-01",enddate:"",context:_contextid,aggregation:"bistate",aggregation_config:""}},toolbox:{right:!0},activestudyplan:null,loadingstudyplan:!1,studyplans:[],frameworks:[],badges:[],courses:[],text:strings.studyplan,usedcontexts:[]},created:function(){this.$root.$on("studyplanRemoved",(function(studyplan){app.activestudyplan==studyplan&&(app.activestudyplan=null);var index=null;for(var idx in app.studyplans)if(app.studyplans[idx].id==studyplan.id){index=idx;break}index&&app.studyplans.splice(index,1)}))},mounted:function(){(0,_ajax.call)([{methodname:"local_treestudyplan_list_studyplans",args:{context_id:_contextid}}])[0].done((function(response){var timingval={future:0,present:1,past:2};response.sort((function(a,b){var timinga=_treestudyplanComponents.default.studyplanTiming(a),timingb=_treestudyplanComponents.default.studyplanTiming(b),t=timingval[timinga]-timingval[timingb];return 0==t&&0==(t=new Date(b.startdate).getTime()-new Date(a.startdate).getTime())&&(t=a.name.localeCompare(b.name)),t})),app.studyplans=response;var hash=location.hash.replace("#","");if(hash)for(var idx in app.studyplans)if(app.studyplans[idx].id==hash){app.selectStudyplan(app.studyplans[idx]);break}})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_list_badges",args:{}}])[0].done((function(response){app.badges=response})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_map_categories",args:{root_id:categoryid}}])[0].done((function(response){app.courses=response})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_list_used_categories",args:{operation:"edit"}}])[0].done((function(response){app.usedcontexts=response})).fail(_notification.default.exception)},computed:{dropdown_title:function(){return this.activestudyplan&&this.activestudyplan.name?this.activestudyplan.name:this.text.studyplan_select_placeholder},contextid:function(){return _contextid},filterComponentType:function(){return{item:!1,component:!0,span:1,type:"filter"}}},methods:{closeStudyplan:function(){app.activestudyplan=null,location.hash=""},movedStudyplan:function(plan,from,to){var params=new URLSearchParams(location.search);params.delete("categoryid"),params.set("contextid",to),window.location.search=params.toString()},onStudyPlanCreated:function(newstudyplan){app.studyplans.push(newstudyplan),app.selectStudyplan(newstudyplan)},switchContext:function(ctx){var params=new URLSearchParams(location.search);params.set("categoryid",ctx.id),window.location.search=params.toString()},selectStudyplan:function(studyplan){app.loadingstudyplan=!0,app.activestudyplan=null,(0,_ajax.call)([{methodname:"local_treestudyplan_get_studyplan_map",args:{id:studyplan.id}}])[0].done((function(response){app.activestudyplan=(0,_studyplanProcessor.ProcessStudyplan)(response,!0),debug.info("studyplan processed"),app.loadingstudyplan=!1,location.hash=app.activestudyplan.id})).fail((function(error){_notification.default.exception(error),app.loadingstudyplan=!1}))},import_studyplan:function(){(0,_downloader.upload)((function(filename,content){(0,_ajax.call)([{methodname:"local_treestudyplan_import_plan",args:{content:content,format:"application/json",context_id:_contextid}}])[0].done((function(response){response.success?location.reload():debug.error("Import failed: ",response.msg)})).fail(_notification.default.exception)}),"application/json")},export_plan:function(plan,format){null!=format&&["json","csv"].includes(format)||(format="json"),(0,_ajax.call)([{methodname:"local_treestudyplan_export_plan",args:{studyplan_id:plan.id,format:format}}])[0].done((function(response){(0,_downloader.download)(plan.shortname+".json",response.content,response.format)})).fail(_notification.default.exception)}}})},_notification=_interopRequireDefault(_notification),_vue=_interopRequireDefault(_vue),_studyplanEditorComponents=_interopRequireDefault(_studyplanEditorComponents),_treestudyplanComponents=_interopRequireDefault(_treestudyplanComponents),_modeditModal=_interopRequireDefault(_modeditModal),_debugger=_interopRequireDefault(_debugger),_portalVue=_interopRequireDefault(_portalVue),_bootstrapVue=_interopRequireDefault(_bootstrapVue),_vue.default.use(_studyplanEditorComponents.default),_vue.default.use(_treestudyplanComponents.default),_vue.default.use(_modeditModal.default),_vue.default.use(_portalVue.default),_vue.default.use(_bootstrapVue.default),_vue.default.component("drag",_vueEasyDnd.Drag),_vue.default.component("drop",_vueEasyDnd.Drop),_vue.default.component("drop-list",_vueEasyDnd.DropList);var debug=new _debugger.default("treestudyplan"),strings=(0,_stringHelper.load_strings)({studyplan:{studyplan_select_placeholder:"studyplan_select_placeholder"}})})); +define("local_treestudyplan/page-edit-plan",["exports","core/str","core/ajax","core/notification","./vue/vue","./studyplan-editor-components","./treestudyplan-components","./modedit-modal","./util/debugger","./util/string-helper","./studyplan-processor","./downloader","./portal-vue/portal-vue.esm","./bootstrap-vue/bootstrap-vue.esm","./vue-easy-dnd/vue-easy-dnd.esm"],(function(_exports,_str,_ajax,_notification,_vue,_studyplanEditorComponents,_treestudyplanComponents,_modeditModal,_debugger,_stringHelper,_studyplanProcessor,_downloader,_portalVue,_bootstrapVue,_vueEasyDnd){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=function(_contextid,categoryid){_contextid=void 0===_contextid||!Number.isInteger(Number(_contextid))||_contextid<1?1:Number(_contextid);categoryid=void 0!==categoryid&&Number.isInteger(Number(categoryid))?Number(categoryid):0;var app=new _vue.default({el:"#root",data:{create:{studyplan:{name:"",shortname:"",description:"",idnumber:"",slots:4,startdate:"2020-08-01",enddate:"",context:_contextid,aggregation:"bistate",aggregation_config:""}},toolbox:{right:!0},activestudyplan:null,loadingstudyplan:!1,studyplans:[],frameworks:[],badges:[],courses:[],text:strings.studyplan,usedcontexts:[]},created:function(){this.$root.$on("studyplanRemoved",(function(studyplan){app.activestudyplan==studyplan&&(app.activestudyplan=null);var index=null;for(var idx in app.studyplans)if(app.studyplans[idx].id==studyplan.id){index=idx;break}index&&app.studyplans.splice(index,1)}))},mounted:function(){(0,_ajax.call)([{methodname:"local_treestudyplan_list_studyplans",args:{context_id:_contextid}}])[0].done((function(response){var timingval={future:0,present:1,past:2};response.sort((function(a,b){var timinga=_treestudyplanComponents.default.studyplanTiming(a),timingb=_treestudyplanComponents.default.studyplanTiming(b),t=timingval[timinga]-timingval[timingb];return 0==t&&0==(t=new Date(b.startdate).getTime()-new Date(a.startdate).getTime())&&(t=a.name.localeCompare(b.name)),t})),app.studyplans=response;var hash=location.hash.replace("#","");if(hash)for(var idx in app.studyplans)if(app.studyplans[idx].id==hash){app.selectStudyplan(app.studyplans[idx]);break}})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_list_badges",args:{}}])[0].done((function(response){app.badges=response})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_map_categories",args:{root_id:categoryid}}])[0].done((function(response){app.courses=response})).fail(_notification.default.exception),(0,_ajax.call)([{methodname:"local_treestudyplan_list_used_categories",args:{operation:"edit"}}])[0].done((function(response){app.usedcontexts=response})).fail(_notification.default.exception)},computed:{dropdown_title:function(){return this.activestudyplan&&this.activestudyplan.name?this.activestudyplan.name:this.text.studyplan_select_placeholder},contextid:function(){return _contextid},filterComponentType:function(){return{item:!1,component:!0,span:1,type:"filter"}}},methods:{closeStudyplan:function(){app.activestudyplan=null,location.hash=""},movedStudyplan:function(plan,from,to){var params=new URLSearchParams(location.search);params.delete("categoryid"),params.set("contextid",to),window.location.search=params.toString()},onStudyPlanCreated:function(newstudyplan){app.studyplans.push(newstudyplan),app.selectStudyplan(newstudyplan)},switchContext:function(ctx){var params=new URLSearchParams(location.search);params.set("categoryid",ctx.id),window.location.search=params.toString()},selectStudyplan:function(studyplan){app.loadingstudyplan=!0,app.activestudyplan=null,(0,_ajax.call)([{methodname:"local_treestudyplan_get_studyplan_map",args:{id:studyplan.id}}])[0].done((function(response){app.activestudyplan=(0,_studyplanProcessor.ProcessStudyplan)(response,!0),debug.info("studyplan processed"),app.loadingstudyplan=!1,location.hash=app.activestudyplan.id})).fail((function(error){_notification.default.exception(error),app.loadingstudyplan=!1}))},import_studyplan:function(){(0,_downloader.upload)((function(filename,content){(0,_ajax.call)([{methodname:"local_treestudyplan_import_plan",args:{content:content,format:"application/json",context_id:_contextid}}])[0].done((function(response){response.success?location.reload():debug.error("Import failed: ",response.msg)})).fail(_notification.default.exception)}),"application/json")},export_plan:function(plan,format){null!=format&&["json","csv"].includes(format)||(format="json"),(0,_ajax.call)([{methodname:"local_treestudyplan_export_plan",args:{studyplan_id:plan.id,format:format}}])[0].done((function(response){(0,_downloader.download)(plan.shortname+".json",response.content,response.format)})).fail(_notification.default.exception)}}})},_notification=_interopRequireDefault(_notification),_vue=_interopRequireDefault(_vue),_studyplanEditorComponents=_interopRequireDefault(_studyplanEditorComponents),_treestudyplanComponents=_interopRequireDefault(_treestudyplanComponents),_modeditModal=_interopRequireDefault(_modeditModal),_debugger=_interopRequireDefault(_debugger),_portalVue=_interopRequireDefault(_portalVue),_bootstrapVue=_interopRequireDefault(_bootstrapVue),_vue.default.use(_studyplanEditorComponents.default),_vue.default.use(_treestudyplanComponents.default),_vue.default.use(_modeditModal.default),_vue.default.use(_portalVue.default),_vue.default.use(_bootstrapVue.default),_vue.default.component("drag",_vueEasyDnd.Drag),_vue.default.component("drop",_vueEasyDnd.Drop),_vue.default.component("drop-list",_vueEasyDnd.DropList);var debug=new _debugger.default("treestudyplan"),strings=(0,_stringHelper.load_strings)({studyplan:{studyplan_select_placeholder:"studyplan_select_placeholder"}})})); //# sourceMappingURL=page-edit-plan.min.js.map \ No newline at end of file diff --git a/amd/build/page-edit-plan.min.js.map b/amd/build/page-edit-plan.min.js.map index 167a62e..0e9c983 100644 --- a/amd/build/page-edit-plan.min.js.map +++ b/amd/build/page-edit-plan.min.js.map @@ -1 +1 @@ -{"version":3,"file":"page-edit-plan.min.js","sources":["../src/page-edit-plan.js"],"sourcesContent":["/*eslint no-var: \"error\" */\n/*eslint no-unused-vars: \"off\" */\n/*eslint linebreak-style: \"off\" */\n/*eslint no-trailing-spaces: \"off\" */\n/*eslint-env es6*/\n// Put this file in path/to/plugin/amd/src\n// You can call it anything you like\n\nimport {get_string,get_strings} from 'core/str';\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\n\nimport Vue from './vue/vue';\n\n\nimport EditorComponents from './studyplan-editor-components';\nVue.use(EditorComponents);\n\nimport TSComponents from './treestudyplan-components';\nVue.use(TSComponents);\n\nimport ModalComponents from './modedit-modal';\nVue.use(ModalComponents);\nimport Debugger from './util/debugger';\n\nimport {load_strings} from './util/string-helper';\nimport {ProcessStudyplan} from './studyplan-processor';\nimport {download,upload} from './downloader';\n\nimport PortalVue from './portal-vue/portal-vue.esm';\nVue.use(PortalVue);\nimport BootstrapVue from './bootstrap-vue/bootstrap-vue.esm';\nVue.use(BootstrapVue);\n\nimport {Drag, Drop, DropList} from './vue-easy-dnd/vue-easy-dnd';\nVue.component('drag',Drag);\nVue.component('drop',Drop);\nVue.component('drop-list',DropList);\n\nconst debug = new Debugger(\"treestudyplan\");\n\nlet strings = load_strings({\n studyplan: {\n studyplan_select_placeholder: 'studyplan_select_placeholder',\n },\n});\n\n/**\n * Initialize the Page\n * @param {int} contextid The context we should attempt to work in (1:1 related to the category)\n * @param {int} categoryid The category we shoud attempt to work in (1:1 related to the context)\n */\nexport function init(contextid,categoryid) {\n // Make sure the id's are numeric and integer\n if(undefined === contextid || !Number.isInteger(Number(contextid)) || contextid < 1 ){ contextid = 1;} \n else { contextid = Number(contextid);} // ensure a numeric value instead of string\n if(undefined === categoryid || !Number.isInteger(Number(categoryid))){ categoryid = 0;}\n else { categoryid = Number(categoryid);} // ensure a numeric value instead of string\n\n const in_systemcontext = (contextid <= 1);\n\n // Setup the initial Vue app for this page\n let app = new Vue({\n el: '#root',\n data: {\n create: {\n studyplan: {\n name: '',\n shortname: '',\n description: '',\n idnumber: '',\n slots : 4,\n startdate: '2020-08-01',\n enddate: '',\n context: contextid,\n aggregation: 'bistate',\n aggregation_config: '',\n }\n },\n toolbox: {\n right: true,\n },\n activestudyplan: null,\n loadingstudyplan: false,\n studyplans: [],\n frameworks: [],\n badges: [],\n courses: [],\n text: strings.studyplan,\n usedcontexts: [],\n },\n created() {\n this.$root.$on('studyplanRemoved',(studyplan)=>{\n \n if(app.activestudyplan == studyplan){\n app.activestudyplan = null;\n }\n\n // remove studyplan from index list\n let index = null;\n for(let idx in app.studyplans){\n if(app.studyplans[idx].id == studyplan.id){\n index = idx;\n break;\n }\n }\n if(index){\n app.studyplans.splice(index, 1);\n }\n\n });\n },\n mounted() {\n call([{\n methodname: 'local_treestudyplan_list_studyplans',\n args: { context_id: contextid}\n }])[0].done(function(response){\n const timingval = { future: 0, present: 1, past: 2, };\n response.sort((a,b) => {\n const timinga = TSComponents.studyplanTiming(a);\n const timingb = TSComponents.studyplanTiming(b);\n\n let t = timingval[timinga] - timingval[timingb];\n if(t == 0){\n // sort by start date if timing is equal\n t = new Date(b.startdate).getTime() - new Date(a.startdate).getTime();\n \n if (t == 0) {\n // sort by name if timing is equal\n t = a.name.localeCompare(b.name);\n }\n }\n return t;\n }); \n app.studyplans = response;\n\n // load studyplan from hash if applicable\n const hash = location.hash.replace('#','');\n if(hash){\n for(let idx in app.studyplans){\n if(app.studyplans[idx].id == hash){\n app.selectStudyplan(app.studyplans[idx]);\n break;\n }\n }\n }\n }).fail(notification.exception);\n call([{\n methodname: 'local_treestudyplan_list_badges',\n args: {}\n }])[0].done(function(response){\n app.badges = response;\n }).fail(notification.exception); \n call([{\n methodname: 'local_treestudyplan_map_categories',\n args: {root_id: categoryid}\n }])[0].done(function(response){\n app.courses = response;\n }).fail(notification.exception); \n call([{\n methodname: 'local_treestudyplan_list_used_categories',\n args: { operation: 'edit'}\n }])[0].done(function(response){\n app.usedcontexts = response;\n }).fail(notification.exception); \n\n },\n computed: {\n dropdown_title(){\n if(this.activestudyplan && this.activestudyplan.name){\n return this.activestudyplan.name;\n }\n else{\n return this.text.studyplan_select_placeholder;\n }\n },\n contextid(){\n return contextid;\n },\n filterComponentType(){\n return {\n item: false,\n component: true,\n span: 1,\n type: 'filter',\n };\n },\n },\n methods: {\n closeStudyplan() {\n app.activestudyplan = null;\n location.hash = '';\n }, \n movedStudyplan(plan,from,to) {\n // reload the page in the new context (needed, since a number of links are not reactive in the page)\n const params = new URLSearchParams(location.search);\n params.delete('categoryid');\n params.set(\"contextid\", to);\n window.location.search = params.toString();\n },\n onStudyPlanCreated(newstudyplan){\n app.studyplans.push(newstudyplan);\n app.selectStudyplan(newstudyplan);\n\n },\n switchContext(ctx){\n const params = new URLSearchParams(location.search);\n params.set('categoryid', ctx.id);\n window.location.search = params.toString();\n \n },\n selectStudyplan(studyplan){\n // fetch studyplan\n app.loadingstudyplan = true;\n app.activestudyplan = null;\n call([{\n methodname: 'local_treestudyplan_get_studyplan_map',\n args: { id: studyplan.id}\n }])[0].done(function(response){\n app.activestudyplan = ProcessStudyplan(response,true);\n debug.info('studyplan processed');\n app.loadingstudyplan = false;\n location.hash = app.activestudyplan.id;\n }).fail(function(error){\n notification.exception(error);\n app.loadingstudyplan = false;\n });\n },\n import_studyplan(){\n upload((filename,content)=>{\n call([{\n methodname: 'local_treestudyplan_import_plan',\n args: {\n content: content,\n format: \"application/json\",\n context_id: contextid,\n },\n }])[0].done(function(response){\n if(response.success){\n location.reload();\n } else {\n debug.error(\"Import failed: \",response.msg);\n }\n \n }).fail(notification.exception); \n }, \"application/json\");\n },\n export_plan(plan,format){\n let self = this;\n if(format == undefined || ![\"json\",\"csv\"].includes(format)){\n format = \"json\";\n }\n call([{\n methodname: 'local_treestudyplan_export_plan',\n args: {\n studyplan_id: plan.id,\n format: format\n },\n }])[0].done(function(response){\n \n download(plan.shortname+\".json\",response.content,response.format);\n }).fail(notification.exception); \n },\n },\n });\n}\n\n"],"names":["contextid","categoryid","undefined","Number","isInteger","app","Vue","el","data","create","studyplan","name","shortname","description","idnumber","slots","startdate","enddate","context","aggregation","aggregation_config","toolbox","right","activestudyplan","loadingstudyplan","studyplans","frameworks","badges","courses","text","strings","usedcontexts","created","$root","$on","index","idx","id","splice","mounted","methodname","args","context_id","done","response","timingval","future","present","past","sort","a","b","timinga","TSComponents","studyplanTiming","timingb","t","Date","getTime","localeCompare","hash","location","replace","selectStudyplan","fail","notification","exception","root_id","operation","computed","dropdown_title","this","studyplan_select_placeholder","filterComponentType","item","component","span","type","methods","closeStudyplan","movedStudyplan","plan","from","to","params","URLSearchParams","search","delete","set","window","toString","onStudyPlanCreated","newstudyplan","push","switchContext","ctx","debug","info","error","import_studyplan","filename","content","format","success","reload","msg","export_plan","includes","studyplan_id","use","EditorComponents","ModalComponents","PortalVue","BootstrapVue","Drag","Drop","DropList","Debugger"],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kBAAmB,EACvBnB,IAAIkB,gBAAkB,oBACjB,CAAC,CACFiB,WAAY,wCACZC,KAAM,CAAEJ,GAAI3B,UAAU2B,OACtB,GAAGM,MAAK,SAASC,UACjBvC,IAAIkB,iBAAkB,wCAAiBqB,UAAS,GAChDoD,MAAMC,KAAK,uBACX5F,IAAImB,kBAAmB,EACvBqC,SAASD,KAAOvD,IAAIkB,gBAAgBc,MACrC2B,MAAK,SAASkC,6BACAhC,UAAUgC,OACvB7F,IAAImB,kBAAmB,MAG/B2E,oDACW,SAACC,SAASC,wBACR,CAAC,CACF7D,WAAY,kCACZC,KAAM,CACF4D,QAASA,QACTC,OAAQ,mBACR5D,WAAY1C,eAEhB,GAAG2C,MAAK,SAASC,UACdA,SAAS2D,QACR1C,SAAS2C,SAETR,MAAME,MAAM,kBAAkBtD,SAAS6D,QAG5CzC,KAAKC,sBAAaC,aACtB,qBAEPwC,qBAAYzB,KAAKqB,QAEApG,MAAVoG,QAAwB,CAAC,OAAO,OAAOK,SAASL,UAC/CA,OAAS,uBAER,CAAC,CACE9D,WAAY,kCACZC,KAAM,CACFmE,aAAc3B,KAAK5C,GACnBiE,OAAQA,WAEZ,GAAG3D,MAAK,SAASC,mCAERqC,KAAKrE,UAAU,QAAQgC,SAASyD,QAAQzD,SAAS0D,WAC3DtC,KAAKC,sBAAaC,6cArPrC2C,IAAIC,iDAGJD,IAAIxD,+CAGJwD,IAAIE,oCAQJF,IAAIG,iCAEJH,IAAII,oCAGJtC,UAAU,OAAOuC,+BACjBvC,UAAU,OAAOwC,+BACjBxC,UAAU,YAAYyC,0BAEpBpB,MAAQ,IAAIqB,kBAAS,iBAEvBvF,SAAU,8BAAa,CACvBpB,UAAW,CACP8D,6BAA8B"} \ No newline at end of file +{"version":3,"file":"page-edit-plan.min.js","sources":["../src/page-edit-plan.js"],"sourcesContent":["/*eslint no-var: \"error\" */\n/*eslint no-unused-vars: \"off\" */\n/*eslint linebreak-style: \"off\" */\n/*eslint no-trailing-spaces: \"off\" */\n/*eslint-env es6*/\n// Put this file in path/to/plugin/amd/src\n// You can call it anything you like\n\nimport {get_string,get_strings} from 'core/str';\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\n\nimport Vue from './vue/vue';\n\n\nimport EditorComponents from './studyplan-editor-components';\nVue.use(EditorComponents);\n\nimport TSComponents from './treestudyplan-components';\nVue.use(TSComponents);\n\nimport ModalComponents from './modedit-modal';\nVue.use(ModalComponents);\nimport Debugger from './util/debugger';\n\nimport {load_strings} from './util/string-helper';\nimport {ProcessStudyplan} from './studyplan-processor';\nimport {download,upload} from './downloader';\n\nimport PortalVue from './portal-vue/portal-vue.esm';\nVue.use(PortalVue);\nimport BootstrapVue from './bootstrap-vue/bootstrap-vue.esm';\nVue.use(BootstrapVue);\n\nimport {Drag, Drop, DropList} from './vue-easy-dnd/vue-easy-dnd.esm';\nVue.component('drag',Drag);\nVue.component('drop',Drop);\nVue.component('drop-list',DropList);\n\nconst debug = new Debugger(\"treestudyplan\");\n\nlet strings = load_strings({\n studyplan: {\n studyplan_select_placeholder: 'studyplan_select_placeholder',\n },\n});\n\n/**\n * Initialize the Page\n * @param {int} contextid The context we should attempt to work in (1:1 related to the category)\n * @param {int} categoryid The category we shoud attempt to work in (1:1 related to the context)\n */\nexport function init(contextid,categoryid) {\n // Make sure the id's are numeric and integer\n if(undefined === contextid || !Number.isInteger(Number(contextid)) || contextid < 1 ){ contextid = 1;} \n else { contextid = Number(contextid);} // ensure a numeric value instead of string\n if(undefined === categoryid || !Number.isInteger(Number(categoryid))){ categoryid = 0;}\n else { categoryid = Number(categoryid);} // ensure a numeric value instead of string\n\n const in_systemcontext = (contextid <= 1);\n\n // Setup the initial Vue app for this page\n let app = new Vue({\n el: '#root',\n data: {\n create: {\n studyplan: {\n name: '',\n shortname: '',\n description: '',\n idnumber: '',\n slots : 4,\n startdate: '2020-08-01',\n enddate: '',\n context: contextid,\n aggregation: 'bistate',\n aggregation_config: '',\n }\n },\n toolbox: {\n right: true,\n },\n activestudyplan: null,\n loadingstudyplan: false,\n studyplans: [],\n frameworks: [],\n badges: [],\n courses: [],\n text: strings.studyplan,\n usedcontexts: [],\n },\n created() {\n this.$root.$on('studyplanRemoved',(studyplan)=>{\n \n if(app.activestudyplan == studyplan){\n app.activestudyplan = null;\n }\n\n // remove studyplan from index list\n let index = null;\n for(let idx in app.studyplans){\n if(app.studyplans[idx].id == studyplan.id){\n index = idx;\n break;\n }\n }\n if(index){\n app.studyplans.splice(index, 1);\n }\n\n });\n },\n mounted() {\n call([{\n methodname: 'local_treestudyplan_list_studyplans',\n args: { context_id: contextid}\n }])[0].done(function(response){\n const timingval = { future: 0, present: 1, past: 2, };\n response.sort((a,b) => {\n const timinga = TSComponents.studyplanTiming(a);\n const timingb = TSComponents.studyplanTiming(b);\n\n let t = timingval[timinga] - timingval[timingb];\n if(t == 0){\n // sort by start date if timing is equal\n t = new Date(b.startdate).getTime() - new Date(a.startdate).getTime();\n \n if (t == 0) {\n // sort by name if timing is equal\n t = a.name.localeCompare(b.name);\n }\n }\n return t;\n }); \n app.studyplans = response;\n\n // load studyplan from hash if applicable\n const hash = location.hash.replace('#','');\n if(hash){\n for(let idx in app.studyplans){\n if(app.studyplans[idx].id == hash){\n app.selectStudyplan(app.studyplans[idx]);\n break;\n }\n }\n }\n }).fail(notification.exception);\n call([{\n methodname: 'local_treestudyplan_list_badges',\n args: {}\n }])[0].done(function(response){\n app.badges = response;\n }).fail(notification.exception); \n call([{\n methodname: 'local_treestudyplan_map_categories',\n args: {root_id: categoryid}\n }])[0].done(function(response){\n app.courses = response;\n }).fail(notification.exception); \n call([{\n methodname: 'local_treestudyplan_list_used_categories',\n args: { operation: 'edit'}\n }])[0].done(function(response){\n app.usedcontexts = response;\n }).fail(notification.exception); \n\n },\n computed: {\n dropdown_title(){\n if(this.activestudyplan && this.activestudyplan.name){\n return this.activestudyplan.name;\n }\n else{\n return this.text.studyplan_select_placeholder;\n }\n },\n contextid(){\n return contextid;\n },\n filterComponentType(){\n return {\n item: false,\n component: true,\n span: 1,\n type: 'filter',\n };\n },\n },\n methods: {\n closeStudyplan() {\n app.activestudyplan = null;\n location.hash = '';\n }, \n movedStudyplan(plan,from,to) {\n // reload the page in the new context (needed, since a number of links are not reactive in the page)\n const params = new URLSearchParams(location.search);\n params.delete('categoryid');\n params.set(\"contextid\", to);\n window.location.search = params.toString();\n },\n onStudyPlanCreated(newstudyplan){\n app.studyplans.push(newstudyplan);\n app.selectStudyplan(newstudyplan);\n\n },\n switchContext(ctx){\n const params = new URLSearchParams(location.search);\n params.set('categoryid', ctx.id);\n window.location.search = params.toString();\n \n },\n selectStudyplan(studyplan){\n // fetch studyplan\n app.loadingstudyplan = true;\n app.activestudyplan = null;\n call([{\n methodname: 'local_treestudyplan_get_studyplan_map',\n args: { id: studyplan.id}\n }])[0].done(function(response){\n app.activestudyplan = ProcessStudyplan(response,true);\n debug.info('studyplan processed');\n app.loadingstudyplan = false;\n location.hash = app.activestudyplan.id;\n }).fail(function(error){\n notification.exception(error);\n app.loadingstudyplan = false;\n });\n },\n import_studyplan(){\n upload((filename,content)=>{\n call([{\n methodname: 'local_treestudyplan_import_plan',\n args: {\n content: content,\n format: \"application/json\",\n context_id: contextid,\n },\n }])[0].done(function(response){\n if(response.success){\n location.reload();\n } else {\n debug.error(\"Import failed: \",response.msg);\n }\n \n }).fail(notification.exception); \n }, \"application/json\");\n },\n export_plan(plan,format){\n let self = this;\n if(format == undefined || ![\"json\",\"csv\"].includes(format)){\n format = \"json\";\n }\n call([{\n methodname: 'local_treestudyplan_export_plan',\n args: {\n studyplan_id: plan.id,\n format: format\n },\n }])[0].done(function(response){\n \n download(plan.shortname+\".json\",response.content,response.format);\n }).fail(notification.exception); \n },\n },\n });\n}\n\n"],"names":["contextid","categoryid","undefined","Number","isInteger","app","Vue","el","data","create","studyplan","name","shortname","description","idnumber","slots","startdate","enddate","context","aggregation","aggregation_config","toolbox","right","activestudyplan","loadingstudyplan","studyplans","frameworks","badges","courses","text","strings","usedcontexts","created","$root","$on","index","idx","id","splice","mounted","methodname","args","context_id","done","response","timingval","future","present","past","sort","a","b","timinga","TSComponents","studyplanTiming","timingb","t","Date","getTime","localeCompare","hash","location","replace","selectStudyplan","fail","notification","exception","root_id","operation","computed","dropdown_title","this","studyplan_select_placeholder","filterComponentType","item","component","span","type","methods","closeStudyplan","movedStudyplan","plan","from","to","params","URLSearchParams","search","delete","set","window","toString","onStudyPlanCreated","newstudyplan","push","switchContext","ctx","debug","info","error","import_studyplan","filename","content","format","success","reload","msg","export_plan","includes","studyplan_id","use","EditorComponents","ModalComponents","PortalVue","BootstrapVue","Drag","Drop","DropList","Debugger"],"mappings":"ouBAoDqBA,WAAUC,YAE4DD,gBAApFE,IAAcF,aAAcG,OAAOC,UAAUD,OAAOH,cAAeA,WAAY,EAAiB,EAChFG,OAAOH,YAEnBC,gBADJC,IAAcD,YAAeE,OAAOC,UAAUD,OAAOF,aACpCE,OAAOF,YADyD,MAMhFI,IAAM,IAAIC,aAAI,CACdC,GAAI,QACJC,KAAM,CACFC,OAAQ,CACJC,UAAW,CACPC,KAAM,GACNC,UAAW,GACXC,YAAa,GACbC,SAAU,GACVC,MAAQ,EACRC,UAAW,aACXC,QAAS,GACTC,QAASlB,WACTmB,YAAa,UACbC,mBAAoB,KAG5BC,QAAS,CACLC,OAAO,GAEXC,gBAAiB,KACjBC,kBAAkB,EAClBC,WAAY,GACZC,WAAY,GACZC,OAAQ,GACRC,QAAS,GACTC,KAAMC,QAAQpB,UACdqB,aAAc,IAElBC,wBACSC,MAAMC,IAAI,oBAAmB,SAACxB,WAE5BL,IAAIkB,iBAAmBb,YACtBL,IAAIkB,gBAAkB,UAItBY,MAAQ,SACR,IAAIC,OAAO/B,IAAIoB,cACZpB,IAAIoB,WAAWW,KAAKC,IAAM3B,UAAU2B,GAAG,CACtCF,MAAQC,UAIbD,OACC9B,IAAIoB,WAAWa,OAAOH,MAAO,OAKzCI,kCACS,CAAC,CACFC,WAAY,sCACZC,KAAM,CAAE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ArPrC2C,IAAIC,iDAGJD,IAAIxD,+CAGJwD,IAAIE,oCAQJF,IAAIG,iCAEJH,IAAII,oCAGJtC,UAAU,OAAOuC,+BACjBvC,UAAU,OAAOwC,+BACjBxC,UAAU,YAAYyC,0BAEpBpB,MAAQ,IAAIqB,kBAAS,iBAEvBvF,SAAU,8BAAa,CACvBpB,UAAW,CACP8D,6BAA8B"} \ No newline at end of file diff --git a/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js b/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js index 2b2598f..86ffa79 100644 --- a/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js +++ b/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js @@ -1,3 +1,3 @@ -define("local_treestudyplan/vue-easy-dnd/vue-easy-dnd.esm",["exports","../vue/vue"],(function(_exports,_vue){function _toConsumableArray(arr){return function(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||_unsupportedIterableToArray(arr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _slicedToArray(arr,i){return function(arr){if(Array.isArray(arr))return arr}(arr)||function(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||_unsupportedIterableToArray(arr,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function(){};return{s:F,n:function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function(){it=it.call(o)},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(_e3){didErr=!0,err=_e3},f:function(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map((function(n){n(e)})),(i=n.get("*"))&&i.slice().map((function(n){n(t,e)}))}}),_defineProperty(this,"success",null)}return _createClass(DnD,[{key:"startDrag",value:function(source,event,x,y,type,data){this.type=type,this.data=data,this.source=source,this.position={x:x,y:y},this.top=null,this.inProgress=!0,this.emit(event,"dragstart"),this.emit(event,"dragtopchanged",{previousTop:null})}},{key:"resetVariables",value:function(){this.inProgress=!1,this.data=null,this.source=null,this.position=null,this.success=null}},{key:"stopDrag",value:function(event){this.success=null!==this.top&&this.top.compatibleMode&&this.top.dropAllowed,null!==this.top&&this.emit(event,"drop"),this.emit(event,"dragend"),this.resetVariables()}},{key:"cancelDrag",value:function(event){this.success=!1,this.emit(event,"dragend"),this.resetVariables()}},{key:"mouseMove",value:function(event,comp){if(this.inProgress){var prevent=!1,previousTop=this.top;null===comp||comp.isDropMask?(this.top=null,prevent=!0):comp.candidate(this.type,this.data,this.source)&&(this.top=comp,prevent=!0),prevent&&event.stopPropagation(),this.top!==previousTop&&this.emit(event.detail.native,"dragtopchanged",{previousTop:previousTop}),this.position={x:event.detail.x,y:event.detail.y},this.emit(event.detail.native,"dragpositionchanged")}}},{key:"emit",value:function(native,event){var data=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.eventBus.emit(event,_objectSpread({type:this.type,data:this.data,top:this.top,source:this.source,position:this.position,success:this.success,native:native},data))}},{key:"on",value:function(event,callback){this.eventBus.on(event,callback)}},{key:"off",value:function(event,callback){this.eventBus.off(event,callback)}}]),DnD}(),dnd=(0,_vue.reactive)(new DnD);_exports.dnd=dnd;var DragAwareMixin={data:function(){return{isDropMask:!1}},computed:{dragInProgress:function(){return dnd.inProgress},dragData:function(){return dnd.data},dragType:function(){return dnd.type},dragPosition:function(){return dnd.position},dragSource:function(){return dnd.source},dragTop:function(){return dnd.top}}};function _createDragImage(el){var clone=function(el){var clone=el.cloneNode(!0);copyStyle(el,clone);for(var vSrcElements=el.getElementsByTagName("*"),vDstElements=clone.getElementsByTagName("*"),i=vSrcElements.length;i--;){copyStyle(vSrcElements[i],vDstElements[i])}return clone}(el);return clone.style.position="fixed",clone.style.margin="0",clone.style["z-index"]="1000",clone.style.transition="opacity 0.2s",clone}function copyStyle(src,destination){var _step,computedStyle=window.getComputedStyle(src),_iterator=_createForOfIteratorHelper(computedStyle);try{for(_iterator.s();!(_step=_iterator.n()).done;){var key=_step.value;if("width"===key){var width="border-box"===computedStyle.getPropertyValue("box-sizing")?src.clientWidth:src.clientWidth-parseFloat(computedStyle.paddingLeft)-parseFloat(computedStyle.paddingRight);destination.style.setProperty("width",width+"px")}else if("height"===key){var height="border-box"===computedStyle.getPropertyValue("box-sizing")?src.clientHeight:src.clientHeight-parseFloat(computedStyle.paddingTop)-parseFloat(computedStyle.paddingBottom);destination.style.setProperty("height",height+"px")}else destination.style.setProperty(key,computedStyle.getPropertyValue(key),computedStyle.getPropertyPriority(key))}}catch(err){_iterator.e(err)}finally{_iterator.f()}destination.style.pointerEvents="none"}_exports.DragAwareMixin=DragAwareMixin;var regex=/(auto|scroll)/,style=function(node,prop){return getComputedStyle(node,null).getPropertyValue(prop)},scrollparent=function scrollparent(node){return node&&node!==document.body?function(node){return regex.test(style(node,"overflow")+style(node,"overflow-y")+style(node,"overflow-x"))}(node)?node:scrollparent(node.parentNode):document.body},timer=null;function cancelScrollAction(){clearTimeout(timer)}function performEdgeScroll(event,container,clientX,clientY,edgeSize){if(!container||!edgeSize)return cancelScrollAction(),!1;var rect=container.getBoundingClientRect(),isBody=container===document.body,viewportX=clientX-rect.left,viewportY=clientY-rect.top;isBody&&(viewportX=clientX,viewportY=clientY);var viewportWidth=rect.width,viewportHeight=rect.height;isBody&&(viewportWidth=document.documentElement.clientWidth,viewportHeight=document.documentElement.clientHeight);var edgeTop=edgeSize,edgeLeft=edgeSize,edgeBottom=viewportHeight-edgeSize,edgeRight=viewportWidth-edgeSize,isInLeftEdge=viewportXedgeRight,isInTopEdge=viewportYedgeBottom;if(!(isInLeftEdge||isInRightEdge||isInTopEdge||isInBottomEdge))return cancelScrollAction(),!1;var documentWidth=Math.max(container.scrollWidth,container.offsetWidth,container.clientWidth),documentHeight=Math.max(container.scrollHeight,container.offsetHeight,container.clientHeight),maxScrollX=documentWidth-viewportWidth,maxScrollY=documentHeight-viewportHeight;return function checkForWindowScroll(){cancelScrollAction(),function(){var currentScrollX=container.scrollLeft,currentScrollY=container.scrollTop;isBody&&(currentScrollX=window.pageXOffset,currentScrollY=window.pageYOffset);var canScrollUp=currentScrollY>0,canScrollDown=currentScrollY0,canScrollRight=currentScrollX0&&window.navigator&&window.navigator.vibrate&&window.navigator.vibrate(this.vibration)},onMouseDown:function(e){var _this=this,target=null,goodButton=!1;if("mousedown"===e.type){var mouse=e;target=e.target,goodButton=1===mouse.buttons}else{target=e.touches[0].target,goodButton=!0}if(!this.disabled&&null===this.downEvent&&goodButton&&(!target.matches(".dnd-no-drag, .dnd-no-drag *")&&(!this.handle||target.matches(this.handle+", "+this.handle+" *")))){if(this.scrollContainer=scrollparent(target),this.initialUserSelect=document.body.style.userSelect,document.documentElement.style.userSelect="none",this.dragStarted=!1,this.downEvent=e,"mousedown"===this.downEvent.type){var _mouse=e;this.startPosition={x:_mouse.clientX,y:_mouse.clientY}}else{var _touch=e;this.startPosition={x:_touch.touches[0].clientX,y:_touch.touches[0].clientY}}this.delay?(this.dragInitialised=!1,clearTimeout(this.delayTimer),this.delayTimer=setTimeout((function(){_this.dragInitialised=!0,_this.performVibration()}),this.delay)):(this.dragInitialised=!0,this.performVibration()),document.addEventListener("click",this.onMouseClick,!0),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("touchend",this.onMouseUp),document.addEventListener("selectstart",this.onSelectStart),document.addEventListener("keyup",this.onKeyUp),setTimeout((function(){document.addEventListener("mousemove",_this.onMouseMove),document.addEventListener("touchmove",_this.onMouseMove,{passive:!1}),document.addEventListener("easy-dnd-move",_this.onEasyDnDMove)}),0),e.stopPropagation()}},onMouseClick:function(e){if(this.ignoreNextClick)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.ignoreNextClick=!1,!1},onMouseMove:function(e){if(null!==this.downEvent&&("touchstart"!==this.downEvent.type||"mousemove"!==e.type)){var target=null,x=null,y=null;if("touchmove"===e.type){var touch=e;if(x=touch.touches[0].clientX,y=touch.touches[0].clientY,!(target=document.elementFromPoint(x,y)))return}else{var mouse=e;x=mouse.clientX,y=mouse.clientY,target=mouse.target}var dist=Math.sqrt(Math.pow(this.startPosition.x-x,2)+Math.pow(this.startPosition.y-y,2));if(!this.dragStarted&&dist>this.delta&&(this.dragInitialised?(this.ignoreNextClick=!0,this.dragStarted=!0,dnd.startDrag(this,this.downEvent,this.startPosition.x,this.startPosition.y,this.type,this.data),document.documentElement.classList.add("drag-in-progress")):clearTimeout(this.delayTimer)),this.dragStarted){var currEdgeSize=this.dragTop&&void 0!==this.dragTop.$props.scrollingEdgeSize?this.dragTop.$props.scrollingEdgeSize:this.scrollingEdgeSize;if(currEdgeSize)performEdgeScroll(0,this.dragTop?scrollparent(this.dragTop.$el):this.scrollContainer,x,y,currEdgeSize);else cancelScrollAction();var custom=new CustomEvent("easy-dnd-move",{bubbles:!0,cancelable:!0,detail:{x:x,y:y,native:e}});target.dispatchEvent(custom)}this.dragInitialised&&e.cancelable&&e.preventDefault()}},onEasyDnDMove:function(e){dnd.mouseMove(e,null)},onMouseUp:function(e){var _this2=this;"touchstart"===this.downEvent.type&&"mouseup"===e.type||setTimeout((function(){_this2.cancelDragActions(),_this2.dragStarted&&dnd.stopDrag(e),_this2.finishDrag()}),0)},onKeyUp:function(e){var _this3=this;"Escape"===e.key&&(this.cancelDragActions(),setTimeout((function(){dnd.cancelDrag(e),_this3.finishDrag()}),0))},cancelDragActions:function(){this.dragInitialised=!1,clearTimeout(this.delayTimer),cancelScrollAction()},finishDrag:function(){this.downEvent=null,this.scrollContainer=null,this.dragStarted&&document.documentElement.classList.remove("drag-in-progress"),document.removeEventListener("click",this.onMouseClick,!0),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("easy-dnd-move",this.onEasyDnDMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchend",this.onMouseUp),document.removeEventListener("selectstart",this.onSelectStart),document.removeEventListener("keyup",this.onKeyUp),document.documentElement.style.userSelect=this.initialUserSelect},dndDragStart:function(ev){ev.source===this&&this.$emit("dragstart",ev)},dndDragEnd:function(ev){ev.source===this&&this.$emit("dragend",ev)},createDragImage:function(selfTransform){var image;if(this.$slots["drag-image"]){var el=this.$refs["drag-image"]||document.createElement("div");image=1!==el.childElementCount?_createDragImage(el):_createDragImage(el.children.item(0))}else(image=_createDragImage(this.$el)).style.transform=selfTransform;return this.dragClass&&image.classList.add(this.dragClass),image.classList.add("dnd-ghost"),image.__opacity=this.dragImageOpacity,image}},created:function(){dnd.on("dragstart",this.dndDragStart),dnd.on("dragend",this.dndDragEnd)},mounted:function(){this.$el.addEventListener("mousedown",this.onMouseDown),this.$el.addEventListener("touchstart",this.onMouseDown)},beforeUnmount:function(){dnd.off("dragstart",this.dndDragStart),dnd.off("dragend",this.dndDragEnd),this.$el.removeEventListener("mousedown",this.onMouseDown),this.$el.removeEventListener("touchstart",this.onMouseDown)}};_exports.DragMixin=DragMixin;var script$4={name:"Drag",mixins:[DragMixin],props:{tag:{type:[String,Object,Function],default:"div"}},computed:{dynamicSlots:function(){return Object.entries(this.$slots).filter((function(_ref){var key=_slicedToArray(_ref,1)[0];return"drag-image"!==key&&"default"!==key}))}}};_exports.Drag=script$4;var _hoisted_1$2={key:0,ref:"drag-image",class:"__drag-image"};function _dropAllowed(inst){return inst.dragInProgress&&inst.typeAllowed?inst.compatibleMode&&inst.effectiveAcceptsData(inst.dragData,inst.dragType):null}function _doDrop(inst,event){inst.$emit("drop",event),event.source.$emit(inst.mode,event)}function _candidate(inst,type){return inst.effectiveAcceptsType(type)}script$4.render=function(_ctx,_cache,$props,$setup,$data,$options){return(0,_vue.openBlock)(),(0,_vue.createBlock)((0,_vue.resolveDynamicComponent)($props.tag),{class:(0,_vue.normalizeClass)(_ctx.cssClasses)},(0,_vue.createSlots)({default:(0,_vue.withCtx)((function(){return[(0,_vue.renderSlot)(_ctx.$slots,"default",(0,_vue.normalizeProps)((0,_vue.guardReactiveProps)(_ctx.$slots.default||{}))),_ctx.dragInitialised?((0,_vue.openBlock)(),(0,_vue.createElementBlock)("div",_hoisted_1$2,[(0,_vue.renderSlot)(_ctx.$slots,"drag-image")],512)):(0,_vue.createCommentVNode)("v-if",!0)]})),_:2},[(0,_vue.renderList)($options.dynamicSlots,(function(_ref3){var _ref4=_slicedToArray(_ref3,2),slot=_ref4[0],args=_ref4[1];return{name:slot,fn:(0,_vue.withCtx)((function(){return[(0,_vue.renderSlot)(_ctx.$slots,slot,(0,_vue.normalizeProps)((0,_vue.guardReactiveProps)(args)))]}))}}))]),1032,["class"])},script$4.__scopeId="data-v-f87407ce";var DropMixin={mixins:[DragAwareMixin],props:{acceptsType:{type:[String,Array,Function],default:null},acceptsData:{type:Function,default:function(){return!0}},mode:{type:String,default:"copy"},dragImageOpacity:{type:Number,default:.7}},emits:["dragover","dragenter","dragleave","dragend","drop"],data:function(){return{isDrop:!0}},computed:{compatibleMode:function(){return!!this.dragInProgress||null},dropIn:function(){return this.dragInProgress?this.dragTop===this:null},typeAllowed:function(){return this.dragInProgress?this.effectiveAcceptsType(this.dragType):null},dropAllowed:function(){return _dropAllowed(this)},cssClasses:function(){var clazz={"dnd-drop":!0};return null!==this.dropIn&&(clazz["drop-in"]=this.dropIn,clazz["drop-out"]=!this.dropIn),null!==this.typeAllowed&&(clazz["type-allowed"]=this.typeAllowed,clazz["type-forbidden"]=!this.typeAllowed),null!==this.dropAllowed&&(clazz["drop-allowed"]=this.dropAllowed,clazz["drop-forbidden"]=!this.dropAllowed),clazz}},methods:{effectiveAcceptsType:function(type){return null===this.acceptsType||("string"==typeof this.acceptsType||"number"==typeof this.acceptsType?this.acceptsType===type:"object"===_typeof(this.acceptsType)&&Array.isArray(this.acceptsType)?this.acceptsType.includes(type):this.acceptsType(type))},effectiveAcceptsData:function(data,type){return this.acceptsData(data,type)},onDragPositionChanged:function(event){this===event.top&&this.$emit("dragover",event)},onDragTopChanged:function(event){this===event.top&&this.$emit("dragenter",event),this===event.previousTop&&this.$emit("dragleave",event)},onDragEnd:function(event){this===event.top&&this.$emit("dragend",event)},onDrop:function(event){this.dropIn&&this.compatibleMode&&this.dropAllowed&&this.doDrop(event)},doDrop:function(event){_doDrop(this,event)},candidate:function(type){return _candidate(this,type)},createDragImage:function(){var image="source";if(this.$refs["drag-image"]){var el=this.$refs["drag-image"];(image=1!==el.childElementCount?_createDragImage(el):_createDragImage(el.children.item(0))).__opacity=this.dragImageOpacity,image.classList.add("dnd-ghost")}return image},onDnDMove:function(e){dnd.mouseMove(e,this)}},created:function(){dnd.on("dragpositionchanged",this.onDragPositionChanged),dnd.on("dragtopchanged",this.onDragTopChanged),dnd.on("drop",this.onDrop),dnd.on("dragend",this.onDragEnd)},mounted:function(){this.$el.addEventListener("easy-dnd-move",this.onDnDMove)},beforeUnmount:function(){this.$el.removeEventListener("easy-dnd-move",this.onDnDMove),dnd.off("dragpositionchanged",this.onDragPositionChanged),dnd.off("dragtopchanged",this.onDragTopChanged),dnd.off("drop",this.onDrop),dnd.off("dragend",this.onDragEnd)}};_exports.DropMixin=DropMixin;var script$3={name:"Drop",mixins:[DropMixin],props:{tag:{type:[String,Object,Function],default:"div"}},computed:{dynamicSlots:function(){return Object.entries(this.$slots).filter((function(_ref5){var key=_slicedToArray(_ref5,1)[0];return"drag-image"!==key&&"default"!==key}))},showDragImage:function(){return this.dragInProgress&&this.typeAllowed&&!!this.$slots["drag-image"]}}};_exports.Drop=script$3;var _hoisted_1$1={key:0,ref:"drag-image",class:"__drag-image"};script$3.render=function(_ctx,_cache,$props,$setup,$data,$options){return(0,_vue.openBlock)(),(0,_vue.createBlock)((0,_vue.resolveDynamicComponent)($props.tag),{class:(0,_vue.normalizeClass)(_ctx.cssClasses)},(0,_vue.createSlots)({default:(0,_vue.withCtx)((function(){return[(0,_vue.renderSlot)(_ctx.$slots,"default",(0,_vue.normalizeProps)((0,_vue.guardReactiveProps)(_ctx.$slots.default||{}))),$options.showDragImage?((0,_vue.openBlock)(),(0,_vue.createElementBlock)("div",_hoisted_1$1,[(0,_vue.renderSlot)(_ctx.$slots,"drag-image",{type:_ctx.dragType,data:_ctx.dragData})],512)):(0,_vue.createCommentVNode)("v-if",!0)]})),_:2},[(0,_vue.renderList)($options.dynamicSlots,(function(_ref7){var _ref8=_slicedToArray(_ref7,2),slot=_ref8[0],args=_ref8[1];return{name:slot,fn:(0,_vue.withCtx)((function(){return[(0,_vue.renderSlot)(_ctx.$slots,slot,(0,_vue.normalizeProps)((0,_vue.guardReactiveProps)(args)))]}))}}))]),1032,["class"])},script$3.__scopeId="data-v-12a39e52";var script$2={name:"DropMask",mixins:[DragAwareMixin],props:{tag:{type:[String,Object,Function],default:"div"}},data:function(){return{isDropMask:!0}},mounted:function(){this.$el.addEventListener("easy-dnd-move",this.onDndMove)},beforeUnmount:function(){this.$el.removeEventListener("easy-dnd-move",this.onDndMove)},methods:{createDragImage:function(){return"source"},onDndMove:function(e){dnd.mouseMove(e,this)}}};_exports.DropMask=script$2,script$2.render=function(_ctx,_cache,$props,$setup,$data,$options){return(0,_vue.openBlock)(),(0,_vue.createBlock)((0,_vue.resolveDynamicComponent)($props.tag),null,(0,_vue.createSlots)({_:2},[(0,_vue.renderList)(_ctx.$slots,(function(args,slot){return{name:slot,fn:(0,_vue.withCtx)((function(){return[(0,_vue.renderSlot)(_ctx.$slots,slot,(0,_vue.normalizeProps)((0,_vue.guardReactiveProps)(args)))]}))}}))]),1024)};var script$1={name:"DragFeedback"};_exports.DragFeedback=script$1;var _hoisted_1={class:"DragFeedback"};script$1.render=function(_ctx,_cache,$props,$setup,$data,$options){return(0,_vue.openBlock)(),(0,_vue.createElementBlock)("div",_hoisted_1,[(0,_vue.renderSlot)(_ctx.$slots,"default")])};var Grid=function(){function Grid(collection,upToIndex,direction,fromIndex){_classCallCheck(this,Grid),_defineProperty(this,"reference",void 0),_defineProperty(this,"referenceOriginalPosition",void 0),_defineProperty(this,"magnets",[]),this.reference=collection.item(0).parentNode,this.referenceOriginalPosition={x:this.reference.getBoundingClientRect().left-this.reference.scrollLeft,y:this.reference.getBoundingClientRect().top-this.reference.scrollTop};var _step2,index=0,_iterator2=_createForOfIteratorHelper(collection);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var child=_step2.value;if(index>upToIndex)break;var rect=child.getBoundingClientRect(),hasNestedDrop=child.classList.contains("dnd-drop")||child.getElementsByClassName("dnd-drop").length>0,horizontal=!1;if(hasNestedDrop){if("auto"===direction)throw"Easy-DnD error : a drop list is missing one of these attributes : 'row' or 'column'.";horizontal="row"===direction}null===fromIndex?this.magnets.push(hasNestedDrop?this.before(rect,horizontal):this.center(rect)):this.magnets.push(hasNestedDrop?(fromIndex1:!!_dropAllowed(this)&&(null===this.forbiddenKeys||null===this.feedbackKey||!this.forbiddenKeys.includes(this.feedbackKey)):null},itemsBeforeFeedback:function(){return 0===this.closestIndex?[]:this.items.slice(0,this.closestIndex)},itemsAfterFeedback:function(){return this.closestIndex===this.items.length?[]:this.items.slice(this.closestIndex)},itemsBeforeReorderingFeedback:function(){return this.closestIndex<=this.fromIndex?this.items.slice(0,this.closestIndex):this.items.slice(0,this.closestIndex+1)},itemsAfterReorderingFeedback:function(){return this.closestIndex<=this.fromIndex?this.items.slice(this.closestIndex):this.items.slice(this.closestIndex+1)},reorderedItems:function(){var toIndex=this.closestIndex,reordered=_toConsumableArray(this.items),temp=reordered[this.fromIndex];return reordered.splice(this.fromIndex,1),reordered.splice(toIndex,0,temp),reordered},clazz:function(){return _objectSpread({"drop-list":!0,reordering:!0===this.reordering,inserting:!1===this.reordering},!1===this.reordering?this.cssClasses:{"dnd-drop":!0})},showDragFeedback:function(){return this.dragInProgress&&this.typeAllowed&&!this.reordering},showInsertingDragImage:function(){return this.dragInProgress&&this.typeAllowed&&!this.reordering&&!!this.$slots["drag-image"]},showReorderingDragImage:function(){return this.dragInProgress&&this.reordering&&!!this.$slots["reordering-drag-image"]},hasReorderingFeedback:function(){return!!this.$slots["reordering-feedback"]},hasEmptySlot:function(){return!!this.$slots.empty}},created:function(){dnd.on("dragstart",this.onDragStart),dnd.on("dragend",this.onDragEnd)},beforeUnmount:function(){dnd.off("dragstart",this.onDragStart),dnd.off("dragend",this.onDragEnd)},methods:{refresh:function(){var _this4=this;this.$nextTick((function(){_this4.grid=_this4.computeInsertingGrid(),_this4.feedbackKey=_this4.computeFeedbackKey(),_this4.forbiddenKeys=_this4.computeForbiddenKeys()}))},onDragStart:function(event){this.candidate(dnd.type)&&(this.reordering?(this.fromIndex=Array.prototype.indexOf.call(event.source.$el.parentElement.children,event.source.$el),this.grid=this.computeReorderingGrid()):this.refresh())},onDragEnd:function(){this.fromIndex=null,this.feedbackKey=null,this.forbiddenKeys=null,this.grid=null},doDrop:function(event){this.reordering?this.fromIndex!==this.closestIndex&&this.$emit("reorder",new ReorderEvent(this.fromIndex,this.closestIndex)):(_doDrop(this,event),this.$emit("insert",new InsertEvent(event.type,event.data,this.closestIndex)))},candidate:function(type){return _candidate(this,type)||this.reordering},computeForbiddenKeys:function(){return(this.noAnimations?[]:this.$refs.component.$slots.default()).map((function(vn){return vn.key})).filter((function(k){return!!k&&"drag-image"!==k&&"drag-feedback"!==k}))},computeFeedbackKey:function(){return this.$refs.feedback.$slots.default()[0].key},computeInsertingGrid:function(){if(this.$refs.feedback.$el.children.length<1)return null;var clone=this.$refs.feedback.$el.children[0].cloneNode(!0),tg=this.$el;tg.children.length>this.items.length?tg.insertBefore(clone,tg.children[this.items.length]):tg.appendChild(clone);var grid=new Grid(tg.children,this.items.length,this.direction,null);return tg.removeChild(clone),grid},computeReorderingGrid:function(){return new Grid(this.$el.children,this.items.length-1,this.direction,this.fromIndex)},createDragImage:function(){var image;if(this.$refs["drag-image"]){var el=this.$refs["drag-image"],clone=(1!==el.childElementCount?el:el.children.item(0)).cloneNode(!0),tg=this.$el;tg.appendChild(clone),image=_createDragImage(clone),tg.removeChild(clone),image.__opacity=this.dragImageOpacity,image.classList.add("dnd-ghost")}else image="source";return image}},render:function(){var _this5=this;if(!this.$slots.item)throw'The "Item" slot must be defined to use DropList';if(!this.$slots.feedback)throw'The "Feedback" slot must be defined to use DropList';var defaultArr=[];if(this.dropIn&&this.dropAllowed)if(this.reordering)if(this.hasReorderingFeedback){var itemsReorderingBefore=this.itemsBeforeReorderingFeedback.map((function(item,index){return _this5.$slots.item({item:item,index:index,reorder:!1})[0]}));itemsReorderingBefore.length>0&&(defaultArr=defaultArr.concat(itemsReorderingBefore)),defaultArr.push(this.$slots["reordering-feedback"]({key:"reordering-feedback",item:this.items[this.fromIndex]})[0]);var itemsReorderingAfter=this.itemsAfterReorderingFeedback.map((function(item,index){return _this5.$slots.item({item:item,index:_this5.itemsBeforeReorderingFeedback.length+index,reorder:!1})[0]}));itemsReorderingAfter.length>0&&(defaultArr=defaultArr.concat(itemsReorderingAfter))}else{var reorderedItems=this.reorderedItems.map((function(item,index){return _this5.$slots.item({item:item,index:index,reorder:index===_this5.closestIndex})[0]}));reorderedItems.length>0&&(defaultArr=defaultArr.concat(reorderedItems))}else{var itemsBefore=this.itemsBeforeFeedback.map((function(item,index){return _this5.$slots.item({item:item,index:index,reorder:!1})[0]}));itemsBefore.length>0&&(defaultArr=defaultArr.concat(itemsBefore)),defaultArr.push(this.$slots.feedback({key:"drag-feedback",data:this.dragData,type:this.dragType})[0]);var itemsAfter=this.itemsAfterFeedback.map((function(item,index){return _this5.$slots.item({item:item,index:_this5.itemsBeforeFeedback.length+index,reorder:!1})[0]}));itemsAfter.length>0&&(defaultArr=defaultArr.concat(itemsAfter))}else{var defaultItems=this.items.map((function(item,index){return _this5.$slots.item({item:item,index:index,reorder:!1})[0]}));defaultItems.length>0?defaultArr=defaultArr.concat(defaultItems):this.hasEmptySlot&&defaultArr.push(this.$slots.empty()[0])}return this.showDragFeedback&&defaultArr.push((0,_vue.h)(script$1,{class:"__feedback",ref:"feedback",key:"drag-feedback"},{default:function(){return _this5.$slots.feedback({type:_this5.dragType,data:_this5.dragData})[0]}})),this.showReorderingDragImage&&defaultArr.push((0,_vue.h)("div",{class:"__drag-image",ref:"drag-image",key:"reordering-drag-image"},{default:function(){return _this5.$slots["reordering-drag-image"]({item:_this5.items[_this5.fromIndex]})[0]}})),this.showInsertingDragImage&&defaultArr.push((0,_vue.h)("div",{class:"__drag-image",ref:"drag-image",key:"inserting-drag-image"},{default:function(){return _this5.$slots["drag-image"]({type:_this5.dragType,data:_this5.dragData})[0]}})),(0,_vue.h)(this.rootTag,_objectSpread({ref:"component",class:this.clazz},this.rootProps),{default:function(){return defaultArr}})}};_exports.DropList=script,script.__scopeId="data-v-230f65e3";var DragImagesManager=function(){function DragImagesManager(){_classCallCheck(this,DragImagesManager),_defineProperty(this,"selfTransform",null),_defineProperty(this,"clones",null),_defineProperty(this,"source",null),_defineProperty(this,"sourcePos",null),_defineProperty(this,"sourceClone",null),dnd.on("dragstart",this.onDragStart.bind(this)),dnd.on("dragtopchanged",this.onDragTopChanged.bind(this)),dnd.on("dragpositionchanged",this.onDragPositionChanged.bind(this)),dnd.on("dragend",this.onDragEnd.bind(this))}return _createClass(DragImagesManager,[{key:"onDragStart",value:function(event){this.cleanUp(),this.sourcePos={x:event.source.$el.getBoundingClientRect().left,y:event.source.$el.getBoundingClientRect().top},this.selfTransform="translate(-"+(event.position.x-this.sourcePos.x)+"px, -"+(event.position.y-this.sourcePos.y)+"px)",this.clones=new Map,this.source=event.source}},{key:"onDragEnd",value:function(event){var _this6=this;(0,_vue.nextTick)().then((function(){if(!event.success&&_this6.source&&_this6.source.goBack){var img=_this6.switch(null);window.requestAnimationFrame((function(){img.style.transition="all 0.5s",window.requestAnimationFrame((function(){img.style.left=_this6.sourcePos.x+"px",img.style.top=_this6.sourcePos.y+"px",img.style.transform="translate(0,0)";img.addEventListener("transitionend",(function handler(){_this6.cleanUp(),img.removeEventListener("transitionend",handler)}))}))}))}else _this6.cleanUp()}))}},{key:"cleanUp",value:function(){this.clones&&this.clones.forEach((function(clone){clone.parentNode===document.body&&document.body.removeChild(clone)})),null!==this.sourceClone&&this.sourceClone.parentNode===document.body&&document.body.removeChild(this.sourceClone),this.selfTransform=null,this.clones=null,this.source=null,this.sourceClone=null,this.sourcePos=null}},{key:"onDragTopChanged",value:function(event){this.switch(event.top)}},{key:"switch",value:function(top){var activeClone;if(this.clones.forEach((function(clone){clone.style.opacity="0"})),this.sourceClone&&(this.sourceClone.style.opacity="0"),null===top)activeClone=this.getSourceClone();else{if(!this.clones.has(top)){var clone=top.createDragImage(this.selfTransform);"source"===clone?clone=this.getSourceClone():null!==clone&&(clone.style.opacity="0",document.body.appendChild(clone)),this.clones.set(top,clone)}activeClone=this.clones.get(top)}return null!==activeClone&&(activeClone.offsetWidth,activeClone.style.opacity=activeClone.__opacity,activeClone.style.visibility="visible"),activeClone}},{key:"getSourceClone",value:function(){return null===this.sourceClone&&(this.sourceClone=this.source.createDragImage(this.selfTransform),this.sourceClone.style.opacity="0",document.body.appendChild(this.sourceClone)),this.sourceClone}},{key:"onDragPositionChanged",value:function(){this.clones.forEach((function(clone){clone.style.left=dnd.position.x+"px",clone.style.top=dnd.position.y+"px"})),this.sourceClone&&(this.sourceClone.style.left=dnd.position.x+"px",this.sourceClone.style.top=dnd.position.y+"px")}}]),DragImagesManager}();_exports.DragImagesManager=DragImagesManager,new DragImagesManager})); +define("local_treestudyplan/vue-easy-dnd/vue-easy-dnd.esm",["exports","./reflect-metadata","./vue-property-decorator"],(function(_exports,_reflectMetadata,_vuePropertyDecorator){function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.ReorderEvent=_exports.InsertEvent=_exports.DropMixin=_exports.DropMask=_exports.DropList=_exports.Drop=_exports.DragMixin=_exports.DragImagesManager=_exports.DragAwareMixin=_exports.Drag=_exports.DnDEvent=void 0,_exports.createDragImage=createDragImage,_exports.dnd=void 0;var _extendStatics=function(d,b){return _extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},_extendStatics(d,b)};function __extends(d,b){function __(){this.constructor=d}_extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var _assign=function(){return _assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r}function __metadata(metadataKey,metadataValue){if("object"===("undefined"==typeof Reflect?"undefined":_typeof(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(metadataKey,metadataValue)}function __values(o){var m="function"==typeof Symbol&&o[Symbol.iterator],i=0;return m?m.call(o):{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}function __read(o,n){var m="function"==typeof Symbol&&o[Symbol.iterator];if(!m)return o;var r,e,i=m.call(o),ar=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)ar.push(r.value)}catch(error){e={error:error}}finally{try{r&&!r.done&&(m=i.return)&&m.call(i)}finally{if(e)throw e.error}}return ar}function __spread(){for(var ar=[],i=0;iedgeRight,isInTopEdge=viewportYedgeBottom;if(!(isInLeftEdge||isInRightEdge||isInTopEdge||isInBottomEdge))return cancelScrollAction(),!1;var documentWidth=Math.max(container.scrollWidth,container.offsetWidth,container.clientWidth),documentHeight=Math.max(container.scrollHeight,container.offsetHeight,container.clientHeight),maxScrollX=documentWidth-viewportWidth,maxScrollY=documentHeight-viewportHeight;return function checkForWindowScroll(){cancelScrollAction(),function(){var currentScrollX=container.scrollLeft,currentScrollY=container.scrollTop;isBody&&(currentScrollX=window.pageXOffset,currentScrollY=window.pageYOffset);var canScrollUp=currentScrollY>0,canScrollDown=currentScrollY0,canScrollRight=currentScrollX0&&window.navigator&&window.navigator.vibrate&&window.navigator.vibrate(this.vibration)},DragMixin.prototype.onMouseDown=function(e){var target,goodButton,_this=this;if("mousedown"===e.type){var mouse=e;target=e.target,goodButton=1===mouse.buttons}else{target=(touch=e).touches[0].target,goodButton=!0}if(!this.disabled&&null===this.downEvent&&goodButton&&(!target.matches(".dnd-no-drag, .dnd-no-drag *")&&(!this.handle||target.matches(this.handle+", "+this.handle+" *")))){if(this.scrollContainer=scrollparent(target),this.initialUserSelect=document.body.style.userSelect,document.documentElement.style.userSelect="none",this.dragStarted=!1,this.downEvent=e,"mousedown"===this.downEvent.type){mouse=event;this.startPosition={x:mouse.clientX,y:mouse.clientY}}else{var touch=event;this.startPosition={x:touch.touches[0].clientX,y:touch.touches[0].clientY}}this.delay?(this.dragInitialised=!1,clearTimeout(this.delayTimer),this.delayTimer=setTimeout((function(){_this.dragInitialised=!0,_this.performVibration()}),this.delay)):(this.dragInitialised=!0,this.performVibration()),document.addEventListener("click",this.onMouseClick,!0),document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("touchend",this.onMouseUp),document.addEventListener("selectstart",this.onSelectStart),document.addEventListener("keyup",this.onKeyUp),setTimeout((function(){document.addEventListener("mousemove",_this.onMouseMove),document.addEventListener("touchmove",_this.onMouseMove,{passive:!1}),document.addEventListener("easy-dnd-move",_this.onEasyDnDMove)}),0),e.stopPropagation()}},DragMixin.prototype.onMouseClick=function(e){if(this.ignoreNextClick)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.ignoreNextClick=!1,!1},DragMixin.prototype.onMouseMove=function(e){if(null!==this.downEvent&&("touchstart"!==this.downEvent.type||"mousemove"!==e.type)){var target,x,y;if("touchmove"===e.type){var touch=e;if(x=touch.touches[0].clientX,y=touch.touches[0].clientY,!(target=document.elementFromPoint(x,y)))return}else{var mouse=e;x=mouse.clientX,y=mouse.clientY,target=mouse.target}var dist=Math.sqrt(Math.pow(this.startPosition.x-x,2)+Math.pow(this.startPosition.y-y,2));if(!this.dragStarted&&dist>this.delta&&(this.dragInitialised?(this.ignoreNextClick=!0,this.dragStarted=!0,dnd.startDrag(this,this.downEvent,this.startPosition.x,this.startPosition.y,this.type,this.data),document.documentElement.classList.add("drag-in-progress")):clearTimeout(this.delayTimer)),this.dragStarted){var currEdgeSize=this.dragTop&&void 0!==this.dragTop.$props.scrollingEdgeSize?this.dragTop.$props.scrollingEdgeSize:this.scrollingEdgeSize;if(currEdgeSize)performEdgeScroll(0,this.dragTop?scrollparent(this.dragTop.$el):this.scrollContainer,x,y,currEdgeSize);else cancelScrollAction();var custom=new CustomEvent("easy-dnd-move",{bubbles:!0,cancelable:!0,detail:{x:x,y:y,native:e}});target.dispatchEvent(custom)}this.dragInitialised&&e.cancelable&&e.preventDefault()}},DragMixin.prototype.onEasyDnDMove=function(e){dnd.mouseMove(e,null)},DragMixin.prototype.onMouseUp=function(e){var _this=this;"touchstart"===this.downEvent.type&&"mouseup"===e.type||setTimeout((function(){_this.cancelDragActions(),_this.dragStarted&&dnd.stopDrag(e),_this.finishDrag()}),0)},DragMixin.prototype.onKeyUp=function(e){var _this=this;"Escape"===e.key&&(this.cancelDragActions(),setTimeout((function(){dnd.cancelDrag(e),_this.finishDrag()}),0))},DragMixin.prototype.cancelDragActions=function(){this.dragInitialised=!1,clearTimeout(this.delayTimer),cancelScrollAction()},DragMixin.prototype.finishDrag=function(){this.downEvent=null,this.scrollContainer=null,this.dragStarted&&document.documentElement.classList.remove("drag-in-progress"),document.removeEventListener("click",this.onMouseClick,!0),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("easy-dnd-move",this.onEasyDnDMove),document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("touchend",this.onMouseUp),document.removeEventListener("selectstart",this.onSelectStart),document.removeEventListener("keyup",this.onKeyUp),document.documentElement.style.userSelect=this.initialUserSelect},DragMixin.prototype.dndDragStart=function(ev){ev.source===this&&this.$emit("dragstart",ev)},DragMixin.prototype.dndDragEnd=function(ev){ev.source===this&&this.$emit("dragend",ev)},DragMixin.prototype.created=function(){dnd.on("dragstart",this.dndDragStart),dnd.on("dragend",this.dndDragEnd)},DragMixin.prototype.mounted=function(){this.$el.addEventListener("mousedown",this.onMouseDown),this.$el.addEventListener("touchstart",this.onMouseDown)},DragMixin.prototype.beforeDestroy=function(){dnd.off("dragstart",this.dndDragStart),dnd.off("dragend",this.dndDragEnd),this.$el.removeEventListener("mousedown",this.onMouseDown),this.$el.removeEventListener("touchstart",this.onMouseDown)},Object.defineProperty(DragMixin.prototype,"cssClasses",{get:function(){var clazz={"dnd-drag":!0};return this.disabled?clazz:_assign(_assign({},clazz),{"drag-source":this.dragInProgress&&this.dragSource===this,"drag-mode-copy":"copy"===this.currentDropMode,"drag-mode-cut":"cut"===this.currentDropMode,"drag-mode-reordering":"reordering"===this.currentDropMode,"drag-no-handle":!this.handle})},enumerable:!0,configurable:!0}),Object.defineProperty(DragMixin.prototype,"currentDropMode",{get:function(){return this.dragInProgress&&this.dragSource===this&&this.dragTop&&this.dragTop.dropAllowed?this.dragTop.reordering?"reordering":this.dragTop.mode:null},enumerable:!0,configurable:!0}),DragMixin.prototype.createDragImage=function(selfTransform){var image;if(this.$scopedSlots["drag-image"]){var el=this.$refs["drag-image"]||document.createElement("div");image=1!==el.childElementCount?createDragImage(el):createDragImage(el.children.item(0))}else(image=createDragImage(this.$el)).style.transform=selfTransform;return this.dragClass&&image.classList.add(this.dragClass),image.classList.add("dnd-ghost"),image.__opacity=this.dragImageOpacity,image},__decorate([(0,_vuePropertyDecorator.Prop)({default:null,type:null}),__metadata("design:type",String)],DragMixin.prototype,"type",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:null,type:null}),__metadata("design:type",Object)],DragMixin.prototype,"data",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:.7,type:Number}),__metadata("design:type",Object)],DragMixin.prototype,"dragImageOpacity",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:!1,type:Boolean}),__metadata("design:type",Boolean)],DragMixin.prototype,"disabled",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:!1,type:Boolean}),__metadata("design:type",Boolean)],DragMixin.prototype,"goBack",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({required:!1,type:String}),__metadata("design:type",String)],DragMixin.prototype,"handle",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({type:Number,default:3}),__metadata("design:type",Number)],DragMixin.prototype,"delta",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({type:Number,default:0}),__metadata("design:type",Number)],DragMixin.prototype,"delay",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({type:String,default:null}),__metadata("design:type",String)],DragMixin.prototype,"dragClass",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({type:Number,default:0}),__metadata("design:type",Number)],DragMixin.prototype,"vibration",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({type:Number,default:100}),__metadata("design:type",Number)],DragMixin.prototype,"scrollingEdgeSize",void 0),DragMixin=__decorate([(0,_vuePropertyDecorator.Component)({})],DragMixin)}(DragAwareMixin);_exports.DragMixin=DragMixin;var Drag=function(_super){function Drag(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(Drag,_super),__decorate([(0,_vuePropertyDecorator.Prop)({default:"div",type:[String,Object,Function]}),__metadata("design:type",Object)],Drag.prototype,"tag",void 0),Drag=__decorate([(0,_vuePropertyDecorator.Component)({})],Drag)}(DragMixin);var HEAD,normalizeComponent_1=function(template,style,script,scopeId,isFunctionalTemplate,moduleIdentifier,shadowMode,createInjector,createInjectorSSR,createInjectorShadow){"boolean"!=typeof shadowMode&&(createInjectorSSR=createInjector,createInjector=shadowMode,shadowMode=!1);var hook,options="function"==typeof script?script.options:script;if(template&&template.render&&(options.render=template.render,options.staticRenderFns=template.staticRenderFns,options._compiled=!0,isFunctionalTemplate&&(options.functional=!0)),scopeId&&(options._scopeId=scopeId),moduleIdentifier?(hook=function(context){(context=context||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(context=__VUE_SSR_CONTEXT__),style&&style.call(this,createInjectorSSR(context)),context&&context._registeredComponents&&context._registeredComponents.add(moduleIdentifier)},options._ssrRegister=hook):style&&(hook=shadowMode?function(){style.call(this,createInjectorShadow(this.$root.$options.shadowRoot))}:function(context){style.call(this,createInjector(context))}),hook)if(options.functional){var originalRender=options.render;options.render=function(h,context){return hook.call(context),originalRender(h,context)}}else{var existing=options.beforeCreate;options.beforeCreate=existing?[].concat(existing,hook):[hook]}return script},isOldIE="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var styles={};var browser=function(context){return function(id,style){return function(id,css){var group=isOldIE?css.media||"default":id,style=styles[group]||(styles[group]={ids:new Set,styles:[]});if(!style.ids.has(id)){style.ids.add(id);var code=css.source;if(css.map&&(code+="\n/*# sourceURL="+css.map.sources[0]+" */",code+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(css.map))))+" */"),style.element||(style.element=document.createElement("style"),style.element.type="text/css",css.media&&style.element.setAttribute("media",css.media),void 0===HEAD&&(HEAD=document.head||document.getElementsByTagName("head")[0]),HEAD.appendChild(style.element)),"styleSheet"in style.element)style.styles.push(code),style.element.styleSheet.cssText=style.styles.filter(Boolean).join("\n");else{var index=style.ids.size-1,textNode=document.createTextNode(code),nodes=style.element.childNodes;nodes[index]&&style.element.removeChild(nodes[index]),nodes.length?style.element.insertBefore(textNode,nodes[index]):style.element.appendChild(textNode)}}}(id,style)}},Drag$1=normalizeComponent_1({render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:"component",class:_vm.cssClasses,scopedSlots:_vm._u([_vm._l(_vm.$scopedSlots,(function(_,slot){return{key:slot,fn:function(scope){return[_vm._t(slot,null,null,scope)]}}}))],null,!0)},"component",_vm.$attrs,!1),_vm.$listeners),[_vm._t("default"),_vm._v(" "),_vm._v(" "),_vm.dragInitialised?_c("div",{ref:"drag-image",staticClass:"__drag-image"},[_vm._t("drag-image")],2):_vm._e()],2)},staticRenderFns:[]},(function(inject){inject&&(inject("data-v-fb811e22_0",{source:".drop-allowed.drop-in *{cursor:inherit!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}.drag-no-handle:hover{cursor:move;cursor:grab}",map:void 0,media:void 0}),inject("data-v-fb811e22_1",{source:"html.drag-in-progress *{cursor:move!important;cursor:grabbing!important}",map:void 0,media:void 0}),inject("data-v-fb811e22_2",{source:".__drag-image[data-v-fb811e22]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}",map:void 0,media:void 0}))}),Drag,"data-v-fb811e22",!1,undefined,browser,void 0);_exports.Drag=Drag$1;var DropMixin=function(_super){function DropMixin(){var _this=_super.call(this)||this;return _this.isDrop=!0,_this}return __extends(DropMixin,_super),DropMixin.prototype.effectiveAcceptsType=function(type){return null===this.acceptsType||("string"==typeof this.acceptsType?this.acceptsType===type:"object"===_typeof(this.acceptsType)&&Array.isArray(this.acceptsType)?this.acceptsType.includes(type):this.acceptsType(type))},DropMixin.prototype.effectiveAcceptsData=function(data,type){return this.acceptsData(data,type)},DropMixin.prototype.created=function(){dnd.on("dragpositionchanged",this.onDragPositionChanged),dnd.on("dragtopchanged",this.onDragTopChanged),dnd.on("drop",this.onDrop),dnd.on("dragend",this.onDragEnd)},DropMixin.prototype.beforeDestroy=function(){dnd.off("dragpositionchanged",this.onDragPositionChanged),dnd.off("dragtopchanged",this.onDragTopChanged),dnd.off("drop",this.onDrop),dnd.off("dragend",this.onDragEnd)},DropMixin.prototype.onDragPositionChanged=function(event){this===event.top&&this.$emit("dragover",event)},DropMixin.prototype.onDragTopChanged=function(event){this===event.top&&this.$emit("dragenter",event),this===event.previousTop&&this.$emit("dragleave",event)},DropMixin.prototype.onDragEnd=function(event){this===event.top&&this.$emit("dragend",event)},DropMixin.prototype.onDrop=function(event){this.dropIn&&this.compatibleMode&&this.dropAllowed&&this.doDrop(event)},DropMixin.prototype.doDrop=function(event){this.$emit("drop",event),event.source.$emit(this.mode,event)},DropMixin.prototype.mounted=function(){var el=this.$el,comp=this;el.addEventListener("easy-dnd-move",(function(e){dnd.mouseMove(e,comp)}))},Object.defineProperty(DropMixin.prototype,"compatibleMode",{get:function(){return this.dragInProgress?"copy"===this.mode||dnd.sourceListeners.hasOwnProperty(this.mode):null},enumerable:!0,configurable:!0}),Object.defineProperty(DropMixin.prototype,"dropIn",{get:function(){return this.dragInProgress?this.dragTop===this:null},enumerable:!0,configurable:!0}),Object.defineProperty(DropMixin.prototype,"typeAllowed",{get:function(){return this.dragInProgress?this.effectiveAcceptsType(this.dragType):null},enumerable:!0,configurable:!0}),Object.defineProperty(DropMixin.prototype,"dropAllowed",{get:function(){return this.dragInProgress&&this.typeAllowed?this.compatibleMode&&this.effectiveAcceptsData(this.dragData,this.dragType):null},enumerable:!0,configurable:!0}),Object.defineProperty(DropMixin.prototype,"cssClasses",{get:function(){var clazz={"dnd-drop":!0};return null!==this.dropIn&&(clazz["drop-in"]=this.dropIn,clazz["drop-out"]=!this.dropIn),null!==this.typeAllowed&&(clazz["type-allowed"]=this.typeAllowed,clazz["type-forbidden"]=!this.typeAllowed),null!==this.dropAllowed&&(clazz["drop-allowed"]=this.dropAllowed,clazz["drop-forbidden"]=!this.dropAllowed),clazz},enumerable:!0,configurable:!0}),Object.defineProperty(DropMixin.prototype,"cssStyle",{get:function(){return{}},enumerable:!0,configurable:!0}),DropMixin.prototype.candidate=function(type,data,source){return this.effectiveAcceptsType(type)},DropMixin.prototype.createDragImage=function(){var image;if(this.$refs["drag-image"]){var el=this.$refs["drag-image"];(image=1!==el.childElementCount?createDragImage(el):createDragImage(el.children.item(0))).__opacity=this.dragImageOpacity,image.classList.add("dnd-ghost")}else image="source";return image},__decorate([(0,_vuePropertyDecorator.Prop)({default:function(){return function(){return!0}},type:[String,Array,Function]}),__metadata("design:type",Object)],DropMixin.prototype,"acceptsType",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:function(){return!0},type:Function}),__metadata("design:type",Object)],DropMixin.prototype,"acceptsData",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:"copy"}),__metadata("design:type",String)],DropMixin.prototype,"mode",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:.7,type:Number}),__metadata("design:type",Object)],DropMixin.prototype,"dragImageOpacity",void 0),DropMixin=__decorate([(0,_vuePropertyDecorator.Component)({}),__metadata("design:paramtypes",[])],DropMixin)}(DragAwareMixin);_exports.DropMixin=DropMixin;var Drop=function(_super){function Drop(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(Drop,_super),Object.defineProperty(Drop.prototype,"showDragImage",{get:function(){return this.dragInProgress&&this.typeAllowed&&this.$scopedSlots["drag-image"]},enumerable:!0,configurable:!0}),__decorate([(0,_vuePropertyDecorator.Prop)({default:"div",type:[String,Object,Function]}),__metadata("design:type",Object)],Drop.prototype,"tag",void 0),Drop=__decorate([(0,_vuePropertyDecorator.Component)({})],Drop)}(DropMixin),Drop$1=normalizeComponent_1({render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:"component",class:_vm.cssClasses,style:_vm.cssStyle,scopedSlots:_vm._u([_vm._l(_vm.$scopedSlots,(function(_,slot){return{key:slot,fn:function(scope){return[_vm._t(slot,null,null,scope)]}}}))],null,!0)},"component",_vm.$attrs,!1),_vm.$listeners),[_vm._t("default"),_vm._v(" "),_vm._v(" "),_vm.showDragImage?_c("div",{ref:"drag-image",staticClass:"__drag-image"},[_vm._t("drag-image",null,{type:_vm.dragType,data:_vm.dragData})],2):_vm._e()],2)},staticRenderFns:[]},(function(inject){inject&&(inject("data-v-1d9169a9_0",{source:".drop-allowed.drop-in,.drop-allowed.drop-in *{cursor:pointer!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}",map:void 0,media:void 0}),inject("data-v-1d9169a9_1",{source:".__drag-image[data-v-1d9169a9]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}",map:void 0,media:void 0}))}),Drop,"data-v-1d9169a9",!1,undefined,browser,void 0);_exports.Drop=Drop$1;var DropMask=function(_super){function DropMask(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.isDropMask=!0,_this}return __extends(DropMask,_super),DropMask.prototype.mounted=function(){var el=this.$el,comp=this;el.addEventListener("easy-dnd-move",(function(e){dnd.mouseMove(e,comp)}))},DropMask.prototype.createDragImage=function(){return"source"},__decorate([(0,_vuePropertyDecorator.Prop)({default:"div",type:[String,Object,Function]}),__metadata("design:type",Object)],DropMask.prototype,"tag",void 0),DropMask=__decorate([(0,_vuePropertyDecorator.Component)({})],DropMask)}(DragAwareMixin),DropMask$1=normalizeComponent_1({render:function(){var _vm=this,_h=_vm.$createElement;return(_vm._self._c||_h)(_vm.tag,_vm._g(_vm._b({tag:"component",scopedSlots:_vm._u([_vm._l(_vm.$scopedSlots,(function(_,slot){return{key:slot,fn:function(scope){return[_vm._t(slot,null,null,scope)]}}}))],null,!0)},"component",_vm.$attrs,!1),_vm.$listeners),[_vm._t("default")],2)},staticRenderFns:[]},undefined,DropMask,undefined,!1,undefined,void 0,void 0);_exports.DropMask=DropMask$1;var DragImagesManager=function(_super){function DragImagesManager(){var _this=_super.call(this)||this;return _this.selfTransform=null,_this.clones=null,_this.source=null,_this.sourcePos=null,_this.sourceClone=null,dnd.on("dragstart",_this.onDragStart),dnd.on("dragtopchanged",_this.onDragTopChanged),dnd.on("dragpositionchanged",_this.onDragPositionChanged),dnd.on("dragend",_this.onDragEnd),_this}return __extends(DragImagesManager,_super),DragImagesManager.prototype.onDragStart=function(event){this.cleanUp(),this.sourcePos={x:event.source.$el.getBoundingClientRect().left,y:event.source.$el.getBoundingClientRect().top},this.selfTransform="translate(-"+(event.position.x-this.sourcePos.x)+"px, -"+(event.position.y-this.sourcePos.y)+"px)",this.clones=new Map,this.source=event.source},DragImagesManager.prototype.onDragEnd=function(event){var _this=this;_vuePropertyDecorator.Vue.nextTick((function(){if(!event.success&&_this.source&&_this.source.goBack){var img_1=_this.switch(null);window.requestAnimationFrame((function(){img_1.style.transition="all 0.5s",window.requestAnimationFrame((function(){img_1.style.left=_this.sourcePos.x+"px",img_1.style.top=_this.sourcePos.y+"px",img_1.style.transform="translate(0,0)";img_1.addEventListener("transitionend",(function handler(){_this.cleanUp(),img_1.removeEventListener("transitionend",handler)}))}))}))}else _this.cleanUp()}))},DragImagesManager.prototype.cleanUp=function(){this.clones&&this.clones.forEach((function(clone){clone.parentNode===document.body&&document.body.removeChild(clone)})),null!==this.sourceClone&&this.sourceClone.parentNode===document.body&&document.body.removeChild(this.sourceClone),this.selfTransform=null,this.clones=null,this.source=null,this.sourceClone=null,this.sourcePos=null},DragImagesManager.prototype.onDragTopChanged=function(event){this.switch(event.top)},DragImagesManager.prototype.switch=function(top){var activeClone;if(this.clones.forEach((function(clone){clone.style.opacity="0"})),this.sourceClone&&(this.sourceClone.style.opacity="0"),null===top)activeClone=this.getSourceClone();else{if(!this.clones.has(top)){var clone=top.createDragImage(this.selfTransform);"source"===clone?clone=this.getSourceClone():null!==clone&&(clone.style.opacity="0",document.body.appendChild(clone)),this.clones.set(top,clone)}activeClone=this.clones.get(top)}return null!==activeClone&&(activeClone.offsetWidth,activeClone.style.opacity=activeClone.__opacity,activeClone.style.visibility="visible"),activeClone},DragImagesManager.prototype.getSourceClone=function(){return null===this.sourceClone&&(this.sourceClone=this.source.createDragImage(this.selfTransform),this.sourceClone.style.opacity="0",document.body.appendChild(this.sourceClone)),this.sourceClone},DragImagesManager.prototype.onDragPositionChanged=function(event){this.clones.forEach((function(clone){clone.style.left=dnd.position.x+"px",clone.style.top=dnd.position.y+"px"})),this.sourceClone&&(this.sourceClone.style.left=dnd.position.x+"px",this.sourceClone.style.top=dnd.position.y+"px")},DragImagesManager=__decorate([(0,_vuePropertyDecorator.Component)({}),__metadata("design:paramtypes",[])],DragImagesManager)}(_vuePropertyDecorator.Vue);_exports.DragImagesManager=DragImagesManager,new DragImagesManager;var DragFeedback=function(_super){function DragFeedback(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DragFeedback,_super),DragFeedback=__decorate([(0,_vuePropertyDecorator.Component)({})],DragFeedback)}(_vuePropertyDecorator.Vue),DragFeedback$1=normalizeComponent_1({render:function(){var _h=this.$createElement;return(this._self._c||_h)("div",{staticClass:"DragFeedback"},[this._t("default")],2)},staticRenderFns:[]},undefined,DragFeedback,"data-v-0589f3cb",!1,undefined,void 0,void 0),Grid=function(){function Grid(collection,upToIndex,row,fromIndex){var e_1,_a;this.magnets=[],this.reference=collection.item(0).parentNode,this.referenceOriginalPosition={x:this.reference.getBoundingClientRect().left-this.reference.scrollLeft,y:this.reference.getBoundingClientRect().top-this.reference.scrollTop};var index=0;try{for(var collection_1=__values(collection),collection_1_1=collection_1.next();!collection_1_1.done;collection_1_1=collection_1.next()){var child=collection_1_1.value;if(index>upToIndex)break;var rect=child.getBoundingClientRect(),hasNestedDrop=child.classList.contains("dnd-drop")||child.getElementsByClassName("dnd-drop").length>0,horizontal=null;if(hasNestedDrop){if("auto"===row)throw new Error("Easy-DnD error : a drop list is missing one of these attributes : 'row' or 'column'.");horizontal="row"===row}null===fromIndex?this.magnets.push(hasNestedDrop?this.before(rect,horizontal):this.center(rect)):this.magnets.push(hasNestedDrop?(fromIndex1:!!DropMixin.options.computed.dropAllowed.get.call(this)&&(null!==this.forbiddenKeys&&null!==this.feedbackKey?!this.forbiddenKeys.includes(this.feedbackKey):null):null},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"itemsBeforeFeedback",{get:function(){return 0===this.closestIndex?[]:this.items.slice(0,this.closestIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"itemsAfterFeedback",{get:function(){return this.closestIndex===this.items.length?[]:this.items.slice(this.closestIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"itemsBeforeReorderingFeedback",{get:function(){return this.closestIndex<=this.fromIndex?this.items.slice(0,this.closestIndex):this.items.slice(0,this.closestIndex+1)},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"itemsAfterReorderingFeedback",{get:function(){return this.closestIndex<=this.fromIndex?this.items.slice(this.closestIndex):this.items.slice(this.closestIndex+1)},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"reorderedItems",{get:function(){var toIndex=this.closestIndex,reordered=__spread(this.items),temp=reordered[this.fromIndex];return reordered.splice(this.fromIndex,1),reordered.splice(toIndex,0,temp),reordered},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"clazz",{get:function(){return _assign({"drop-list":!0,reordering:!0===this.reordering,inserting:!1===this.reordering},!1===this.reordering?this.cssClasses:{"dnd-drop":!0})},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"style",{get:function(){return _assign({},!1===this.reordering?this.cssStyle:{})},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"showDragFeedback",{get:function(){return this.dragInProgress&&this.typeAllowed&&!this.reordering},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"showInsertingDragImage",{get:function(){return this.dragInProgress&&this.typeAllowed&&!this.reordering&&this.$scopedSlots.hasOwnProperty("drag-image")},enumerable:!0,configurable:!0}),Object.defineProperty(DropList.prototype,"showReorderingDragImage",{get:function(){return this.dragInProgress&&this.reordering&&this.$scopedSlots.hasOwnProperty("reordering-drag-image")},enumerable:!0,configurable:!0}),DropList.prototype.doDrop=function(event){this.reordering?this.fromIndex!==this.closestIndex&&this.$emit("reorder",new ReorderEvent(this.fromIndex,this.closestIndex)):(DropMixin.options.methods.doDrop.call(this,event),this.$emit("insert",new InsertEvent(event.type,event.data,this.closestIndex)))},DropList.prototype.candidate=function(type,data,source){var _a;return(_a=DropMixin.options.methods.candidate).call.apply(_a,__spread([this],arguments))&&(this.$listeners.hasOwnProperty("insert")||this.$listeners.hasOwnProperty("drop"))||this.reordering},DropList.prototype.computeForbiddenKeys=function(){return(this.noAnimations?[]:this.$children[0].$vnode.context.$children[0].$slots.default).map((function(vn){return vn.key})).filter((function(k){return void 0!==k&&"drag-image"!==k&&"drag-feedback"!==k}))},DropList.prototype.computeFeedbackKey=function(){return this.$refs.feedback.$slots.default[0].key},Object.defineProperty(DropList.prototype,"hasReorderingFeedback",{get:function(){return this.$scopedSlots.hasOwnProperty("reordering-feedback")},enumerable:!0,configurable:!0}),DropList.prototype.computeInsertingGrid=function(){var clone=this.$refs.feedback.$el.children[0].cloneNode(!0),tg=this.$el;tg.children.length>this.items.length?tg.insertBefore(clone,tg.children[this.items.length]):tg.appendChild(clone);var grid=new Grid(tg.children,this.items.length,this.direction,null);return tg.removeChild(clone),grid},DropList.prototype.computeReorderingGrid=function(){var tg=this.$el;return new Grid(tg.children,this.items.length-1,this.direction,this.fromIndex)},DropList.prototype.createDragImage=function(){var image;if(this.$refs["drag-image"]){var el=this.$refs["drag-image"],clone=(1!==el.childElementCount?el:el.children.item(0)).cloneNode(!0),tg=this.$el;tg.appendChild(clone),image=createDragImage(clone),tg.removeChild(clone),image.__opacity=this.dragImageOpacity,image.classList.add("dnd-ghost")}else image="source";return image},__decorate([(0,_vuePropertyDecorator.Prop)({default:"div",type:[String,Object,Function]}),__metadata("design:type",Object)],DropList.prototype,"tag",void 0),__decorate([(0,_vuePropertyDecorator.Prop)(),__metadata("design:type",Array)],DropList.prototype,"items",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:null}),__metadata("design:type",Boolean)],DropList.prototype,"row",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:null,type:Boolean}),__metadata("design:type",Boolean)],DropList.prototype,"column",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({default:!1,type:Boolean}),__metadata("design:type",Boolean)],DropList.prototype,"noAnimations",void 0),__decorate([(0,_vuePropertyDecorator.Prop)({type:Number,default:void 0}),__metadata("design:type",Number)],DropList.prototype,"scrollingEdgeSize",void 0),DropList=__decorate([(0,_vuePropertyDecorator.Component)({components:{DragFeedback:DragFeedback$1},inheritAttrs:!1})],DropList)}(DropMixin),DropList$1=normalizeComponent_1({render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c(_vm.rootTag,_vm._g(_vm._b({tag:"component",class:_vm.clazz,style:_vm.style},"component",_vm.rootProps,!1),_vm.rootListeners),[_vm.dropIn&&_vm.dropAllowed?[_vm.reordering?[_vm.hasReorderingFeedback?[_vm._l(_vm.itemsBeforeReorderingFeedback,(function(item,index){return _vm._t("item",null,{item:item,index:index})})),_vm._v(" "),_vm._t("reordering-feedback",null,{item:_vm.items[_vm.fromIndex]}),_vm._v(" "),_vm._l(_vm.itemsAfterReorderingFeedback,(function(item,index){return _vm._t("item",null,{item:item,index:_vm.itemsBeforeReorderingFeedback.length+index})}))]:[_vm._l(_vm.reorderedItems,(function(item,index){return _vm._t("item",null,{item:item,index:index,reorder:index===_vm.closestIndex})}))]]:[_vm._l(_vm.itemsBeforeFeedback,(function(item,index){return _vm._t("item",null,{item:item,reorder:!1,index:index})})),_vm._v(" "),_vm._t("feedback",null,{data:_vm.dragData,type:_vm.dragType}),_vm._v(" "),_vm._l(_vm.itemsAfterFeedback,(function(item,index){return _vm._t("item",null,{item:item,reorder:!1,index:_vm.itemsBeforeFeedback.length+index})}))]]:[_vm._l(_vm.items,(function(item,index){return _vm._t("item",null,{item:item,reorder:!1,index:index})})),_vm._v(" "),_vm.items.length<1?_vm._t("empty"):_vm._e()],_vm._v(" "),_vm.showDragFeedback?_c("drag-feedback",{key:"drag-feedback",ref:"feedback",staticClass:"__feedback"},[_vm._t("feedback",null,{data:_vm.dragData,type:_vm.dragType})],2):_vm._e(),_vm._v(" "),_vm.showInsertingDragImage?_c("div",{key:"inserting-drag-image",ref:"drag-image",staticClass:"__drag-image"},[_vm._t("drag-image",null,{type:_vm.dragType,data:_vm.dragData})],2):_vm._e(),_vm._v(" "),_vm.showReorderingDragImage?_c("div",{key:"reordering-drag-image",ref:"drag-image",staticClass:"__drag-image"},[_vm._t("reordering-drag-image",null,{item:_vm.items[_vm.fromIndex]})],2):_vm._e(),_vm._v(" "),_vm._t("default")],2)},staticRenderFns:[]},(function(inject){inject&&(inject("data-v-228404f8_0",{source:".drop-list[data-v-228404f8]>*{transition:transform .2s}.__feedback[data-v-228404f8]{display:none}.__drag-image[data-v-228404f8]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}",map:void 0,media:void 0}),inject("data-v-228404f8_1",{source:".drop-allowed.drop-in *{cursor:inherit!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}",map:void 0,media:void 0}))}),DropList,"data-v-228404f8",!1,undefined,browser,void 0);_exports.DropList=DropList$1})); //# sourceMappingURL=vue-easy-dnd.esm.min.js.map \ No newline at end of file diff --git a/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js.map b/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js.map index b8868f2..c89a668 100644 --- a/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js.map +++ b/amd/build/vue-easy-dnd/vue-easy-dnd.esm.min.js.map @@ -1 +1 @@ -{"version":3,"file":"vue-easy-dnd.esm.min.js","sources":["../../src/vue-easy-dnd/vue-easy-dnd.esm.js"],"sourcesContent":["/* eslint-disable */\r\nimport { reactive, openBlock, createBlock, resolveDynamicComponent, normalizeClass, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementBlock, createCommentVNode, renderList, TransitionGroup, h, nextTick } from '../vue/vue';\r\n\r\nfunction mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get(\"*\"))&&i.slice().map(function(n){n(t,e);});}}}\r\n\r\n/**\r\n * This is the class of the global object that holds the state of the drag and drop during its progress. It emits events\r\n * reporting its state evolution during the progress of the drag and drop. Its data is reactive and listeners can be\r\n * attached to it using the method on.\r\n */\r\nclass DnD {\r\n\r\n inProgress = false;\r\n type = null;\r\n data = null;\r\n source = null;\r\n top = null;\r\n position = null;\r\n eventBus = mitt();\r\n success = null;\r\n\r\n startDrag (source, event, x, y, type, data) {\r\n this.type = type;\r\n this.data = data;\r\n this.source = source;\r\n this.position = { x, y };\r\n this.top = null;\r\n this.inProgress = true;\r\n this.emit(event, 'dragstart');\r\n this.emit(event, 'dragtopchanged', { previousTop: null });\r\n }\r\n\r\n resetVariables () {\r\n this.inProgress = false;\r\n this.data = null;\r\n this.source = null;\r\n this.position = null;\r\n this.success = null;\r\n }\r\n\r\n stopDrag (event) {\r\n this.success = this.top !== null && this.top['compatibleMode'] && this.top['dropAllowed'];\r\n if (this.top !== null) {\r\n this.emit(event, 'drop');\r\n }\r\n this.emit(event, 'dragend');\r\n this.resetVariables();\r\n }\r\n\r\n cancelDrag (event) {\r\n this.success = false;\r\n this.emit(event, 'dragend');\r\n this.resetVariables();\r\n }\r\n\r\n mouseMove (event, comp) {\r\n if (this.inProgress) {\r\n let prevent = false;\r\n const previousTop = this.top;\r\n if (comp === null) {\r\n // The mouse move event reached the top of the document without hitting a drop component.\r\n this.top = null;\r\n prevent = true;\r\n }\r\n else if (comp['isDropMask']) {\r\n // The mouse move event bubbled until it reached a drop mask.\r\n this.top = null;\r\n prevent = true;\r\n }\r\n else if (comp['candidate'](this.type, this.data, this.source)) {\r\n // The mouse move event bubbled until it reached a drop component that participates in the current drag operation.\r\n this.top = comp;\r\n prevent = true;\r\n }\r\n\r\n if (prevent) {\r\n // We prevent the mouse move event from bubbling further up the tree because it reached the foremost drop component and that component is all that matters.\r\n event.stopPropagation();\r\n }\r\n if (this.top !== previousTop) {\r\n this.emit(event.detail.native, 'dragtopchanged', { previousTop: previousTop });\r\n }\r\n this.position = {\r\n x: event.detail.x,\r\n y: event.detail.y\r\n };\r\n this.emit(event.detail.native, 'dragpositionchanged');\r\n }\r\n }\r\n\r\n emit (native, event, data = {}) {\r\n this.eventBus.emit(event, {\r\n type: this.type,\r\n data: this.data,\r\n top: this.top,\r\n source: this.source,\r\n position: this.position,\r\n success: this.success,\r\n native,\r\n ...data\r\n });\r\n }\r\n\r\n on (event, callback) {\r\n this.eventBus.on(event, callback);\r\n }\r\n\r\n off (event, callback) {\r\n this.eventBus.off(event, callback);\r\n }\r\n}\r\n\r\nconst dnd = reactive(new DnD());\r\n\r\nvar DragAwareMixin = {\r\n data () {\r\n return {\r\n isDropMask: false\r\n };\r\n },\r\n computed: {\r\n dragInProgress () {\r\n return dnd.inProgress;\r\n },\r\n dragData () {\r\n return dnd.data;\r\n },\r\n dragType () {\r\n return dnd.type;\r\n },\r\n dragPosition () {\r\n return dnd.position;\r\n },\r\n dragSource () {\r\n return dnd.source;\r\n },\r\n dragTop () {\r\n return dnd.top;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * This files contains the primitives required to create drag images from HTML elements that serve as models. A snapshot\r\n * of the computed styles of the model elements is taken when creating the drag image, so that it will look the same as\r\n * the model, no matter where the drag images is grafted into the DOM.\r\n */\r\n\r\n/**\r\n * Creates a drag image using the given element as model.\r\n */\r\nfunction createDragImage (el) {\r\n const clone = deepClone(el);\r\n clone.style.position = 'fixed';\r\n clone.style.margin = '0';\r\n clone.style['z-index'] = '1000';\r\n clone.style.transition = 'opacity 0.2s';\r\n return clone;\r\n}\r\n\r\n/**\r\n * Clones the given element and all its descendants.\r\n */\r\nfunction deepClone (el) {\r\n const clone = el.cloneNode(true);\r\n copyStyle(el, clone);\r\n const vSrcElements = el.getElementsByTagName('*');\r\n const vDstElements = clone.getElementsByTagName('*');\r\n for (let i = vSrcElements.length; i--;) {\r\n const vSrcElement = vSrcElements[i];\r\n const vDstElement = vDstElements[i];\r\n copyStyle(vSrcElement, vDstElement);\r\n }\r\n return clone;\r\n}\r\n\r\n/**\r\n * Copy the computed styles from src to destination.\r\n */\r\nfunction copyStyle (src, destination) {\r\n const computedStyle = window.getComputedStyle(src);\r\n for (const key of computedStyle) {\r\n if (key === 'width') {\r\n // IE11\r\n const width = computedStyle.getPropertyValue('box-sizing') === 'border-box' ?\r\n src.clientWidth :\r\n src.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight);\r\n destination.style.setProperty('width', width + 'px');\r\n }\r\n else if (key === 'height') {\r\n // IE11\r\n const height = computedStyle.getPropertyValue('box-sizing') === 'border-box' ?\r\n src.clientHeight :\r\n src.clientHeight - parseFloat(computedStyle.paddingTop) - parseFloat(computedStyle.paddingBottom);\r\n destination.style.setProperty('height', height + 'px');\r\n }\r\n else {\r\n destination.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key));\r\n }\r\n }\r\n destination.style.pointerEvents = 'none';\r\n}\r\n\r\n// Forked from https://gist.github.com/gre/296291b8ce0d8fe6e1c3ea4f1d1c5c3b\r\nconst regex = /(auto|scroll)/;\r\n\r\nconst style = (node, prop) =>\r\n getComputedStyle(node, null).getPropertyValue(prop);\r\n\r\nconst scroll = (node) =>\r\n regex.test(\r\n style(node, 'overflow') +\r\n style(node, 'overflow-y') +\r\n style(node, 'overflow-x'));\r\n\r\nconst scrollparent = (node) =>\r\n !node || node===document.body\r\n ? document.body\r\n : scroll(node)\r\n ? node\r\n : scrollparent(node.parentNode);\r\n\r\n// Forked from https://github.com/bennadel/JavaScript-Demos/blob/master/demos/window-edge-scrolling/index.htm\r\n// Code was altered to work with scrollable containers\r\n\r\nvar timer = null;\r\n\r\nfunction cancelScrollAction () {\r\n clearTimeout(timer);\r\n}\r\n\r\nfunction performEdgeScroll (event, container, clientX, clientY, edgeSize) {\r\n if (!container || !edgeSize) {\r\n cancelScrollAction();\r\n return false;\r\n }\r\n \r\n // NOTE: Much of the information here, with regard to document dimensions,\r\n // viewport dimensions, and window scrolling is derived from JavaScript.info.\r\n // I am consuming it here primarily as NOTE TO SELF.\r\n // --\r\n // Read More: https://javascript.info/size-and-scroll-window\r\n // --\r\n // CAUTION: The viewport and document dimensions can all be CACHED and then\r\n // recalculated on window-resize events (for the most part). I am keeping it\r\n // all here in the mousemove event handler to remove as many of the moving\r\n // parts as possible and keep the demo as simple as possible.\r\n \r\n // Get the viewport-relative coordinates of the mousemove event.\r\n var rect = container.getBoundingClientRect();\r\n var isBody = container === document.body;\r\n \r\n var viewportX = clientX - rect.left;\r\n var viewportY = clientY - rect.top;\r\n if (isBody) {\r\n viewportX = clientX;\r\n viewportY = clientY;\r\n }\r\n \r\n // Get the viewport dimensions.\r\n var viewportWidth = rect.width;\r\n var viewportHeight = rect.height;\r\n if (isBody) {\r\n viewportWidth = document.documentElement.clientWidth;\r\n viewportHeight = document.documentElement.clientHeight;\r\n }\r\n \r\n // Next, we need to determine if the mouse is within the \"edge\" of the\r\n // viewport, which may require scrolling the window. To do this, we need to\r\n // calculate the boundaries of the edge in the viewport (these coordinates\r\n // are relative to the viewport grid system).\r\n var edgeTop = edgeSize;\r\n var edgeLeft = edgeSize;\r\n var edgeBottom = ( viewportHeight - edgeSize );\r\n var edgeRight = ( viewportWidth - edgeSize );\r\n \r\n var isInLeftEdge = ( viewportX < edgeLeft );\r\n var isInRightEdge = ( viewportX > edgeRight );\r\n var isInTopEdge = ( viewportY < edgeTop );\r\n var isInBottomEdge = ( viewportY > edgeBottom );\r\n \r\n // If the mouse is not in the viewport edge, there's no need to calculate\r\n // anything else.\r\n if (!(isInLeftEdge || isInRightEdge || isInTopEdge || isInBottomEdge)) {\r\n cancelScrollAction();\r\n return false;\r\n }\r\n \r\n // If we made it this far, the user's mouse is located within the edge of the\r\n // viewport. As such, we need to check to see if scrolling needs to be done.\r\n \r\n // Get the document dimensions.\r\n var documentWidth = Math.max(\r\n container.scrollWidth,\r\n container.offsetWidth,\r\n container.clientWidth\r\n );\r\n var documentHeight = Math.max(\r\n container.scrollHeight,\r\n container.offsetHeight,\r\n container.clientHeight\r\n );\r\n \r\n // Calculate the maximum scroll offset in each direction. Since you can only\r\n // scroll the overflow portion of the document, the maximum represents the\r\n // length of the document that is NOT in the viewport.\r\n var maxScrollX = (documentWidth - viewportWidth);\r\n var maxScrollY = (documentHeight - viewportHeight);\r\n \r\n // As we examine the mousemove event, we want to adjust the window scroll in\r\n // immediate response to the event; but, we also want to continue adjusting\r\n // the window scroll if the user rests their mouse in the edge boundary. To\r\n // do this, we'll invoke the adjustment logic immediately. Then, we'll setup\r\n // a timer that continues to invoke the adjustment logic while the window can\r\n // still be scrolled in a particular direction.\r\n (function checkForWindowScroll () {\r\n cancelScrollAction();\r\n \r\n if (adjustWindowScroll()) {\r\n timer = setTimeout( checkForWindowScroll, 30 );\r\n }\r\n })();\r\n \r\n // Adjust the window scroll based on the user's mouse position. Returns True\r\n // or False depending on whether or not the window scroll was changed.\r\n function adjustWindowScroll () {\r\n // Get the current scroll position of the document.\r\n var currentScrollX = container.scrollLeft;\r\n var currentScrollY = container.scrollTop;\r\n if (isBody) {\r\n currentScrollX = window.pageXOffset;\r\n currentScrollY = window.pageYOffset;\r\n }\r\n \r\n // Determine if the window can be scrolled in any particular direction.\r\n var canScrollUp = (currentScrollY > 0);\r\n var canScrollDown = (currentScrollY < maxScrollY);\r\n var canScrollLeft = (currentScrollX > 0);\r\n var canScrollRight = (currentScrollX < maxScrollX);\r\n \r\n // Since we can potentially scroll in two directions at the same time,\r\n // let's keep track of the next scroll, starting with the current scroll.\r\n // Each of these values can then be adjusted independently in the logic\r\n // below.\r\n var nextScrollX = currentScrollX;\r\n var nextScrollY = currentScrollY;\r\n \r\n // As we examine the mouse position within the edge, we want to make the\r\n // incremental scroll changes more \"intense\" the closer that the user\r\n // gets the viewport edge. As such, we'll calculate the percentage that\r\n // the user has made it \"through the edge\" when calculating the delta.\r\n // Then, that use that percentage to back-off from the \"max\" step value.\r\n var maxStep = 50;\r\n \r\n // Should we scroll left?\r\n if (isInLeftEdge && canScrollLeft) {\r\n const intensity = ((edgeLeft - viewportX) / edgeSize);\r\n nextScrollX = (nextScrollX - (maxStep * intensity));\r\n }\r\n // Should we scroll right?\r\n else if (isInRightEdge && canScrollRight) {\r\n const intensity = ((viewportX - edgeRight) / edgeSize);\r\n nextScrollX = (nextScrollX + (maxStep * intensity));\r\n }\r\n \r\n // Should we scroll up?\r\n if (isInTopEdge && canScrollUp) {\r\n const intensity = ((edgeTop - viewportY) / edgeSize);\r\n nextScrollY = (nextScrollY - (maxStep * intensity));\r\n }\r\n // Should we scroll down?\r\n else if (isInBottomEdge && canScrollDown) {\r\n const intensity = ((viewportY - edgeBottom) / edgeSize);\r\n nextScrollY = (nextScrollY + (maxStep * intensity));\r\n }\r\n \r\n // Sanitize invalid maximums. An invalid scroll offset won't break the\r\n // subsequent .scrollTo() call; however, it will make it harder to\r\n // determine if the .scrollTo() method should have been called in the\r\n // first place.\r\n nextScrollX = Math.max(0, Math.min(maxScrollX, nextScrollX));\r\n nextScrollY = Math.max(0, Math.min(maxScrollY, nextScrollY));\r\n \r\n if (\r\n (nextScrollX !== currentScrollX) ||\r\n (nextScrollY !== currentScrollY)\r\n ) {\r\n (isBody ? window : container).scrollTo(nextScrollX, nextScrollY);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n \r\n return true;\r\n}\r\n\r\nvar DragMixin = {\r\n mixins: [DragAwareMixin],\r\n props: {\r\n type: {\r\n type: String,\r\n default: null\r\n },\r\n data: {\r\n default: null\r\n },\r\n dragImageOpacity: {\r\n type: Number,\r\n default: 0.7\r\n },\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n goBack: {\r\n type: Boolean,\r\n default: false\r\n },\r\n handle: {\r\n type: String,\r\n default: null\r\n },\r\n delta: {\r\n type: Number,\r\n default: 0\r\n },\r\n delay: {\r\n type: Number,\r\n default: 0\r\n },\r\n dragClass: {\r\n type: String,\r\n default: null\r\n },\r\n vibration: {\r\n type: Number,\r\n default: 0\r\n },\r\n scrollingEdgeSize: {\r\n type: Number,\r\n default: 100\r\n }\r\n },\r\n emits: ['dragstart', 'dragend', 'cut', 'copy'],\r\n data () {\r\n return {\r\n dragInitialised: false,\r\n dragStarted: false,\r\n ignoreNextClick: false,\r\n initialUserSelect: null,\r\n downEvent: null,\r\n startPosition: null,\r\n delayTimer: null,\r\n scrollContainer: null\r\n };\r\n },\r\n computed: {\r\n cssClasses () {\r\n const clazz = {\r\n 'dnd-drag': true\r\n };\r\n if (!this.disabled) {\r\n return {\r\n ...clazz,\r\n 'drag-source': this.dragInProgress && this.dragSource === this,\r\n 'drag-mode-copy': this.currentDropMode === 'copy',\r\n 'drag-mode-cut': this.currentDropMode === 'cut',\r\n 'drag-mode-reordering': this.currentDropMode === 'reordering',\r\n 'drag-no-handle': !this.handle\r\n };\r\n }\r\n else {\r\n return clazz;\r\n }\r\n },\r\n currentDropMode () {\r\n if (this.dragInProgress && this.dragSource === this) {\r\n if (this.dragTop && this.dragTop['dropAllowed']) {\r\n if (this.dragTop['reordering']) {\r\n return 'reordering';\r\n }\r\n else {\r\n return this.dragTop['mode'];\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n },\r\n methods: {\r\n onSelectStart (e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n },\r\n performVibration () {\r\n // If browser can perform vibration and user has defined a vibration, perform it\r\n if (this.vibration > 0 && window.navigator && window.navigator.vibrate) {\r\n window.navigator.vibrate(this.vibration);\r\n }\r\n },\r\n onMouseDown (e) {\r\n let target = null;\r\n let goodButton = false;\r\n if (e.type === 'mousedown') {\r\n const mouse = e;\r\n target = e.target;\r\n goodButton = mouse.buttons === 1;\r\n }\r\n else {\r\n const touch = e;\r\n target = touch.touches[0].target;\r\n goodButton = true;\r\n }\r\n\r\n if (this.disabled || this.downEvent !== null || !goodButton) {\r\n return;\r\n }\r\n\r\n // Check that the target element is eligible for starting a drag\r\n // Includes checking against the handle selector\r\n // or whether the element contains 'dnd-no-drag' class (which should disable dragging from that\r\n // sub-element of a draggable parent)\r\n const goodTarget = !target.matches('.dnd-no-drag, .dnd-no-drag *') &&\r\n (\r\n !this.handle ||\r\n target.matches(this.handle + ', ' + this.handle + ' *')\r\n );\r\n\r\n if (!goodTarget) {\r\n return;\r\n }\r\n\r\n this.scrollContainer = scrollparent(target);\r\n this.initialUserSelect = document.body.style.userSelect;\r\n document.documentElement.style.userSelect = 'none'; // Permet au drag de se poursuivre normalement même\r\n // quand on quitte un élémént avec overflow: hidden.\r\n this.dragStarted = false;\r\n this.downEvent = e;\r\n if (this.downEvent.type === 'mousedown') {\r\n const mouse = e;\r\n this.startPosition = {\r\n x: mouse.clientX,\r\n y: mouse.clientY\r\n };\r\n }\r\n else {\r\n const touch = e;\r\n this.startPosition = {\r\n x: touch.touches[0].clientX,\r\n y: touch.touches[0].clientY\r\n };\r\n }\r\n\r\n if (this.delay) {\r\n this.dragInitialised = false;\r\n clearTimeout(this.delayTimer);\r\n this.delayTimer = setTimeout(() => {\r\n this.dragInitialised = true;\r\n this.performVibration();\r\n }, this.delay);\r\n }\r\n else {\r\n this.dragInitialised = true;\r\n this.performVibration();\r\n }\r\n\r\n document.addEventListener('click', this.onMouseClick, true);\r\n document.addEventListener('mouseup', this.onMouseUp);\r\n document.addEventListener('touchend', this.onMouseUp);\r\n document.addEventListener('selectstart', this.onSelectStart);\r\n document.addEventListener('keyup', this.onKeyUp);\r\n\r\n setTimeout(() => {\r\n document.addEventListener('mousemove', this.onMouseMove);\r\n document.addEventListener('touchmove', this.onMouseMove, { passive: false });\r\n document.addEventListener('easy-dnd-move', this.onEasyDnDMove);\r\n }, 0);\r\n\r\n // Prevents event from bubbling to ancestor drag components and initiate several drags at the same time\r\n e.stopPropagation();\r\n },\r\n // Prevent the user from accidentally causing a click event\r\n // if they have just attempted a drag event\r\n onMouseClick (e) {\r\n if (this.ignoreNextClick) {\r\n e.preventDefault();\r\n e.stopPropagation && e.stopPropagation();\r\n e.stopImmediatePropagation && e.stopImmediatePropagation();\r\n this.ignoreNextClick = false;\r\n return false;\r\n }\r\n },\r\n onMouseMove (e) {\r\n // We ignore the mousemove event that follows touchend :\r\n if (this.downEvent === null) return;\r\n\r\n // On touch devices, we ignore fake mouse events and deal with touch events only.\r\n if (this.downEvent.type === 'touchstart' && e.type === 'mousemove') return;\r\n\r\n // Find out event target and pointer position :\r\n let target = null;\r\n let x = null;\r\n let y = null;\r\n if (e.type === 'touchmove') {\r\n const touch = e;\r\n x = touch.touches[0].clientX;\r\n y = touch.touches[0].clientY;\r\n target = document.elementFromPoint(x, y);\r\n if (!target) {\r\n // Mouse going off screen. Ignore event.\r\n return;\r\n }\r\n }\r\n else {\r\n const mouse = e;\r\n x = mouse.clientX;\r\n y = mouse.clientY;\r\n target = mouse.target;\r\n }\r\n\r\n // Distance between current event and start position :\r\n const dist = Math.sqrt(Math.pow(this.startPosition.x - x, 2) + Math.pow(this.startPosition.y - y, 2));\r\n\r\n // If the drag has not begun yet and distance from initial point is greater than delta, we start the drag :\r\n if (!this.dragStarted && dist > this.delta) {\r\n // If they have dragged greater than the delta before the delay period has ended,\r\n // It means that they attempted to perform another action (such as scrolling) on the page\r\n if (!this.dragInitialised) {\r\n clearTimeout(this.delayTimer);\r\n }\r\n else {\r\n this.ignoreNextClick = true;\r\n this.dragStarted = true;\r\n dnd.startDrag(this, this.downEvent, this.startPosition.x, this.startPosition.y, this.type, this.data);\r\n document.documentElement.classList.add('drag-in-progress');\r\n }\r\n }\r\n\r\n // Dispatch custom easy-dnd-move event :\r\n if (this.dragStarted) {\r\n // If cursor/touch is at edge of container, perform scroll if available\r\n // If this.dragTop is defined, it means they are dragging on top of another DropList/EasyDnd component\r\n // if dropTop is a DropList, use the scrollingEdgeSize of that container if it exists, otherwise use the scrollingEdgeSize of the Drag component\r\n const currEdgeSize = this.dragTop && this.dragTop.$props.scrollingEdgeSize !== undefined ?\r\n this.dragTop.$props.scrollingEdgeSize :\r\n this.scrollingEdgeSize;\r\n\r\n if (currEdgeSize) {\r\n const currScrollContainer = this.dragTop ? scrollparent(this.dragTop.$el) : this.scrollContainer;\r\n performEdgeScroll(e, currScrollContainer, x, y, currEdgeSize);\r\n }\r\n else {\r\n cancelScrollAction();\r\n }\r\n\r\n const custom = new CustomEvent('easy-dnd-move', {\r\n bubbles: true,\r\n cancelable: true,\r\n detail: {\r\n x,\r\n y,\r\n native: e\r\n }\r\n });\r\n target.dispatchEvent(custom);\r\n }\r\n\r\n // Prevent scroll on touch devices if they were performing a drag\r\n if (this.dragInitialised && e.cancelable) {\r\n e.preventDefault();\r\n }\r\n },\r\n onEasyDnDMove (e) {\r\n dnd.mouseMove(e, null);\r\n },\r\n onMouseUp (e) {\r\n // On touch devices, we ignore fake mouse events and deal with touch events only.\r\n if (this.downEvent.type === 'touchstart' && e.type === 'mouseup') return;\r\n\r\n // This delay makes sure that when the click event that results from the mouseup is produced, the drag is\r\n // still in progress. So by checking the flag dnd.inProgress, one can tell apart true clicks from drag and\r\n // drop artefacts.\r\n setTimeout(() => {\r\n this.cancelDragActions();\r\n\r\n if (this.dragStarted) {\r\n dnd.stopDrag(e);\r\n }\r\n this.finishDrag();\r\n }, 0);\r\n },\r\n onKeyUp (e) {\r\n // If ESC is pressed, cancel the drag\r\n if (e.key === 'Escape') {\r\n this.cancelDragActions();\r\n\r\n setTimeout(() => {\r\n dnd.cancelDrag(e);\r\n this.finishDrag();\r\n }, 0);\r\n }\r\n },\r\n cancelDragActions () {\r\n this.dragInitialised = false;\r\n clearTimeout(this.delayTimer);\r\n cancelScrollAction();\r\n },\r\n finishDrag () {\r\n this.downEvent = null;\r\n this.scrollContainer = null;\r\n\r\n if (this.dragStarted) {\r\n document.documentElement.classList.remove('drag-in-progress');\r\n }\r\n document.removeEventListener('click', this.onMouseClick, true);\r\n document.removeEventListener('mousemove', this.onMouseMove);\r\n document.removeEventListener('touchmove', this.onMouseMove);\r\n document.removeEventListener('easy-dnd-move', this.onEasyDnDMove);\r\n document.removeEventListener('mouseup', this.onMouseUp);\r\n document.removeEventListener('touchend', this.onMouseUp);\r\n document.removeEventListener('selectstart', this.onSelectStart);\r\n document.removeEventListener('keyup', this.onKeyUp);\r\n document.documentElement.style.userSelect = this.initialUserSelect;\r\n },\r\n dndDragStart (ev) {\r\n if (ev.source === this) {\r\n this.$emit('dragstart', ev);\r\n }\r\n },\r\n dndDragEnd (ev) {\r\n if (ev.source === this) {\r\n this.$emit('dragend', ev);\r\n }\r\n },\r\n createDragImage (selfTransform) {\r\n let image;\r\n if (this.$slots['drag-image']) {\r\n const el = this.$refs['drag-image'] || document.createElement('div');\r\n if (el.childElementCount !== 1) {\r\n image = createDragImage(el);\r\n }\r\n else {\r\n image = createDragImage(el.children.item(0));\r\n }\r\n }\r\n else {\r\n image = createDragImage(this.$el);\r\n image.style.transform = selfTransform;\r\n }\r\n\r\n if (this.dragClass) {\r\n image.classList.add(this.dragClass);\r\n }\r\n image.classList.add('dnd-ghost');\r\n image['__opacity'] = this.dragImageOpacity;\r\n return image;\r\n }\r\n },\r\n created () {\r\n dnd.on('dragstart', this.dndDragStart);\r\n dnd.on('dragend', this.dndDragEnd);\r\n },\r\n mounted () {\r\n this.$el.addEventListener('mousedown', this.onMouseDown);\r\n this.$el.addEventListener('touchstart', this.onMouseDown);\r\n },\r\n beforeUnmount () {\r\n dnd.off('dragstart', this.dndDragStart);\r\n dnd.off('dragend', this.dndDragEnd);\r\n\r\n this.$el.removeEventListener('mousedown', this.onMouseDown);\r\n this.$el.removeEventListener('touchstart', this.onMouseDown);\r\n }\r\n};\r\n\r\nvar script$4 = {\r\n name: 'Drag',\r\n mixins: [DragMixin],\r\n props: {\r\n /**\r\n * Tag to be used as root of this component. Defaults to div.\r\n */\r\n tag: {\r\n type: [String, Object, Function],\r\n default: 'div'\r\n }\r\n },\r\n computed: {\r\n dynamicSlots () {\r\n return Object.entries(this.$slots).filter(([key]) => key !== 'drag-image' && key !== 'default');\r\n }\r\n }\r\n};\r\n\r\nconst _hoisted_1$2 = {\r\n key: 0,\r\n ref: \"drag-image\",\r\n class: \"__drag-image\"\r\n};\r\n\r\nfunction render$3(_ctx, _cache, $props, $setup, $data, $options) {\r\n return (openBlock(), createBlock(resolveDynamicComponent($props.tag), {\r\n class: normalizeClass(_ctx.cssClasses)\r\n }, createSlots({\r\n default: withCtx(() => [\r\n renderSlot(_ctx.$slots, \"default\", normalizeProps(guardReactiveProps(_ctx.$slots['default'] || {}))),\r\n (_ctx.dragInitialised)\r\n ? (openBlock(), createElementBlock(\"div\", _hoisted_1$2, [\r\n renderSlot(_ctx.$slots, \"drag-image\")\r\n ], 512 /* NEED_PATCH */))\r\n : createCommentVNode(\"v-if\", true)\r\n ]),\r\n _: 2 /* DYNAMIC */\r\n }, [\r\n renderList($options.dynamicSlots, ([slot, args]) => {\r\n return {\r\n name: slot,\r\n fn: withCtx(() => [\r\n renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(args)))\r\n ])\r\n }\r\n })\r\n ]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"class\"]))\r\n}\r\n\r\nscript$4.render = render$3;\r\nscript$4.__scopeId = \"data-v-f87407ce\";\r\n\r\nfunction dropAllowed (inst) {\r\n if (inst.dragInProgress && inst.typeAllowed) {\r\n return inst.compatibleMode && inst.effectiveAcceptsData(inst.dragData, inst.dragType);\r\n }\r\n return null;\r\n}\r\n\r\nfunction doDrop (inst, event) {\r\n inst.$emit('drop', event);\r\n event.source.$emit(inst.mode, event);\r\n}\r\n\r\nfunction candidate (inst, type) {\r\n return inst.effectiveAcceptsType(type);\r\n}\r\n\r\nvar DropMixin = {\r\n mixins: [DragAwareMixin],\r\n props: {\r\n acceptsType: {\r\n type: [String, Array, Function],\r\n default: null\r\n },\r\n acceptsData: {\r\n type: Function,\r\n default: () => {\r\n return true;\r\n }\r\n },\r\n mode: {\r\n type: String,\r\n default: 'copy'\r\n },\r\n dragImageOpacity: {\r\n type: Number,\r\n default: 0.7\r\n }\r\n },\r\n emits: ['dragover', 'dragenter', 'dragleave', 'dragend', 'drop'],\r\n data () {\r\n return {\r\n isDrop: true\r\n };\r\n },\r\n computed: {\r\n compatibleMode () {\r\n return this.dragInProgress ? true : null;\r\n },\r\n dropIn () {\r\n if (this.dragInProgress) {\r\n return this.dragTop === this;\r\n }\r\n return null;\r\n },\r\n typeAllowed () {\r\n if (this.dragInProgress) {\r\n return this.effectiveAcceptsType(this.dragType);\r\n }\r\n return null;\r\n },\r\n dropAllowed () {\r\n return dropAllowed(this);\r\n },\r\n cssClasses () {\r\n const clazz = {\r\n 'dnd-drop': true\r\n };\r\n if (this.dropIn !== null) {\r\n clazz['drop-in'] = this.dropIn;\r\n clazz['drop-out'] = !this.dropIn;\r\n }\r\n if (this.typeAllowed !== null) {\r\n clazz['type-allowed'] = this.typeAllowed;\r\n clazz['type-forbidden'] = !this.typeAllowed;\r\n }\r\n if (this.dropAllowed !== null) {\r\n clazz['drop-allowed'] = this.dropAllowed;\r\n clazz['drop-forbidden'] = !this.dropAllowed;\r\n }\r\n return clazz;\r\n }\r\n },\r\n methods: {\r\n effectiveAcceptsType (type) {\r\n if (this.acceptsType === null) {\r\n return true;\r\n }\r\n else if (typeof (this.acceptsType) === 'string' || typeof(this.acceptsType) === 'number') {\r\n return this.acceptsType === type;\r\n }\r\n else if (typeof (this.acceptsType) === 'object' && Array.isArray(this.acceptsType)) {\r\n return this.acceptsType.includes(type);\r\n }\r\n else {\r\n return this.acceptsType(type);\r\n }\r\n },\r\n effectiveAcceptsData (data, type) {\r\n return this.acceptsData(data, type);\r\n },\r\n onDragPositionChanged (event) {\r\n if (this === event.top) {\r\n this.$emit('dragover', event);\r\n }\r\n },\r\n onDragTopChanged (event) {\r\n if (this === event.top) {\r\n this.$emit('dragenter', event);\r\n }\r\n if (this === event.previousTop) {\r\n this.$emit('dragleave', event);\r\n }\r\n },\r\n onDragEnd (event) {\r\n if (this === event.top) {\r\n this.$emit('dragend', event);\r\n }\r\n },\r\n onDrop (event) {\r\n if (this.dropIn && this.compatibleMode && this.dropAllowed) {\r\n this.doDrop(event);\r\n }\r\n },\r\n doDrop (event) {\r\n doDrop(this, event);\r\n },\r\n /**\r\n * Returns true if the current drop area participates in the current drag operation.\r\n */\r\n candidate (type) {\r\n return candidate(this, type);\r\n },\r\n createDragImage () {\r\n let image = 'source';\r\n if (this.$refs['drag-image']) {\r\n const el = this.$refs['drag-image'];\r\n if (el.childElementCount !== 1) {\r\n image = createDragImage(el);\r\n }\r\n else {\r\n image = createDragImage(el.children.item(0));\r\n }\r\n image['__opacity'] = this.dragImageOpacity;\r\n image.classList.add('dnd-ghost');\r\n }\r\n return image;\r\n },\r\n onDnDMove (e) {\r\n dnd.mouseMove(e, this);\r\n }\r\n },\r\n created () {\r\n dnd.on('dragpositionchanged', this.onDragPositionChanged);\r\n dnd.on('dragtopchanged', this.onDragTopChanged);\r\n dnd.on('drop', this.onDrop);\r\n dnd.on('dragend', this.onDragEnd);\r\n },\r\n mounted () {\r\n this.$el.addEventListener('easy-dnd-move', this.onDnDMove);\r\n },\r\n beforeUnmount () {\r\n this.$el.removeEventListener('easy-dnd-move', this.onDnDMove);\r\n\r\n dnd.off('dragpositionchanged', this.onDragPositionChanged);\r\n dnd.off('dragtopchanged', this.onDragTopChanged);\r\n dnd.off('drop', this.onDrop);\r\n dnd.off('dragend', this.onDragEnd);\r\n }\r\n};\r\n\r\nvar script$3 = {\r\n name: 'Drop',\r\n mixins: [DropMixin],\r\n props: {\r\n tag: {\r\n type: [String, Object, Function],\r\n default: 'div'\r\n }\r\n },\r\n computed: {\r\n dynamicSlots () {\r\n return Object.entries(this.$slots).filter(([key]) => key !== 'drag-image' && key !== 'default');\r\n },\r\n showDragImage () {\r\n return this.dragInProgress && this.typeAllowed && !!this.$slots['drag-image'];\r\n }\r\n }\r\n};\r\n\r\nconst _hoisted_1$1 = {\r\n key: 0,\r\n ref: \"drag-image\",\r\n class: \"__drag-image\"\r\n};\r\n\r\nfunction render$2(_ctx, _cache, $props, $setup, $data, $options) {\r\n return (openBlock(), createBlock(resolveDynamicComponent($props.tag), {\r\n class: normalizeClass(_ctx.cssClasses)\r\n }, createSlots({\r\n default: withCtx(() => [\r\n renderSlot(_ctx.$slots, \"default\", normalizeProps(guardReactiveProps(_ctx.$slots['default'] || {}))),\r\n ($options.showDragImage)\r\n ? (openBlock(), createElementBlock(\"div\", _hoisted_1$1, [\r\n renderSlot(_ctx.$slots, \"drag-image\", {\r\n type: _ctx.dragType,\r\n data: _ctx.dragData\r\n })\r\n ], 512 /* NEED_PATCH */))\r\n : createCommentVNode(\"v-if\", true)\r\n ]),\r\n _: 2 /* DYNAMIC */\r\n }, [\r\n renderList($options.dynamicSlots, ([slot, args]) => {\r\n return {\r\n name: slot,\r\n fn: withCtx(() => [\r\n renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(args)))\r\n ])\r\n }\r\n })\r\n ]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"class\"]))\r\n}\r\n\r\nscript$3.render = render$2;\r\nscript$3.__scopeId = \"data-v-12a39e52\";\r\n\r\nvar script$2 = {\r\n name: 'DropMask',\r\n mixins: [DragAwareMixin],\r\n props: {\r\n tag: {\r\n type: [String, Object, Function],\r\n default: 'div'\r\n }\r\n },\r\n data () {\r\n return {\r\n isDropMask: true\r\n };\r\n },\r\n mounted () {\r\n this.$el.addEventListener('easy-dnd-move', this.onDndMove);\r\n },\r\n beforeUnmount () {\r\n this.$el.removeEventListener('easy-dnd-move', this.onDndMove);\r\n },\r\n methods: {\r\n createDragImage () {\r\n return 'source';\r\n },\r\n onDndMove (e) {\r\n dnd.mouseMove(e, this);\r\n }\r\n }\r\n};\r\n\r\nfunction render$1(_ctx, _cache, $props, $setup, $data, $options) {\r\n return (openBlock(), createBlock(resolveDynamicComponent($props.tag), null, createSlots({ _: 2 /* DYNAMIC */ }, [\r\n renderList(_ctx.$slots, (args, slot) => {\r\n return {\r\n name: slot,\r\n fn: withCtx(() => [\r\n renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(args)))\r\n ])\r\n }\r\n })\r\n ]), 1024 /* DYNAMIC_SLOTS */))\r\n}\r\n\r\nscript$2.render = render$1;\r\n\r\nvar script$1 = {\r\n name: 'DragFeedback'\r\n};\r\n\r\nconst _hoisted_1 = { class: \"DragFeedback\" };\r\n\r\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\r\n return (openBlock(), createElementBlock(\"div\", _hoisted_1, [\r\n renderSlot(_ctx.$slots, \"default\")\r\n ]))\r\n}\r\n\r\nscript$1.render = render;\r\n\r\nclass Grid {\r\n reference;\r\n referenceOriginalPosition;\r\n magnets = [];\r\n\r\n constructor (collection, upToIndex, direction, fromIndex) {\r\n this.reference = collection.item(0).parentNode;\r\n this.referenceOriginalPosition = {\r\n x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft,\r\n y: this.reference.getBoundingClientRect().top - this.reference.scrollTop,\r\n };\r\n let index = 0;\r\n for (const child of collection) {\r\n if (index > upToIndex) break;\r\n const rect = child.getBoundingClientRect();\r\n const hasNestedDrop = child.classList.contains('dnd-drop') || child.getElementsByClassName('dnd-drop').length > 0;\r\n let horizontal = false;\r\n if (hasNestedDrop) {\r\n if (direction === 'auto') {\r\n // Auto mode not supported for now. Row or column must be defined explicitly if there are nested drop lists.\r\n throw 'Easy-DnD error : a drop list is missing one of these attributes : \\'row\\' or \\'column\\'.';\r\n }\r\n else {\r\n horizontal = direction === 'row';\r\n }\r\n }\r\n if (fromIndex === null) {\r\n // Inserting mode.\r\n this.magnets.push(hasNestedDrop ? this.before(rect, horizontal) : this.center(rect));\r\n }\r\n else {\r\n // Reordering mode.\r\n this.magnets.push(hasNestedDrop ? (\r\n fromIndex < index ? this.after : this.before\r\n )(rect, horizontal) : this.center(rect));\r\n }\r\n // Debug : show magnets :\r\n //document.body.insertAdjacentHTML(\"beforeend\", \"
\")\r\n index++;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the center of the rectangle.\r\n */\r\n center (rect) {\r\n return {\r\n x: rect.left + rect.width / 2,\r\n y: rect.top + rect.height / 2\r\n };\r\n }\r\n\r\n /**\r\n * When horizontal is true / false, returns middle of the left / top side of the rectangle.\r\n */\r\n before (rect, horizontal) {\r\n return horizontal ? {\r\n x: rect.left,\r\n y: rect.top + rect.height / 2\r\n } : {\r\n x: rect.left + rect.width / 2,\r\n y: rect.top\r\n };\r\n }\r\n\r\n /**\r\n * When horizontal is true / false, returns middle of the right / bottom side of the rectangle.\r\n */\r\n after (rect, horizontal) {\r\n return horizontal ? {\r\n x: rect.left + rect.width,\r\n y: rect.top + rect.height / 2\r\n } : {\r\n x: rect.left + rect.width / 2,\r\n y: rect.top + rect.height\r\n };\r\n }\r\n\r\n /**\r\n * In case the user scrolls during the drag, the position of the magnets are not what they used to be when the drag\r\n * started. A correction must be applied that takes into account the amount of scroll. This correction is the\r\n * difference between the current position of the parent element and its position when the drag started.\r\n */\r\n correction () {\r\n return {\r\n x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft - this.referenceOriginalPosition.x,\r\n y: this.reference.getBoundingClientRect().top - this.reference.scrollTop - this.referenceOriginalPosition.y,\r\n };\r\n }\r\n\r\n closestIndex (position) {\r\n const x = position.x - this.correction().x;\r\n const y = position.y - this.correction().y;\r\n let minDist = 999999;\r\n let index = -1;\r\n for (let i = 0; i < this.magnets.length; i++) {\r\n const magnet = this.magnets[i];\r\n const dist = Math.sqrt(Math.pow(magnet.x - x, 2) + Math.pow(magnet.y - y, 2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n index = i;\r\n }\r\n }\r\n return index;\r\n }\r\n}\r\n\r\nclass DnDEvent {\r\n type;\r\n data;\r\n top;\r\n previousTop;\r\n source;\r\n position;\r\n success;\r\n native;\r\n}\r\n\r\nclass ReorderEvent {\r\n from;\r\n to;\r\n \r\n constructor (from, to) {\r\n this.from = from;\r\n this.to = to;\r\n }\r\n\r\n apply (array) {\r\n const temp = array[this.from];\r\n array.splice(this.from, 1);\r\n array.splice(this.to, 0, temp);\r\n }\r\n\r\n}\r\n\r\nclass InsertEvent {\r\n type;\r\n data;\r\n index;\r\n \r\n constructor (type, data, index) {\r\n this.type = type;\r\n this.data = data;\r\n this.index = index;\r\n }\r\n}\r\n\r\nvar script = {\r\n name: 'DropList',\r\n mixins: [DropMixin],\r\n props: {\r\n tag: {\r\n type: [String, Object, Function],\r\n default: 'div'\r\n },\r\n items: {\r\n type: Array,\r\n required: true\r\n },\r\n row: {\r\n type: Boolean,\r\n default: false\r\n },\r\n column: {\r\n type: Boolean,\r\n default: false\r\n },\r\n noAnimations: {\r\n type: Boolean,\r\n default: false\r\n },\r\n scrollingEdgeSize: {\r\n type: Number,\r\n default: undefined\r\n }\r\n },\r\n emits: ['reorder', 'insert'],\r\n data () {\r\n return {\r\n grid: null,\r\n forbiddenKeys: [],\r\n feedbackKey: null,\r\n fromIndex: null\r\n };\r\n },\r\n computed: {\r\n rootTag () {\r\n if (this.noAnimations) {\r\n return this.tag;\r\n }\r\n return TransitionGroup;\r\n },\r\n rootProps () {\r\n if (this.noAnimations) {\r\n return {};\r\n }\r\n\r\n return {\r\n tag: this.tag,\r\n css: false\r\n };\r\n },\r\n direction () {\r\n // todo - rewrite this logic\r\n if (this.row) return 'row';\r\n if (this.column) return 'column';\r\n return 'auto';\r\n },\r\n reordering () {\r\n if (dnd.inProgress) {\r\n return dnd.source.$el.parentElement === this.$el;\r\n }\r\n return null;\r\n },\r\n closestIndex () {\r\n if (this.grid) {\r\n return this.grid.closestIndex(dnd.position);\r\n }\r\n return null;\r\n },\r\n dropAllowed () {\r\n if (this.dragInProgress) {\r\n if (this.reordering) {\r\n return this.items.length > 1;\r\n }\r\n else {\r\n // todo - eventually refactor so that this isn't necessary\r\n if (!dropAllowed(this)) {\r\n return false;\r\n }\r\n\r\n if (this.forbiddenKeys !== null && this.feedbackKey !== null) {\r\n return !this.forbiddenKeys.includes(this.feedbackKey);\r\n }\r\n\r\n return true;\r\n }\r\n }\r\n\r\n return null;\r\n },\r\n itemsBeforeFeedback () {\r\n if (this.closestIndex === 0) {\r\n return [];\r\n }\r\n return this.items.slice(0, this.closestIndex);\r\n },\r\n itemsAfterFeedback () {\r\n if (this.closestIndex === this.items.length) {\r\n return [];\r\n }\r\n return this.items.slice(this.closestIndex);\r\n },\r\n itemsBeforeReorderingFeedback () {\r\n if (this.closestIndex <= this.fromIndex) {\r\n return this.items.slice(0, this.closestIndex);\r\n }\r\n return this.items.slice(0, this.closestIndex + 1);\r\n },\r\n itemsAfterReorderingFeedback () {\r\n if (this.closestIndex <= this.fromIndex) {\r\n return this.items.slice(this.closestIndex);\r\n }\r\n return this.items.slice(this.closestIndex + 1);\r\n },\r\n reorderedItems () {\r\n const toIndex = this.closestIndex;\r\n const reordered = [...this.items];\r\n const temp = reordered[this.fromIndex];\r\n\r\n reordered.splice(this.fromIndex, 1);\r\n reordered.splice(toIndex, 0, temp);\r\n return reordered;\r\n },\r\n clazz () {\r\n return {\r\n 'drop-list': true,\r\n 'reordering': this.reordering === true,\r\n 'inserting': this.reordering === false,\r\n ...(this.reordering === false ? this.cssClasses : { 'dnd-drop': true })\r\n };\r\n },\r\n showDragFeedback () {\r\n return this.dragInProgress && this.typeAllowed && !this.reordering;\r\n },\r\n showInsertingDragImage () {\r\n return this.dragInProgress && this.typeAllowed && !this.reordering && !!this.$slots['drag-image'];\r\n },\r\n showReorderingDragImage () {\r\n return this.dragInProgress && this.reordering && !!this.$slots['reordering-drag-image'];\r\n },\r\n hasReorderingFeedback () {\r\n return !!this.$slots['reordering-feedback'];\r\n },\r\n hasEmptySlot () {\r\n return !!this.$slots['empty'];\r\n }\r\n },\r\n created () {\r\n dnd.on('dragstart', this.onDragStart);\r\n dnd.on('dragend', this.onDragEnd);\r\n },\r\n beforeUnmount () {\r\n dnd.off('dragstart', this.onDragStart);\r\n dnd.off('dragend', this.onDragEnd);\r\n },\r\n methods: {\r\n // Presence of feedback node in the DOM and of keys in the virtual DOM required => delayed until what\r\n // depends on drag data has been processed.\r\n refresh () {\r\n this.$nextTick(() => {\r\n this.grid = this.computeInsertingGrid();\r\n this.feedbackKey = this.computeFeedbackKey();\r\n this.forbiddenKeys = this.computeForbiddenKeys();\r\n });\r\n },\r\n onDragStart (event) {\r\n if (this.candidate(dnd.type)) {\r\n if (this.reordering) {\r\n this.fromIndex = Array.prototype.indexOf.call(event.source.$el.parentElement.children, event.source.$el);\r\n this.grid = this.computeReorderingGrid();\r\n }\r\n else {\r\n this.refresh();\r\n }\r\n }\r\n },\r\n onDragEnd () {\r\n this.fromIndex = null;\r\n this.feedbackKey = null;\r\n this.forbiddenKeys = null;\r\n this.grid = null;\r\n },\r\n doDrop (event) {\r\n if (this.reordering) {\r\n if (this.fromIndex !== this.closestIndex) {\r\n this.$emit('reorder', new ReorderEvent(\r\n this.fromIndex,\r\n this.closestIndex\r\n ));\r\n }\r\n }\r\n else {\r\n // todo - eventually remove the need for this\r\n doDrop(this, event);\r\n this.$emit('insert', new InsertEvent(\r\n event.type,\r\n event.data,\r\n this.closestIndex\r\n ));\r\n }\r\n },\r\n candidate (type) {\r\n return candidate(this, type) || this.reordering;\r\n },\r\n computeForbiddenKeys () {\r\n return (this.noAnimations ? [] : this.$refs.component.$slots['default']())\r\n .map(vn => vn.key)\r\n .filter(k => !!k && k !== 'drag-image' && k !== 'drag-feedback');\r\n },\r\n computeFeedbackKey () {\r\n return this.$refs['feedback']['$slots']['default']()[0]['key'];\r\n },\r\n computeInsertingGrid () {\r\n if (this.$refs.feedback.$el.children.length < 1) {\r\n return null;\r\n }\r\n\r\n const feedback = this.$refs.feedback.$el.children[0];\r\n const clone = feedback.cloneNode(true);\r\n const tg = this.$el;\r\n if (tg.children.length > this.items.length) {\r\n tg.insertBefore(clone, tg.children[this.items.length]);\r\n }\r\n else {\r\n tg.appendChild(clone);\r\n }\r\n const grid = new Grid(tg.children, this.items.length, this.direction, null);\r\n tg.removeChild(clone);\r\n return grid;\r\n },\r\n computeReorderingGrid () {\r\n return new Grid(this.$el.children, this.items.length - 1, this.direction, this.fromIndex);\r\n },\r\n createDragImage () {\r\n let image;\r\n if (this.$refs['drag-image']) {\r\n const el = this.$refs['drag-image'];\r\n let model;\r\n if (el.childElementCount !== 1) {\r\n model = el;\r\n }\r\n else {\r\n model = el.children.item(0);\r\n }\r\n const clone = model.cloneNode(true);\r\n const tg = this.$el;\r\n tg.appendChild(clone);\r\n image = createDragImage(clone);\r\n tg.removeChild(clone);\r\n image['__opacity'] = this.dragImageOpacity;\r\n image.classList.add('dnd-ghost');\r\n }\r\n else {\r\n image = 'source';\r\n }\r\n return image;\r\n }\r\n },\r\n render () {\r\n if (!this.$slots['item']) {\r\n throw 'The \"Item\" slot must be defined to use DropList';\r\n }\r\n\r\n if (!this.$slots['feedback']) {\r\n throw 'The \"Feedback\" slot must be defined to use DropList';\r\n }\r\n\r\n let defaultArr = [];\r\n if (this.dropIn && this.dropAllowed) {\r\n if (this.reordering) {\r\n if (this.hasReorderingFeedback) {\r\n const itemsReorderingBefore = this.itemsBeforeReorderingFeedback.map((item, index) => {\r\n return this.$slots['item']({\r\n item: item,\r\n index: index,\r\n reorder: false\r\n })[0];\r\n });\r\n if (itemsReorderingBefore.length > 0) {\r\n defaultArr = defaultArr.concat(itemsReorderingBefore);\r\n }\r\n\r\n defaultArr.push(this.$slots['reordering-feedback']({\r\n key: 'reordering-feedback',\r\n item: this.items[this.fromIndex]\r\n })[0]);\r\n\r\n const itemsReorderingAfter = this.itemsAfterReorderingFeedback.map((item, index) => {\r\n return this.$slots['item']({\r\n item: item,\r\n index: this.itemsBeforeReorderingFeedback.length + index,\r\n reorder: false\r\n })[0];\r\n });\r\n if (itemsReorderingAfter.length > 0) {\r\n defaultArr = defaultArr.concat(itemsReorderingAfter);\r\n }\r\n }\r\n else {\r\n const reorderedItems = this.reorderedItems.map((item, index) => {\r\n return this.$slots['item']({\r\n item: item,\r\n index: index,\r\n reorder: index === this.closestIndex\r\n })[0];\r\n });\r\n if (reorderedItems.length > 0) {\r\n defaultArr = defaultArr.concat(reorderedItems);\r\n }\r\n }\r\n }\r\n else {\r\n const itemsBefore = this.itemsBeforeFeedback.map((item, index) => {\r\n return this.$slots['item']({\r\n item: item,\r\n index: index,\r\n reorder: false\r\n })[0];\r\n });\r\n if (itemsBefore.length > 0) {\r\n defaultArr = defaultArr.concat(itemsBefore);\r\n }\r\n\r\n defaultArr.push(this.$slots['feedback']({\r\n key: 'drag-feedback',\r\n data: this.dragData,\r\n type: this.dragType\r\n })[0]);\r\n\r\n const itemsAfter = this.itemsAfterFeedback.map((item, index) => {\r\n return this.$slots['item']({\r\n item: item,\r\n index: this.itemsBeforeFeedback.length + index,\r\n reorder: false\r\n })[0];\r\n });\r\n if (itemsAfter.length > 0) {\r\n defaultArr = defaultArr.concat(itemsAfter);\r\n }\r\n }\r\n }\r\n else {\r\n const defaultItems = this.items.map((item, index) => {\r\n return this.$slots['item']({\r\n item: item,\r\n index: index,\r\n reorder: false\r\n })[0];\r\n });\r\n\r\n if (defaultItems.length > 0) {\r\n defaultArr = defaultArr.concat(defaultItems);\r\n }\r\n else if (this.hasEmptySlot) {\r\n defaultArr.push(this.$slots['empty']()[0]);\r\n }\r\n }\r\n\r\n if (this.showDragFeedback) {\r\n defaultArr.push(h(\r\n script$1,\r\n {\r\n class: '__feedback',\r\n ref: 'feedback',\r\n key: 'drag-feedback'\r\n },\r\n {\r\n default: () => this.$slots['feedback']({\r\n type: this.dragType,\r\n data: this.dragData\r\n })[0]\r\n }\r\n ));\r\n }\r\n\r\n if (this.showReorderingDragImage) {\r\n defaultArr.push(h(\r\n 'div',\r\n {\r\n class: '__drag-image',\r\n ref: 'drag-image',\r\n key: 'reordering-drag-image'\r\n },\r\n {\r\n default: () => this.$slots['reordering-drag-image']({\r\n item: this.items[this.fromIndex]\r\n })[0]\r\n }\r\n ));\r\n }\r\n\r\n if (this.showInsertingDragImage) {\r\n defaultArr.push(h(\r\n 'div',\r\n {\r\n class: '__drag-image',\r\n ref: 'drag-image',\r\n key: 'inserting-drag-image'\r\n },\r\n {\r\n default: () => this.$slots['drag-image']({\r\n type: this.dragType,\r\n data: this.dragData\r\n })[0]\r\n }\r\n ));\r\n }\r\n\r\n return h(\r\n this.rootTag,\r\n {\r\n ref: 'component',\r\n class: this.clazz,\r\n ...this.rootProps\r\n },\r\n {\r\n default: () => defaultArr\r\n }\r\n );\r\n }\r\n};\r\n\r\nscript.__scopeId = \"data-v-230f65e3\";\r\n\r\n/**\r\n * This class reacts to drag events emitted by the dnd object to manage a sequence of drag images and fade from one to the\r\n * other as the drag progresses.\r\n */\r\nclass DragImagesManager {\r\n\r\n selfTransform = null;\r\n clones = null;\r\n source = null;\r\n sourcePos = null;\r\n sourceClone = null;\r\n\r\n constructor () {\r\n dnd.on('dragstart', this.onDragStart.bind(this));\r\n dnd.on('dragtopchanged', this.onDragTopChanged.bind(this));\r\n dnd.on('dragpositionchanged', this.onDragPositionChanged.bind(this));\r\n dnd.on('dragend', this.onDragEnd.bind(this));\r\n }\r\n\r\n onDragStart (event) {\r\n // If go-back=true and it is still animating while they attempt another drag,\r\n // it will bug out. Best to clean up any existing elements on the page before\r\n // attempting to start the next animation\r\n this.cleanUp();\r\n\r\n this.sourcePos = {\r\n x: event.source.$el.getBoundingClientRect().left,\r\n y: event.source.$el.getBoundingClientRect().top\r\n };\r\n this.selfTransform = 'translate(-' + (event.position.x - this.sourcePos.x) + 'px, -' + (event.position.y - this.sourcePos.y) + 'px)';\r\n this.clones = new Map();\r\n this.source = event.source;\r\n }\r\n\r\n onDragEnd (event) {\r\n nextTick()\r\n .then(() => {\r\n if (!event.success && this.source && this.source['goBack']) {\r\n // Restore the drag image that is active when hovering outside any drop zone :\r\n const img = this.switch(null);\r\n \r\n // Move it back to its original place :\r\n window.requestAnimationFrame(() => {\r\n img.style.transition = 'all 0.5s';\r\n window.requestAnimationFrame(() => {\r\n img.style.left = this.sourcePos.x + 'px';\r\n img.style.top = this.sourcePos.y + 'px';\r\n img.style.transform = 'translate(0,0)';\r\n const handler = () => {\r\n this.cleanUp();\r\n img.removeEventListener('transitionend', handler);\r\n };\r\n img.addEventListener('transitionend', handler);\r\n });\r\n });\r\n }\r\n else {\r\n this.cleanUp();\r\n }\r\n });\r\n }\r\n\r\n cleanUp () {\r\n if (this.clones) {\r\n this.clones.forEach((clone) => {\r\n if (clone.parentNode === document.body) {\r\n document.body.removeChild(clone);\r\n }\r\n });\r\n }\r\n if (this.sourceClone !== null) {\r\n if (this.sourceClone.parentNode === document.body) {\r\n document.body.removeChild(this.sourceClone);\r\n }\r\n }\r\n this.selfTransform = null;\r\n this.clones = null;\r\n this.source = null;\r\n this.sourceClone = null;\r\n this.sourcePos = null;\r\n }\r\n\r\n onDragTopChanged (event) {\r\n this.switch(event.top);\r\n }\r\n\r\n switch (top) {\r\n this.clones.forEach(clone => {\r\n clone.style.opacity = '0';\r\n });\r\n if (this.sourceClone) {\r\n this.sourceClone.style.opacity = '0';\r\n }\r\n\r\n let activeClone;\r\n if (top === null) {\r\n activeClone = this.getSourceClone();\r\n }\r\n else {\r\n if (!this.clones.has(top)) {\r\n let clone = top['createDragImage'](this.selfTransform);\r\n if (clone === 'source') {\r\n clone = this.getSourceClone();\r\n }\r\n else if (clone !== null) {\r\n clone.style.opacity = '0';\r\n document.body.appendChild(clone);\r\n }\r\n this.clones.set(top, clone);\r\n }\r\n activeClone = this.clones.get(top);\r\n }\r\n\r\n if (activeClone !== null) {\r\n activeClone.offsetWidth; // Forces browser reflow\r\n activeClone.style.opacity = activeClone['__opacity'];\r\n activeClone.style.visibility = 'visible';\r\n }\r\n\r\n return activeClone;\r\n }\r\n\r\n getSourceClone () {\r\n if (this.sourceClone === null) {\r\n this.sourceClone = this.source['createDragImage'](this.selfTransform);\r\n this.sourceClone.style.opacity = '0';\r\n document.body.appendChild(this.sourceClone);\r\n }\r\n return this.sourceClone;\r\n }\r\n\r\n onDragPositionChanged () {\r\n this.clones.forEach((clone) => {\r\n clone.style.left = dnd.position.x + 'px';\r\n clone.style.top = dnd.position.y + 'px';\r\n });\r\n if (this.sourceClone) {\r\n this.sourceClone.style.left = dnd.position.x + 'px';\r\n this.sourceClone.style.top = dnd.position.y + 'px';\r\n }\r\n }\r\n\r\n}\r\n\r\nnew DragImagesManager();\r\n\r\nexport { DnDEvent, script$4 as Drag, DragAwareMixin, script$1 as DragFeedback, DragImagesManager, DragMixin, script$3 as Drop, script as DropList, script$2 as DropMask, DropMixin, InsertEvent, ReorderEvent, createDragImage, dnd };\r\n"],"names":["DnD","n","all","Map","on","t","e","i","get","push","set","off","splice","indexOf","emit","slice","map","source","event","x","y","type","data","position","top","inProgress","previousTop","success","this","resetVariables","comp","prevent","stopPropagation","detail","native","eventBus","callback","dnd","DragAwareMixin","isDropMask","computed","dragInProgress","dragData","dragType","dragPosition","dragSource","dragTop","createDragImage","el","clone","cloneNode","copyStyle","vSrcElements","getElementsByTagName","vDstElements","length","deepClone","style","margin","transition","src","destination","computedStyle","window","getComputedStyle","key","width","getPropertyValue","clientWidth","parseFloat","paddingLeft","paddingRight","setProperty","height","clientHeight","paddingTop","paddingBottom","getPropertyPriority","pointerEvents","regex","node","prop","scrollparent","document","body","test","scroll","parentNode","timer","cancelScrollAction","clearTimeout","performEdgeScroll","container","clientX","clientY","edgeSize","rect","getBoundingClientRect","isBody","viewportX","left","viewportY","viewportWidth","viewportHeight","documentElement","edgeTop","edgeLeft","edgeBottom","edgeRight","isInLeftEdge","isInRightEdge","isInTopEdge","isInBottomEdge","documentWidth","Math","max","scrollWidth","offsetWidth","documentHeight","scrollHeight","offsetHeight","maxScrollX","maxScrollY","checkForWindowScroll","currentScrollX","scrollLeft","currentScrollY","scrollTop","pageXOffset","pageYOffset","canScrollUp","canScrollDown","canScrollLeft","canScrollRight","nextScrollX","nextScrollY","maxStep","min","scrollTo","adjustWindowScroll","setTimeout","DragMixin","mixins","props","String","default","dragImageOpacity","Number","disabled","Boolean","goBack","handle","delta","delay","dragClass","vibration","scrollingEdgeSize","emits","dragInitialised","dragStarted","ignoreNextClick","initialUserSelect","downEvent","startPosition","delayTimer","scrollContainer","cssClasses","clazz","currentDropMode","methods","onSelectStart","preventDefault","performVibration","navigator","vibrate","onMouseDown","target","goodButton","mouse","buttons","touches","matches","userSelect","touch","_this","addEventListener","onMouseClick","onMouseUp","onKeyUp","onMouseMove","passive","onEasyDnDMove","stopImmediatePropagation","elementFromPoint","dist","sqrt","pow","startDrag","classList","add","currEdgeSize","undefined","$props","$el","custom","CustomEvent","bubbles","cancelable","dispatchEvent","mouseMove","_this2","cancelDragActions","stopDrag","finishDrag","cancelDrag","_this3","remove","removeEventListener","dndDragStart","ev","$emit","dndDragEnd","selfTransform","image","$slots","$refs","createElement","childElementCount","children","item","transform","created","mounted","beforeUnmount","script$4","name","tag","Object","Function","dynamicSlots","entries","filter","_hoisted_1$2","ref","class","dropAllowed","inst","typeAllowed","compatibleMode","effectiveAcceptsData","doDrop","mode","candidate","effectiveAcceptsType","render","_ctx","_cache","$setup","$data","$options","_","slot","args","fn","__scopeId","DropMixin","acceptsType","Array","acceptsData","isDrop","dropIn","_typeof","isArray","includes","onDragPositionChanged","onDragTopChanged","onDragEnd","onDrop","onDnDMove","script$3","showDragImage","_hoisted_1$1","script$2","onDndMove","script$1","_hoisted_1","Grid","collection","upToIndex","direction","fromIndex","reference","referenceOriginalPosition","index","child","hasNestedDrop","contains","getElementsByClassName","horizontal","magnets","before","center","after","correction","minDist","magnet","DnDEvent","ReorderEvent","from","to","array","temp","InsertEvent","script","items","required","row","column","noAnimations","grid","forbiddenKeys","feedbackKey","rootTag","TransitionGroup","rootProps","css","reordering","parentElement","closestIndex","itemsBeforeFeedback","itemsAfterFeedback","itemsBeforeReorderingFeedback","itemsAfterReorderingFeedback","reorderedItems","toIndex","reordered","showDragFeedback","showInsertingDragImage","showReorderingDragImage","hasReorderingFeedback","hasEmptySlot","onDragStart","refresh","$nextTick","_this4","computeInsertingGrid","computeFeedbackKey","computeForbiddenKeys","prototype","call","computeReorderingGrid","component","vn","k","feedback","tg","insertBefore","appendChild","removeChild","defaultArr","itemsReorderingBefore","_this5","reorder","concat","itemsReorderingAfter","itemsBefore","itemsAfter","defaultItems","DragImagesManager","bind","cleanUp","sourcePos","clones","then","_this6","img","switch","requestAnimationFrame","handler","forEach","sourceClone","activeClone","opacity","getSourceClone","has","visibility"],"mappings":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nW,KAAKwV,OAAOY,IAAIxW,KAAM,KACrByB,MAAQzB,IAAG,gBAAoBI,KAAKkM,eAC1B,WAAV7K,MACFA,MAAQrB,KAAKmW,iBAEI,OAAV9U,QACPA,MAAMQ,MAAMqU,QAAU,IACtB3S,SAASC,KAAKiR,YAAYpT,aAEvBmU,OAAO1W,IAAIc,IAAKyB,OAEvB4U,YAAcjW,KAAKwV,OAAO5W,IAAIgB,YAGZ,OAAhBqW,cACFA,YAAYxQ,YACZwQ,YAAYpU,MAAMqU,QAAUD,YAAW,UACvCA,YAAYpU,MAAMwU,WAAa,WAG1BJ,0CAGT,kBAC2B,OAArBjW,KAAKgW,mBACFA,YAAchW,KAAKX,OAAL,gBAA+BW,KAAKkM,oBAClD8J,YAAYnU,MAAMqU,QAAU,IACjC3S,SAASC,KAAKiR,YAAYzU,KAAKgW,cAE1BhW,KAAKgW,iDAGd,gBACOR,OAAOO,SAAQ,SAAC1U,OACnBA,MAAMQ,MAAM2C,KAAO/D,IAAId,SAASJ,EAAI,KACpC8B,MAAMQ,MAAMjC,IAAMa,IAAId,SAASH,EAAI,QAEjCQ,KAAKgW,mBACFA,YAAYnU,MAAM2C,KAAO/D,IAAId,SAASJ,EAAI,UAC1CyW,YAAYnU,MAAMjC,IAAMa,IAAId,SAASH,EAAI,gFAMlD4V"} \ No newline at end of file +{"version":3,"file":"vue-easy-dnd.esm.min.js","sources":["../../src/vue-easy-dnd/vue-easy-dnd.esm.js"],"sourcesContent":["/* eslint-disable */\r\nimport './reflect-metadata';\r\nimport { Vue, Component, Prop } from './vue-property-decorator';\r\n\r\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/**\r\n * This is the class of the global object that holds the state of the drag and drop during its progress. It emits events\r\n * reporting its state evolution during the progress of the drag and drop. Its data is reactive and listeners can be\r\n * attachted to it using the method on.\r\n */\r\nvar DnD = /** @class */ (function () {\r\n function DnD() {\r\n this.inProgress = false;\r\n this.type = null;\r\n this.data = null;\r\n this.source = null;\r\n this.top = null;\r\n this.position = null;\r\n this.eventBus = new Vue();\r\n this.sourceListeners = null;\r\n this.success = null;\r\n }\r\n DnD.prototype.startDrag = function (source, event, x, y, type, data) {\r\n this.type = type;\r\n this.data = data;\r\n this.source = source;\r\n this.position = { x: x, y: y };\r\n this.top = null;\r\n this.sourceListeners = source.$listeners;\r\n this.inProgress = true;\r\n this.emit(event, \"dragstart\");\r\n this.emit(event, \"dragtopchanged\", { previousTop: null });\r\n };\r\n DnD.prototype.resetVariables = function () {\r\n this.inProgress = false;\r\n this.data = null;\r\n this.source = null;\r\n this.position = null;\r\n this.success = null;\r\n };\r\n DnD.prototype.stopDrag = function (event) {\r\n this.success = this.top !== null && this.top['compatibleMode'] && this.top['dropAllowed'];\r\n if (this.top !== null) {\r\n this.emit(event, \"drop\");\r\n }\r\n this.emit(event, \"dragend\");\r\n this.resetVariables();\r\n };\r\n DnD.prototype.cancelDrag = function (event) {\r\n this.success = false;\r\n this.emit(event, \"dragend\");\r\n this.resetVariables();\r\n };\r\n DnD.prototype.mouseMove = function (event, comp) {\r\n if (this.inProgress) {\r\n var prevent = false;\r\n var previousTop = this.top;\r\n if (comp === null) {\r\n // The mouse move event reached the top of the document without hitting a drop component.\r\n this.top = null;\r\n prevent = true;\r\n }\r\n else if (comp['isDropMask']) {\r\n // The mouse move event bubbled until it reached a drop mask.\r\n this.top = null;\r\n prevent = true;\r\n }\r\n else if (comp['candidate'](this.type, this.data, this.source)) {\r\n // The mouse move event bubbled until it reached a drop component that participates in the current drag operation.\r\n this.top = comp;\r\n prevent = true;\r\n }\r\n if (prevent) {\r\n // We prevent the mouse move event from bubbling further up the tree because it reached the foremost drop component and that component is all that matters.\r\n event.stopPropagation();\r\n }\r\n if (this.top !== previousTop) {\r\n this.emit(event.detail.native, 'dragtopchanged', { previousTop: previousTop });\r\n }\r\n this.position = {\r\n x: event.detail.x,\r\n y: event.detail.y\r\n };\r\n this.emit(event.detail.native, 'dragpositionchanged');\r\n }\r\n };\r\n DnD.prototype.emit = function (native, event, data) {\r\n this.eventBus.$emit(event, __assign({ type: this.type, data: this.data, top: this.top, source: this.source, position: this.position, success: this.success, native: native }, data));\r\n };\r\n DnD.prototype.on = function (event, callback) {\r\n this.eventBus.$on(event, callback);\r\n };\r\n DnD.prototype.off = function (event, callback) {\r\n this.eventBus.$off(event, callback);\r\n };\r\n return DnD;\r\n}());\r\nvar dnd = new DnD();\r\ndnd = Vue.observable(dnd);\r\n\r\nvar DragAwareMixin = /** @class */ (function (_super) {\r\n __extends(DragAwareMixin, _super);\r\n function DragAwareMixin() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(DragAwareMixin.prototype, \"dragInProgress\", {\r\n get: function () {\r\n return dnd.inProgress;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DragAwareMixin.prototype, \"dragData\", {\r\n get: function () {\r\n return dnd.data;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DragAwareMixin.prototype, \"dragType\", {\r\n get: function () {\r\n return dnd.type;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DragAwareMixin.prototype, \"dragPosition\", {\r\n get: function () {\r\n return dnd.position;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DragAwareMixin.prototype, \"dragSource\", {\r\n get: function () {\r\n return dnd.source;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DragAwareMixin.prototype, \"dragTop\", {\r\n get: function () {\r\n return dnd.top;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DragAwareMixin = __decorate([\r\n Component({})\r\n ], DragAwareMixin);\r\n return DragAwareMixin;\r\n}(Vue));\r\n\r\n/**\r\n * This files contains the primitives required to create drag images from HTML elements that serve as models. A snapshot\r\n * of the computed styles of the model elements is taken when creating the drag image, so that it will look the same as\r\n * the model, no matter where the drag images is grafted into the DOM.\r\n */\r\n/**\r\n * Creates a drag image using the given element as model.\r\n */\r\nfunction createDragImage(el) {\r\n var clone = deepClone(el);\r\n clone.style.position = 'fixed';\r\n clone.style.margin = '0';\r\n clone.style[\"z-index\"] = '1000';\r\n clone.style.transition = 'opacity 0.2s';\r\n return clone;\r\n}\r\n/**\r\n * Clones the given element and all its descendants.\r\n */\r\nfunction deepClone(el) {\r\n var clone = el.cloneNode(true);\r\n copyStyle(el, clone);\r\n var vSrcElements = el.getElementsByTagName(\"*\");\r\n var vDstElements = clone.getElementsByTagName(\"*\");\r\n for (var i = vSrcElements.length; i--;) {\r\n var vSrcElement = vSrcElements[i];\r\n var vDstElement = vDstElements[i];\r\n copyStyle(vSrcElement, vDstElement);\r\n }\r\n return clone;\r\n}\r\n/**\r\n * Copy the computed styles from src to destination.\r\n */\r\nfunction copyStyle(src, destination) {\r\n var e_1, _a;\r\n var computedStyle = window.getComputedStyle(src);\r\n try {\r\n for (var computedStyle_1 = __values(computedStyle), computedStyle_1_1 = computedStyle_1.next(); !computedStyle_1_1.done; computedStyle_1_1 = computedStyle_1.next()) {\r\n var key = computedStyle_1_1.value;\r\n if (key === 'width') {\r\n // IE11\r\n var width = computedStyle.getPropertyValue(\"box-sizing\") === 'border-box' ?\r\n src.clientWidth :\r\n src.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight);\r\n destination.style.setProperty(\"width\", width + \"px\");\r\n }\r\n else if (key === 'height') {\r\n // IE11\r\n var height = computedStyle.getPropertyValue(\"box-sizing\") === 'border-box' ?\r\n src.clientHeight :\r\n src.clientHeight - parseFloat(computedStyle.paddingTop) - parseFloat(computedStyle.paddingBottom);\r\n destination.style.setProperty(\"height\", height + \"px\");\r\n }\r\n else {\r\n destination.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key));\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (computedStyle_1_1 && !computedStyle_1_1.done && (_a = computedStyle_1.return)) { _a.call(computedStyle_1); }\r\n }\r\n finally { if (e_1) { throw e_1.error; } }\r\n }\r\n destination.style.pointerEvents = 'none';\r\n}\r\n\r\n// Forked from https://gist.github.com/gre/296291b8ce0d8fe6e1c3ea4f1d1c5c3b\r\nvar regex = /(auto|scroll)/;\r\n\r\nvar style = function (node, prop) { return getComputedStyle(node, null).getPropertyValue(prop); };\r\n\r\nvar scroll = function (node) { return regex.test(\r\n style(node, \"overflow\") +\r\n style(node, \"overflow-y\") +\r\n style(node, \"overflow-x\")); };\r\n\r\nvar scrollparent = function (node) { return !node || node===document.body\r\n ? document.body\r\n : scroll(node)\r\n ? node\r\n : scrollparent(node.parentNode); };\r\n\r\n// Forked from https://github.com/bennadel/JavaScript-Demos/blob/master/demos/window-edge-scrolling/index.htm\r\n// Code was altered to work with scrollable containers\r\n\r\nvar timer = null;\r\n\r\nfunction cancelScrollAction () {\r\n clearTimeout(timer);\r\n}\r\n\r\nfunction performEdgeScroll(event, container, clientX, clientY, edgeSize) {\r\n if (!container || !edgeSize) {\r\n cancelScrollAction();\r\n return false;\r\n }\r\n \r\n // NOTE: Much of the information here, with regard to document dimensions,\r\n // viewport dimensions, and window scrolling is derived from JavaScript.info.\r\n // I am consuming it here primarily as NOTE TO SELF.\r\n // --\r\n // Read More: https://javascript.info/size-and-scroll-window\r\n // --\r\n // CAUTION: The viewport and document dimensions can all be CACHED and then\r\n // recalculated on window-resize events (for the most part). I am keeping it\r\n // all here in the mousemove event handler to remove as many of the moving\r\n // parts as possible and keep the demo as simple as possible.\r\n \r\n // Get the viewport-relative coordinates of the mousemove event.\r\n var rect = container.getBoundingClientRect();\r\n var isBody = container === document.body;\r\n \r\n var viewportX = clientX - rect.left;\r\n var viewportY = clientY - rect.top;\r\n if (isBody) {\r\n viewportX = clientX;\r\n viewportY = clientY;\r\n }\r\n \r\n // Get the viewport dimensions.\r\n var viewportWidth = rect.width;\r\n var viewportHeight = rect.height;\r\n if (isBody) {\r\n viewportWidth = document.documentElement.clientWidth;\r\n viewportHeight = document.documentElement.clientHeight;\r\n }\r\n \r\n // Next, we need to determine if the mouse is within the \"edge\" of the\r\n // viewport, which may require scrolling the window. To do this, we need to\r\n // calculate the boundaries of the edge in the viewport (these coordinates\r\n // are relative to the viewport grid system).\r\n var edgeTop = edgeSize;\r\n var edgeLeft = edgeSize;\r\n var edgeBottom = ( viewportHeight - edgeSize );\r\n var edgeRight = ( viewportWidth - edgeSize );\r\n \r\n var isInLeftEdge = ( viewportX < edgeLeft );\r\n var isInRightEdge = ( viewportX > edgeRight );\r\n var isInTopEdge = ( viewportY < edgeTop );\r\n var isInBottomEdge = ( viewportY > edgeBottom );\r\n \r\n // If the mouse is not in the viewport edge, there's no need to calculate\r\n // anything else.\r\n if (!(isInLeftEdge || isInRightEdge || isInTopEdge || isInBottomEdge)) {\r\n cancelScrollAction();\r\n return false;\r\n }\r\n \r\n // If we made it this far, the user's mouse is located within the edge of the\r\n // viewport. As such, we need to check to see if scrolling needs to be done.\r\n \r\n // Get the document dimensions.\r\n var documentWidth = Math.max(\r\n container.scrollWidth,\r\n container.offsetWidth,\r\n container.clientWidth\r\n );\r\n var documentHeight = Math.max(\r\n container.scrollHeight,\r\n container.offsetHeight,\r\n container.clientHeight\r\n );\r\n \r\n // Calculate the maximum scroll offset in each direction. Since you can only\r\n // scroll the overflow portion of the document, the maximum represents the\r\n // length of the document that is NOT in the viewport.\r\n var maxScrollX = (documentWidth - viewportWidth);\r\n var maxScrollY = (documentHeight - viewportHeight);\r\n \r\n // As we examine the mousemove event, we want to adjust the window scroll in\r\n // immediate response to the event; but, we also want to continue adjusting\r\n // the window scroll if the user rests their mouse in the edge boundary. To\r\n // do this, we'll invoke the adjustment logic immediately. Then, we'll setup\r\n // a timer that continues to invoke the adjustment logic while the window can\r\n // still be scrolled in a particular direction.\r\n (function checkForWindowScroll() {\r\n cancelScrollAction();\r\n \r\n if (adjustWindowScroll()) {\r\n timer = setTimeout( checkForWindowScroll, 30 );\r\n }\r\n })();\r\n \r\n // Adjust the window scroll based on the user's mouse position. Returns True\r\n // or False depending on whether or not the window scroll was changed.\r\n function adjustWindowScroll() {\r\n // Get the current scroll position of the document.\r\n var currentScrollX = container.scrollLeft;\r\n var currentScrollY = container.scrollTop;\r\n if (isBody) {\r\n currentScrollX = window.pageXOffset;\r\n currentScrollY = window.pageYOffset;\r\n }\r\n \r\n // Determine if the window can be scrolled in any particular direction.\r\n var canScrollUp = (currentScrollY > 0);\r\n var canScrollDown = (currentScrollY < maxScrollY);\r\n var canScrollLeft = (currentScrollX > 0);\r\n var canScrollRight = (currentScrollX < maxScrollX);\r\n \r\n // Since we can potentially scroll in two directions at the same time,\r\n // let's keep track of the next scroll, starting with the current scroll.\r\n // Each of these values can then be adjusted independently in the logic\r\n // below.\r\n var nextScrollX = currentScrollX;\r\n var nextScrollY = currentScrollY;\r\n \r\n // As we examine the mouse position within the edge, we want to make the\r\n // incremental scroll changes more \"intense\" the closer that the user\r\n // gets the viewport edge. As such, we'll calculate the percentage that\r\n // the user has made it \"through the edge\" when calculating the delta.\r\n // Then, that use that percentage to back-off from the \"max\" step value.\r\n var maxStep = 50;\r\n \r\n // Should we scroll left?\r\n if (isInLeftEdge && canScrollLeft) {\r\n var intensity = ((edgeLeft - viewportX) / edgeSize);\r\n nextScrollX = (nextScrollX - (maxStep * intensity));\r\n }\r\n // Should we scroll right?\r\n else if (isInRightEdge && canScrollRight) {\r\n var intensity = ((viewportX - edgeRight) / edgeSize);\r\n nextScrollX = (nextScrollX + (maxStep * intensity));\r\n }\r\n \r\n // Should we scroll up?\r\n if (isInTopEdge && canScrollUp) {\r\n var intensity = ((edgeTop - viewportY) / edgeSize);\r\n nextScrollY = (nextScrollY - (maxStep * intensity));\r\n }\r\n // Should we scroll down?\r\n else if (isInBottomEdge && canScrollDown) {\r\n var intensity = ((viewportY - edgeBottom) / edgeSize);\r\n nextScrollY = (nextScrollY + (maxStep * intensity));\r\n }\r\n \r\n // Sanitize invalid maximums. An invalid scroll offset won't break the\r\n // subsequent .scrollTo() call; however, it will make it harder to\r\n // determine if the .scrollTo() method should have been called in the\r\n // first place.\r\n nextScrollX = Math.max(0, Math.min(maxScrollX, nextScrollX));\r\n nextScrollY = Math.max(0, Math.min(maxScrollY, nextScrollY));\r\n \r\n if (\r\n (nextScrollX !== currentScrollX) ||\r\n (nextScrollY !== currentScrollY)\r\n ) {\r\n (isBody ? window : container).scrollTo(nextScrollX, nextScrollY);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n \r\n return true\r\n}\r\n\r\nvar DragMixin = /** @class */ (function (_super) {\r\n __extends(DragMixin, _super);\r\n function DragMixin() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.dragInitialised = false;\r\n _this.dragStarted = false;\r\n _this.ignoreNextClick = false;\r\n _this.initialUserSelect = null;\r\n _this.downEvent = null;\r\n _this.startPosition = null;\r\n _this.delayTimer = null;\r\n _this.scrollContainer = null;\r\n return _this;\r\n }\r\n DragMixin.prototype.onSelectStart = function (e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n DragMixin.prototype.performVibration = function () {\r\n // If browser can perform vibration and user has defined a vibration, perform it\r\n if (this.vibration > 0 && window.navigator && window.navigator.vibrate) {\r\n window.navigator.vibrate(this.vibration);\r\n }\r\n };\r\n DragMixin.prototype.onMouseDown = function (e) {\r\n var _this = this;\r\n var target;\r\n var goodButton;\r\n if (e.type === 'mousedown') {\r\n var mouse = e;\r\n target = e.target;\r\n goodButton = mouse.buttons === 1;\r\n }\r\n else {\r\n var touch = e;\r\n target = touch.touches[0].target;\r\n goodButton = true;\r\n }\r\n if (this.disabled || this.downEvent !== null || !goodButton) {\r\n return;\r\n }\r\n // Check that the target element is eligible for starting a drag\r\n // Includes checking against the handle selector\r\n // or whether the element contains 'dnd-no-drag' class (which should disable dragging from that\r\n // sub-element of a draggable parent)\r\n var goodTarget = !target.matches('.dnd-no-drag, .dnd-no-drag *') &&\r\n (!this.handle ||\r\n target.matches(this.handle + ', ' + this.handle + ' *'));\r\n if (!goodTarget) {\r\n return;\r\n }\r\n this.scrollContainer = scrollparent(target);\r\n this.initialUserSelect = document.body.style.userSelect;\r\n document.documentElement.style.userSelect = 'none'; // Permet au drag de se poursuivre normalement même\r\n // quand on quitte un élémént avec overflow: hidden.\r\n this.dragStarted = false;\r\n this.downEvent = e;\r\n if (this.downEvent.type === 'mousedown') {\r\n var mouse = event;\r\n this.startPosition = {\r\n x: mouse.clientX,\r\n y: mouse.clientY\r\n };\r\n }\r\n else {\r\n var touch = event;\r\n this.startPosition = {\r\n x: touch.touches[0].clientX,\r\n y: touch.touches[0].clientY\r\n };\r\n }\r\n if (!!this.delay) {\r\n this.dragInitialised = false;\r\n clearTimeout(this.delayTimer);\r\n this.delayTimer = setTimeout(function () {\r\n _this.dragInitialised = true;\r\n _this.performVibration();\r\n }, this.delay);\r\n }\r\n else {\r\n this.dragInitialised = true;\r\n this.performVibration();\r\n }\r\n document.addEventListener('click', this.onMouseClick, true);\r\n document.addEventListener('mouseup', this.onMouseUp);\r\n document.addEventListener('touchend', this.onMouseUp);\r\n document.addEventListener('selectstart', this.onSelectStart);\r\n document.addEventListener('keyup', this.onKeyUp);\r\n setTimeout(function () {\r\n document.addEventListener('mousemove', _this.onMouseMove);\r\n document.addEventListener('touchmove', _this.onMouseMove, { passive: false });\r\n document.addEventListener('easy-dnd-move', _this.onEasyDnDMove);\r\n }, 0);\r\n // Prevents event from bubbling to ancestor drag components and initiate several drags at the same time\r\n e.stopPropagation();\r\n };\r\n // Prevent the user from accidentally causing a click event\r\n // if they have just attempted a drag event\r\n DragMixin.prototype.onMouseClick = function (e) {\r\n if (this.ignoreNextClick) {\r\n e.preventDefault();\r\n e.stopPropagation && e.stopPropagation();\r\n e.stopImmediatePropagation && e.stopImmediatePropagation();\r\n this.ignoreNextClick = false;\r\n return false;\r\n }\r\n };\r\n DragMixin.prototype.onMouseMove = function (e) {\r\n // We ignore the mousemove event that follows touchend :\r\n if (this.downEvent === null)\r\n { return; }\r\n // On touch devices, we ignore fake mouse events and deal with touch events only.\r\n if (this.downEvent.type === 'touchstart' && e.type === 'mousemove')\r\n { return; }\r\n // Find out event target and pointer position :\r\n var target;\r\n var x;\r\n var y;\r\n if (e.type === 'touchmove') {\r\n var touch = e;\r\n x = touch.touches[0].clientX;\r\n y = touch.touches[0].clientY;\r\n target = document.elementFromPoint(x, y);\r\n if (!target) {\r\n // Mouse going off screen. Ignore event.\r\n return;\r\n }\r\n }\r\n else {\r\n var mouse = e;\r\n x = mouse.clientX;\r\n y = mouse.clientY;\r\n target = mouse.target;\r\n }\r\n // Distance between current event and start position :\r\n var dist = Math.sqrt(Math.pow(this.startPosition.x - x, 2) + Math.pow(this.startPosition.y - y, 2));\r\n // If the drag has not begun yet and distance from initial point is greater than delta, we start the drag :\r\n if (!this.dragStarted && dist > this.delta) {\r\n // If they have dragged greater than the delta before the delay period has ended,\r\n // It means that they attempted to perform another action (such as scrolling) on the page\r\n if (!this.dragInitialised) {\r\n clearTimeout(this.delayTimer);\r\n }\r\n else {\r\n this.ignoreNextClick = true;\r\n this.dragStarted = true;\r\n dnd.startDrag(this, this.downEvent, this.startPosition.x, this.startPosition.y, this.type, this.data);\r\n document.documentElement.classList.add('drag-in-progress');\r\n }\r\n }\r\n // Dispatch custom easy-dnd-move event :\r\n if (this.dragStarted) {\r\n // If cursor/touch is at edge of container, perform scroll if available\r\n // If this.dragTop is defined, it means they are dragging on top of another DropList/EasyDnd component\r\n // if dropTop is a DropList, use the scrollingEdgeSize of that container if it exists, otherwise use the scrollingEdgeSize of the Drag component\r\n var currEdgeSize = this.dragTop && this.dragTop.$props.scrollingEdgeSize !== undefined ?\r\n this.dragTop.$props.scrollingEdgeSize :\r\n this.scrollingEdgeSize;\r\n if (!!currEdgeSize) {\r\n var currScrollContainer = this.dragTop ? scrollparent(this.dragTop.$el) : this.scrollContainer;\r\n performEdgeScroll(e, currScrollContainer, x, y, currEdgeSize);\r\n }\r\n else {\r\n cancelScrollAction();\r\n }\r\n var custom = new CustomEvent(\"easy-dnd-move\", {\r\n bubbles: true,\r\n cancelable: true,\r\n detail: {\r\n x: x,\r\n y: y,\r\n native: e\r\n }\r\n });\r\n target.dispatchEvent(custom);\r\n }\r\n // Prevent scroll on touch devices if they were performing a drag\r\n if (this.dragInitialised && e.cancelable) {\r\n e.preventDefault();\r\n }\r\n };\r\n DragMixin.prototype.onEasyDnDMove = function (e) {\r\n dnd.mouseMove(e, null);\r\n };\r\n DragMixin.prototype.onMouseUp = function (e) {\r\n var _this = this;\r\n // On touch devices, we ignore fake mouse events and deal with touch events only.\r\n if (this.downEvent.type === 'touchstart' && e.type === 'mouseup')\r\n { return; }\r\n // This delay makes sure that when the click event that results from the mouseup is produced, the drag is\r\n // still in progress. So by checking the flag dnd.inProgress, one can tell apart true clicks from drag and\r\n // drop artefacts.\r\n setTimeout(function () {\r\n _this.cancelDragActions();\r\n if (_this.dragStarted) {\r\n dnd.stopDrag(e);\r\n }\r\n _this.finishDrag();\r\n }, 0);\r\n };\r\n DragMixin.prototype.onKeyUp = function (e) {\r\n var _this = this;\r\n // If ESC is pressed, cancel the drag\r\n if (e.key === 'Escape') {\r\n this.cancelDragActions();\r\n setTimeout(function () {\r\n dnd.cancelDrag(e);\r\n _this.finishDrag();\r\n }, 0);\r\n }\r\n };\r\n DragMixin.prototype.cancelDragActions = function () {\r\n this.dragInitialised = false;\r\n clearTimeout(this.delayTimer);\r\n cancelScrollAction();\r\n };\r\n DragMixin.prototype.finishDrag = function () {\r\n this.downEvent = null;\r\n this.scrollContainer = null;\r\n if (this.dragStarted) {\r\n document.documentElement.classList.remove('drag-in-progress');\r\n }\r\n document.removeEventListener('click', this.onMouseClick, true);\r\n document.removeEventListener('mousemove', this.onMouseMove);\r\n document.removeEventListener('touchmove', this.onMouseMove);\r\n document.removeEventListener('easy-dnd-move', this.onEasyDnDMove);\r\n document.removeEventListener('mouseup', this.onMouseUp);\r\n document.removeEventListener('touchend', this.onMouseUp);\r\n document.removeEventListener('selectstart', this.onSelectStart);\r\n document.removeEventListener('keyup', this.onKeyUp);\r\n document.documentElement.style.userSelect = this.initialUserSelect;\r\n };\r\n DragMixin.prototype.dndDragStart = function (ev) {\r\n if (ev.source === this) {\r\n this.$emit('dragstart', ev);\r\n }\r\n };\r\n DragMixin.prototype.dndDragEnd = function (ev) {\r\n if (ev.source === this) {\r\n this.$emit('dragend', ev);\r\n }\r\n };\r\n DragMixin.prototype.created = function () {\r\n dnd.on('dragstart', this.dndDragStart);\r\n dnd.on('dragend', this.dndDragEnd);\r\n };\r\n DragMixin.prototype.mounted = function () {\r\n this.$el.addEventListener('mousedown', this.onMouseDown);\r\n this.$el.addEventListener('touchstart', this.onMouseDown);\r\n };\r\n DragMixin.prototype.beforeDestroy = function () {\r\n dnd.off('dragstart', this.dndDragStart);\r\n dnd.off('dragend', this.dndDragEnd);\r\n this.$el.removeEventListener('mousedown', this.onMouseDown);\r\n this.$el.removeEventListener('touchstart', this.onMouseDown);\r\n };\r\n Object.defineProperty(DragMixin.prototype, \"cssClasses\", {\r\n get: function () {\r\n var clazz = {\r\n 'dnd-drag': true\r\n };\r\n if (!this.disabled) {\r\n return __assign(__assign({}, clazz), { 'drag-source': this.dragInProgress && this.dragSource === this, 'drag-mode-copy': this.currentDropMode === 'copy', 'drag-mode-cut': this.currentDropMode === 'cut', 'drag-mode-reordering': this.currentDropMode === 'reordering', 'drag-no-handle': !this.handle });\r\n }\r\n else {\r\n return clazz;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DragMixin.prototype, \"currentDropMode\", {\r\n get: function () {\r\n if (this.dragInProgress && this.dragSource === this) {\r\n if (this.dragTop && this.dragTop['dropAllowed']) {\r\n if (this.dragTop['reordering'])\r\n { return 'reordering'; }\r\n else\r\n { return this.dragTop['mode']; }\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DragMixin.prototype.createDragImage = function (selfTransform) {\r\n var image;\r\n if (this.$scopedSlots['drag-image']) {\r\n var el = this.$refs['drag-image'] || document.createElement('div');\r\n if (el.childElementCount !== 1) {\r\n image = createDragImage(el);\r\n }\r\n else {\r\n image = createDragImage(el.children.item(0));\r\n }\r\n }\r\n else {\r\n image = createDragImage(this.$el);\r\n image.style.transform = selfTransform;\r\n }\r\n if (this.dragClass) {\r\n image.classList.add(this.dragClass);\r\n }\r\n image.classList.add('dnd-ghost');\r\n image['__opacity'] = this.dragImageOpacity;\r\n return image;\r\n };\r\n __decorate([\r\n Prop({ default: null, type: null }),\r\n __metadata(\"design:type\", String)\r\n ], DragMixin.prototype, \"type\", void 0);\r\n __decorate([\r\n Prop({ default: null, type: null }),\r\n __metadata(\"design:type\", Object)\r\n ], DragMixin.prototype, \"data\", void 0);\r\n __decorate([\r\n Prop({ default: 0.7, type: Number }),\r\n __metadata(\"design:type\", Object)\r\n ], DragMixin.prototype, \"dragImageOpacity\", void 0);\r\n __decorate([\r\n Prop({ default: false, type: Boolean }),\r\n __metadata(\"design:type\", Boolean)\r\n ], DragMixin.prototype, \"disabled\", void 0);\r\n __decorate([\r\n Prop({ default: false, type: Boolean }),\r\n __metadata(\"design:type\", Boolean)\r\n ], DragMixin.prototype, \"goBack\", void 0);\r\n __decorate([\r\n Prop({ required: false, type: String }),\r\n __metadata(\"design:type\", String)\r\n ], DragMixin.prototype, \"handle\", void 0);\r\n __decorate([\r\n Prop({ type: Number, default: 3 }),\r\n __metadata(\"design:type\", Number)\r\n ], DragMixin.prototype, \"delta\", void 0);\r\n __decorate([\r\n Prop({ type: Number, default: 0 }),\r\n __metadata(\"design:type\", Number)\r\n ], DragMixin.prototype, \"delay\", void 0);\r\n __decorate([\r\n Prop({ type: String, default: null }),\r\n __metadata(\"design:type\", String)\r\n ], DragMixin.prototype, \"dragClass\", void 0);\r\n __decorate([\r\n Prop({ type: Number, default: 0 }),\r\n __metadata(\"design:type\", Number)\r\n ], DragMixin.prototype, \"vibration\", void 0);\r\n __decorate([\r\n Prop({ type: Number, default: 100 }),\r\n __metadata(\"design:type\", Number)\r\n ], DragMixin.prototype, \"scrollingEdgeSize\", void 0);\r\n DragMixin = __decorate([\r\n Component({})\r\n ], DragMixin);\r\n return DragMixin;\r\n}(DragAwareMixin));\r\n\r\nvar Drag = /** @class */ (function (_super) {\r\n __extends(Drag, _super);\r\n function Drag() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n __decorate([\r\n Prop({ default: 'div', type: [String, Object, Function] }),\r\n __metadata(\"design:type\", Object)\r\n ], Drag.prototype, \"tag\", void 0);\r\n Drag = __decorate([\r\n Component({})\r\n ], Drag);\r\n return Drag;\r\n}(DragMixin));\r\n\r\nfunction normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\r\n/* server only */\r\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\r\n if (typeof shadowMode !== 'boolean') {\r\n createInjectorSSR = createInjector;\r\n createInjector = shadowMode;\r\n shadowMode = false;\r\n } // Vue.extend constructor export interop.\r\n\r\n\r\n var options = typeof script === 'function' ? script.options : script; // render functions\r\n\r\n if (template && template.render) {\r\n options.render = template.render;\r\n options.staticRenderFns = template.staticRenderFns;\r\n options._compiled = true; // functional template\r\n\r\n if (isFunctionalTemplate) {\r\n options.functional = true;\r\n }\r\n } // scopedId\r\n\r\n\r\n if (scopeId) {\r\n options._scopeId = scopeId;\r\n }\r\n\r\n var hook;\r\n\r\n if (moduleIdentifier) {\r\n // server build\r\n hook = function hook(context) {\r\n // 2.3 injection\r\n context = context || // cached call\r\n this.$vnode && this.$vnode.ssrContext || // stateful\r\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\r\n // 2.2 with runInNewContext: true\r\n\r\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\r\n context = __VUE_SSR_CONTEXT__;\r\n } // inject component styles\r\n\r\n\r\n if (style) {\r\n style.call(this, createInjectorSSR(context));\r\n } // register component module identifier for async chunk inference\r\n\r\n\r\n if (context && context._registeredComponents) {\r\n context._registeredComponents.add(moduleIdentifier);\r\n }\r\n }; // used by ssr in case component is cached and beforeCreate\r\n // never gets called\r\n\r\n\r\n options._ssrRegister = hook;\r\n } else if (style) {\r\n hook = shadowMode ? function () {\r\n style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));\r\n } : function (context) {\r\n style.call(this, createInjector(context));\r\n };\r\n }\r\n\r\n if (hook) {\r\n if (options.functional) {\r\n // register for functional component in vue file\r\n var originalRender = options.render;\r\n\r\n options.render = function renderWithStyleInjection(h, context) {\r\n hook.call(context);\r\n return originalRender(h, context);\r\n };\r\n } else {\r\n // inject component registration as beforeCreate hook\r\n var existing = options.beforeCreate;\r\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\r\n }\r\n }\r\n\r\n return script;\r\n}\r\n\r\nvar normalizeComponent_1 = normalizeComponent;\r\n\r\nvar isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase());\r\nfunction createInjector(context) {\r\n return function (id, style) {\r\n return addStyle(id, style);\r\n };\r\n}\r\nvar HEAD;\r\nvar styles = {};\r\n\r\nfunction addStyle(id, css) {\r\n var group = isOldIE ? css.media || 'default' : id;\r\n var style = styles[group] || (styles[group] = {\r\n ids: new Set(),\r\n styles: []\r\n });\r\n\r\n if (!style.ids.has(id)) {\r\n style.ids.add(id);\r\n var code = css.source;\r\n\r\n if (css.map) {\r\n // https://developer.chrome.com/devtools/docs/javascript-debugging\r\n // this makes source maps inside style tags work properly in Chrome\r\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875\r\n\r\n code += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';\r\n }\r\n\r\n if (!style.element) {\r\n style.element = document.createElement('style');\r\n style.element.type = 'text/css';\r\n if (css.media) { style.element.setAttribute('media', css.media); }\r\n\r\n if (HEAD === undefined) {\r\n HEAD = document.head || document.getElementsByTagName('head')[0];\r\n }\r\n\r\n HEAD.appendChild(style.element);\r\n }\r\n\r\n if ('styleSheet' in style.element) {\r\n style.styles.push(code);\r\n style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\\n');\r\n } else {\r\n var index = style.ids.size - 1;\r\n var textNode = document.createTextNode(code);\r\n var nodes = style.element.childNodes;\r\n if (nodes[index]) { style.element.removeChild(nodes[index]); }\r\n if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }else { style.element.appendChild(textNode); }\r\n }\r\n }\r\n}\r\n\r\nvar browser = createInjector;\r\n\r\n/* script */\r\nvar __vue_script__ = Drag;\r\n\r\n/* template */\r\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:\"component\",class:_vm.cssClasses,scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'component',_vm.$attrs,false),_vm.$listeners),[_vm._t(\"default\"),_vm._v(\" \"),_vm._v(\" \"),(_vm.dragInitialised)?_c('div',{ref:\"drag-image\",staticClass:\"__drag-image\"},[_vm._t(\"drag-image\")],2):_vm._e()],2)};\r\nvar __vue_staticRenderFns__ = [];\r\n\r\n /* style */\r\n var __vue_inject_styles__ = function (inject) {\r\n if (!inject) { return }\r\n inject(\"data-v-fb811e22_0\", { source: \".drop-allowed.drop-in *{cursor:inherit!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}.drag-no-handle:hover{cursor:move;cursor:grab}\", map: undefined, media: undefined })\r\n,inject(\"data-v-fb811e22_1\", { source: \"html.drag-in-progress *{cursor:move!important;cursor:grabbing!important}\", map: undefined, media: undefined })\r\n,inject(\"data-v-fb811e22_2\", { source: \".__drag-image[data-v-fb811e22]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}\", map: undefined, media: undefined });\r\n\r\n };\r\n /* scoped */\r\n var __vue_scope_id__ = \"data-v-fb811e22\";\r\n /* module identifier */\r\n var __vue_module_identifier__ = undefined;\r\n /* functional template */\r\n var __vue_is_functional_template__ = false;\r\n /* style inject SSR */\r\n \r\n\r\n \r\n var Drag$1 = normalizeComponent_1(\r\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\r\n __vue_inject_styles__,\r\n __vue_script__,\r\n __vue_scope_id__,\r\n __vue_is_functional_template__,\r\n __vue_module_identifier__,\r\n browser,\r\n undefined\r\n );\r\n\r\nvar DropMixin = /** @class */ (function (_super) {\r\n __extends(DropMixin, _super);\r\n function DropMixin() {\r\n var _this = _super.call(this) || this;\r\n _this.isDrop = true;\r\n return _this;\r\n }\r\n DropMixin.prototype.effectiveAcceptsType = function (type) {\r\n if (this.acceptsType === null)\r\n { return true; }\r\n else if (typeof (this.acceptsType) === 'string')\r\n { return this.acceptsType === type; }\r\n else if (typeof (this.acceptsType) === 'object' && Array.isArray(this.acceptsType)) {\r\n return this.acceptsType.includes(type);\r\n }\r\n else {\r\n return this.acceptsType(type);\r\n }\r\n };\r\n DropMixin.prototype.effectiveAcceptsData = function (data, type) {\r\n return this.acceptsData(data, type);\r\n };\r\n DropMixin.prototype.created = function () {\r\n dnd.on(\"dragpositionchanged\", this.onDragPositionChanged);\r\n dnd.on(\"dragtopchanged\", this.onDragTopChanged);\r\n dnd.on(\"drop\", this.onDrop);\r\n dnd.on(\"dragend\", this.onDragEnd);\r\n };\r\n DropMixin.prototype.beforeDestroy = function () {\r\n dnd.off(\"dragpositionchanged\", this.onDragPositionChanged);\r\n dnd.off(\"dragtopchanged\", this.onDragTopChanged);\r\n dnd.off(\"drop\", this.onDrop);\r\n dnd.off(\"dragend\", this.onDragEnd);\r\n };\r\n DropMixin.prototype.onDragPositionChanged = function (event) {\r\n if (this === event.top) {\r\n this.$emit(\"dragover\", event);\r\n }\r\n };\r\n DropMixin.prototype.onDragTopChanged = function (event) {\r\n if (this === event.top) {\r\n this.$emit(\"dragenter\", event);\r\n }\r\n if (this === event.previousTop) {\r\n this.$emit(\"dragleave\", event);\r\n }\r\n };\r\n DropMixin.prototype.onDragEnd = function (event) {\r\n if (this === event.top) {\r\n this.$emit('dragend', event);\r\n }\r\n };\r\n DropMixin.prototype.onDrop = function (event) {\r\n if (this.dropIn && this.compatibleMode && this.dropAllowed) {\r\n this.doDrop(event);\r\n }\r\n };\r\n DropMixin.prototype.doDrop = function (event) {\r\n this.$emit('drop', event);\r\n event.source.$emit(this.mode, event);\r\n };\r\n DropMixin.prototype.mounted = function () {\r\n var el = this.$el;\r\n var comp = this;\r\n el.addEventListener('easy-dnd-move', onMouseMove);\r\n function onMouseMove(e) {\r\n dnd.mouseMove(e, comp);\r\n }\r\n };\r\n Object.defineProperty(DropMixin.prototype, \"compatibleMode\", {\r\n get: function () {\r\n if (this.dragInProgress) {\r\n return this.mode === 'copy' || dnd.sourceListeners.hasOwnProperty(this.mode);\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropMixin.prototype, \"dropIn\", {\r\n get: function () {\r\n if (this.dragInProgress) {\r\n return this.dragTop === this;\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropMixin.prototype, \"typeAllowed\", {\r\n get: function () {\r\n if (this.dragInProgress) {\r\n return this.effectiveAcceptsType(this.dragType);\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropMixin.prototype, \"dropAllowed\", {\r\n get: function () {\r\n if (this.dragInProgress) {\r\n if (this.typeAllowed) {\r\n return this.compatibleMode && this.effectiveAcceptsData(this.dragData, this.dragType);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropMixin.prototype, \"cssClasses\", {\r\n get: function () {\r\n var clazz = {\r\n 'dnd-drop': true\r\n };\r\n if (this.dropIn !== null) {\r\n clazz['drop-in'] = this.dropIn;\r\n clazz['drop-out'] = !this.dropIn;\r\n }\r\n if (this.typeAllowed !== null) {\r\n clazz['type-allowed'] = this.typeAllowed;\r\n clazz['type-forbidden'] = !this.typeAllowed;\r\n }\r\n if (this.dropAllowed !== null) {\r\n clazz['drop-allowed'] = this.dropAllowed;\r\n clazz['drop-forbidden'] = !this.dropAllowed;\r\n }\r\n return clazz;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropMixin.prototype, \"cssStyle\", {\r\n get: function () {\r\n return {};\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns true if the current drop area participates in the current drag operation.\r\n */\r\n DropMixin.prototype.candidate = function (type, data, source) {\r\n return this.effectiveAcceptsType(type);\r\n };\r\n DropMixin.prototype.createDragImage = function () {\r\n var image;\r\n if (this.$refs['drag-image']) {\r\n var el = this.$refs['drag-image'];\r\n if (el.childElementCount !== 1) {\r\n image = createDragImage(el);\r\n }\r\n else {\r\n image = createDragImage(el.children.item(0));\r\n }\r\n image['__opacity'] = this.dragImageOpacity;\r\n image.classList.add('dnd-ghost');\r\n }\r\n else {\r\n image = 'source';\r\n }\r\n return image;\r\n };\r\n __decorate([\r\n Prop({ default: function () { return function () { return true; }; }, type: [String, Array, Function] }),\r\n __metadata(\"design:type\", Object)\r\n ], DropMixin.prototype, \"acceptsType\", void 0);\r\n __decorate([\r\n Prop({ default: function () { return true; }, type: Function }),\r\n __metadata(\"design:type\", Object)\r\n ], DropMixin.prototype, \"acceptsData\", void 0);\r\n __decorate([\r\n Prop({ default: 'copy' }),\r\n __metadata(\"design:type\", String)\r\n ], DropMixin.prototype, \"mode\", void 0);\r\n __decorate([\r\n Prop({ default: 0.7, type: Number }),\r\n __metadata(\"design:type\", Object)\r\n ], DropMixin.prototype, \"dragImageOpacity\", void 0);\r\n DropMixin = __decorate([\r\n Component({}),\r\n __metadata(\"design:paramtypes\", [])\r\n ], DropMixin);\r\n return DropMixin;\r\n}(DragAwareMixin));\r\n\r\nvar Drop = /** @class */ (function (_super) {\r\n __extends(Drop, _super);\r\n function Drop() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(Drop.prototype, \"showDragImage\", {\r\n get: function () {\r\n return this.dragInProgress && this.typeAllowed && this.$scopedSlots['drag-image'];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n __decorate([\r\n Prop({ default: 'div', type: [String, Object, Function] }),\r\n __metadata(\"design:type\", Object)\r\n ], Drop.prototype, \"tag\", void 0);\r\n Drop = __decorate([\r\n Component({})\r\n ], Drop);\r\n return Drop;\r\n}(DropMixin));\r\n\r\n/* script */\r\nvar __vue_script__$1 = Drop;\r\n\r\n/* template */\r\nvar __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:\"component\",class:_vm.cssClasses,style:(_vm.cssStyle),scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'component',_vm.$attrs,false),_vm.$listeners),[_vm._t(\"default\"),_vm._v(\" \"),_vm._v(\" \"),(_vm.showDragImage)?_c('div',{ref:\"drag-image\",staticClass:\"__drag-image\"},[_vm._t(\"drag-image\",null,{\"type\":_vm.dragType,\"data\":_vm.dragData})],2):_vm._e()],2)};\r\nvar __vue_staticRenderFns__$1 = [];\r\n\r\n /* style */\r\n var __vue_inject_styles__$1 = function (inject) {\r\n if (!inject) { return }\r\n inject(\"data-v-1d9169a9_0\", { source: \".drop-allowed.drop-in,.drop-allowed.drop-in *{cursor:pointer!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}\", map: undefined, media: undefined })\r\n,inject(\"data-v-1d9169a9_1\", { source: \".__drag-image[data-v-1d9169a9]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}\", map: undefined, media: undefined });\r\n\r\n };\r\n /* scoped */\r\n var __vue_scope_id__$1 = \"data-v-1d9169a9\";\r\n /* module identifier */\r\n var __vue_module_identifier__$1 = undefined;\r\n /* functional template */\r\n var __vue_is_functional_template__$1 = false;\r\n /* style inject SSR */\r\n \r\n\r\n \r\n var Drop$1 = normalizeComponent_1(\r\n { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },\r\n __vue_inject_styles__$1,\r\n __vue_script__$1,\r\n __vue_scope_id__$1,\r\n __vue_is_functional_template__$1,\r\n __vue_module_identifier__$1,\r\n browser,\r\n undefined\r\n );\r\n\r\nvar DropMask = /** @class */ (function (_super) {\r\n __extends(DropMask, _super);\r\n function DropMask() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.isDropMask = true;\r\n return _this;\r\n }\r\n DropMask.prototype.mounted = function () {\r\n var el = this.$el;\r\n var comp = this;\r\n el.addEventListener('easy-dnd-move', onMouseMove);\r\n function onMouseMove(e) {\r\n dnd.mouseMove(e, comp);\r\n }\r\n };\r\n DropMask.prototype.createDragImage = function () {\r\n return 'source';\r\n };\r\n __decorate([\r\n Prop({ default: 'div', type: [String, Object, Function] }),\r\n __metadata(\"design:type\", Object)\r\n ], DropMask.prototype, \"tag\", void 0);\r\n DropMask = __decorate([\r\n Component({})\r\n ], DropMask);\r\n return DropMask;\r\n}(DragAwareMixin));\r\n\r\n/* script */\r\nvar __vue_script__$2 = DropMask;\r\n\r\n/* template */\r\nvar __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:\"component\",scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'component',_vm.$attrs,false),_vm.$listeners),[_vm._t(\"default\")],2)};\r\nvar __vue_staticRenderFns__$2 = [];\r\n\r\n /* style */\r\n var __vue_inject_styles__$2 = undefined;\r\n /* scoped */\r\n var __vue_scope_id__$2 = undefined;\r\n /* module identifier */\r\n var __vue_module_identifier__$2 = undefined;\r\n /* functional template */\r\n var __vue_is_functional_template__$2 = false;\r\n /* style inject */\r\n \r\n /* style inject SSR */\r\n \r\n\r\n \r\n var DropMask$1 = normalizeComponent_1(\r\n { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },\r\n __vue_inject_styles__$2,\r\n __vue_script__$2,\r\n __vue_scope_id__$2,\r\n __vue_is_functional_template__$2,\r\n __vue_module_identifier__$2,\r\n undefined,\r\n undefined\r\n );\r\n\r\n/**\r\n * This class reacts to drag events emitted by the dnd object to manage a sequence of drag images and fade from one to the\r\n * other as the drag progresses.\r\n */\r\nvar DragImagesManager = /** @class */ (function (_super) {\r\n __extends(DragImagesManager, _super);\r\n function DragImagesManager() {\r\n var _this = _super.call(this) || this;\r\n _this.selfTransform = null;\r\n _this.clones = null;\r\n _this.source = null;\r\n _this.sourcePos = null;\r\n _this.sourceClone = null;\r\n dnd.on('dragstart', _this.onDragStart);\r\n dnd.on('dragtopchanged', _this.onDragTopChanged);\r\n dnd.on('dragpositionchanged', _this.onDragPositionChanged);\r\n dnd.on('dragend', _this.onDragEnd);\r\n return _this;\r\n }\r\n DragImagesManager.prototype.onDragStart = function (event) {\r\n // If go-back=true and it is still animating while they attempt another drag,\r\n // it will bug out. Best to clean up any existing elements on the page before\r\n // attempting to start the next animation\r\n this.cleanUp();\r\n this.sourcePos = {\r\n x: event.source.$el.getBoundingClientRect().left,\r\n y: event.source.$el.getBoundingClientRect().top\r\n };\r\n this.selfTransform = \"translate(-\" + (event.position.x - this.sourcePos.x) + \"px, -\" + (event.position.y - this.sourcePos.y) + \"px)\";\r\n this.clones = new Map();\r\n this.source = event.source;\r\n };\r\n DragImagesManager.prototype.onDragEnd = function (event) {\r\n var _this = this;\r\n Vue.nextTick(function () {\r\n if (!event.success && _this.source && _this.source['goBack']) {\r\n // Restore the drag image that is active when hovering outside any drop zone :\r\n var img_1 = _this.switch(null);\r\n // Move it back to its original place :\r\n window.requestAnimationFrame(function () {\r\n img_1.style.transition = \"all 0.5s\";\r\n window.requestAnimationFrame(function () {\r\n img_1.style.left = _this.sourcePos.x + \"px\";\r\n img_1.style.top = _this.sourcePos.y + \"px\";\r\n img_1.style.transform = \"translate(0,0)\";\r\n var handler = function () {\r\n _this.cleanUp();\r\n img_1.removeEventListener(\"transitionend\", handler);\r\n };\r\n img_1.addEventListener(\"transitionend\", handler);\r\n });\r\n });\r\n }\r\n else {\r\n _this.cleanUp();\r\n }\r\n });\r\n };\r\n DragImagesManager.prototype.cleanUp = function () {\r\n if (this.clones) {\r\n this.clones.forEach(function (clone) {\r\n if (clone.parentNode === document.body) {\r\n document.body.removeChild(clone);\r\n }\r\n });\r\n }\r\n if (this.sourceClone !== null) {\r\n if (this.sourceClone.parentNode === document.body) {\r\n document.body.removeChild(this.sourceClone);\r\n }\r\n }\r\n this.selfTransform = null;\r\n this.clones = null;\r\n this.source = null;\r\n this.sourceClone = null;\r\n this.sourcePos = null;\r\n };\r\n DragImagesManager.prototype.onDragTopChanged = function (event) {\r\n this.switch(event.top);\r\n };\r\n DragImagesManager.prototype.switch = function (top) {\r\n this.clones.forEach(function (clone) {\r\n clone.style.opacity = \"0\";\r\n });\r\n if (this.sourceClone) {\r\n this.sourceClone.style.opacity = \"0\";\r\n }\r\n var activeClone;\r\n if (top === null) {\r\n activeClone = this.getSourceClone();\r\n }\r\n else {\r\n if (!this.clones.has(top)) {\r\n var clone = top['createDragImage'](this.selfTransform);\r\n if (clone === 'source') {\r\n clone = this.getSourceClone();\r\n }\r\n else if (clone !== null) {\r\n clone.style.opacity = '0';\r\n document.body.appendChild(clone);\r\n }\r\n this.clones.set(top, clone);\r\n }\r\n activeClone = this.clones.get(top);\r\n }\r\n if (activeClone !== null) {\r\n activeClone.offsetWidth; // Forces browser reflow\r\n activeClone.style.opacity = activeClone['__opacity'];\r\n activeClone.style.visibility = 'visible';\r\n }\r\n return activeClone;\r\n };\r\n DragImagesManager.prototype.getSourceClone = function () {\r\n if (this.sourceClone === null) {\r\n this.sourceClone = this.source['createDragImage'](this.selfTransform);\r\n this.sourceClone.style.opacity = '0';\r\n document.body.appendChild(this.sourceClone);\r\n }\r\n return this.sourceClone;\r\n };\r\n DragImagesManager.prototype.onDragPositionChanged = function (event) {\r\n this.clones.forEach(function (clone) {\r\n clone.style.left = dnd.position.x + \"px\";\r\n clone.style.top = dnd.position.y + \"px\";\r\n });\r\n if (this.sourceClone) {\r\n this.sourceClone.style.left = dnd.position.x + \"px\";\r\n this.sourceClone.style.top = dnd.position.y + \"px\";\r\n }\r\n };\r\n DragImagesManager = __decorate([\r\n Component({}) // Necessary to set proper \"this\" context in event listeners.\r\n ,\r\n __metadata(\"design:paramtypes\", [])\r\n ], DragImagesManager);\r\n return DragImagesManager;\r\n}(Vue));\r\nnew DragImagesManager();\r\n\r\nvar DragFeedback = /** @class */ (function (_super) {\r\n __extends(DragFeedback, _super);\r\n function DragFeedback() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DragFeedback = __decorate([\r\n Component({})\r\n ], DragFeedback);\r\n return DragFeedback;\r\n}(Vue));\r\n\r\n/* script */\r\nvar __vue_script__$3 = DragFeedback;\r\n\r\n/* template */\r\nvar __vue_render__$3 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"DragFeedback\"},[_vm._t(\"default\")],2)};\r\nvar __vue_staticRenderFns__$3 = [];\r\n\r\n /* style */\r\n var __vue_inject_styles__$3 = undefined;\r\n /* scoped */\r\n var __vue_scope_id__$3 = \"data-v-0589f3cb\";\r\n /* module identifier */\r\n var __vue_module_identifier__$3 = undefined;\r\n /* functional template */\r\n var __vue_is_functional_template__$3 = false;\r\n /* style inject */\r\n \r\n /* style inject SSR */\r\n \r\n\r\n \r\n var DragFeedback$1 = normalizeComponent_1(\r\n { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },\r\n __vue_inject_styles__$3,\r\n __vue_script__$3,\r\n __vue_scope_id__$3,\r\n __vue_is_functional_template__$3,\r\n __vue_module_identifier__$3,\r\n undefined,\r\n undefined\r\n );\r\n\r\nvar Grid = /** @class */ (function () {\r\n function Grid(collection, upToIndex, row, fromIndex) {\r\n var e_1, _a;\r\n this.magnets = [];\r\n this.reference = collection.item(0).parentNode;\r\n this.referenceOriginalPosition = {\r\n x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft,\r\n y: this.reference.getBoundingClientRect().top - this.reference.scrollTop,\r\n };\r\n var index = 0;\r\n try {\r\n for (var collection_1 = __values(collection), collection_1_1 = collection_1.next(); !collection_1_1.done; collection_1_1 = collection_1.next()) {\r\n var child = collection_1_1.value;\r\n if (index > upToIndex)\r\n { break; }\r\n var rect = child.getBoundingClientRect();\r\n var hasNestedDrop = child.classList.contains(\"dnd-drop\") || child.getElementsByClassName(\"dnd-drop\").length > 0;\r\n var horizontal = null;\r\n if (hasNestedDrop) {\r\n if (row === 'auto') {\r\n // Auto mode not supported for now. Row or column must be defined explicitly if there are nested drop lists.\r\n throw new Error(\"Easy-DnD error : a drop list is missing one of these attributes : 'row' or 'column'.\");\r\n }\r\n else {\r\n horizontal = row === 'row';\r\n }\r\n }\r\n if (fromIndex === null) {\r\n // Inserting mode.\r\n this.magnets.push(hasNestedDrop ? this.before(rect, horizontal) : this.center(rect));\r\n }\r\n else {\r\n // Reordering mode.\r\n this.magnets.push(hasNestedDrop ? (fromIndex < index ? this.after : this.before)(rect, horizontal) : this.center(rect));\r\n }\r\n // Debug : show magnets :\r\n //document.body.insertAdjacentHTML(\"beforeend\", \"
\")\r\n index++;\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (collection_1_1 && !collection_1_1.done && (_a = collection_1.return)) { _a.call(collection_1); }\r\n }\r\n finally { if (e_1) { throw e_1.error; } }\r\n }\r\n }\r\n /**\r\n * Returns the center of the rectangle.\r\n */\r\n Grid.prototype.center = function (rect) {\r\n return {\r\n x: rect.left + rect.width / 2,\r\n y: rect.top + rect.height / 2\r\n };\r\n };\r\n /**\r\n * When horizontal is true / false, returns middle of the left / top side of the rectangle.\r\n */\r\n Grid.prototype.before = function (rect, horizontal) {\r\n return horizontal ? {\r\n x: rect.left,\r\n y: rect.top + rect.height / 2\r\n } : {\r\n x: rect.left + rect.width / 2,\r\n y: rect.top\r\n };\r\n };\r\n /**\r\n * When horizontal is true / false, returns middle of the right / bottom side of the rectangle.\r\n */\r\n Grid.prototype.after = function (rect, horizontal) {\r\n return horizontal ? {\r\n x: rect.left + rect.width,\r\n y: rect.top + rect.height / 2\r\n } : {\r\n x: rect.left + rect.width / 2,\r\n y: rect.top + rect.height\r\n };\r\n };\r\n /**\r\n * In case the user scrolls during the drag, the position of the magnets are not what they used to be when the drag\r\n * started. A correction must be applied that takes into account the amount of scroll. This correction is the\r\n * difference between the current position of the parent element and its position when the drag started.\r\n */\r\n Grid.prototype.correction = function () {\r\n return {\r\n x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft - this.referenceOriginalPosition.x,\r\n y: this.reference.getBoundingClientRect().top - this.reference.scrollTop - this.referenceOriginalPosition.y,\r\n };\r\n };\r\n Grid.prototype.closestIndex = function (position) {\r\n var x = position.x - this.correction().x;\r\n var y = position.y - this.correction().y;\r\n var minDist = 999999;\r\n var index = -1;\r\n for (var i = 0; i < this.magnets.length; i++) {\r\n var magnet = this.magnets[i];\r\n var dist = Math.sqrt(Math.pow(magnet.x - x, 2) + Math.pow(magnet.y - y, 2));\r\n if (dist < minDist) {\r\n minDist = dist;\r\n index = i;\r\n }\r\n }\r\n return index;\r\n };\r\n return Grid;\r\n}());\r\n\r\nvar DnDEvent = /** @class */ (function () {\r\n function DnDEvent() {\r\n }\r\n return DnDEvent;\r\n}());\r\nvar ReorderEvent = /** @class */ (function () {\r\n function ReorderEvent(from, to) {\r\n this.from = from;\r\n this.to = to;\r\n }\r\n ReorderEvent.prototype.apply = function (array) {\r\n var tmp = array[this.from];\r\n array.splice(this.from, 1);\r\n array.splice(this.to, 0, tmp);\r\n };\r\n return ReorderEvent;\r\n}());\r\nvar InsertEvent = /** @class */ (function () {\r\n function InsertEvent(type, data, index) {\r\n this.type = type;\r\n this.data = data;\r\n this.index = index;\r\n }\r\n return InsertEvent;\r\n}());\r\n\r\nvar DropList = /** @class */ (function (_super) {\r\n __extends(DropList, _super);\r\n function DropList() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.grid = null;\r\n _this.forbiddenKeys = [];\r\n _this.feedbackKey = null;\r\n _this.fromIndex = null;\r\n return _this;\r\n }\r\n Object.defineProperty(DropList.prototype, \"rootTag\", {\r\n get: function () {\r\n if (this.noAnimations) {\r\n return this.tag ? this.tag : 'div';\r\n }\r\n else {\r\n return \"transition-group\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"rootProps\", {\r\n get: function () {\r\n if (this.noAnimations) {\r\n return this.$attrs;\r\n }\r\n else {\r\n return {\r\n tag: this.tag,\r\n duration: { enter: 0, leave: 0 },\r\n css: false\r\n };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"rootListeners\", {\r\n get: function () {\r\n if (this.noAnimations) {\r\n return this.$listeners;\r\n }\r\n else {\r\n return {};\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DropList.prototype.created = function () {\r\n dnd.on(\"dragstart\", this.onDragStart);\r\n dnd.on(\"dragend\", this.onDragEnd);\r\n };\r\n Object.defineProperty(DropList.prototype, \"direction\", {\r\n get: function () {\r\n if (this.row)\r\n { return 'row'; }\r\n if (this.column)\r\n { return 'column'; }\r\n return 'auto';\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DropList.prototype.beforeDestroy = function () {\r\n dnd.off(\"dragstart\", this.onDragStart);\r\n dnd.off(\"dragend\", this.onDragEnd);\r\n };\r\n // Presence of feedback node in the DOM and of keys in the virtual DOM required => delayed until what\r\n // depends on drag data has been processed.\r\n DropList.prototype.refresh = function () {\r\n var _this = this;\r\n this.$nextTick(function () {\r\n _this.grid = _this.computeInsertingGrid();\r\n _this.feedbackKey = _this.computeFeedbackKey();\r\n _this.forbiddenKeys = _this.computeForbiddenKeys();\r\n });\r\n };\r\n DropList.prototype.onDragStart = function (event) {\r\n if (this.candidate(dnd.type, dnd.data, dnd.source)) {\r\n if (this.reordering) {\r\n this.fromIndex = Array.prototype.indexOf.call(event.source.$el.parentElement.children, event.source.$el);\r\n this.grid = this.computeReorderingGrid();\r\n }\r\n else {\r\n this.refresh();\r\n }\r\n }\r\n };\r\n DropList.prototype.onDragEnd = function () {\r\n this.fromIndex = null;\r\n this.feedbackKey = null;\r\n this.forbiddenKeys = null;\r\n this.grid = null;\r\n };\r\n Object.defineProperty(DropList.prototype, \"reordering\", {\r\n get: function () {\r\n if (dnd.inProgress) {\r\n return dnd.source.$el.parentElement === this.$el && this.$listeners.hasOwnProperty('reorder');\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"closestIndex\", {\r\n get: function () {\r\n if (this.grid) {\r\n return this.grid.closestIndex(dnd.position);\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"dropAllowed\", {\r\n get: function () {\r\n if (this.dragInProgress) {\r\n if (this.reordering) {\r\n return this.items.length > 1;\r\n }\r\n else {\r\n var superDropAllowed = DropMixin['options'].computed.dropAllowed.get.call(this);\r\n if (!superDropAllowed) {\r\n return false;\r\n }\r\n else {\r\n if (this.forbiddenKeys !== null && this.feedbackKey !== null) {\r\n return !this.forbiddenKeys.includes(this.feedbackKey);\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"itemsBeforeFeedback\", {\r\n get: function () {\r\n if (this.closestIndex === 0) {\r\n return [];\r\n }\r\n else {\r\n return this.items.slice(0, this.closestIndex);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"itemsAfterFeedback\", {\r\n get: function () {\r\n if (this.closestIndex === this.items.length) {\r\n return [];\r\n }\r\n else {\r\n return this.items.slice(this.closestIndex);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"itemsBeforeReorderingFeedback\", {\r\n get: function () {\r\n if (this.closestIndex <= this.fromIndex) {\r\n return this.items.slice(0, this.closestIndex);\r\n }\r\n else {\r\n return this.items.slice(0, this.closestIndex + 1);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"itemsAfterReorderingFeedback\", {\r\n get: function () {\r\n if (this.closestIndex <= this.fromIndex) {\r\n return this.items.slice(this.closestIndex);\r\n }\r\n else {\r\n return this.items.slice(this.closestIndex + 1);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"reorderedItems\", {\r\n get: function () {\r\n var toIndex = this.closestIndex;\r\n var reordered = __spread(this.items);\r\n var temp = reordered[this.fromIndex];\r\n reordered.splice(this.fromIndex, 1);\r\n reordered.splice(toIndex, 0, temp);\r\n return reordered;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"clazz\", {\r\n get: function () {\r\n return __assign({ 'drop-list': true, 'reordering': this.reordering === true, 'inserting': this.reordering === false }, (this.reordering === false ? this.cssClasses : { 'dnd-drop': true }));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"style\", {\r\n get: function () {\r\n return __assign({}, (this.reordering === false ? this.cssStyle : {}));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"showDragFeedback\", {\r\n get: function () {\r\n return this.dragInProgress && this.typeAllowed && !this.reordering;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"showInsertingDragImage\", {\r\n get: function () {\r\n return this.dragInProgress && this.typeAllowed && !this.reordering && this.$scopedSlots.hasOwnProperty(\"drag-image\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropList.prototype, \"showReorderingDragImage\", {\r\n get: function () {\r\n return this.dragInProgress && this.reordering && this.$scopedSlots.hasOwnProperty(\"reordering-drag-image\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DropList.prototype.doDrop = function (event) {\r\n if (this.reordering) {\r\n if (this.fromIndex !== this.closestIndex) {\r\n this.$emit('reorder', new ReorderEvent(this.fromIndex, this.closestIndex));\r\n }\r\n }\r\n else {\r\n DropMixin['options'].methods.doDrop.call(this, event);\r\n this.$emit('insert', new InsertEvent(event.type, event.data, this.closestIndex));\r\n }\r\n };\r\n DropList.prototype.candidate = function (type, data, source) {\r\n var _a;\r\n var superCandidate = (_a = DropMixin['options'].methods.candidate).call.apply(_a, __spread([this], arguments));\r\n return (superCandidate && (this.$listeners.hasOwnProperty(\"insert\") || this.$listeners.hasOwnProperty(\"drop\"))) || this.reordering;\r\n };\r\n DropList.prototype.computeForbiddenKeys = function () {\r\n var vnodes = this.noAnimations ? [] : this.$children[0].$vnode.context.$children[0].$slots.default;\r\n return vnodes\r\n .map(function (vn) { return vn.key; })\r\n .filter(function (k) { return k !== undefined && k !== 'drag-image' && k !== 'drag-feedback'; });\r\n };\r\n DropList.prototype.computeFeedbackKey = function () {\r\n return this.$refs['feedback']['$slots']['default'][0]['key'];\r\n };\r\n Object.defineProperty(DropList.prototype, \"hasReorderingFeedback\", {\r\n get: function () {\r\n return this.$scopedSlots.hasOwnProperty(\"reordering-feedback\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DropList.prototype.computeInsertingGrid = function () {\r\n var feedbackParent = this.$refs['feedback']['$el'];\r\n var feedback = feedbackParent.children[0];\r\n var clone = feedback.cloneNode(true);\r\n var tg = this.$el;\r\n if (tg.children.length > this.items.length) {\r\n tg.insertBefore(clone, tg.children[this.items.length]);\r\n }\r\n else {\r\n tg.appendChild(clone);\r\n }\r\n var grid = new Grid(tg.children, this.items.length, this.direction, null);\r\n tg.removeChild(clone);\r\n return grid;\r\n };\r\n DropList.prototype.computeReorderingGrid = function () {\r\n var tg = this.$el;\r\n return new Grid(tg.children, this.items.length - 1, this.direction, this.fromIndex);\r\n };\r\n DropList.prototype.createDragImage = function () {\r\n var image;\r\n if (this.$refs['drag-image']) {\r\n var el = this.$refs['drag-image'];\r\n var model = void 0;\r\n if (el.childElementCount !== 1) {\r\n model = el;\r\n }\r\n else {\r\n model = el.children.item(0);\r\n }\r\n var clone = model.cloneNode(true);\r\n var tg = this.$el;\r\n tg.appendChild(clone);\r\n image = createDragImage(clone);\r\n tg.removeChild(clone);\r\n image['__opacity'] = this.dragImageOpacity;\r\n image.classList.add('dnd-ghost');\r\n }\r\n else {\r\n image = 'source';\r\n }\r\n return image;\r\n };\r\n __decorate([\r\n Prop({ default: 'div', type: [String, Object, Function] }),\r\n __metadata(\"design:type\", Object)\r\n ], DropList.prototype, \"tag\", void 0);\r\n __decorate([\r\n Prop(),\r\n __metadata(\"design:type\", Array)\r\n ], DropList.prototype, \"items\", void 0);\r\n __decorate([\r\n Prop({ default: null }),\r\n __metadata(\"design:type\", Boolean)\r\n ], DropList.prototype, \"row\", void 0);\r\n __decorate([\r\n Prop({ default: null, type: Boolean }),\r\n __metadata(\"design:type\", Boolean)\r\n ], DropList.prototype, \"column\", void 0);\r\n __decorate([\r\n Prop({ default: false, type: Boolean }),\r\n __metadata(\"design:type\", Boolean)\r\n ], DropList.prototype, \"noAnimations\", void 0);\r\n __decorate([\r\n Prop({ type: Number, default: undefined }),\r\n __metadata(\"design:type\", Number)\r\n ], DropList.prototype, \"scrollingEdgeSize\", void 0);\r\n DropList = __decorate([\r\n Component({\r\n components: { DragFeedback: DragFeedback$1 },\r\n inheritAttrs: false\r\n })\r\n ], DropList);\r\n return DropList;\r\n}(DropMixin));\r\n\r\n/* script */\r\nvar __vue_script__$4 = DropList;\r\n\r\n/* template */\r\nvar __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.rootTag,_vm._g(_vm._b({tag:\"component\",class:_vm.clazz,style:(_vm.style)},'component',_vm.rootProps,false),_vm.rootListeners),[(_vm.dropIn && _vm.dropAllowed)?[(_vm.reordering)?[(_vm.hasReorderingFeedback)?[_vm._l((_vm.itemsBeforeReorderingFeedback),function(item,index){return _vm._t(\"item\",null,{\"item\":item,\"index\":index})}),_vm._v(\" \"),_vm._t(\"reordering-feedback\",null,{\"item\":_vm.items[_vm.fromIndex]}),_vm._v(\" \"),_vm._l((_vm.itemsAfterReorderingFeedback),function(item,index){return _vm._t(\"item\",null,{\"item\":item,\"index\":_vm.itemsBeforeReorderingFeedback.length + index})})]:[_vm._l((_vm.reorderedItems),function(item,index){return _vm._t(\"item\",null,{\"item\":item,\"index\":index,\"reorder\":index === _vm.closestIndex})})]]:[_vm._l((_vm.itemsBeforeFeedback),function(item,index){return _vm._t(\"item\",null,{\"item\":item,\"reorder\":false,\"index\":index})}),_vm._v(\" \"),_vm._t(\"feedback\",null,{\"data\":_vm.dragData,\"type\":_vm.dragType}),_vm._v(\" \"),_vm._l((_vm.itemsAfterFeedback),function(item,index){return _vm._t(\"item\",null,{\"item\":item,\"reorder\":false,\"index\":_vm.itemsBeforeFeedback.length + index})})]]:[_vm._l((_vm.items),function(item,index){return _vm._t(\"item\",null,{\"item\":item,\"reorder\":false,\"index\":index})}),_vm._v(\" \"),(_vm.items.length < 1)?_vm._t(\"empty\"):_vm._e()],_vm._v(\" \"),(_vm.showDragFeedback)?_c('drag-feedback',{key:\"drag-feedback\",ref:\"feedback\",staticClass:\"__feedback\"},[_vm._t(\"feedback\",null,{\"data\":_vm.dragData,\"type\":_vm.dragType})],2):_vm._e(),_vm._v(\" \"),(_vm.showInsertingDragImage)?_c('div',{key:\"inserting-drag-image\",ref:\"drag-image\",staticClass:\"__drag-image\"},[_vm._t(\"drag-image\",null,{\"type\":_vm.dragType,\"data\":_vm.dragData})],2):_vm._e(),_vm._v(\" \"),(_vm.showReorderingDragImage)?_c('div',{key:\"reordering-drag-image\",ref:\"drag-image\",staticClass:\"__drag-image\"},[_vm._t(\"reordering-drag-image\",null,{\"item\":_vm.items[_vm.fromIndex]})],2):_vm._e(),_vm._v(\" \"),_vm._t(\"default\")],2)};\r\nvar __vue_staticRenderFns__$4 = [];\r\n\r\n /* style */\r\n var __vue_inject_styles__$4 = function (inject) {\r\n if (!inject) { return }\r\n inject(\"data-v-228404f8_0\", { source: \".drop-list[data-v-228404f8]>*{transition:transform .2s}.__feedback[data-v-228404f8]{display:none}.__drag-image[data-v-228404f8]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}\", map: undefined, media: undefined })\r\n,inject(\"data-v-228404f8_1\", { source: \".drop-allowed.drop-in *{cursor:inherit!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}\", map: undefined, media: undefined });\r\n\r\n };\r\n /* scoped */\r\n var __vue_scope_id__$4 = \"data-v-228404f8\";\r\n /* module identifier */\r\n var __vue_module_identifier__$4 = undefined;\r\n /* functional template */\r\n var __vue_is_functional_template__$4 = false;\r\n /* style inject SSR */\r\n \r\n\r\n \r\n var DropList$1 = normalizeComponent_1(\r\n { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },\r\n __vue_inject_styles__$4,\r\n __vue_script__$4,\r\n __vue_scope_id__$4,\r\n __vue_is_functional_template__$4,\r\n __vue_module_identifier__$4,\r\n browser,\r\n undefined\r\n );\r\n\r\nexport { DnDEvent, Drag$1 as Drag, DragAwareMixin, DragImagesManager, DragMixin, Drop$1 as Drop, DropList$1 as DropList, DropMask$1 as DropMask, DropMixin, InsertEvent, ReorderEvent, createDragImage, dnd };\r\n"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","this","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__metadata","metadataKey","metadataValue","metadata","__values","o","m","Symbol","iterator","next","value","done","__read","e","ar","push","error","__spread","concat","dnd","DnD","inProgress","type","data","source","top","position","eventBus","Vue","sourceListeners","success","startDrag","event","x","y","$listeners","emit","previousTop","resetVariables","stopDrag","cancelDrag","mouseMove","comp","prevent","stopPropagation","detail","native","$emit","on","callback","$on","off","$off","observable","DragAwareMixin","_super","get","enumerable","configurable","createDragImage","el","clone","cloneNode","copyStyle","vSrcElements","getElementsByTagName","vDstElements","deepClone","style","margin","transition","src","destination","e_1","_a","computedStyle","window","getComputedStyle","computedStyle_1","computedStyle_1_1","width","getPropertyValue","clientWidth","parseFloat","paddingLeft","paddingRight","setProperty","height","clientHeight","paddingTop","paddingBottom","getPropertyPriority","e_1_1","return","pointerEvents","regex","node","prop","scrollparent","document","body","test","scroll","parentNode","timer","cancelScrollAction","clearTimeout","performEdgeScroll","container","clientX","clientY","edgeSize","rect","getBoundingClientRect","isBody","viewportX","left","viewportY","viewportWidth","viewportHeight","documentElement","edgeTop","edgeLeft","edgeBottom","edgeRight","isInLeftEdge","isInRightEdge","isInTopEdge","isInBottomEdge","documentWidth","Math","max","scrollWidth","offsetWidth","documentHeight","scrollHeight","offsetHeight","maxScrollX","maxScrollY","checkForWindowScroll","currentScrollX","scrollLeft","currentScrollY","scrollTop","pageXOffset","pageYOffset","canScrollUp","canScrollDown","canScrollLeft","canScrollRight","nextScrollX","nextScrollY","maxStep","min","scrollTo","adjustWindowScroll","setTimeout","DragMixin","_this","dragInitialised","dragStarted","ignoreNextClick","initialUserSelect","downEvent","startPosition","delayTimer","scrollContainer","onSelectStart","preventDefault","performVibration","vibration","navigator","vibrate","onMouseDown","goodButton","mouse","buttons","touch","touches","disabled","matches","handle","userSelect","delay","addEventListener","onMouseClick","onMouseUp","onKeyUp","onMouseMove","passive","onEasyDnDMove","stopImmediatePropagation","elementFromPoint","dist","sqrt","pow","delta","classList","add","currEdgeSize","dragTop","undefined","$props","scrollingEdgeSize","$el","custom","CustomEvent","bubbles","cancelable","dispatchEvent","cancelDragActions","finishDrag","remove","removeEventListener","dndDragStart","ev","dndDragEnd","created","mounted","beforeDestroy","clazz","dragInProgress","dragSource","currentDropMode","selfTransform","image","$scopedSlots","$refs","createElement","childElementCount","children","item","transform","dragClass","dragImageOpacity","default","String","Number","Boolean","required","Drag","Function","HEAD","normalizeComponent_1","template","script","scopeId","isFunctionalTemplate","moduleIdentifier","shadowMode","createInjector","createInjectorSSR","createInjectorShadow","hook","options","render","staticRenderFns","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","_ssrRegister","$root","$options","shadowRoot","originalRender","h","existing","beforeCreate","isOldIE","userAgent","toLowerCase","styles","browser","id","css","group","media","ids","Set","has","code","map","sources","btoa","unescape","encodeURIComponent","JSON","stringify","element","setAttribute","head","appendChild","styleSheet","cssText","filter","join","index","size","textNode","createTextNode","nodes","childNodes","removeChild","insertBefore","addStyle","Drag$1","_vm","_h","$createElement","_c","_self","tag","_g","_b","class","cssClasses","scopedSlots","_u","_l","_","slot","fn","scope","_t","$attrs","_v","ref","staticClass","_e","inject","DropMixin","isDrop","effectiveAcceptsType","acceptsType","_typeof","isArray","includes","effectiveAcceptsData","acceptsData","onDragPositionChanged","onDragTopChanged","onDrop","onDragEnd","dropIn","compatibleMode","dropAllowed","doDrop","mode","dragType","typeAllowed","dragData","candidate","Drop","Drop$1","cssStyle","showDragImage","DropMask","isDropMask","DropMask$1","DragImagesManager","clones","sourcePos","sourceClone","onDragStart","cleanUp","Map","nextTick","img_1","switch","requestAnimationFrame","handler","forEach","activeClone","opacity","getSourceClone","set","visibility","DragFeedback","DragFeedback$1","Grid","collection","upToIndex","row","fromIndex","magnets","reference","referenceOriginalPosition","collection_1","collection_1_1","child","hasNestedDrop","contains","getElementsByClassName","horizontal","Error","before","center","after","correction","closestIndex","minDist","magnet","DnDEvent","ReorderEvent","from","to","array","tmp","splice","InsertEvent","DropList","grid","forbiddenKeys","feedbackKey","noAnimations","duration","enter","leave","column","refresh","$nextTick","computeInsertingGrid","computeFeedbackKey","computeForbiddenKeys","reordering","indexOf","parentElement","computeReorderingGrid","items","computed","slice","toIndex","reordered","temp","methods","$children","$slots","vn","k","tg","direction","components","inheritAttrs","DropList$1","rootTag","rootProps","rootListeners","hasReorderingFeedback","itemsBeforeReorderingFeedback","itemsAfterReorderingFeedback","reorderedItems","itemsBeforeFeedback","itemsAfterFeedback","showDragFeedback","showInsertingDragImage","showReorderingDragImage"],"mappings":"kxBAoBIA,eAAgB,SAASC,EAAGC,UAC5BF,eAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,OAAU,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,KAClEP,eAAcC,EAAGC,aAGnBO,UAAUR,EAAGC,YAETQ,UAAYC,YAAcV,EADnCD,eAAcC,EAAGC,GAEjBD,EAAEW,UAAkB,OAANV,EAAaC,OAAOU,OAAOX,IAAMQ,GAAGE,UAAYV,EAAEU,UAAW,IAAIF,QAG/EI,QAAW,kBACXA,QAAWX,OAAOY,QAAU,SAAkBC,OACrC,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,QAEvC,IAAIX,KADTU,EAAIG,UAAUF,GACOf,OAAOS,UAAUJ,eAAec,KAAKL,EAAGV,KAAIS,EAAET,GAAKU,EAAEV,WAEvES,GAEJF,QAASS,MAAMC,KAAMJ,qBAGvBK,WAAWC,WAAYC,OAAQC,IAAKC,UACkF5B,EAAvH6B,EAAIV,UAAUC,OAAQU,EAAID,EAAI,EAAIH,OAAkB,OAATE,KAAgBA,KAAO1B,OAAO6B,yBAAyBL,OAAQC,KAAOC,QAC9F,gCAAZI,4BAAAA,WAAoD,mBAArBA,QAAQC,SAAyBH,EAAIE,QAAQC,SAASR,WAAYC,OAAQC,IAAKC,WACpH,IAAK,IAAIX,EAAIQ,WAAWL,OAAS,EAAGH,GAAK,EAAGA,KAASjB,EAAIyB,WAAWR,MAAIa,GAAKD,EAAI,EAAI7B,EAAE8B,GAAKD,EAAI,EAAI7B,EAAE0B,OAAQC,IAAKG,GAAK9B,EAAE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vue-easy-dnd/readme-moodle.txt b/amd/src/vue-easy-dnd/readme-moodle.txt index 5e1b284..e2be572 100644 --- a/amd/src/vue-easy-dnd/readme-moodle.txt +++ b/amd/src/vue-easy-dnd/readme-moodle.txt @@ -1,13 +1,14 @@ Instructions for downloading and integrating vue-easy-dnd -1. download vue-easy-dnd distribusion throuhg npm - npm install vue-easy-dnd@ +(Unfortunately we cannot use the latest version, since that requires vue3 support, and bootstrap-vue isn't there yet...) + +1. download vue-easy-dnd distribusion throuhg npm + npm install vue-easy-dnd@1.22.0 2. Copy node_modules/vue-easy-dnd/dist/vue-easy-dnd.esm.js to amd/src/vue-easy-dnd -3. Change import statement - ... from 'vue'; - into - ... from '../vue/vue'; +3. Change import statements to + import './reflect-metadata'; + import { Vue, Component, Prop } from './vue-property-decorator'; 4. add /* eslint-disable */ to top of file \ No newline at end of file diff --git a/amd/src/vue-easy-dnd/vue-easy-dnd.esm.js b/amd/src/vue-easy-dnd/vue-easy-dnd.esm.js index b53e839..fff120f 100644 --- a/amd/src/vue-easy-dnd/vue-easy-dnd.esm.js +++ b/amd/src/vue-easy-dnd/vue-easy-dnd.esm.js @@ -1,224 +1,324 @@ /* eslint-disable */ -import { reactive, openBlock, createBlock, resolveDynamicComponent, normalizeClass, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementBlock, createCommentVNode, renderList, TransitionGroup, h, nextTick } from '../vue/vue'; +import './reflect-metadata'; +import { Vue, Component, Prop } from './vue-property-decorator'; -function mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e);});}}} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} /** * This is the class of the global object that holds the state of the drag and drop during its progress. It emits events * reporting its state evolution during the progress of the drag and drop. Its data is reactive and listeners can be - * attached to it using the method on. + * attachted to it using the method on. */ -class DnD { - - inProgress = false; - type = null; - data = null; - source = null; - top = null; - position = null; - eventBus = mitt(); - success = null; - - startDrag (source, event, x, y, type, data) { - this.type = type; - this.data = data; - this.source = source; - this.position = { x, y }; - this.top = null; - this.inProgress = true; - this.emit(event, 'dragstart'); - this.emit(event, 'dragtopchanged', { previousTop: null }); +var DnD = /** @class */ (function () { + function DnD() { + this.inProgress = false; + this.type = null; + this.data = null; + this.source = null; + this.top = null; + this.position = null; + this.eventBus = new Vue(); + this.sourceListeners = null; + this.success = null; } - - resetVariables () { - this.inProgress = false; - this.data = null; - this.source = null; - this.position = null; - this.success = null; - } - - stopDrag (event) { - this.success = this.top !== null && this.top['compatibleMode'] && this.top['dropAllowed']; - if (this.top !== null) { - this.emit(event, 'drop'); - } - this.emit(event, 'dragend'); - this.resetVariables(); - } - - cancelDrag (event) { - this.success = false; - this.emit(event, 'dragend'); - this.resetVariables(); - } - - mouseMove (event, comp) { - if (this.inProgress) { - let prevent = false; - const previousTop = this.top; - if (comp === null) { - // The mouse move event reached the top of the document without hitting a drop component. - this.top = null; - prevent = true; - } - else if (comp['isDropMask']) { - // The mouse move event bubbled until it reached a drop mask. - this.top = null; - prevent = true; - } - else if (comp['candidate'](this.type, this.data, this.source)) { - // The mouse move event bubbled until it reached a drop component that participates in the current drag operation. - this.top = comp; - prevent = true; - } - - if (prevent) { - // We prevent the mouse move event from bubbling further up the tree because it reached the foremost drop component and that component is all that matters. - event.stopPropagation(); - } - if (this.top !== previousTop) { - this.emit(event.detail.native, 'dragtopchanged', { previousTop: previousTop }); - } - this.position = { - x: event.detail.x, - y: event.detail.y - }; - this.emit(event.detail.native, 'dragpositionchanged'); - } - } - - emit (native, event, data = {}) { - this.eventBus.emit(event, { - type: this.type, - data: this.data, - top: this.top, - source: this.source, - position: this.position, - success: this.success, - native, - ...data - }); - } - - on (event, callback) { - this.eventBus.on(event, callback); - } - - off (event, callback) { - this.eventBus.off(event, callback); - } -} - -const dnd = reactive(new DnD()); - -var DragAwareMixin = { - data () { - return { - isDropMask: false + DnD.prototype.startDrag = function (source, event, x, y, type, data) { + this.type = type; + this.data = data; + this.source = source; + this.position = { x: x, y: y }; + this.top = null; + this.sourceListeners = source.$listeners; + this.inProgress = true; + this.emit(event, "dragstart"); + this.emit(event, "dragtopchanged", { previousTop: null }); }; - }, - computed: { - dragInProgress () { - return dnd.inProgress; - }, - dragData () { - return dnd.data; - }, - dragType () { - return dnd.type; - }, - dragPosition () { - return dnd.position; - }, - dragSource () { - return dnd.source; - }, - dragTop () { - return dnd.top; + DnD.prototype.resetVariables = function () { + this.inProgress = false; + this.data = null; + this.source = null; + this.position = null; + this.success = null; + }; + DnD.prototype.stopDrag = function (event) { + this.success = this.top !== null && this.top['compatibleMode'] && this.top['dropAllowed']; + if (this.top !== null) { + this.emit(event, "drop"); + } + this.emit(event, "dragend"); + this.resetVariables(); + }; + DnD.prototype.cancelDrag = function (event) { + this.success = false; + this.emit(event, "dragend"); + this.resetVariables(); + }; + DnD.prototype.mouseMove = function (event, comp) { + if (this.inProgress) { + var prevent = false; + var previousTop = this.top; + if (comp === null) { + // The mouse move event reached the top of the document without hitting a drop component. + this.top = null; + prevent = true; + } + else if (comp['isDropMask']) { + // The mouse move event bubbled until it reached a drop mask. + this.top = null; + prevent = true; + } + else if (comp['candidate'](this.type, this.data, this.source)) { + // The mouse move event bubbled until it reached a drop component that participates in the current drag operation. + this.top = comp; + prevent = true; + } + if (prevent) { + // We prevent the mouse move event from bubbling further up the tree because it reached the foremost drop component and that component is all that matters. + event.stopPropagation(); + } + if (this.top !== previousTop) { + this.emit(event.detail.native, 'dragtopchanged', { previousTop: previousTop }); + } + this.position = { + x: event.detail.x, + y: event.detail.y + }; + this.emit(event.detail.native, 'dragpositionchanged'); + } + }; + DnD.prototype.emit = function (native, event, data) { + this.eventBus.$emit(event, __assign({ type: this.type, data: this.data, top: this.top, source: this.source, position: this.position, success: this.success, native: native }, data)); + }; + DnD.prototype.on = function (event, callback) { + this.eventBus.$on(event, callback); + }; + DnD.prototype.off = function (event, callback) { + this.eventBus.$off(event, callback); + }; + return DnD; +}()); +var dnd = new DnD(); +dnd = Vue.observable(dnd); + +var DragAwareMixin = /** @class */ (function (_super) { + __extends(DragAwareMixin, _super); + function DragAwareMixin() { + return _super !== null && _super.apply(this, arguments) || this; } - } -}; + Object.defineProperty(DragAwareMixin.prototype, "dragInProgress", { + get: function () { + return dnd.inProgress; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragAwareMixin.prototype, "dragData", { + get: function () { + return dnd.data; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragAwareMixin.prototype, "dragType", { + get: function () { + return dnd.type; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragAwareMixin.prototype, "dragPosition", { + get: function () { + return dnd.position; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragAwareMixin.prototype, "dragSource", { + get: function () { + return dnd.source; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragAwareMixin.prototype, "dragTop", { + get: function () { + return dnd.top; + }, + enumerable: true, + configurable: true + }); + DragAwareMixin = __decorate([ + Component({}) + ], DragAwareMixin); + return DragAwareMixin; +}(Vue)); /** * This files contains the primitives required to create drag images from HTML elements that serve as models. A snapshot * of the computed styles of the model elements is taken when creating the drag image, so that it will look the same as * the model, no matter where the drag images is grafted into the DOM. */ - /** * Creates a drag image using the given element as model. */ -function createDragImage (el) { - const clone = deepClone(el); - clone.style.position = 'fixed'; - clone.style.margin = '0'; - clone.style['z-index'] = '1000'; - clone.style.transition = 'opacity 0.2s'; - return clone; +function createDragImage(el) { + var clone = deepClone(el); + clone.style.position = 'fixed'; + clone.style.margin = '0'; + clone.style["z-index"] = '1000'; + clone.style.transition = 'opacity 0.2s'; + return clone; } - /** * Clones the given element and all its descendants. */ -function deepClone (el) { - const clone = el.cloneNode(true); - copyStyle(el, clone); - const vSrcElements = el.getElementsByTagName('*'); - const vDstElements = clone.getElementsByTagName('*'); - for (let i = vSrcElements.length; i--;) { - const vSrcElement = vSrcElements[i]; - const vDstElement = vDstElements[i]; - copyStyle(vSrcElement, vDstElement); - } - return clone; +function deepClone(el) { + var clone = el.cloneNode(true); + copyStyle(el, clone); + var vSrcElements = el.getElementsByTagName("*"); + var vDstElements = clone.getElementsByTagName("*"); + for (var i = vSrcElements.length; i--;) { + var vSrcElement = vSrcElements[i]; + var vDstElement = vDstElements[i]; + copyStyle(vSrcElement, vDstElement); + } + return clone; } - /** * Copy the computed styles from src to destination. */ -function copyStyle (src, destination) { - const computedStyle = window.getComputedStyle(src); - for (const key of computedStyle) { - if (key === 'width') { - // IE11 - const width = computedStyle.getPropertyValue('box-sizing') === 'border-box' ? - src.clientWidth : - src.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight); - destination.style.setProperty('width', width + 'px'); +function copyStyle(src, destination) { + var e_1, _a; + var computedStyle = window.getComputedStyle(src); + try { + for (var computedStyle_1 = __values(computedStyle), computedStyle_1_1 = computedStyle_1.next(); !computedStyle_1_1.done; computedStyle_1_1 = computedStyle_1.next()) { + var key = computedStyle_1_1.value; + if (key === 'width') { + // IE11 + var width = computedStyle.getPropertyValue("box-sizing") === 'border-box' ? + src.clientWidth : + src.clientWidth - parseFloat(computedStyle.paddingLeft) - parseFloat(computedStyle.paddingRight); + destination.style.setProperty("width", width + "px"); + } + else if (key === 'height') { + // IE11 + var height = computedStyle.getPropertyValue("box-sizing") === 'border-box' ? + src.clientHeight : + src.clientHeight - parseFloat(computedStyle.paddingTop) - parseFloat(computedStyle.paddingBottom); + destination.style.setProperty("height", height + "px"); + } + else { + destination.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key)); + } + } } - else if (key === 'height') { - // IE11 - const height = computedStyle.getPropertyValue('box-sizing') === 'border-box' ? - src.clientHeight : - src.clientHeight - parseFloat(computedStyle.paddingTop) - parseFloat(computedStyle.paddingBottom); - destination.style.setProperty('height', height + 'px'); + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (computedStyle_1_1 && !computedStyle_1_1.done && (_a = computedStyle_1.return)) { _a.call(computedStyle_1); } + } + finally { if (e_1) { throw e_1.error; } } } - else { - destination.style.setProperty(key, computedStyle.getPropertyValue(key), computedStyle.getPropertyPriority(key)); - } - } - destination.style.pointerEvents = 'none'; + destination.style.pointerEvents = 'none'; } // Forked from https://gist.github.com/gre/296291b8ce0d8fe6e1c3ea4f1d1c5c3b -const regex = /(auto|scroll)/; +var regex = /(auto|scroll)/; -const style = (node, prop) => - getComputedStyle(node, null).getPropertyValue(prop); +var style = function (node, prop) { return getComputedStyle(node, null).getPropertyValue(prop); }; -const scroll = (node) => - regex.test( - style(node, 'overflow') + - style(node, 'overflow-y') + - style(node, 'overflow-x')); +var scroll = function (node) { return regex.test( + style(node, "overflow") + + style(node, "overflow-y") + + style(node, "overflow-x")); }; -const scrollparent = (node) => - !node || node===document.body +var scrollparent = function (node) { return !node || node===document.body ? document.body : scroll(node) ? node - : scrollparent(node.parentNode); + : scrollparent(node.parentNode); }; // Forked from https://github.com/bennadel/JavaScript-Demos/blob/master/demos/window-edge-scrolling/index.htm // Code was altered to work with scrollable containers @@ -229,7 +329,7 @@ function cancelScrollAction () { clearTimeout(timer); } -function performEdgeScroll (event, container, clientX, clientY, edgeSize) { +function performEdgeScroll(event, container, clientX, clientY, edgeSize) { if (!container || !edgeSize) { cancelScrollAction(); return false; @@ -313,7 +413,7 @@ function performEdgeScroll (event, container, clientX, clientY, edgeSize) { // do this, we'll invoke the adjustment logic immediately. Then, we'll setup // a timer that continues to invoke the adjustment logic while the window can // still be scrolled in a particular direction. - (function checkForWindowScroll () { + (function checkForWindowScroll() { cancelScrollAction(); if (adjustWindowScroll()) { @@ -323,7 +423,7 @@ function performEdgeScroll (event, container, clientX, clientY, edgeSize) { // Adjust the window scroll based on the user's mouse position. Returns True // or False depending on whether or not the window scroll was changed. - function adjustWindowScroll () { + function adjustWindowScroll() { // Get the current scroll position of the document. var currentScrollX = container.scrollLeft; var currentScrollY = container.scrollTop; @@ -354,23 +454,23 @@ function performEdgeScroll (event, container, clientX, clientY, edgeSize) { // Should we scroll left? if (isInLeftEdge && canScrollLeft) { - const intensity = ((edgeLeft - viewportX) / edgeSize); + var intensity = ((edgeLeft - viewportX) / edgeSize); nextScrollX = (nextScrollX - (maxStep * intensity)); } // Should we scroll right? else if (isInRightEdge && canScrollRight) { - const intensity = ((viewportX - edgeRight) / edgeSize); + var intensity = ((viewportX - edgeRight) / edgeSize); nextScrollX = (nextScrollX + (maxStep * intensity)); } // Should we scroll up? if (isInTopEdge && canScrollUp) { - const intensity = ((edgeTop - viewportY) / edgeSize); + var intensity = ((edgeTop - viewportY) / edgeSize); nextScrollY = (nextScrollY - (maxStep * intensity)); } // Should we scroll down? else if (isInBottomEdge && canScrollDown) { - const intensity = ((viewportY - edgeBottom) / edgeSize); + var intensity = ((viewportY - edgeBottom) / edgeSize); nextScrollY = (nextScrollY + (maxStep * intensity)); } @@ -393,1450 +493,1580 @@ function performEdgeScroll (event, container, clientX, clientY, edgeSize) { } } - return true; + return true } -var DragMixin = { - mixins: [DragAwareMixin], - props: { - type: { - type: String, - default: null - }, - data: { - default: null - }, - dragImageOpacity: { - type: Number, - default: 0.7 - }, - disabled: { - type: Boolean, - default: false - }, - goBack: { - type: Boolean, - default: false - }, - handle: { - type: String, - default: null - }, - delta: { - type: Number, - default: 0 - }, - delay: { - type: Number, - default: 0 - }, - dragClass: { - type: String, - default: null - }, - vibration: { - type: Number, - default: 0 - }, - scrollingEdgeSize: { - type: Number, - default: 100 +var DragMixin = /** @class */ (function (_super) { + __extends(DragMixin, _super); + function DragMixin() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.dragInitialised = false; + _this.dragStarted = false; + _this.ignoreNextClick = false; + _this.initialUserSelect = null; + _this.downEvent = null; + _this.startPosition = null; + _this.delayTimer = null; + _this.scrollContainer = null; + return _this; } - }, - emits: ['dragstart', 'dragend', 'cut', 'copy'], - data () { - return { - dragInitialised: false, - dragStarted: false, - ignoreNextClick: false, - initialUserSelect: null, - downEvent: null, - startPosition: null, - delayTimer: null, - scrollContainer: null + DragMixin.prototype.onSelectStart = function (e) { + e.stopPropagation(); + e.preventDefault(); }; - }, - computed: { - cssClasses () { - const clazz = { - 'dnd-drag': true - }; - if (!this.disabled) { - return { - ...clazz, - 'drag-source': this.dragInProgress && this.dragSource === this, - 'drag-mode-copy': this.currentDropMode === 'copy', - 'drag-mode-cut': this.currentDropMode === 'cut', - 'drag-mode-reordering': this.currentDropMode === 'reordering', - 'drag-no-handle': !this.handle - }; - } - else { - return clazz; - } - }, - currentDropMode () { - if (this.dragInProgress && this.dragSource === this) { - if (this.dragTop && this.dragTop['dropAllowed']) { - if (this.dragTop['reordering']) { - return 'reordering'; - } - else { - return this.dragTop['mode']; - } + DragMixin.prototype.performVibration = function () { + // If browser can perform vibration and user has defined a vibration, perform it + if (this.vibration > 0 && window.navigator && window.navigator.vibrate) { + window.navigator.vibrate(this.vibration); + } + }; + DragMixin.prototype.onMouseDown = function (e) { + var _this = this; + var target; + var goodButton; + if (e.type === 'mousedown') { + var mouse = e; + target = e.target; + goodButton = mouse.buttons === 1; } else { - return null; + var touch = e; + target = touch.touches[0].target; + goodButton = true; } - } - else { - return null; - } - } - }, - methods: { - onSelectStart (e) { - e.stopPropagation(); - e.preventDefault(); - }, - performVibration () { - // If browser can perform vibration and user has defined a vibration, perform it - if (this.vibration > 0 && window.navigator && window.navigator.vibrate) { - window.navigator.vibrate(this.vibration); - } - }, - onMouseDown (e) { - let target = null; - let goodButton = false; - if (e.type === 'mousedown') { - const mouse = e; - target = e.target; - goodButton = mouse.buttons === 1; - } - else { - const touch = e; - target = touch.touches[0].target; - goodButton = true; - } - - if (this.disabled || this.downEvent !== null || !goodButton) { - return; - } - - // Check that the target element is eligible for starting a drag - // Includes checking against the handle selector - // or whether the element contains 'dnd-no-drag' class (which should disable dragging from that - // sub-element of a draggable parent) - const goodTarget = !target.matches('.dnd-no-drag, .dnd-no-drag *') && - ( - !this.handle || - target.matches(this.handle + ', ' + this.handle + ' *') - ); - - if (!goodTarget) { - return; - } - - this.scrollContainer = scrollparent(target); - this.initialUserSelect = document.body.style.userSelect; - document.documentElement.style.userSelect = 'none'; // Permet au drag de se poursuivre normalement même - // quand on quitte un élémént avec overflow: hidden. - this.dragStarted = false; - this.downEvent = e; - if (this.downEvent.type === 'mousedown') { - const mouse = e; - this.startPosition = { - x: mouse.clientX, - y: mouse.clientY - }; - } - else { - const touch = e; - this.startPosition = { - x: touch.touches[0].clientX, - y: touch.touches[0].clientY - }; - } - - if (this.delay) { - this.dragInitialised = false; - clearTimeout(this.delayTimer); - this.delayTimer = setTimeout(() => { - this.dragInitialised = true; - this.performVibration(); - }, this.delay); - } - else { - this.dragInitialised = true; - this.performVibration(); - } - - document.addEventListener('click', this.onMouseClick, true); - document.addEventListener('mouseup', this.onMouseUp); - document.addEventListener('touchend', this.onMouseUp); - document.addEventListener('selectstart', this.onSelectStart); - document.addEventListener('keyup', this.onKeyUp); - - setTimeout(() => { - document.addEventListener('mousemove', this.onMouseMove); - document.addEventListener('touchmove', this.onMouseMove, { passive: false }); - document.addEventListener('easy-dnd-move', this.onEasyDnDMove); - }, 0); - - // Prevents event from bubbling to ancestor drag components and initiate several drags at the same time - e.stopPropagation(); - }, + if (this.disabled || this.downEvent !== null || !goodButton) { + return; + } + // Check that the target element is eligible for starting a drag + // Includes checking against the handle selector + // or whether the element contains 'dnd-no-drag' class (which should disable dragging from that + // sub-element of a draggable parent) + var goodTarget = !target.matches('.dnd-no-drag, .dnd-no-drag *') && + (!this.handle || + target.matches(this.handle + ', ' + this.handle + ' *')); + if (!goodTarget) { + return; + } + this.scrollContainer = scrollparent(target); + this.initialUserSelect = document.body.style.userSelect; + document.documentElement.style.userSelect = 'none'; // Permet au drag de se poursuivre normalement même + // quand on quitte un élémént avec overflow: hidden. + this.dragStarted = false; + this.downEvent = e; + if (this.downEvent.type === 'mousedown') { + var mouse = event; + this.startPosition = { + x: mouse.clientX, + y: mouse.clientY + }; + } + else { + var touch = event; + this.startPosition = { + x: touch.touches[0].clientX, + y: touch.touches[0].clientY + }; + } + if (!!this.delay) { + this.dragInitialised = false; + clearTimeout(this.delayTimer); + this.delayTimer = setTimeout(function () { + _this.dragInitialised = true; + _this.performVibration(); + }, this.delay); + } + else { + this.dragInitialised = true; + this.performVibration(); + } + document.addEventListener('click', this.onMouseClick, true); + document.addEventListener('mouseup', this.onMouseUp); + document.addEventListener('touchend', this.onMouseUp); + document.addEventListener('selectstart', this.onSelectStart); + document.addEventListener('keyup', this.onKeyUp); + setTimeout(function () { + document.addEventListener('mousemove', _this.onMouseMove); + document.addEventListener('touchmove', _this.onMouseMove, { passive: false }); + document.addEventListener('easy-dnd-move', _this.onEasyDnDMove); + }, 0); + // Prevents event from bubbling to ancestor drag components and initiate several drags at the same time + e.stopPropagation(); + }; // Prevent the user from accidentally causing a click event // if they have just attempted a drag event - onMouseClick (e) { - if (this.ignoreNextClick) { - e.preventDefault(); - e.stopPropagation && e.stopPropagation(); - e.stopImmediatePropagation && e.stopImmediatePropagation(); - this.ignoreNextClick = false; - return false; - } - }, - onMouseMove (e) { - // We ignore the mousemove event that follows touchend : - if (this.downEvent === null) return; - - // On touch devices, we ignore fake mouse events and deal with touch events only. - if (this.downEvent.type === 'touchstart' && e.type === 'mousemove') return; - - // Find out event target and pointer position : - let target = null; - let x = null; - let y = null; - if (e.type === 'touchmove') { - const touch = e; - x = touch.touches[0].clientX; - y = touch.touches[0].clientY; - target = document.elementFromPoint(x, y); - if (!target) { - // Mouse going off screen. Ignore event. - return; - } - } - else { - const mouse = e; - x = mouse.clientX; - y = mouse.clientY; - target = mouse.target; - } - - // Distance between current event and start position : - const dist = Math.sqrt(Math.pow(this.startPosition.x - x, 2) + Math.pow(this.startPosition.y - y, 2)); - - // If the drag has not begun yet and distance from initial point is greater than delta, we start the drag : - if (!this.dragStarted && dist > this.delta) { - // If they have dragged greater than the delta before the delay period has ended, - // It means that they attempted to perform another action (such as scrolling) on the page - if (!this.dragInitialised) { - clearTimeout(this.delayTimer); - } - else { - this.ignoreNextClick = true; - this.dragStarted = true; - dnd.startDrag(this, this.downEvent, this.startPosition.x, this.startPosition.y, this.type, this.data); - document.documentElement.classList.add('drag-in-progress'); - } - } - - // Dispatch custom easy-dnd-move event : - if (this.dragStarted) { - // If cursor/touch is at edge of container, perform scroll if available - // If this.dragTop is defined, it means they are dragging on top of another DropList/EasyDnd component - // if dropTop is a DropList, use the scrollingEdgeSize of that container if it exists, otherwise use the scrollingEdgeSize of the Drag component - const currEdgeSize = this.dragTop && this.dragTop.$props.scrollingEdgeSize !== undefined ? - this.dragTop.$props.scrollingEdgeSize : - this.scrollingEdgeSize; - - if (currEdgeSize) { - const currScrollContainer = this.dragTop ? scrollparent(this.dragTop.$el) : this.scrollContainer; - performEdgeScroll(e, currScrollContainer, x, y, currEdgeSize); - } - else { - cancelScrollAction(); - } - - const custom = new CustomEvent('easy-dnd-move', { - bubbles: true, - cancelable: true, - detail: { - x, - y, - native: e - } - }); - target.dispatchEvent(custom); - } - - // Prevent scroll on touch devices if they were performing a drag - if (this.dragInitialised && e.cancelable) { - e.preventDefault(); - } - }, - onEasyDnDMove (e) { - dnd.mouseMove(e, null); - }, - onMouseUp (e) { - // On touch devices, we ignore fake mouse events and deal with touch events only. - if (this.downEvent.type === 'touchstart' && e.type === 'mouseup') return; - - // This delay makes sure that when the click event that results from the mouseup is produced, the drag is - // still in progress. So by checking the flag dnd.inProgress, one can tell apart true clicks from drag and - // drop artefacts. - setTimeout(() => { - this.cancelDragActions(); - - if (this.dragStarted) { - dnd.stopDrag(e); - } - this.finishDrag(); - }, 0); - }, - onKeyUp (e) { - // If ESC is pressed, cancel the drag - if (e.key === 'Escape') { - this.cancelDragActions(); - - setTimeout(() => { - dnd.cancelDrag(e); - this.finishDrag(); - }, 0); - } - }, - cancelDragActions () { - this.dragInitialised = false; - clearTimeout(this.delayTimer); - cancelScrollAction(); - }, - finishDrag () { - this.downEvent = null; - this.scrollContainer = null; - - if (this.dragStarted) { - document.documentElement.classList.remove('drag-in-progress'); - } - document.removeEventListener('click', this.onMouseClick, true); - document.removeEventListener('mousemove', this.onMouseMove); - document.removeEventListener('touchmove', this.onMouseMove); - document.removeEventListener('easy-dnd-move', this.onEasyDnDMove); - document.removeEventListener('mouseup', this.onMouseUp); - document.removeEventListener('touchend', this.onMouseUp); - document.removeEventListener('selectstart', this.onSelectStart); - document.removeEventListener('keyup', this.onKeyUp); - document.documentElement.style.userSelect = this.initialUserSelect; - }, - dndDragStart (ev) { - if (ev.source === this) { - this.$emit('dragstart', ev); - } - }, - dndDragEnd (ev) { - if (ev.source === this) { - this.$emit('dragend', ev); - } - }, - createDragImage (selfTransform) { - let image; - if (this.$slots['drag-image']) { - const el = this.$refs['drag-image'] || document.createElement('div'); - if (el.childElementCount !== 1) { - image = createDragImage(el); - } - else { - image = createDragImage(el.children.item(0)); - } - } - else { - image = createDragImage(this.$el); - image.style.transform = selfTransform; - } - - if (this.dragClass) { - image.classList.add(this.dragClass); - } - image.classList.add('dnd-ghost'); - image['__opacity'] = this.dragImageOpacity; - return image; - } - }, - created () { - dnd.on('dragstart', this.dndDragStart); - dnd.on('dragend', this.dndDragEnd); - }, - mounted () { - this.$el.addEventListener('mousedown', this.onMouseDown); - this.$el.addEventListener('touchstart', this.onMouseDown); - }, - beforeUnmount () { - dnd.off('dragstart', this.dndDragStart); - dnd.off('dragend', this.dndDragEnd); - - this.$el.removeEventListener('mousedown', this.onMouseDown); - this.$el.removeEventListener('touchstart', this.onMouseDown); - } -}; - -var script$4 = { - name: 'Drag', - mixins: [DragMixin], - props: { - /** - * Tag to be used as root of this component. Defaults to div. - */ - tag: { - type: [String, Object, Function], - default: 'div' - } - }, - computed: { - dynamicSlots () { - return Object.entries(this.$slots).filter(([key]) => key !== 'drag-image' && key !== 'default'); - } - } -}; - -const _hoisted_1$2 = { - key: 0, - ref: "drag-image", - class: "__drag-image" -}; - -function render$3(_ctx, _cache, $props, $setup, $data, $options) { - return (openBlock(), createBlock(resolveDynamicComponent($props.tag), { - class: normalizeClass(_ctx.cssClasses) - }, createSlots({ - default: withCtx(() => [ - renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(_ctx.$slots['default'] || {}))), - (_ctx.dragInitialised) - ? (openBlock(), createElementBlock("div", _hoisted_1$2, [ - renderSlot(_ctx.$slots, "drag-image") - ], 512 /* NEED_PATCH */)) - : createCommentVNode("v-if", true) - ]), - _: 2 /* DYNAMIC */ - }, [ - renderList($options.dynamicSlots, ([slot, args]) => { - return { - name: slot, - fn: withCtx(() => [ - renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(args))) - ]) - } - }) - ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["class"])) -} - -script$4.render = render$3; -script$4.__scopeId = "data-v-f87407ce"; - -function dropAllowed (inst) { - if (inst.dragInProgress && inst.typeAllowed) { - return inst.compatibleMode && inst.effectiveAcceptsData(inst.dragData, inst.dragType); - } - return null; -} - -function doDrop (inst, event) { - inst.$emit('drop', event); - event.source.$emit(inst.mode, event); -} - -function candidate (inst, type) { - return inst.effectiveAcceptsType(type); -} - -var DropMixin = { - mixins: [DragAwareMixin], - props: { - acceptsType: { - type: [String, Array, Function], - default: null - }, - acceptsData: { - type: Function, - default: () => { - return true; - } - }, - mode: { - type: String, - default: 'copy' - }, - dragImageOpacity: { - type: Number, - default: 0.7 - } - }, - emits: ['dragover', 'dragenter', 'dragleave', 'dragend', 'drop'], - data () { - return { - isDrop: true - }; - }, - computed: { - compatibleMode () { - return this.dragInProgress ? true : null; - }, - dropIn () { - if (this.dragInProgress) { - return this.dragTop === this; - } - return null; - }, - typeAllowed () { - if (this.dragInProgress) { - return this.effectiveAcceptsType(this.dragType); - } - return null; - }, - dropAllowed () { - return dropAllowed(this); - }, - cssClasses () { - const clazz = { - 'dnd-drop': true - }; - if (this.dropIn !== null) { - clazz['drop-in'] = this.dropIn; - clazz['drop-out'] = !this.dropIn; - } - if (this.typeAllowed !== null) { - clazz['type-allowed'] = this.typeAllowed; - clazz['type-forbidden'] = !this.typeAllowed; - } - if (this.dropAllowed !== null) { - clazz['drop-allowed'] = this.dropAllowed; - clazz['drop-forbidden'] = !this.dropAllowed; - } - return clazz; - } - }, - methods: { - effectiveAcceptsType (type) { - if (this.acceptsType === null) { - return true; - } - else if (typeof (this.acceptsType) === 'string' || typeof(this.acceptsType) === 'number') { - return this.acceptsType === type; - } - else if (typeof (this.acceptsType) === 'object' && Array.isArray(this.acceptsType)) { - return this.acceptsType.includes(type); - } - else { - return this.acceptsType(type); - } - }, - effectiveAcceptsData (data, type) { - return this.acceptsData(data, type); - }, - onDragPositionChanged (event) { - if (this === event.top) { - this.$emit('dragover', event); - } - }, - onDragTopChanged (event) { - if (this === event.top) { - this.$emit('dragenter', event); - } - if (this === event.previousTop) { - this.$emit('dragleave', event); - } - }, - onDragEnd (event) { - if (this === event.top) { - this.$emit('dragend', event); - } - }, - onDrop (event) { - if (this.dropIn && this.compatibleMode && this.dropAllowed) { - this.doDrop(event); - } - }, - doDrop (event) { - doDrop(this, event); - }, - /** - * Returns true if the current drop area participates in the current drag operation. - */ - candidate (type) { - return candidate(this, type); - }, - createDragImage () { - let image = 'source'; - if (this.$refs['drag-image']) { - const el = this.$refs['drag-image']; - if (el.childElementCount !== 1) { - image = createDragImage(el); - } - else { - image = createDragImage(el.children.item(0)); - } - image['__opacity'] = this.dragImageOpacity; - image.classList.add('dnd-ghost'); - } - return image; - }, - onDnDMove (e) { - dnd.mouseMove(e, this); - } - }, - created () { - dnd.on('dragpositionchanged', this.onDragPositionChanged); - dnd.on('dragtopchanged', this.onDragTopChanged); - dnd.on('drop', this.onDrop); - dnd.on('dragend', this.onDragEnd); - }, - mounted () { - this.$el.addEventListener('easy-dnd-move', this.onDnDMove); - }, - beforeUnmount () { - this.$el.removeEventListener('easy-dnd-move', this.onDnDMove); - - dnd.off('dragpositionchanged', this.onDragPositionChanged); - dnd.off('dragtopchanged', this.onDragTopChanged); - dnd.off('drop', this.onDrop); - dnd.off('dragend', this.onDragEnd); - } -}; - -var script$3 = { - name: 'Drop', - mixins: [DropMixin], - props: { - tag: { - type: [String, Object, Function], - default: 'div' - } - }, - computed: { - dynamicSlots () { - return Object.entries(this.$slots).filter(([key]) => key !== 'drag-image' && key !== 'default'); - }, - showDragImage () { - return this.dragInProgress && this.typeAllowed && !!this.$slots['drag-image']; - } - } -}; - -const _hoisted_1$1 = { - key: 0, - ref: "drag-image", - class: "__drag-image" -}; - -function render$2(_ctx, _cache, $props, $setup, $data, $options) { - return (openBlock(), createBlock(resolveDynamicComponent($props.tag), { - class: normalizeClass(_ctx.cssClasses) - }, createSlots({ - default: withCtx(() => [ - renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(_ctx.$slots['default'] || {}))), - ($options.showDragImage) - ? (openBlock(), createElementBlock("div", _hoisted_1$1, [ - renderSlot(_ctx.$slots, "drag-image", { - type: _ctx.dragType, - data: _ctx.dragData - }) - ], 512 /* NEED_PATCH */)) - : createCommentVNode("v-if", true) - ]), - _: 2 /* DYNAMIC */ - }, [ - renderList($options.dynamicSlots, ([slot, args]) => { - return { - name: slot, - fn: withCtx(() => [ - renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(args))) - ]) - } - }) - ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["class"])) -} - -script$3.render = render$2; -script$3.__scopeId = "data-v-12a39e52"; - -var script$2 = { - name: 'DropMask', - mixins: [DragAwareMixin], - props: { - tag: { - type: [String, Object, Function], - default: 'div' - } - }, - data () { - return { - isDropMask: true - }; - }, - mounted () { - this.$el.addEventListener('easy-dnd-move', this.onDndMove); - }, - beforeUnmount () { - this.$el.removeEventListener('easy-dnd-move', this.onDndMove); - }, - methods: { - createDragImage () { - return 'source'; - }, - onDndMove (e) { - dnd.mouseMove(e, this); - } - } -}; - -function render$1(_ctx, _cache, $props, $setup, $data, $options) { - return (openBlock(), createBlock(resolveDynamicComponent($props.tag), null, createSlots({ _: 2 /* DYNAMIC */ }, [ - renderList(_ctx.$slots, (args, slot) => { - return { - name: slot, - fn: withCtx(() => [ - renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(args))) - ]) - } - }) - ]), 1024 /* DYNAMIC_SLOTS */)) -} - -script$2.render = render$1; - -var script$1 = { - name: 'DragFeedback' -}; - -const _hoisted_1 = { class: "DragFeedback" }; - -function render(_ctx, _cache, $props, $setup, $data, $options) { - return (openBlock(), createElementBlock("div", _hoisted_1, [ - renderSlot(_ctx.$slots, "default") - ])) -} - -script$1.render = render; - -class Grid { - reference; - referenceOriginalPosition; - magnets = []; - - constructor (collection, upToIndex, direction, fromIndex) { - this.reference = collection.item(0).parentNode; - this.referenceOriginalPosition = { - x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft, - y: this.reference.getBoundingClientRect().top - this.reference.scrollTop, - }; - let index = 0; - for (const child of collection) { - if (index > upToIndex) break; - const rect = child.getBoundingClientRect(); - const hasNestedDrop = child.classList.contains('dnd-drop') || child.getElementsByClassName('dnd-drop').length > 0; - let horizontal = false; - if (hasNestedDrop) { - if (direction === 'auto') { - // Auto mode not supported for now. Row or column must be defined explicitly if there are nested drop lists. - throw 'Easy-DnD error : a drop list is missing one of these attributes : \'row\' or \'column\'.'; - } - else { - horizontal = direction === 'row'; - } - } - if (fromIndex === null) { - // Inserting mode. - this.magnets.push(hasNestedDrop ? this.before(rect, horizontal) : this.center(rect)); - } - else { - // Reordering mode. - this.magnets.push(hasNestedDrop ? ( - fromIndex < index ? this.after : this.before - )(rect, horizontal) : this.center(rect)); - } - // Debug : show magnets : - //document.body.insertAdjacentHTML("beforeend", "
") - index++; - } - } - - /** - * Returns the center of the rectangle. - */ - center (rect) { - return { - x: rect.left + rect.width / 2, - y: rect.top + rect.height / 2 - }; - } - - /** - * When horizontal is true / false, returns middle of the left / top side of the rectangle. - */ - before (rect, horizontal) { - return horizontal ? { - x: rect.left, - y: rect.top + rect.height / 2 - } : { - x: rect.left + rect.width / 2, - y: rect.top - }; - } - - /** - * When horizontal is true / false, returns middle of the right / bottom side of the rectangle. - */ - after (rect, horizontal) { - return horizontal ? { - x: rect.left + rect.width, - y: rect.top + rect.height / 2 - } : { - x: rect.left + rect.width / 2, - y: rect.top + rect.height - }; - } - - /** - * In case the user scrolls during the drag, the position of the magnets are not what they used to be when the drag - * started. A correction must be applied that takes into account the amount of scroll. This correction is the - * difference between the current position of the parent element and its position when the drag started. - */ - correction () { - return { - x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft - this.referenceOriginalPosition.x, - y: this.reference.getBoundingClientRect().top - this.reference.scrollTop - this.referenceOriginalPosition.y, - }; - } - - closestIndex (position) { - const x = position.x - this.correction().x; - const y = position.y - this.correction().y; - let minDist = 999999; - let index = -1; - for (let i = 0; i < this.magnets.length; i++) { - const magnet = this.magnets[i]; - const dist = Math.sqrt(Math.pow(magnet.x - x, 2) + Math.pow(magnet.y - y, 2)); - if (dist < minDist) { - minDist = dist; - index = i; - } - } - return index; - } -} - -class DnDEvent { - type; - data; - top; - previousTop; - source; - position; - success; - native; -} - -class ReorderEvent { - from; - to; - - constructor (from, to) { - this.from = from; - this.to = to; - } - - apply (array) { - const temp = array[this.from]; - array.splice(this.from, 1); - array.splice(this.to, 0, temp); - } - -} - -class InsertEvent { - type; - data; - index; - - constructor (type, data, index) { - this.type = type; - this.data = data; - this.index = index; - } -} - -var script = { - name: 'DropList', - mixins: [DropMixin], - props: { - tag: { - type: [String, Object, Function], - default: 'div' - }, - items: { - type: Array, - required: true - }, - row: { - type: Boolean, - default: false - }, - column: { - type: Boolean, - default: false - }, - noAnimations: { - type: Boolean, - default: false - }, - scrollingEdgeSize: { - type: Number, - default: undefined - } - }, - emits: ['reorder', 'insert'], - data () { - return { - grid: null, - forbiddenKeys: [], - feedbackKey: null, - fromIndex: null - }; - }, - computed: { - rootTag () { - if (this.noAnimations) { - return this.tag; - } - return TransitionGroup; - }, - rootProps () { - if (this.noAnimations) { - return {}; - } - - return { - tag: this.tag, - css: false - }; - }, - direction () { - // todo - rewrite this logic - if (this.row) return 'row'; - if (this.column) return 'column'; - return 'auto'; - }, - reordering () { - if (dnd.inProgress) { - return dnd.source.$el.parentElement === this.$el; - } - return null; - }, - closestIndex () { - if (this.grid) { - return this.grid.closestIndex(dnd.position); - } - return null; - }, - dropAllowed () { - if (this.dragInProgress) { - if (this.reordering) { - return this.items.length > 1; - } - else { - // todo - eventually refactor so that this isn't necessary - if (!dropAllowed(this)) { + DragMixin.prototype.onMouseClick = function (e) { + if (this.ignoreNextClick) { + e.preventDefault(); + e.stopPropagation && e.stopPropagation(); + e.stopImmediatePropagation && e.stopImmediatePropagation(); + this.ignoreNextClick = false; return false; - } - - if (this.forbiddenKeys !== null && this.feedbackKey !== null) { - return !this.forbiddenKeys.includes(this.feedbackKey); - } - - return true; } - } - - return null; - }, - itemsBeforeFeedback () { - if (this.closestIndex === 0) { - return []; - } - return this.items.slice(0, this.closestIndex); - }, - itemsAfterFeedback () { - if (this.closestIndex === this.items.length) { - return []; - } - return this.items.slice(this.closestIndex); - }, - itemsBeforeReorderingFeedback () { - if (this.closestIndex <= this.fromIndex) { - return this.items.slice(0, this.closestIndex); - } - return this.items.slice(0, this.closestIndex + 1); - }, - itemsAfterReorderingFeedback () { - if (this.closestIndex <= this.fromIndex) { - return this.items.slice(this.closestIndex); - } - return this.items.slice(this.closestIndex + 1); - }, - reorderedItems () { - const toIndex = this.closestIndex; - const reordered = [...this.items]; - const temp = reordered[this.fromIndex]; - - reordered.splice(this.fromIndex, 1); - reordered.splice(toIndex, 0, temp); - return reordered; - }, - clazz () { - return { - 'drop-list': true, - 'reordering': this.reordering === true, - 'inserting': this.reordering === false, - ...(this.reordering === false ? this.cssClasses : { 'dnd-drop': true }) - }; - }, - showDragFeedback () { - return this.dragInProgress && this.typeAllowed && !this.reordering; - }, - showInsertingDragImage () { - return this.dragInProgress && this.typeAllowed && !this.reordering && !!this.$slots['drag-image']; - }, - showReorderingDragImage () { - return this.dragInProgress && this.reordering && !!this.$slots['reordering-drag-image']; - }, - hasReorderingFeedback () { - return !!this.$slots['reordering-feedback']; - }, - hasEmptySlot () { - return !!this.$slots['empty']; - } - }, - created () { - dnd.on('dragstart', this.onDragStart); - dnd.on('dragend', this.onDragEnd); - }, - beforeUnmount () { - dnd.off('dragstart', this.onDragStart); - dnd.off('dragend', this.onDragEnd); - }, - methods: { - // Presence of feedback node in the DOM and of keys in the virtual DOM required => delayed until what - // depends on drag data has been processed. - refresh () { - this.$nextTick(() => { - this.grid = this.computeInsertingGrid(); - this.feedbackKey = this.computeFeedbackKey(); - this.forbiddenKeys = this.computeForbiddenKeys(); - }); - }, - onDragStart (event) { - if (this.candidate(dnd.type)) { - if (this.reordering) { - this.fromIndex = Array.prototype.indexOf.call(event.source.$el.parentElement.children, event.source.$el); - this.grid = this.computeReorderingGrid(); + }; + DragMixin.prototype.onMouseMove = function (e) { + // We ignore the mousemove event that follows touchend : + if (this.downEvent === null) + { return; } + // On touch devices, we ignore fake mouse events and deal with touch events only. + if (this.downEvent.type === 'touchstart' && e.type === 'mousemove') + { return; } + // Find out event target and pointer position : + var target; + var x; + var y; + if (e.type === 'touchmove') { + var touch = e; + x = touch.touches[0].clientX; + y = touch.touches[0].clientY; + target = document.elementFromPoint(x, y); + if (!target) { + // Mouse going off screen. Ignore event. + return; + } } else { - this.refresh(); + var mouse = e; + x = mouse.clientX; + y = mouse.clientY; + target = mouse.target; } - } - }, - onDragEnd () { - this.fromIndex = null; - this.feedbackKey = null; - this.forbiddenKeys = null; - this.grid = null; - }, - doDrop (event) { - if (this.reordering) { - if (this.fromIndex !== this.closestIndex) { - this.$emit('reorder', new ReorderEvent( - this.fromIndex, - this.closestIndex - )); + // Distance between current event and start position : + var dist = Math.sqrt(Math.pow(this.startPosition.x - x, 2) + Math.pow(this.startPosition.y - y, 2)); + // If the drag has not begun yet and distance from initial point is greater than delta, we start the drag : + if (!this.dragStarted && dist > this.delta) { + // If they have dragged greater than the delta before the delay period has ended, + // It means that they attempted to perform another action (such as scrolling) on the page + if (!this.dragInitialised) { + clearTimeout(this.delayTimer); + } + else { + this.ignoreNextClick = true; + this.dragStarted = true; + dnd.startDrag(this, this.downEvent, this.startPosition.x, this.startPosition.y, this.type, this.data); + document.documentElement.classList.add('drag-in-progress'); + } } - } - else { - // todo - eventually remove the need for this - doDrop(this, event); - this.$emit('insert', new InsertEvent( - event.type, - event.data, - this.closestIndex - )); - } - }, - candidate (type) { - return candidate(this, type) || this.reordering; - }, - computeForbiddenKeys () { - return (this.noAnimations ? [] : this.$refs.component.$slots['default']()) - .map(vn => vn.key) - .filter(k => !!k && k !== 'drag-image' && k !== 'drag-feedback'); - }, - computeFeedbackKey () { - return this.$refs['feedback']['$slots']['default']()[0]['key']; - }, - computeInsertingGrid () { - if (this.$refs.feedback.$el.children.length < 1) { - return null; - } - - const feedback = this.$refs.feedback.$el.children[0]; - const clone = feedback.cloneNode(true); - const tg = this.$el; - if (tg.children.length > this.items.length) { - tg.insertBefore(clone, tg.children[this.items.length]); - } - else { - tg.appendChild(clone); - } - const grid = new Grid(tg.children, this.items.length, this.direction, null); - tg.removeChild(clone); - return grid; - }, - computeReorderingGrid () { - return new Grid(this.$el.children, this.items.length - 1, this.direction, this.fromIndex); - }, - createDragImage () { - let image; - if (this.$refs['drag-image']) { - const el = this.$refs['drag-image']; - let model; - if (el.childElementCount !== 1) { - model = el; + // Dispatch custom easy-dnd-move event : + if (this.dragStarted) { + // If cursor/touch is at edge of container, perform scroll if available + // If this.dragTop is defined, it means they are dragging on top of another DropList/EasyDnd component + // if dropTop is a DropList, use the scrollingEdgeSize of that container if it exists, otherwise use the scrollingEdgeSize of the Drag component + var currEdgeSize = this.dragTop && this.dragTop.$props.scrollingEdgeSize !== undefined ? + this.dragTop.$props.scrollingEdgeSize : + this.scrollingEdgeSize; + if (!!currEdgeSize) { + var currScrollContainer = this.dragTop ? scrollparent(this.dragTop.$el) : this.scrollContainer; + performEdgeScroll(e, currScrollContainer, x, y, currEdgeSize); + } + else { + cancelScrollAction(); + } + var custom = new CustomEvent("easy-dnd-move", { + bubbles: true, + cancelable: true, + detail: { + x: x, + y: y, + native: e + } + }); + target.dispatchEvent(custom); + } + // Prevent scroll on touch devices if they were performing a drag + if (this.dragInitialised && e.cancelable) { + e.preventDefault(); + } + }; + DragMixin.prototype.onEasyDnDMove = function (e) { + dnd.mouseMove(e, null); + }; + DragMixin.prototype.onMouseUp = function (e) { + var _this = this; + // On touch devices, we ignore fake mouse events and deal with touch events only. + if (this.downEvent.type === 'touchstart' && e.type === 'mouseup') + { return; } + // This delay makes sure that when the click event that results from the mouseup is produced, the drag is + // still in progress. So by checking the flag dnd.inProgress, one can tell apart true clicks from drag and + // drop artefacts. + setTimeout(function () { + _this.cancelDragActions(); + if (_this.dragStarted) { + dnd.stopDrag(e); + } + _this.finishDrag(); + }, 0); + }; + DragMixin.prototype.onKeyUp = function (e) { + var _this = this; + // If ESC is pressed, cancel the drag + if (e.key === 'Escape') { + this.cancelDragActions(); + setTimeout(function () { + dnd.cancelDrag(e); + _this.finishDrag(); + }, 0); + } + }; + DragMixin.prototype.cancelDragActions = function () { + this.dragInitialised = false; + clearTimeout(this.delayTimer); + cancelScrollAction(); + }; + DragMixin.prototype.finishDrag = function () { + this.downEvent = null; + this.scrollContainer = null; + if (this.dragStarted) { + document.documentElement.classList.remove('drag-in-progress'); + } + document.removeEventListener('click', this.onMouseClick, true); + document.removeEventListener('mousemove', this.onMouseMove); + document.removeEventListener('touchmove', this.onMouseMove); + document.removeEventListener('easy-dnd-move', this.onEasyDnDMove); + document.removeEventListener('mouseup', this.onMouseUp); + document.removeEventListener('touchend', this.onMouseUp); + document.removeEventListener('selectstart', this.onSelectStart); + document.removeEventListener('keyup', this.onKeyUp); + document.documentElement.style.userSelect = this.initialUserSelect; + }; + DragMixin.prototype.dndDragStart = function (ev) { + if (ev.source === this) { + this.$emit('dragstart', ev); + } + }; + DragMixin.prototype.dndDragEnd = function (ev) { + if (ev.source === this) { + this.$emit('dragend', ev); + } + }; + DragMixin.prototype.created = function () { + dnd.on('dragstart', this.dndDragStart); + dnd.on('dragend', this.dndDragEnd); + }; + DragMixin.prototype.mounted = function () { + this.$el.addEventListener('mousedown', this.onMouseDown); + this.$el.addEventListener('touchstart', this.onMouseDown); + }; + DragMixin.prototype.beforeDestroy = function () { + dnd.off('dragstart', this.dndDragStart); + dnd.off('dragend', this.dndDragEnd); + this.$el.removeEventListener('mousedown', this.onMouseDown); + this.$el.removeEventListener('touchstart', this.onMouseDown); + }; + Object.defineProperty(DragMixin.prototype, "cssClasses", { + get: function () { + var clazz = { + 'dnd-drag': true + }; + if (!this.disabled) { + return __assign(__assign({}, clazz), { 'drag-source': this.dragInProgress && this.dragSource === this, 'drag-mode-copy': this.currentDropMode === 'copy', 'drag-mode-cut': this.currentDropMode === 'cut', 'drag-mode-reordering': this.currentDropMode === 'reordering', 'drag-no-handle': !this.handle }); + } + else { + return clazz; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DragMixin.prototype, "currentDropMode", { + get: function () { + if (this.dragInProgress && this.dragSource === this) { + if (this.dragTop && this.dragTop['dropAllowed']) { + if (this.dragTop['reordering']) + { return 'reordering'; } + else + { return this.dragTop['mode']; } + } + else { + return null; + } + } + else { + return null; + } + }, + enumerable: true, + configurable: true + }); + DragMixin.prototype.createDragImage = function (selfTransform) { + var image; + if (this.$scopedSlots['drag-image']) { + var el = this.$refs['drag-image'] || document.createElement('div'); + if (el.childElementCount !== 1) { + image = createDragImage(el); + } + else { + image = createDragImage(el.children.item(0)); + } } else { - model = el.children.item(0); + image = createDragImage(this.$el); + image.style.transform = selfTransform; + } + if (this.dragClass) { + image.classList.add(this.dragClass); } - const clone = model.cloneNode(true); - const tg = this.$el; - tg.appendChild(clone); - image = createDragImage(clone); - tg.removeChild(clone); - image['__opacity'] = this.dragImageOpacity; image.classList.add('dnd-ghost'); + image['__opacity'] = this.dragImageOpacity; + return image; + }; + __decorate([ + Prop({ default: null, type: null }), + __metadata("design:type", String) + ], DragMixin.prototype, "type", void 0); + __decorate([ + Prop({ default: null, type: null }), + __metadata("design:type", Object) + ], DragMixin.prototype, "data", void 0); + __decorate([ + Prop({ default: 0.7, type: Number }), + __metadata("design:type", Object) + ], DragMixin.prototype, "dragImageOpacity", void 0); + __decorate([ + Prop({ default: false, type: Boolean }), + __metadata("design:type", Boolean) + ], DragMixin.prototype, "disabled", void 0); + __decorate([ + Prop({ default: false, type: Boolean }), + __metadata("design:type", Boolean) + ], DragMixin.prototype, "goBack", void 0); + __decorate([ + Prop({ required: false, type: String }), + __metadata("design:type", String) + ], DragMixin.prototype, "handle", void 0); + __decorate([ + Prop({ type: Number, default: 3 }), + __metadata("design:type", Number) + ], DragMixin.prototype, "delta", void 0); + __decorate([ + Prop({ type: Number, default: 0 }), + __metadata("design:type", Number) + ], DragMixin.prototype, "delay", void 0); + __decorate([ + Prop({ type: String, default: null }), + __metadata("design:type", String) + ], DragMixin.prototype, "dragClass", void 0); + __decorate([ + Prop({ type: Number, default: 0 }), + __metadata("design:type", Number) + ], DragMixin.prototype, "vibration", void 0); + __decorate([ + Prop({ type: Number, default: 100 }), + __metadata("design:type", Number) + ], DragMixin.prototype, "scrollingEdgeSize", void 0); + DragMixin = __decorate([ + Component({}) + ], DragMixin); + return DragMixin; +}(DragAwareMixin)); + +var Drag = /** @class */ (function (_super) { + __extends(Drag, _super); + function Drag() { + return _super !== null && _super.apply(this, arguments) || this; + } + __decorate([ + Prop({ default: 'div', type: [String, Object, Function] }), + __metadata("design:type", Object) + ], Drag.prototype, "tag", void 0); + Drag = __decorate([ + Component({}) + ], Drag); + return Drag; +}(DragMixin)); + +function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier +/* server only */ +, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { + if (typeof shadowMode !== 'boolean') { + createInjectorSSR = createInjector; + createInjector = shadowMode; + shadowMode = false; + } // Vue.extend constructor export interop. + + + var options = typeof script === 'function' ? script.options : script; // render functions + + if (template && template.render) { + options.render = template.render; + options.staticRenderFns = template.staticRenderFns; + options._compiled = true; // functional template + + if (isFunctionalTemplate) { + options.functional = true; + } + } // scopedId + + + if (scopeId) { + options._scopeId = scopeId; + } + + var hook; + + if (moduleIdentifier) { + // server build + hook = function hook(context) { + // 2.3 injection + context = context || // cached call + this.$vnode && this.$vnode.ssrContext || // stateful + this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional + // 2.2 with runInNewContext: true + + if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { + context = __VUE_SSR_CONTEXT__; + } // inject component styles + + + if (style) { + style.call(this, createInjectorSSR(context)); + } // register component module identifier for async chunk inference + + + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier); } - else { - image = 'source'; + }; // used by ssr in case component is cached and beforeCreate + // never gets called + + + options._ssrRegister = hook; + } else if (style) { + hook = shadowMode ? function () { + style.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); + } : function (context) { + style.call(this, createInjector(context)); + }; + } + + if (hook) { + if (options.functional) { + // register for functional component in vue file + var originalRender = options.render; + + options.render = function renderWithStyleInjection(h, context) { + hook.call(context); + return originalRender(h, context); + }; + } else { + // inject component registration as beforeCreate hook + var existing = options.beforeCreate; + options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; + } + } + + return script; +} + +var normalizeComponent_1 = normalizeComponent; + +var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); +function createInjector(context) { + return function (id, style) { + return addStyle(id, style); + }; +} +var HEAD; +var styles = {}; + +function addStyle(id, css) { + var group = isOldIE ? css.media || 'default' : id; + var style = styles[group] || (styles[group] = { + ids: new Set(), + styles: [] + }); + + if (!style.ids.has(id)) { + style.ids.add(id); + var code = css.source; + + if (css.map) { + // https://developer.chrome.com/devtools/docs/javascript-debugging + // this makes source maps inside style tags work properly in Chrome + code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875 + + code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */'; + } + + if (!style.element) { + style.element = document.createElement('style'); + style.element.type = 'text/css'; + if (css.media) { style.element.setAttribute('media', css.media); } + + if (HEAD === undefined) { + HEAD = document.head || document.getElementsByTagName('head')[0]; } - return image; - } - }, - render () { - if (!this.$slots['item']) { - throw 'The "Item" slot must be defined to use DropList'; + + HEAD.appendChild(style.element); } - if (!this.$slots['feedback']) { - throw 'The "Feedback" slot must be defined to use DropList'; + if ('styleSheet' in style.element) { + style.styles.push(code); + style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\n'); + } else { + var index = style.ids.size - 1; + var textNode = document.createTextNode(code); + var nodes = style.element.childNodes; + if (nodes[index]) { style.element.removeChild(nodes[index]); } + if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }else { style.element.appendChild(textNode); } } + } +} - let defaultArr = []; - if (this.dropIn && this.dropAllowed) { - if (this.reordering) { - if (this.hasReorderingFeedback) { - const itemsReorderingBefore = this.itemsBeforeReorderingFeedback.map((item, index) => { - return this.$slots['item']({ - item: item, - index: index, - reorder: false - })[0]; - }); - if (itemsReorderingBefore.length > 0) { - defaultArr = defaultArr.concat(itemsReorderingBefore); - } +var browser = createInjector; - defaultArr.push(this.$slots['reordering-feedback']({ - key: 'reordering-feedback', - item: this.items[this.fromIndex] - })[0]); +/* script */ +var __vue_script__ = Drag; - const itemsReorderingAfter = this.itemsAfterReorderingFeedback.map((item, index) => { - return this.$slots['item']({ - item: item, - index: this.itemsBeforeReorderingFeedback.length + index, - reorder: false - })[0]; - }); - if (itemsReorderingAfter.length > 0) { - defaultArr = defaultArr.concat(itemsReorderingAfter); - } +/* template */ +var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:"component",class:_vm.cssClasses,scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'component',_vm.$attrs,false),_vm.$listeners),[_vm._t("default"),_vm._v(" "),_vm._v(" "),(_vm.dragInitialised)?_c('div',{ref:"drag-image",staticClass:"__drag-image"},[_vm._t("drag-image")],2):_vm._e()],2)}; +var __vue_staticRenderFns__ = []; + + /* style */ + var __vue_inject_styles__ = function (inject) { + if (!inject) { return } + inject("data-v-fb811e22_0", { source: ".drop-allowed.drop-in *{cursor:inherit!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}.drag-no-handle:hover{cursor:move;cursor:grab}", map: undefined, media: undefined }) +,inject("data-v-fb811e22_1", { source: "html.drag-in-progress *{cursor:move!important;cursor:grabbing!important}", map: undefined, media: undefined }) +,inject("data-v-fb811e22_2", { source: ".__drag-image[data-v-fb811e22]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}", map: undefined, media: undefined }); + + }; + /* scoped */ + var __vue_scope_id__ = "data-v-fb811e22"; + /* module identifier */ + var __vue_module_identifier__ = undefined; + /* functional template */ + var __vue_is_functional_template__ = false; + /* style inject SSR */ + + + + var Drag$1 = normalizeComponent_1( + { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, + __vue_inject_styles__, + __vue_script__, + __vue_scope_id__, + __vue_is_functional_template__, + __vue_module_identifier__, + browser, + undefined + ); + +var DropMixin = /** @class */ (function (_super) { + __extends(DropMixin, _super); + function DropMixin() { + var _this = _super.call(this) || this; + _this.isDrop = true; + return _this; + } + DropMixin.prototype.effectiveAcceptsType = function (type) { + if (this.acceptsType === null) + { return true; } + else if (typeof (this.acceptsType) === 'string') + { return this.acceptsType === type; } + else if (typeof (this.acceptsType) === 'object' && Array.isArray(this.acceptsType)) { + return this.acceptsType.includes(type); } else { - const reorderedItems = this.reorderedItems.map((item, index) => { - return this.$slots['item']({ - item: item, - index: index, - reorder: index === this.closestIndex - })[0]; - }); - if (reorderedItems.length > 0) { - defaultArr = defaultArr.concat(reorderedItems); - } + return this.acceptsType(type); } - } - else { - const itemsBefore = this.itemsBeforeFeedback.map((item, index) => { - return this.$slots['item']({ - item: item, - index: index, - reorder: false - })[0]; - }); - if (itemsBefore.length > 0) { - defaultArr = defaultArr.concat(itemsBefore); + }; + DropMixin.prototype.effectiveAcceptsData = function (data, type) { + return this.acceptsData(data, type); + }; + DropMixin.prototype.created = function () { + dnd.on("dragpositionchanged", this.onDragPositionChanged); + dnd.on("dragtopchanged", this.onDragTopChanged); + dnd.on("drop", this.onDrop); + dnd.on("dragend", this.onDragEnd); + }; + DropMixin.prototype.beforeDestroy = function () { + dnd.off("dragpositionchanged", this.onDragPositionChanged); + dnd.off("dragtopchanged", this.onDragTopChanged); + dnd.off("drop", this.onDrop); + dnd.off("dragend", this.onDragEnd); + }; + DropMixin.prototype.onDragPositionChanged = function (event) { + if (this === event.top) { + this.$emit("dragover", event); } - - defaultArr.push(this.$slots['feedback']({ - key: 'drag-feedback', - data: this.dragData, - type: this.dragType - })[0]); - - const itemsAfter = this.itemsAfterFeedback.map((item, index) => { - return this.$slots['item']({ - item: item, - index: this.itemsBeforeFeedback.length + index, - reorder: false - })[0]; - }); - if (itemsAfter.length > 0) { - defaultArr = defaultArr.concat(itemsAfter); + }; + DropMixin.prototype.onDragTopChanged = function (event) { + if (this === event.top) { + this.$emit("dragenter", event); } - } - } - else { - const defaultItems = this.items.map((item, index) => { - return this.$slots['item']({ - item: item, - index: index, - reorder: false - })[0]; - }); - - if (defaultItems.length > 0) { - defaultArr = defaultArr.concat(defaultItems); - } - else if (this.hasEmptySlot) { - defaultArr.push(this.$slots['empty']()[0]); - } - } - - if (this.showDragFeedback) { - defaultArr.push(h( - script$1, - { - class: '__feedback', - ref: 'feedback', - key: 'drag-feedback' + if (this === event.previousTop) { + this.$emit("dragleave", event); + } + }; + DropMixin.prototype.onDragEnd = function (event) { + if (this === event.top) { + this.$emit('dragend', event); + } + }; + DropMixin.prototype.onDrop = function (event) { + if (this.dropIn && this.compatibleMode && this.dropAllowed) { + this.doDrop(event); + } + }; + DropMixin.prototype.doDrop = function (event) { + this.$emit('drop', event); + event.source.$emit(this.mode, event); + }; + DropMixin.prototype.mounted = function () { + var el = this.$el; + var comp = this; + el.addEventListener('easy-dnd-move', onMouseMove); + function onMouseMove(e) { + dnd.mouseMove(e, comp); + } + }; + Object.defineProperty(DropMixin.prototype, "compatibleMode", { + get: function () { + if (this.dragInProgress) { + return this.mode === 'copy' || dnd.sourceListeners.hasOwnProperty(this.mode); + } + else { + return null; + } }, - { - default: () => this.$slots['feedback']({ - type: this.dragType, - data: this.dragData - })[0] - } - )); - } - - if (this.showReorderingDragImage) { - defaultArr.push(h( - 'div', - { - class: '__drag-image', - ref: 'drag-image', - key: 'reordering-drag-image' + enumerable: true, + configurable: true + }); + Object.defineProperty(DropMixin.prototype, "dropIn", { + get: function () { + if (this.dragInProgress) { + return this.dragTop === this; + } + else { + return null; + } }, - { - default: () => this.$slots['reordering-drag-image']({ - item: this.items[this.fromIndex] - })[0] - } - )); - } - - if (this.showInsertingDragImage) { - defaultArr.push(h( - 'div', - { - class: '__drag-image', - ref: 'drag-image', - key: 'inserting-drag-image' + enumerable: true, + configurable: true + }); + Object.defineProperty(DropMixin.prototype, "typeAllowed", { + get: function () { + if (this.dragInProgress) { + return this.effectiveAcceptsType(this.dragType); + } + else { + return null; + } }, - { - default: () => this.$slots['drag-image']({ - type: this.dragType, - data: this.dragData - })[0] + enumerable: true, + configurable: true + }); + Object.defineProperty(DropMixin.prototype, "dropAllowed", { + get: function () { + if (this.dragInProgress) { + if (this.typeAllowed) { + return this.compatibleMode && this.effectiveAcceptsData(this.dragData, this.dragType); + } + else { + return null; + } + } + else { + return null; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropMixin.prototype, "cssClasses", { + get: function () { + var clazz = { + 'dnd-drop': true + }; + if (this.dropIn !== null) { + clazz['drop-in'] = this.dropIn; + clazz['drop-out'] = !this.dropIn; + } + if (this.typeAllowed !== null) { + clazz['type-allowed'] = this.typeAllowed; + clazz['type-forbidden'] = !this.typeAllowed; + } + if (this.dropAllowed !== null) { + clazz['drop-allowed'] = this.dropAllowed; + clazz['drop-forbidden'] = !this.dropAllowed; + } + return clazz; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropMixin.prototype, "cssStyle", { + get: function () { + return {}; + }, + enumerable: true, + configurable: true + }); + /** + * Returns true if the current drop area participates in the current drag operation. + */ + DropMixin.prototype.candidate = function (type, data, source) { + return this.effectiveAcceptsType(type); + }; + DropMixin.prototype.createDragImage = function () { + var image; + if (this.$refs['drag-image']) { + var el = this.$refs['drag-image']; + if (el.childElementCount !== 1) { + image = createDragImage(el); + } + else { + image = createDragImage(el.children.item(0)); + } + image['__opacity'] = this.dragImageOpacity; + image.classList.add('dnd-ghost'); } - )); + else { + image = 'source'; + } + return image; + }; + __decorate([ + Prop({ default: function () { return function () { return true; }; }, type: [String, Array, Function] }), + __metadata("design:type", Object) + ], DropMixin.prototype, "acceptsType", void 0); + __decorate([ + Prop({ default: function () { return true; }, type: Function }), + __metadata("design:type", Object) + ], DropMixin.prototype, "acceptsData", void 0); + __decorate([ + Prop({ default: 'copy' }), + __metadata("design:type", String) + ], DropMixin.prototype, "mode", void 0); + __decorate([ + Prop({ default: 0.7, type: Number }), + __metadata("design:type", Object) + ], DropMixin.prototype, "dragImageOpacity", void 0); + DropMixin = __decorate([ + Component({}), + __metadata("design:paramtypes", []) + ], DropMixin); + return DropMixin; +}(DragAwareMixin)); + +var Drop = /** @class */ (function (_super) { + __extends(Drop, _super); + function Drop() { + return _super !== null && _super.apply(this, arguments) || this; } + Object.defineProperty(Drop.prototype, "showDragImage", { + get: function () { + return this.dragInProgress && this.typeAllowed && this.$scopedSlots['drag-image']; + }, + enumerable: true, + configurable: true + }); + __decorate([ + Prop({ default: 'div', type: [String, Object, Function] }), + __metadata("design:type", Object) + ], Drop.prototype, "tag", void 0); + Drop = __decorate([ + Component({}) + ], Drop); + return Drop; +}(DropMixin)); - return h( - this.rootTag, - { - ref: 'component', - class: this.clazz, - ...this.rootProps - }, - { - default: () => defaultArr - } - ); - } -}; +/* script */ +var __vue_script__$1 = Drop; -script.__scopeId = "data-v-230f65e3"; +/* template */ +var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:"component",class:_vm.cssClasses,style:(_vm.cssStyle),scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'component',_vm.$attrs,false),_vm.$listeners),[_vm._t("default"),_vm._v(" "),_vm._v(" "),(_vm.showDragImage)?_c('div',{ref:"drag-image",staticClass:"__drag-image"},[_vm._t("drag-image",null,{"type":_vm.dragType,"data":_vm.dragData})],2):_vm._e()],2)}; +var __vue_staticRenderFns__$1 = []; + + /* style */ + var __vue_inject_styles__$1 = function (inject) { + if (!inject) { return } + inject("data-v-1d9169a9_0", { source: ".drop-allowed.drop-in,.drop-allowed.drop-in *{cursor:pointer!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}", map: undefined, media: undefined }) +,inject("data-v-1d9169a9_1", { source: ".__drag-image[data-v-1d9169a9]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}", map: undefined, media: undefined }); + + }; + /* scoped */ + var __vue_scope_id__$1 = "data-v-1d9169a9"; + /* module identifier */ + var __vue_module_identifier__$1 = undefined; + /* functional template */ + var __vue_is_functional_template__$1 = false; + /* style inject SSR */ + + + + var Drop$1 = normalizeComponent_1( + { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, + __vue_inject_styles__$1, + __vue_script__$1, + __vue_scope_id__$1, + __vue_is_functional_template__$1, + __vue_module_identifier__$1, + browser, + undefined + ); + +var DropMask = /** @class */ (function (_super) { + __extends(DropMask, _super); + function DropMask() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.isDropMask = true; + return _this; + } + DropMask.prototype.mounted = function () { + var el = this.$el; + var comp = this; + el.addEventListener('easy-dnd-move', onMouseMove); + function onMouseMove(e) { + dnd.mouseMove(e, comp); + } + }; + DropMask.prototype.createDragImage = function () { + return 'source'; + }; + __decorate([ + Prop({ default: 'div', type: [String, Object, Function] }), + __metadata("design:type", Object) + ], DropMask.prototype, "tag", void 0); + DropMask = __decorate([ + Component({}) + ], DropMask); + return DropMask; +}(DragAwareMixin)); + +/* script */ +var __vue_script__$2 = DropMask; + +/* template */ +var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.tag,_vm._g(_vm._b({tag:"component",scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,slot){return {key:slot,fn:function(scope){return [_vm._t(slot,null,null,scope)]}}})],null,true)},'component',_vm.$attrs,false),_vm.$listeners),[_vm._t("default")],2)}; +var __vue_staticRenderFns__$2 = []; + + /* style */ + var __vue_inject_styles__$2 = undefined; + /* scoped */ + var __vue_scope_id__$2 = undefined; + /* module identifier */ + var __vue_module_identifier__$2 = undefined; + /* functional template */ + var __vue_is_functional_template__$2 = false; + /* style inject */ + + /* style inject SSR */ + + + + var DropMask$1 = normalizeComponent_1( + { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, + __vue_inject_styles__$2, + __vue_script__$2, + __vue_scope_id__$2, + __vue_is_functional_template__$2, + __vue_module_identifier__$2, + undefined, + undefined + ); /** * This class reacts to drag events emitted by the dnd object to manage a sequence of drag images and fade from one to the * other as the drag progresses. */ -class DragImagesManager { - - selfTransform = null; - clones = null; - source = null; - sourcePos = null; - sourceClone = null; - - constructor () { - dnd.on('dragstart', this.onDragStart.bind(this)); - dnd.on('dragtopchanged', this.onDragTopChanged.bind(this)); - dnd.on('dragpositionchanged', this.onDragPositionChanged.bind(this)); - dnd.on('dragend', this.onDragEnd.bind(this)); +var DragImagesManager = /** @class */ (function (_super) { + __extends(DragImagesManager, _super); + function DragImagesManager() { + var _this = _super.call(this) || this; + _this.selfTransform = null; + _this.clones = null; + _this.source = null; + _this.sourcePos = null; + _this.sourceClone = null; + dnd.on('dragstart', _this.onDragStart); + dnd.on('dragtopchanged', _this.onDragTopChanged); + dnd.on('dragpositionchanged', _this.onDragPositionChanged); + dnd.on('dragend', _this.onDragEnd); + return _this; } - - onDragStart (event) { - // If go-back=true and it is still animating while they attempt another drag, - // it will bug out. Best to clean up any existing elements on the page before - // attempting to start the next animation - this.cleanUp(); - - this.sourcePos = { - x: event.source.$el.getBoundingClientRect().left, - y: event.source.$el.getBoundingClientRect().top - }; - this.selfTransform = 'translate(-' + (event.position.x - this.sourcePos.x) + 'px, -' + (event.position.y - this.sourcePos.y) + 'px)'; - this.clones = new Map(); - this.source = event.source; - } - - onDragEnd (event) { - nextTick() - .then(() => { - if (!event.success && this.source && this.source['goBack']) { - // Restore the drag image that is active when hovering outside any drop zone : - const img = this.switch(null); - - // Move it back to its original place : - window.requestAnimationFrame(() => { - img.style.transition = 'all 0.5s'; - window.requestAnimationFrame(() => { - img.style.left = this.sourcePos.x + 'px'; - img.style.top = this.sourcePos.y + 'px'; - img.style.transform = 'translate(0,0)'; - const handler = () => { - this.cleanUp(); - img.removeEventListener('transitionend', handler); - }; - img.addEventListener('transitionend', handler); - }); + DragImagesManager.prototype.onDragStart = function (event) { + // If go-back=true and it is still animating while they attempt another drag, + // it will bug out. Best to clean up any existing elements on the page before + // attempting to start the next animation + this.cleanUp(); + this.sourcePos = { + x: event.source.$el.getBoundingClientRect().left, + y: event.source.$el.getBoundingClientRect().top + }; + this.selfTransform = "translate(-" + (event.position.x - this.sourcePos.x) + "px, -" + (event.position.y - this.sourcePos.y) + "px)"; + this.clones = new Map(); + this.source = event.source; + }; + DragImagesManager.prototype.onDragEnd = function (event) { + var _this = this; + Vue.nextTick(function () { + if (!event.success && _this.source && _this.source['goBack']) { + // Restore the drag image that is active when hovering outside any drop zone : + var img_1 = _this.switch(null); + // Move it back to its original place : + window.requestAnimationFrame(function () { + img_1.style.transition = "all 0.5s"; + window.requestAnimationFrame(function () { + img_1.style.left = _this.sourcePos.x + "px"; + img_1.style.top = _this.sourcePos.y + "px"; + img_1.style.transform = "translate(0,0)"; + var handler = function () { + _this.cleanUp(); + img_1.removeEventListener("transitionend", handler); + }; + img_1.addEventListener("transitionend", handler); + }); + }); + } + else { + _this.cleanUp(); + } + }); + }; + DragImagesManager.prototype.cleanUp = function () { + if (this.clones) { + this.clones.forEach(function (clone) { + if (clone.parentNode === document.body) { + document.body.removeChild(clone); + } }); - } - else { - this.cleanUp(); - } - }); - } - - cleanUp () { - if (this.clones) { - this.clones.forEach((clone) => { - if (clone.parentNode === document.body) { - document.body.removeChild(clone); - } - }); - } - if (this.sourceClone !== null) { - if (this.sourceClone.parentNode === document.body) { - document.body.removeChild(this.sourceClone); } - } - this.selfTransform = null; - this.clones = null; - this.source = null; - this.sourceClone = null; - this.sourcePos = null; - } - - onDragTopChanged (event) { - this.switch(event.top); - } - - switch (top) { - this.clones.forEach(clone => { - clone.style.opacity = '0'; - }); - if (this.sourceClone) { - this.sourceClone.style.opacity = '0'; - } - - let activeClone; - if (top === null) { - activeClone = this.getSourceClone(); - } - else { - if (!this.clones.has(top)) { - let clone = top['createDragImage'](this.selfTransform); - if (clone === 'source') { - clone = this.getSourceClone(); - } - else if (clone !== null) { - clone.style.opacity = '0'; - document.body.appendChild(clone); - } - this.clones.set(top, clone); + if (this.sourceClone !== null) { + if (this.sourceClone.parentNode === document.body) { + document.body.removeChild(this.sourceClone); + } } - activeClone = this.clones.get(top); - } - - if (activeClone !== null) { - activeClone.offsetWidth; // Forces browser reflow - activeClone.style.opacity = activeClone['__opacity']; - activeClone.style.visibility = 'visible'; - } - - return activeClone; - } - - getSourceClone () { - if (this.sourceClone === null) { - this.sourceClone = this.source['createDragImage'](this.selfTransform); - this.sourceClone.style.opacity = '0'; - document.body.appendChild(this.sourceClone); - } - return this.sourceClone; - } - - onDragPositionChanged () { - this.clones.forEach((clone) => { - clone.style.left = dnd.position.x + 'px'; - clone.style.top = dnd.position.y + 'px'; - }); - if (this.sourceClone) { - this.sourceClone.style.left = dnd.position.x + 'px'; - this.sourceClone.style.top = dnd.position.y + 'px'; - } - } - -} - + this.selfTransform = null; + this.clones = null; + this.source = null; + this.sourceClone = null; + this.sourcePos = null; + }; + DragImagesManager.prototype.onDragTopChanged = function (event) { + this.switch(event.top); + }; + DragImagesManager.prototype.switch = function (top) { + this.clones.forEach(function (clone) { + clone.style.opacity = "0"; + }); + if (this.sourceClone) { + this.sourceClone.style.opacity = "0"; + } + var activeClone; + if (top === null) { + activeClone = this.getSourceClone(); + } + else { + if (!this.clones.has(top)) { + var clone = top['createDragImage'](this.selfTransform); + if (clone === 'source') { + clone = this.getSourceClone(); + } + else if (clone !== null) { + clone.style.opacity = '0'; + document.body.appendChild(clone); + } + this.clones.set(top, clone); + } + activeClone = this.clones.get(top); + } + if (activeClone !== null) { + activeClone.offsetWidth; // Forces browser reflow + activeClone.style.opacity = activeClone['__opacity']; + activeClone.style.visibility = 'visible'; + } + return activeClone; + }; + DragImagesManager.prototype.getSourceClone = function () { + if (this.sourceClone === null) { + this.sourceClone = this.source['createDragImage'](this.selfTransform); + this.sourceClone.style.opacity = '0'; + document.body.appendChild(this.sourceClone); + } + return this.sourceClone; + }; + DragImagesManager.prototype.onDragPositionChanged = function (event) { + this.clones.forEach(function (clone) { + clone.style.left = dnd.position.x + "px"; + clone.style.top = dnd.position.y + "px"; + }); + if (this.sourceClone) { + this.sourceClone.style.left = dnd.position.x + "px"; + this.sourceClone.style.top = dnd.position.y + "px"; + } + }; + DragImagesManager = __decorate([ + Component({}) // Necessary to set proper "this" context in event listeners. + , + __metadata("design:paramtypes", []) + ], DragImagesManager); + return DragImagesManager; +}(Vue)); new DragImagesManager(); -export { DnDEvent, script$4 as Drag, DragAwareMixin, script$1 as DragFeedback, DragImagesManager, DragMixin, script$3 as Drop, script as DropList, script$2 as DropMask, DropMixin, InsertEvent, ReorderEvent, createDragImage, dnd }; +var DragFeedback = /** @class */ (function (_super) { + __extends(DragFeedback, _super); + function DragFeedback() { + return _super !== null && _super.apply(this, arguments) || this; + } + DragFeedback = __decorate([ + Component({}) + ], DragFeedback); + return DragFeedback; +}(Vue)); + +/* script */ +var __vue_script__$3 = DragFeedback; + +/* template */ +var __vue_render__$3 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"DragFeedback"},[_vm._t("default")],2)}; +var __vue_staticRenderFns__$3 = []; + + /* style */ + var __vue_inject_styles__$3 = undefined; + /* scoped */ + var __vue_scope_id__$3 = "data-v-0589f3cb"; + /* module identifier */ + var __vue_module_identifier__$3 = undefined; + /* functional template */ + var __vue_is_functional_template__$3 = false; + /* style inject */ + + /* style inject SSR */ + + + + var DragFeedback$1 = normalizeComponent_1( + { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, + __vue_inject_styles__$3, + __vue_script__$3, + __vue_scope_id__$3, + __vue_is_functional_template__$3, + __vue_module_identifier__$3, + undefined, + undefined + ); + +var Grid = /** @class */ (function () { + function Grid(collection, upToIndex, row, fromIndex) { + var e_1, _a; + this.magnets = []; + this.reference = collection.item(0).parentNode; + this.referenceOriginalPosition = { + x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft, + y: this.reference.getBoundingClientRect().top - this.reference.scrollTop, + }; + var index = 0; + try { + for (var collection_1 = __values(collection), collection_1_1 = collection_1.next(); !collection_1_1.done; collection_1_1 = collection_1.next()) { + var child = collection_1_1.value; + if (index > upToIndex) + { break; } + var rect = child.getBoundingClientRect(); + var hasNestedDrop = child.classList.contains("dnd-drop") || child.getElementsByClassName("dnd-drop").length > 0; + var horizontal = null; + if (hasNestedDrop) { + if (row === 'auto') { + // Auto mode not supported for now. Row or column must be defined explicitly if there are nested drop lists. + throw new Error("Easy-DnD error : a drop list is missing one of these attributes : 'row' or 'column'."); + } + else { + horizontal = row === 'row'; + } + } + if (fromIndex === null) { + // Inserting mode. + this.magnets.push(hasNestedDrop ? this.before(rect, horizontal) : this.center(rect)); + } + else { + // Reordering mode. + this.magnets.push(hasNestedDrop ? (fromIndex < index ? this.after : this.before)(rect, horizontal) : this.center(rect)); + } + // Debug : show magnets : + //document.body.insertAdjacentHTML("beforeend", "
") + index++; + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (collection_1_1 && !collection_1_1.done && (_a = collection_1.return)) { _a.call(collection_1); } + } + finally { if (e_1) { throw e_1.error; } } + } + } + /** + * Returns the center of the rectangle. + */ + Grid.prototype.center = function (rect) { + return { + x: rect.left + rect.width / 2, + y: rect.top + rect.height / 2 + }; + }; + /** + * When horizontal is true / false, returns middle of the left / top side of the rectangle. + */ + Grid.prototype.before = function (rect, horizontal) { + return horizontal ? { + x: rect.left, + y: rect.top + rect.height / 2 + } : { + x: rect.left + rect.width / 2, + y: rect.top + }; + }; + /** + * When horizontal is true / false, returns middle of the right / bottom side of the rectangle. + */ + Grid.prototype.after = function (rect, horizontal) { + return horizontal ? { + x: rect.left + rect.width, + y: rect.top + rect.height / 2 + } : { + x: rect.left + rect.width / 2, + y: rect.top + rect.height + }; + }; + /** + * In case the user scrolls during the drag, the position of the magnets are not what they used to be when the drag + * started. A correction must be applied that takes into account the amount of scroll. This correction is the + * difference between the current position of the parent element and its position when the drag started. + */ + Grid.prototype.correction = function () { + return { + x: this.reference.getBoundingClientRect().left - this.reference.scrollLeft - this.referenceOriginalPosition.x, + y: this.reference.getBoundingClientRect().top - this.reference.scrollTop - this.referenceOriginalPosition.y, + }; + }; + Grid.prototype.closestIndex = function (position) { + var x = position.x - this.correction().x; + var y = position.y - this.correction().y; + var minDist = 999999; + var index = -1; + for (var i = 0; i < this.magnets.length; i++) { + var magnet = this.magnets[i]; + var dist = Math.sqrt(Math.pow(magnet.x - x, 2) + Math.pow(magnet.y - y, 2)); + if (dist < minDist) { + minDist = dist; + index = i; + } + } + return index; + }; + return Grid; +}()); + +var DnDEvent = /** @class */ (function () { + function DnDEvent() { + } + return DnDEvent; +}()); +var ReorderEvent = /** @class */ (function () { + function ReorderEvent(from, to) { + this.from = from; + this.to = to; + } + ReorderEvent.prototype.apply = function (array) { + var tmp = array[this.from]; + array.splice(this.from, 1); + array.splice(this.to, 0, tmp); + }; + return ReorderEvent; +}()); +var InsertEvent = /** @class */ (function () { + function InsertEvent(type, data, index) { + this.type = type; + this.data = data; + this.index = index; + } + return InsertEvent; +}()); + +var DropList = /** @class */ (function (_super) { + __extends(DropList, _super); + function DropList() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.grid = null; + _this.forbiddenKeys = []; + _this.feedbackKey = null; + _this.fromIndex = null; + return _this; + } + Object.defineProperty(DropList.prototype, "rootTag", { + get: function () { + if (this.noAnimations) { + return this.tag ? this.tag : 'div'; + } + else { + return "transition-group"; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "rootProps", { + get: function () { + if (this.noAnimations) { + return this.$attrs; + } + else { + return { + tag: this.tag, + duration: { enter: 0, leave: 0 }, + css: false + }; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "rootListeners", { + get: function () { + if (this.noAnimations) { + return this.$listeners; + } + else { + return {}; + } + }, + enumerable: true, + configurable: true + }); + DropList.prototype.created = function () { + dnd.on("dragstart", this.onDragStart); + dnd.on("dragend", this.onDragEnd); + }; + Object.defineProperty(DropList.prototype, "direction", { + get: function () { + if (this.row) + { return 'row'; } + if (this.column) + { return 'column'; } + return 'auto'; + }, + enumerable: true, + configurable: true + }); + DropList.prototype.beforeDestroy = function () { + dnd.off("dragstart", this.onDragStart); + dnd.off("dragend", this.onDragEnd); + }; + // Presence of feedback node in the DOM and of keys in the virtual DOM required => delayed until what + // depends on drag data has been processed. + DropList.prototype.refresh = function () { + var _this = this; + this.$nextTick(function () { + _this.grid = _this.computeInsertingGrid(); + _this.feedbackKey = _this.computeFeedbackKey(); + _this.forbiddenKeys = _this.computeForbiddenKeys(); + }); + }; + DropList.prototype.onDragStart = function (event) { + if (this.candidate(dnd.type, dnd.data, dnd.source)) { + if (this.reordering) { + this.fromIndex = Array.prototype.indexOf.call(event.source.$el.parentElement.children, event.source.$el); + this.grid = this.computeReorderingGrid(); + } + else { + this.refresh(); + } + } + }; + DropList.prototype.onDragEnd = function () { + this.fromIndex = null; + this.feedbackKey = null; + this.forbiddenKeys = null; + this.grid = null; + }; + Object.defineProperty(DropList.prototype, "reordering", { + get: function () { + if (dnd.inProgress) { + return dnd.source.$el.parentElement === this.$el && this.$listeners.hasOwnProperty('reorder'); + } + else { + return null; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "closestIndex", { + get: function () { + if (this.grid) { + return this.grid.closestIndex(dnd.position); + } + else { + return null; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "dropAllowed", { + get: function () { + if (this.dragInProgress) { + if (this.reordering) { + return this.items.length > 1; + } + else { + var superDropAllowed = DropMixin['options'].computed.dropAllowed.get.call(this); + if (!superDropAllowed) { + return false; + } + else { + if (this.forbiddenKeys !== null && this.feedbackKey !== null) { + return !this.forbiddenKeys.includes(this.feedbackKey); + } + else { + return null; + } + } + } + } + else { + return null; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "itemsBeforeFeedback", { + get: function () { + if (this.closestIndex === 0) { + return []; + } + else { + return this.items.slice(0, this.closestIndex); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "itemsAfterFeedback", { + get: function () { + if (this.closestIndex === this.items.length) { + return []; + } + else { + return this.items.slice(this.closestIndex); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "itemsBeforeReorderingFeedback", { + get: function () { + if (this.closestIndex <= this.fromIndex) { + return this.items.slice(0, this.closestIndex); + } + else { + return this.items.slice(0, this.closestIndex + 1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "itemsAfterReorderingFeedback", { + get: function () { + if (this.closestIndex <= this.fromIndex) { + return this.items.slice(this.closestIndex); + } + else { + return this.items.slice(this.closestIndex + 1); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "reorderedItems", { + get: function () { + var toIndex = this.closestIndex; + var reordered = __spread(this.items); + var temp = reordered[this.fromIndex]; + reordered.splice(this.fromIndex, 1); + reordered.splice(toIndex, 0, temp); + return reordered; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "clazz", { + get: function () { + return __assign({ 'drop-list': true, 'reordering': this.reordering === true, 'inserting': this.reordering === false }, (this.reordering === false ? this.cssClasses : { 'dnd-drop': true })); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "style", { + get: function () { + return __assign({}, (this.reordering === false ? this.cssStyle : {})); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "showDragFeedback", { + get: function () { + return this.dragInProgress && this.typeAllowed && !this.reordering; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "showInsertingDragImage", { + get: function () { + return this.dragInProgress && this.typeAllowed && !this.reordering && this.$scopedSlots.hasOwnProperty("drag-image"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropList.prototype, "showReorderingDragImage", { + get: function () { + return this.dragInProgress && this.reordering && this.$scopedSlots.hasOwnProperty("reordering-drag-image"); + }, + enumerable: true, + configurable: true + }); + DropList.prototype.doDrop = function (event) { + if (this.reordering) { + if (this.fromIndex !== this.closestIndex) { + this.$emit('reorder', new ReorderEvent(this.fromIndex, this.closestIndex)); + } + } + else { + DropMixin['options'].methods.doDrop.call(this, event); + this.$emit('insert', new InsertEvent(event.type, event.data, this.closestIndex)); + } + }; + DropList.prototype.candidate = function (type, data, source) { + var _a; + var superCandidate = (_a = DropMixin['options'].methods.candidate).call.apply(_a, __spread([this], arguments)); + return (superCandidate && (this.$listeners.hasOwnProperty("insert") || this.$listeners.hasOwnProperty("drop"))) || this.reordering; + }; + DropList.prototype.computeForbiddenKeys = function () { + var vnodes = this.noAnimations ? [] : this.$children[0].$vnode.context.$children[0].$slots.default; + return vnodes + .map(function (vn) { return vn.key; }) + .filter(function (k) { return k !== undefined && k !== 'drag-image' && k !== 'drag-feedback'; }); + }; + DropList.prototype.computeFeedbackKey = function () { + return this.$refs['feedback']['$slots']['default'][0]['key']; + }; + Object.defineProperty(DropList.prototype, "hasReorderingFeedback", { + get: function () { + return this.$scopedSlots.hasOwnProperty("reordering-feedback"); + }, + enumerable: true, + configurable: true + }); + DropList.prototype.computeInsertingGrid = function () { + var feedbackParent = this.$refs['feedback']['$el']; + var feedback = feedbackParent.children[0]; + var clone = feedback.cloneNode(true); + var tg = this.$el; + if (tg.children.length > this.items.length) { + tg.insertBefore(clone, tg.children[this.items.length]); + } + else { + tg.appendChild(clone); + } + var grid = new Grid(tg.children, this.items.length, this.direction, null); + tg.removeChild(clone); + return grid; + }; + DropList.prototype.computeReorderingGrid = function () { + var tg = this.$el; + return new Grid(tg.children, this.items.length - 1, this.direction, this.fromIndex); + }; + DropList.prototype.createDragImage = function () { + var image; + if (this.$refs['drag-image']) { + var el = this.$refs['drag-image']; + var model = void 0; + if (el.childElementCount !== 1) { + model = el; + } + else { + model = el.children.item(0); + } + var clone = model.cloneNode(true); + var tg = this.$el; + tg.appendChild(clone); + image = createDragImage(clone); + tg.removeChild(clone); + image['__opacity'] = this.dragImageOpacity; + image.classList.add('dnd-ghost'); + } + else { + image = 'source'; + } + return image; + }; + __decorate([ + Prop({ default: 'div', type: [String, Object, Function] }), + __metadata("design:type", Object) + ], DropList.prototype, "tag", void 0); + __decorate([ + Prop(), + __metadata("design:type", Array) + ], DropList.prototype, "items", void 0); + __decorate([ + Prop({ default: null }), + __metadata("design:type", Boolean) + ], DropList.prototype, "row", void 0); + __decorate([ + Prop({ default: null, type: Boolean }), + __metadata("design:type", Boolean) + ], DropList.prototype, "column", void 0); + __decorate([ + Prop({ default: false, type: Boolean }), + __metadata("design:type", Boolean) + ], DropList.prototype, "noAnimations", void 0); + __decorate([ + Prop({ type: Number, default: undefined }), + __metadata("design:type", Number) + ], DropList.prototype, "scrollingEdgeSize", void 0); + DropList = __decorate([ + Component({ + components: { DragFeedback: DragFeedback$1 }, + inheritAttrs: false + }) + ], DropList); + return DropList; +}(DropMixin)); + +/* script */ +var __vue_script__$4 = DropList; + +/* template */ +var __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.rootTag,_vm._g(_vm._b({tag:"component",class:_vm.clazz,style:(_vm.style)},'component',_vm.rootProps,false),_vm.rootListeners),[(_vm.dropIn && _vm.dropAllowed)?[(_vm.reordering)?[(_vm.hasReorderingFeedback)?[_vm._l((_vm.itemsBeforeReorderingFeedback),function(item,index){return _vm._t("item",null,{"item":item,"index":index})}),_vm._v(" "),_vm._t("reordering-feedback",null,{"item":_vm.items[_vm.fromIndex]}),_vm._v(" "),_vm._l((_vm.itemsAfterReorderingFeedback),function(item,index){return _vm._t("item",null,{"item":item,"index":_vm.itemsBeforeReorderingFeedback.length + index})})]:[_vm._l((_vm.reorderedItems),function(item,index){return _vm._t("item",null,{"item":item,"index":index,"reorder":index === _vm.closestIndex})})]]:[_vm._l((_vm.itemsBeforeFeedback),function(item,index){return _vm._t("item",null,{"item":item,"reorder":false,"index":index})}),_vm._v(" "),_vm._t("feedback",null,{"data":_vm.dragData,"type":_vm.dragType}),_vm._v(" "),_vm._l((_vm.itemsAfterFeedback),function(item,index){return _vm._t("item",null,{"item":item,"reorder":false,"index":_vm.itemsBeforeFeedback.length + index})})]]:[_vm._l((_vm.items),function(item,index){return _vm._t("item",null,{"item":item,"reorder":false,"index":index})}),_vm._v(" "),(_vm.items.length < 1)?_vm._t("empty"):_vm._e()],_vm._v(" "),(_vm.showDragFeedback)?_c('drag-feedback',{key:"drag-feedback",ref:"feedback",staticClass:"__feedback"},[_vm._t("feedback",null,{"data":_vm.dragData,"type":_vm.dragType})],2):_vm._e(),_vm._v(" "),(_vm.showInsertingDragImage)?_c('div',{key:"inserting-drag-image",ref:"drag-image",staticClass:"__drag-image"},[_vm._t("drag-image",null,{"type":_vm.dragType,"data":_vm.dragData})],2):_vm._e(),_vm._v(" "),(_vm.showReorderingDragImage)?_c('div',{key:"reordering-drag-image",ref:"drag-image",staticClass:"__drag-image"},[_vm._t("reordering-drag-image",null,{"item":_vm.items[_vm.fromIndex]})],2):_vm._e(),_vm._v(" "),_vm._t("default")],2)}; +var __vue_staticRenderFns__$4 = []; + + /* style */ + var __vue_inject_styles__$4 = function (inject) { + if (!inject) { return } + inject("data-v-228404f8_0", { source: ".drop-list[data-v-228404f8]>*{transition:transform .2s}.__feedback[data-v-228404f8]{display:none}.__drag-image[data-v-228404f8]{position:fixed;top:-10000px;left:-10000px;will-change:left,top}", map: undefined, media: undefined }) +,inject("data-v-228404f8_1", { source: ".drop-allowed.drop-in *{cursor:inherit!important}.drop-forbidden.drop-in,.drop-forbidden.drop-in *{cursor:no-drop!important}", map: undefined, media: undefined }); + + }; + /* scoped */ + var __vue_scope_id__$4 = "data-v-228404f8"; + /* module identifier */ + var __vue_module_identifier__$4 = undefined; + /* functional template */ + var __vue_is_functional_template__$4 = false; + /* style inject SSR */ + + + + var DropList$1 = normalizeComponent_1( + { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, + __vue_inject_styles__$4, + __vue_script__$4, + __vue_scope_id__$4, + __vue_is_functional_template__$4, + __vue_module_identifier__$4, + browser, + undefined + ); + +export { DnDEvent, Drag$1 as Drag, DragAwareMixin, DragImagesManager, DragMixin, Drop$1 as Drop, DropList$1 as DropList, DropMask$1 as DropMask, DropMixin, InsertEvent, ReorderEvent, createDragImage, dnd };