2024-07-10 09:08:12 +02:00
|
|
|
{"version":3,"file":"studyplan-editor-components.min.js","sources":["../src/studyplan-editor-components.js"],"sourcesContent":["/* eslint no-var: \"error\"*/\n/* eslint no-console: \"off\"*/\n/* eslint no-unused-vars: warn */\n/* eslint max-len: [\"error\", { \"code\": 160 }] */\n/* eslint no-trailing-spaces: warn */\n/* eslint max-depth: [\"error\", 6] */\n/* eslint-env es6*/\n\nimport {SimpleLine} from \"./simpleline/simpleline\";\nimport {call} from 'core/ajax';\nimport notification from 'core/notification';\nimport {loadStringKeys, loadStrings, strformat} from './util/string-helper';\nimport {formatDate, addDays, datespaninfo} from './util/date-helper';\nimport {objCopy, transportItem} from './studyplan-processor';\nimport Debugger from './util/debugger';\nimport Config from 'core/config';\nimport {download, upload} from './downloader';\nimport {processStudyplan, processStudyplanPage} from './studyplan-processor';\nimport {premiumenabled} from \"./util/premium\";\nimport FitTextVue from './util/fittext-vue';\nimport {settings} from \"./util/settings\";\nimport TSComponents from './treestudyplan-components';\nimport mFormComponents from \"./util/mform-helper\";\nimport pSideBarComponents from \"./util/psidebar-vue\";\n\nimport {Drag, Drop, DropList} from './vue-easy-dnd/vue-easy-dnd.esm';\n\nconst STUDYPLAN_EDITOR_FIELDS =\n['name', 'shortname', 'description', 'idnumber', 'context_id', 'aggregation', 'aggregation_config'];\nconst PERIOD_EDITOR_FIELDS =\n['fullname', 'shortname', 'startdate', 'enddate'];\n\nconst LINE_GRAVITY = 1.3;\n\nexport default {\n install(Vue/* ,options */) {\n Vue.component('drag', Drag);\n Vue.component('drop', Drop);\n Vue.component('drop-list', DropList);\n Vue.use(TSComponents);\n Vue.use(mFormComponents);\n Vue.use(pSideBarComponents);\n Vue.use(FitTextVue);\n let debug = new Debugger(\"treestudyplan-editor\");\n /* **********************************\n * *\n * Treestudyplan Editor components *\n * *\n * **********************************/\n\n /**\n * Check if element is visible\n * @param {Object} elem The element to check\n * @returns {boolean} True if visible\n */\n function isVisible(elem) {\n return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);\n }\n\n // Create new eventbus for interaction between item components\n const ItemEventBus = new Vue();\n\n /*\n // Add event listener for the edit mode event so we can react to it, or at the very least ignore it\n document.addEventListener(editSwEventTypes.editModeSet,(e) => {\n e.preventDefault();\n ItemEventBus.$emit('editModeSet', e.detail.editMode);\n });\n */\n\n let stringKeys = loadStringKeys({\n conditions: [\n {value: 'ALL', textkey: 'condition_all'},\n {value: 'ANY', textkey: 'condition_any'},\n ],\n });\n\n let strings = loadStrings({\n studyplanText: {\n 'studyline_editmode': 'studyline_editmode',\n 'toolbox_toggle': 'toolbox_toggle',\n 'editmode_modules_hidden': 'editmode_modules_hidden',\n 'studyline_add': 'studyline_add',\n add: 'add@core',\n edit: 'edit@core',\n 'delete': \"delete@core\",\n 'studyline_name': 'studyline_name',\n 'studyline_name_ph': 'studyline_name_ph',\n 'studyline_shortname': 'studyline_shortname',\n 'studyline_shortname_ph': 'studyline_shortname_ph',\n 'studyline_enrollable': 'studyline_enrollable',\n 'studyline_enrolroles': 'studyline_enrolroles',\n 'studyline_color': 'studyline_color',\n associations: 'associations',\n 'associated_cohorts': 'associated_cohorts',\n
|