Liens entre les composants (WIP)

This commit is contained in:
HORVILLE 2023-03-30 00:54:13 +02:00
parent 25164157df
commit fd7e31f66b
11 changed files with 282 additions and 192 deletions

View File

@ -1,24 +1,41 @@
<fili-info>
<div class="box p-1 m-2">
<h1 class="title is-4 m-2"><a>BUT</a> / <a>BUT - Production</a> / <a>Informatique</a></h1>
<div class="box p-1 m-2" if={props.shouldShowInfos}>
<h1 class="title is-4 m-2">
<span style="color: #485FC7;">{props.course.fili}</span> /
<span style="color: #485FC7;">{props.course.sousfili}</span> /
<span style="color: #485FC7;">{props.course.soussousfili}</span>
</h1>
<div class="box mt-2" style="background-color: #EAEAEA; margin: auto; width: 60%;">
<p>Moyenne des admis<span class="is-pulled-right">19.3</span></p>
<p>Nombre de formations<span class="is-pulled-right">5</span></p>
<p>Capacité<span class="is-pulled-right">90</span></p>
<p>Moyenne des admis<span class="is-pulled-right">{state.average}</span></p>
<p>Nombre de formations<span class="is-pulled-right">{state.courseNumber}</span></p>
<p>Capacité<span class="is-pulled-right">{state.capacity}</span></p>
<p>Sélectivité</p>
</div>
<div class="m-4">
<line-graph style="height: 6rem;"></line-graph>
<line-graph title="Répartition par genre" style="height: 6rem;"></line-graph>
</div>
<div class="m-4">
<line-graph style="height: 6rem;"></line-graph>
<line-graph title="Répartition par bac" style="height: 6rem;"></line-graph>
</div>
<div class="m-4">
<line-graph style="height: 6rem;"></line-graph>
<line-graph title="Répartition par mention au bac" style="height: 6rem;"></line-graph>
</div>
</div>
<script>
export default {
onBeforeMount(props, state) {
this.state = {
average: 0,
capacity: 0,
selectivity: 0,
courseNumber: 0
}
},
onUpdated(props, state) {
}
}
</script>
</fili-info>

View File

