Fix props cassé

This commit is contained in:
2023-03-29 22:56:14 +02:00
parent 59e30c88ba
commit 785aaba8b8
8 changed files with 111 additions and 150 deletions

View File

@@ -1,38 +1,47 @@
var mainController = {
css: null,
exports: {},
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 expr12="expr12"></search></div><div class="column"><fili-info expr13="expr13"></fili-info><school expr14="expr14"></school></div></div><school-info expr15="expr15"></school-info>', [{
exports: {
//Fonction qui va écouter ce que <search> a à dire.
searchListener(arg) {
console.log("Search il a dit: " + arg);
}
},
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 expr932="expr932"></search></div><div class="column"><fili-info expr933="expr933"></fili-info><school expr934="expr934"></school></div></div><school-info expr935="expr935"></school-info>', [{
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'search',
slots: [],
attributes: [],
redundantAttribute: 'expr12',
selector: '[expr12]'
attributes: [{
type: expressionTypes.ATTRIBUTE,
name: 'partouse',
evaluate: _scope => _scope.searchListener
}],
redundantAttribute: 'expr932',
selector: '[expr932]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'fili-info',
slots: [],
attributes: [],
redundantAttribute: 'expr13',
selector: '[expr13]'
redundantAttribute: 'expr933',
selector: '[expr933]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school',
slots: [],
attributes: [],
redundantAttribute: 'expr14',
selector: '[expr14]'
redundantAttribute: 'expr934',
selector: '[expr934]'
}, {
type: bindingTypes.TAG,
getComponent: getComponent,
evaluate: _scope => 'school-info',
slots: [],
attributes: [],
redundantAttribute: 'expr15',
selector: '[expr15]'
redundantAttribute: 'expr935',
selector: '[expr935]'
}]),
name: 'main-controller'
};

View File

@@ -68,53 +68,53 @@ var school = {
}
};
},
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 expr16="expr16"></tr></tbody></table></div>', [{
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 expr406="expr406"></tr></tbody></table></div>', [{
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<td expr17="expr17"> </td><td expr18="expr18"> </td><td expr19="expr19"> </td><td expr20="expr20"> </td><td expr21="expr21"> </td>', [{
redundantAttribute: 'expr17',
selector: '[expr17]',
template: template('<td expr407="expr407"> </td><td expr408="expr408"> </td><td expr409="expr409"> </td><td expr410="expr410"> </td><td expr411="expr411"> </td>', [{
redundantAttribute: 'expr407',
selector: '[expr407]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.g_ea_lib_vx
}]
}, {
redundantAttribute: 'expr18',
selector: '[expr18]',
redundantAttribute: 'expr408',
selector: '[expr408]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.ville_etab
}]
}, {
redundantAttribute: 'expr19',
selector: '[expr19]',
redundantAttribute: 'expr409',
selector: '[expr409]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.dep
}]
}, {
redundantAttribute: 'expr20',
selector: '[expr20]',
redundantAttribute: 'expr410',
selector: '[expr410]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.moyenne
}]
}, {
redundantAttribute: 'expr21',
selector: '[expr21]',
redundantAttribute: 'expr411',
selector: '[expr411]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.etablissement.fields.taux_acces_ens
}]
}]),
redundantAttribute: 'expr16',
selector: '[expr16]',
redundantAttribute: 'expr406',
selector: '[expr406]',
itemName: 'etablissement',
indexName: null,
evaluate: _scope => _scope.state.items

View File

@@ -55,8 +55,18 @@ var search = {
this.update({
updating: false
});
}, () => {
if (!this.state.currentStep) {
this.cruiseBack();
}
this.update({
updating: false
});
});
},
clearSearch() {
this.$("input").value = "";
},
filterSearch() {
let input = this.$("input");
if (!input) return;
@@ -75,7 +85,6 @@ var search = {
});
},
cruiseForward(selection) {
if (this.state.currentStep >= 2) return;
switch (this.state.currentStep) {
case 0:
this.state.filiere = selection;
@@ -83,9 +92,17 @@ var search = {
case 1:
this.state.specialite = selection;
break;
case 2:
console.log(this.props);
console.log(this.root);
console.log("end");
return;
default:
return;
}
this.state.currentStep++;
this.updateList();
this.clearSearch();
this.update({
placeholder: PLACEHOLDERS[this.state.currentStep]
});
@@ -94,6 +111,7 @@ var search = {
if (!this.state.currentStep) return;
this.state.currentStep--;
this.updateList();
this.clearSearch();
this.update({
placeholder: PLACEHOLDERS[this.state.currentStep]
});
@@ -104,20 +122,19 @@ var search = {
placeholder: PLACEHOLDERS[0],
currentStep: 0,
allItems: null,
filter: null,
items: null,
filiere: null,
specialite: null,
updating: false
};
},
onMounted() {
onMounted(props, state) {
this.updateList();
}
},
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr304="expr304" class="input" type="input"/><button expr305="expr305" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr306="expr306" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr304',
selector: '[expr304]',
template: (template, expressionTypes, bindingTypes, getComponent) => template('<div class="box p-1 m-2"><div class="columns m-1"><input expr966="expr966" class="input" type="input"/><button expr967="expr967" class="button ml-1">&lt;</button></div><div id="list-formations"><ul><li expr968="expr968" class="m-1"></li></ul></div></div>', [{
redundantAttribute: 'expr966',
selector: '[expr966]',
expressions: [{
type: expressionTypes.EVENT,
name: 'onkeyup',
@@ -128,8 +145,8 @@ var search = {
evaluate: _scope => _scope.state.placeholder
}]
}, {
redundantAttribute: 'expr305',
selector: '[expr305]',
redundantAttribute: 'expr967',
selector: '[expr967]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@@ -143,9 +160,9 @@ var search = {
type: bindingTypes.EACH,
getKey: null,
condition: null,
template: template('<button expr307="expr307" class="button is-fullwidth"><span style="font-size: .75em;"><strong expr308="expr308"> </strong></span><div style="margin-left: auto;"></div><span expr309="expr309" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr307',
selector: '[expr307]',
template: template('<button expr969="expr969" class="button is-fullwidth p-2"><span style="font-size: .75em; max-size: 90%"><strong expr970="expr970"> </strong></span><div style="margin-left: auto;"></div><span expr971="expr971" class="tag is-primary"> </span></button>', [{
redundantAttribute: 'expr969',
selector: '[expr969]',
expressions: [{
type: expressionTypes.ATTRIBUTE,
name: 'disabled',
@@ -156,24 +173,24 @@ var search = {
evaluate: _scope => () => _scope.cruiseForward(_scope.item.name)
}]
}, {
redundantAttribute: 'expr308',
selector: '[expr308]',
redundantAttribute: 'expr970',
selector: '[expr970]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.name
}]
}, {
redundantAttribute: 'expr309',
selector: '[expr309]',
redundantAttribute: 'expr971',
selector: '[expr971]',
expressions: [{
type: expressionTypes.TEXT,
childNodeIndex: 0,
evaluate: _scope => _scope.item.count
}]
}]),
redundantAttribute: 'expr306',
selector: '[expr306]',
redundantAttribute: 'expr968',
selector: '[expr968]',
itemName: 'item',
indexName: null,
evaluate: _scope => _scope.state.items