moodle_local_treestudyplan/amd/build/treestudyplan-components.min.js.map

1 line
29 KiB
Plaintext
Raw Normal View History

2024-06-03 23:24:16 +02:00
{"version":3,"file":"treestudyplan-components.min.js","sources":["../src/treestudyplan-components.js"],"sourcesContent":["/* eslint no-var: \"error\"*/\n/* eslint no-console: \"off\"*/\n/* eslint camelcase: \"off\" */\n/* eslint-disable no-trailing-spaces */\n/* eslint-env es6*/\n// Put this file in path/to/plugin/amd/src\n\nimport {loadStrings} from './util/string-helper';\nimport {formatDate, studyplanDates, studyplanTiming} from './util/date-helper';\nimport FitTextVue from './util/fittext-vue';\n\n\nexport default {\n\n install(Vue /* ,options */) {\n Vue.use(FitTextVue);\n\n let strings = loadStrings({\n studyplancard: {\n open: \"open\",\n noenddate: \"noenddate\",\n idnumber: \"studyplan_idnumber\",\n description: \"studyplan_description\",\n completed: \"completed\",\n details: \"studyplan_details\",\n suspended: \"suspended\",\n },\n details: {\n details: \"studyplan_details\",\n },\n extrafields: {\n show: \"show@core\"\n },\n prevnext: {\n prev: \"prev@core\",\n previous: \"previous@core\",\n next: \"next@core\",\n select: \"selectanoptions@core\",\n }\n });\n // Create new eventbus for interaction between item components\n const ItemEventBus = new Vue();\n\n Vue.component('s-studyplan-card', {\n props: {\n value: {\n type: Object,\n },\n open: {\n type: Boolean\n },\n ignoresuspend: {\n type: Boolean,\n 'default': false,\n },\n },\n data() {\n return {\n text: strings.studyplancard\n };\n },\n computed: {\n timeless() {\n const plan = this.value;\n if (!plan.pages || plan.pages.length == 0 || plan.pages[0].timeless) {\n return true;\n } else {\n return false;\n }\n },\n timing() {\n return studyplanTiming(this.value);\n },\n dates() {\n const dates = studyplanDates(this.value);\n return {\n start: formatDate(dates.start),\n end: (dates.end) ? formatDate(dates.end) : this.text.noenddate,\n };\n },\n suspended() {\n return (this.value.suspended && !this.ignoresuspend);\n }\n \n },\n methods: {\n onOpenClick(e) {\n this.$emit('open', e);\n }\n },\n template: `\n <b-card\n :class=\"'s-studyplan-card timing-' + timing + (suspended?' s-suspended':'')\"\n >\n <template #header></template>\n \n <div class='s-studyplan-card-content'>\n <div class='s-studyplan-card-icon'><img :src='value.icon'></div>\n <div class='s-studyplan-card-info'>\n <div class='s-studyplan-card-titlebar'>\n <b-card-title>\n <a class='title' v-if='open && !suspended' \n href='#' @click.prevent='onOpenClick($event)'>{{value.name}}</a>\n <template v-else>{{value.name}}</template>\n <div v-if=\"suspended\" class='text-danger'\n ><fittext maxsize=\"12pt\">{{text.suspended}}</fittext></div>\n </b-card-title>\n