@ -10,6 +10,8 @@
updateCanvas() {
let canvas = this.$("canvas")
if (!canvas) return
canvas.width = canvas.clientWidth
canvas.height = canvas.clientHeight
@ -36,7 +38,7 @@
cx.fillStyle = "#707070"
cx.font = "15px Arial"
cx.fillText("This is an example title", width / 2, 10)
cx.fillText(this.props.title || "Example", width / 2, 10)
cx.font = "10px Arial"
cx.translate(0, 20)

View File

@ -8,24 +8,26 @@
</div>
<div class="column">
<fili-info></fili-info>
<school></school>
<fili-info course={state.course} shouldShowInfos={state.shouldShowInfos}></fili-info>
<school course={state.course} shouldShowInfos={state.shouldShowInfos}></school>
</div>
</div>
<school-info></school-info>
<script>
export default {
export default {
onBeforeMount(props, state) {
//Initial state
this.state = {
formation: null
course: null,
shouldShowInfos: false
}
},
updateCourse(formation){
updateCourse(course){
this.update({
formation: formation
course: course,
shouldShowInfos: course != null
})
}
}

View File

@ -1,5 +1,5 @@
<school>
<div class="box p-2 m-2">
<div if={props.shouldShowInfos} class="box p-2 m-2">
<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
src="https://www.openstreetmap.org/export/embed.html?bbox=-14.655761718750002%2C40.56389453066509%2C13.601074218750002%2C51.754240074033525&amp;layer=mapnik"
style="border-radius: 5px;"></iframe>
@ -21,7 +21,7 @@
</tr>
</thead>
<tbody>
<tr each={etablissement in this.state.items}>
<tr if={!state.loading} each={etablissement in state.items}>
<td>{etablissement.fields.g_ea_lib_vx}</td>
<td>{etablissement.fields.ville_etab}</td>
<td>{etablissement.fields.dep}</td>
@ -35,23 +35,22 @@
<script>
import PAPI from '../javascript/parcoursup-link.js'
async function fetchEtablissement(formation) {
return PAPI.fetchEtablissement(formation.fili, formation.sousfili, formation.soussousfili);
async function fetchEtablissement(course) {
return PAPI.fetchEtablissement(course.fili, course.sousfili, course.soussousfili);
}
export default function search() {
return {
onBeforeMount(props, state) {
this.state = {
items: null,
formation: this.props.formation
state = {
items: null
}
fetchEtablissement(this.state.formation).then((response) => {
this.update({
items: response
})
//console.log(this.state.items)
this.state.items.forEach(etablissement => {
},
onUpdated(props, state) {
if (!props.shouldShowInfos) return
fetchEtablissement(props.course).then((response) => {
response.forEach(etablissement => {
// calcul la moyenne
let pct_sansmention = etablissement.fields.pct_sansmention
let pct_AB = etablissement.fields.pct_ab
@ -61,12 +60,12 @@
// On prend la moyenne des moyennes comprises dans la mention
// Exemple : Assez bien est entre 12 et 14 donc 13.
let moyenne = ((pct_TBF*19)+(pct_TB*17)+(pct_B*15)+(pct_AB*13)+(pct_sansmention*11))/100
etablissement.fields.moyenne=moyenne
//console.log(etablissement.fields)
etablissement.fields.moyenne = ((pct_TBF*19)+(pct_TB*17)+(pct_B*15)+(pct_AB*13)+(pct_sansmention*11))/100
})
this.update({
items: response
})
this.update()
})
}
}

View File

@ -29,10 +29,6 @@
updateList() {
let promise
this.update({
updating: true
})
switch (this.state.currentStep) {
case 0:
@ -44,8 +40,15 @@
case 2:
promise = PAPI.fetchSpecialites(this.state.course.sousfili)
break
default:
return
}
this.update({
updating: true
})
promise.then((response) => {
this.state.allItems = response
this.filterSearch()
@ -99,13 +102,7 @@
case 2:
this.state.course.soussousfili = selection
this.state.updateCourse(this.state.course)
break
case 2:
console.log(this.props)
console.log(this.root)
console.log("end")
this.props.updateCourse(this.state.course)
return
default:
@ -132,19 +129,15 @@
},
onBeforeMount(props, state) {
console.log("on m'a appelé")
//Initial state
this.state = {
placeholder: PLACEHOLDERS[0],
currentStep: 0,
allItems: null,
items: null,
course: [],
course: {},
updating: false,
updateCourse: this.props.updateCourse
}
console.log(this.state.updateCourse)
},
onMounted(props, state) {

View File

@ -1,30 +1,94 @@
var filiInfo = {
css: null,
exports: null,
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><h1 class="title is-4 m-2"><a>BUT</a> / <a>BUT - Production</a> / <a>Informatique</a></h1><div class="box mt-2" style="background-color: #EAEAEA; margin: auto; width: 60%;"><p>Moyenne des admis<span class="is-pulled-right">19.3</span></p><p>Nombre de formations<span class="is-pulled-right">5</span></p><p>Capacité<span class="is-pulled-right">90</span></p><p>Sélectivité</p></div><div class="m-4"><line-graph expr0="expr0" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr1="expr1" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr2="expr2" style="height: 6rem;"></line-graph></div></div>', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr0',
selector: '[expr0]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr1',
selector: '[expr1]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr2',
selector: '[expr2]'
exports: {
onBeforeMount(props, state) {
this.state = {
average: 0,
capacity: 0,
selectivity: 0,
courseNumber: 0
};
},
onUpdated(props, state) {}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr1500="expr1500" class="box p-1 m-2"></div>', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.props.shouldShowInfos,
redundantAttribute: 'expr1500',
selector: '[expr1500]',
template: template('<h1 class="title is-4 m-2"><span expr1501="expr1501" style="color: #485FC7;"> </span> / \r\n <span expr1502="expr1502" style="color: #485FC7;"> </span> / \r\n <span expr1503="expr1503" style="color: #485FC7;"> </span></h1><div class="box mt-2" style="background-color: #EAEAEA; margin: auto; width: 60%;"><p>Moyenne des admis<span expr1504="expr1504" class="is-pulled-right"> </span></p><p>Nombre de formations<span expr1505="expr1505" class="is-pulled-right"> </span></p><p>Capacité<span expr1506="expr1506" class="is-pulled-right"> </span></p><p>Sélectivité</p></div><div class="m-4"><line-graph expr1507="expr1507" title="Répartition par genre" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr1508="expr1508" title="Répartition par bac" style="height: 6rem;"></line-graph></div><div class="m-4"><line-graph expr1509="expr1509" title="Répartition par mention au bac" style="height: 6rem;"></line-graph></div>', [{
redundantAttribute: 'expr1501',
selector: '[expr1501]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.props.course.fili
}]
}, {
redundantAttribute: 'expr1502',
selector: '[expr1502]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.props.course.sousfili
}]
}, {
redundantAttribute: 'expr1503',
selector: '[expr1503]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.props.course.soussousfili
}]
}, {
redundantAttribute: 'expr1504',
selector: '[expr1504]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.state.average
}]
}, {
redundantAttribute: 'expr1505',
selector: '[expr1505]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.state.courseNumber
}]
}, {
redundantAttribute: 'expr1506',
selector: '[expr1506]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.state.capacity
}]
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr1507',
selector: '[expr1507]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr1508',
selector: '[expr1508]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr1509',
selector: '[expr1509]'
}])
}]),
name: 'fili-info'
};

