2024-05-10 15:22:52 +02:00
|
|
|
define("local_treestudyplan/treestudyplan-components",["exports","./util/string-helper","./util/date-helper","./util/fittext-vue"],(function(_exports,_stringHelper,_dateHelper,_fittextVue){var obj;Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_fittextVue=(obj=_fittextVue)&&obj.__esModule?obj:{default:obj};var _default={install(Vue){Vue.use(_fittextVue.default);let strings=(0,_stringHelper.load_strings)({studyplancard:{open:"open",noenddate:"noenddate",idnumber:"studyplan_idnumber",description:"studyplan_description",completed:"completed",details:"studyplan_details",suspended:"suspended"},details:{details:"studyplan_details"},extrafields:{show:"show@core"},prevnext:{prev:"prev@core",previous:"previous@core",next:"next@core",select:"selectanoptions@core"}});const ItemEventBus=new Vue;Vue.component("s-studyplan-card",{props:{value:{type:Object},open:{type:Boolean},ignoresuspend:{type:Boolean,default:!1}},data:()=>({text:strings.studyplancard}),computed:{timeless(){const plan=this.value;return!(plan.pages&&0!=plan.pages.length&&!plan.pages[0].timeless)},timing(){return(0,_dateHelper.studyplanTiming)(this.value)},dates(){const dates=(0,_dateHelper.studyplanDates)(this.value);return{start:(0,_dateHelper.format_date)(dates.start),end:dates.end?(0,_dateHelper.format_date)(dates.end):this.text.noenddate}},suspended(){return this.value.suspended&&!this.ignoresuspend}},methods:{onOpenClick(e){this.$emit("open",e)}},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 <div class='s-studyplan-card-titleslot'><slot name='title'></slot></div>\n </div> \n <div class='s-studyplan-card-idnumber' v-if='value.idnumber'>\n {{ text.idnumber }}: {{ value.idnumber }}\n </div>\n <s-progress-bar \n v-if='!suspended && value.progress !== undefined && value.progress !== null'\n v-model=\"value.progress\"\n ></s-progress-bar>\n </div>\n \n </div>\n <slot></slot>\n <template #footer>\n <span v-if=\"!timeless\" :class=\"'t-timing-'+timing\" v-html=\"dates.start + ' - '+ dates.end\"></span>\n <span class=\"s-studyplan-card-buttons\">\n <slot name='footer'></slot>\n <s-studyplan-details \n v-model=\"value\" \n v-if=\"value.description\"\n ><i class='fa fa-info-circle'></i></s-studyplan-details>\n <b-button style=\"float:right;\" v-if='open && !suspended' variant='primary'\n @click.prevent='onOpenClick($event)'>{{ text.open }}</b-button>\n </span>\n </template>\n </b-card>\n "}),Vue.component("s-progress-bar",{props:{value:{type:Number},min:{type:Number,default:()=>0},max:{type:Number,default:()=>1}},data:()=>({text:strings.studyplancard}),computed:{width_comp
|