View File

@ -3,6 +3,7 @@ var lineGraph = {
exports: {
updateCanvas() {
let canvas = this.$("canvas");
if (!canvas) return;
canvas.width = canvas.clientWidth;
canvas.height = canvas.clientHeight;
let cx = canvas.getContext("2d");
@ -18,7 +19,7 @@ var lineGraph = {
if (!data) return;
cx.fillStyle = "#707070";
cx.font = "15px Arial";
cx.fillText("This is an example title", width / 2, 10);
cx.fillText(this.props.title || "Example", width / 2, 10);
cx.font = "10px Arial";
cx.translate(0, 20);
let total = data.reduce((total, current) => total + current.value, 0);

View File

@ -4,16 +4,18 @@ var mainController = {
onBeforeMount(props, state) {
//Initial state
this.state = {
formation: null
course: null,
shouldShowInfos: false
};
},
updateCourse(formation) {
updateCourse(course) {
this.update({
formation: formation
course: course,
shouldShowInfos: course != null
});
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><div class="box p-3 m-2"><img class="mt-1 ml-5 mr-auto" style="margin: auto;" src="../resources/logo-parcoursup.svg"/></div><search expr984="expr984"></search></div><div class="column"><fili-info expr985="expr985"></fili-info><school expr986="expr986"></school></div></div><school-info expr987="expr987"></school-info>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="columns"><div class="column is-one-third"><div class="box p-3 m-2"><img class="mt-1 ml-5 mr-auto" style="margin: auto;" src="../resources/logo-parcoursup.svg"/></div><search expr1334="expr1334"></search></div><div class="column"><fili-info expr1335="expr1335"></fili-info><school expr1336="expr1336"></school></div></div><school-info expr1337="expr1337"></school-info>', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'search',
@ -23,32 +25,48 @@ var mainController = {
name: 'updateCourse',
evaluate: _scope => _scope.updateCourse
}],
redundantAttribute: 'expr984',
selector: '[expr984]'
redundantAttribute: 'expr1334',
selector: '[expr1334]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'fili-info',
slots: [],
attributes: [],
redundantAttribute: 'expr985',
selector: '[expr985]'
attributes: [{
type: expressionTypes.ATTRIBUTE,
name: 'course',
evaluate: _scope => _scope.state.course
}, {
type: expressionTypes.ATTRIBUTE,
name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos
}],
redundantAttribute: 'expr1335',
selector: '[expr1335]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school',
slots: [],
attributes: [],
redundantAttribute: 'expr986',
selector: '[expr986]'
attributes: [{
type: expressionTypes.ATTRIBUTE,
name: 'course',
evaluate: _scope => _scope.state.course
}, {
type: expressionTypes.ATTRIBUTE,
name: 'shouldShowInfos',
evaluate: _scope => _scope.state.shouldShowInfos
}],
redundantAttribute: 'expr1336',
selector: '[expr1336]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school-info',
slots: [],
attributes: [],
redundantAttribute: 'expr987',
selector: '[expr987]'
redundantAttribute: 'expr1337',
selector: '[expr1337]'
}]),
name: 'main-controller'
};

View File

@ -10,14 +10,14 @@ var schoolInfo = {
this.update();
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr19="expr19" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr9="expr9" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; background: #000000DD;"></div>', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.state.enabled,
redundantAttribute: 'expr19',
selector: '[expr19]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr20="expr20" class="delete is-medium">X</button><p><h2></h2></p><line-graph expr21="expr21" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr20',
selector: '[expr20]',
redundantAttribute: 'expr9',
selector: '[expr9]',
template: template('<div style="position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; background: #FFFFFF"><button expr10="expr10" class="delete is-medium">X</button><p><h2></h2></p><line-graph expr11="expr11" style="height: 90px; margin: 10px;"></line-graph></div>', [{
redundantAttribute: 'expr10',
selector: '[expr10]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onclick',
@ -29,8 +29,8 @@ var schoolInfo = {
evaluate: _scope => 'line-graph',
slots: [],
attributes: [],
redundantAttribute: 'expr21',
selector: '[expr21]'
redundantAttribute: 'expr11',
selector: '[expr11]'
}])
}]),
name: 'school-info'

View File

@ -29,24 +29,19 @@ class PAPI {
}
}
async function fetchEtablissement(formation) {
return PAPI.fetchEtablissement(formation.fili, formation.sousfili, formation.soussousfili);
async function fetchEtablissement(course) {
return PAPI.fetchEtablissement(course.fili, course.sousfili, course.soussousfili);
}
var school = {
css: null,
exports: function search() {
return {
onBeforeMount(props, state) {
this.state = {
items: null,
formation: this.props.formation
};
fetchEtablissement(this.state.formation).then(response => {
this.update({
items: response
});
//console.log(this.state.items)
this.state.items.forEach(etablissement => {
},
onUpdated(props, state) {
if (!props.shouldShowInfos) return;
fetchEtablissement(props.course).then(response => {
response.forEach(etablissement => {
// calcul la moyenne
let pct_sansmention = etablissement.fields.pct_sansmention;
let pct_AB = etablissement.fields.pct_ab;
@ -56,66 +51,71 @@ var school = {
// On prend la moyenne des moyennes comprises dans la mention
// Exemple : Assez bien est entre 12 et 14 donc 13.
let moyenne = (pct_TBF * 19 + pct_TB * 17 + pct_B * 15 + pct_AB * 13 + pct_sansmention * 11) / 100;
etablissement.fields.moyenne = moyenne;
//console.log(etablissement.fields)
etablissement.fields.moyenne = (pct_TBF * 19 + pct_TB * 17 + pct_B * 15 + pct_AB * 13 + pct_sansmention * 11) / 100;
});
this.update({
items: response
});
this.update();
});
}
};
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-2 m-2"><iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=-14.655761718750002%2C40.56389453066509%2C13.601074218750002%2C51.754240074033525&amp;layer=mapnik" style="border-radius: 5px;"></iframe><br/><div class="block control has-icons-left is-inline-block is-pulled-right"><input class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable"><thead><tr><th><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead><tbody><tr expr972="expr972"></tr></tbody></table></div>', [{
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<td expr973="expr973"> </td><td expr974="expr974"> </td><td expr975="expr975"> </td><td expr976="expr976"> </td><td expr977="expr977"> </td>', [{
redundantAttribute: 'expr973',
selector: '[expr973]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.g_ea_lib_vx
}]
}, {
redundantAttribute: 'expr974',
selector: '[expr974]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.ville_etab
}]
}, {
redundantAttribute: 'expr975',
selector: '[expr975]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.dep
}]
}, {
redundantAttribute: 'expr976',
selector: '[expr976]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.moyenne
}]
}, {
redundantAttribute: 'expr977',
selector: '[expr977]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.taux_acces_ens
}]
}]),
redundantAttribute: 'expr972',
selector: '[expr972]',
itemName: 'etablissement',
indexName: null,
evaluate: _scope => _scope.state.items
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div expr1453="expr1453" class="box p-2 m-2"></div>', [{
type: bindingTypes.IF,
evaluate: _scope => _scope.props.shouldShowInfos,
redundantAttribute: 'expr1453',
selector: '[expr1453]',
template: template('<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=-14.655761718750002%2C40.56389453066509%2C13.601074218750002%2C51.754240074033525&amp;layer=mapnik" style="border-radius: 5px;"></iframe><br/><div class="block control has-icons-left is-inline-block is-pulled-right"><input class="input" type="search" placeholder="Établissement"/><span class="icon is-small is-left"><i class="fas fa-search"></i></span></div><table class="table is-fullwidth is-hoverable"><thead><tr><th><abbr title="name">Nom</abbr></th><th><abbr title="city">Ville</abbr></th><th><abbr title="dept">Dpt</abbr></th><th><abbr title="moyenne">Moyenne</abbr></th><th><abbr title="selectivite">Sélectivité</abbr></th></tr></thead><tbody><tr expr1454="expr1454"></tr></tbody></table>', [{
type: bindingTypes.EACH,
getKey: null,
condition: _scope => !_scope.state.loading,
template: template('<td expr1455="expr1455"> </td><td expr1456="expr1456"> </td><td expr1457="expr1457"> </td><td expr1458="expr1458"> </td><td expr1459="expr1459"> </td>', [{
redundantAttribute: 'expr1455',
selector: '[expr1455]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.g_ea_lib_vx
}]
}, {
redundantAttribute: 'expr1456',
selector: '[expr1456]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.ville_etab
}]
}, {
redundantAttribute: 'expr1457',
selector: '[expr1457]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.dep
}]
}, {
redundantAttribute: 'expr1458',
selector: '[expr1458]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.moyenne
}]
}, {
redundantAttribute: 'expr1459',
selector: '[expr1459]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.taux_acces_ens
}]
}]),
redundantAttribute: 'expr1454',
selector: '[expr1454]',
itemName: 'etablissement',
indexName: null,
evaluate: _scope => _scope.state.items
}])
}]),
name: 'school'
};

View File

@ -35,9 +35,6 @@ var search = {
exports: {
updateList() {
let promise;
this.update({
updating: true
});
switch (this.state.currentStep) {
case 0:
promise = PAPI.fetchFilieres();
@ -48,7 +45,12 @@ var search = {
case 2:
promise = PAPI.fetchSpecialites(this.state.course.sousfili);
break;
default:
return;
}
this.update({
updating: true
});
promise.then(response => {
this.state.allItems = response;
this.filterSearch();
@ -94,12 +96,7 @@ var search = {
break;
case 2:
this.state.course.soussousfili = selection;
this.state.updateCourse(this.state.course);
break;
case 2:
console.log(this.props);
console.log(this.root);
console.log("end");
this.props.updateCourse(this.state.course);
return;
default:
return;
@ -121,26 +118,23 @@ var search = {
});
},
onBeforeMount(props, state) {
console.log("on m'a appelé");
//Initial state
this.state = {
placeholder: PLACEHOLDERS[0],
currentStep: 0,
allItems: null,
items: null,
course: [],
updating: false,
updateCourse: this.props.updateCourse
course: {},
updating: false
};
console.log(this.state.updateCourse);
},
onMounted(props, state) {
this.updateList();
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr978="expr978" class="input" type="input"/><button expr979="expr979" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr980="expr980" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr978',
selector: '[expr978]',
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr1400="expr1400" class="input" type="input"/><button expr1401="expr1401" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr1402="expr1402" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr1400',
selector: '[expr1400]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeyup',
@ -151,8 +145,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder
}]
}, {
redundantAttribute: 'expr979',
selector: '[expr979]',
redundantAttribute: 'expr1401',
selector: '[expr1401]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@ -166,9 +160,9 @@ var search = {
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<button expr981="expr981" class="button is-fullwidth p-2"><span style="font-size: .75em; max-size: 90%"><strong expr982="expr982"> </strong></span><div style="margin-left: auto;"></div><span expr983="expr983" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr981',
selector: '[expr981]',
template: template('<button expr1403="expr1403" class="button is-fullwidth p-2"><span style="font-size: .75em; max-size: 90%"><strong expr1404="expr1404"> </strong></span><div style="margin-left: auto;"></div><span expr1405="expr1405" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr1403',
selector: '[expr1403]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@ -179,24 +173,24 @@ var search = {
evaluate: _scope => () => _scope.cruiseForward(_scope.item.name)
}]
}, {
redundantAttribute: 'expr982',
selector: '[expr982]',
redundantAttribute: 'expr1404',
selector: '[expr1404]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
redundantAttribute: 'expr983',
selector: '[expr983]',
redundantAttribute: 'expr1405',
selector: '[expr1405]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.count
}]
}]),
redundantAttribute: 'expr980',
selector: '[expr980]',
redundantAttribute: 'expr1402',
selector: '[expr1402]',
itemName: 'item',
indexName: null,
evaluate: _scope => _scope.state.items