web-api-manager/add-on/config/js/vue_components/web-api-standards.vue.js

35 lines
1.4 KiB
JavaScript
Raw Normal View History

(function () {
"use strict";
const standardsDefaults = window.WEB_API_MANAGER.defaults;
const Vue = window.Vue;
Vue.component("web-api-standards", {
props: ["standards", "selectedStandards", "selectedDomain"],
render: window.WEB_API_MANAGER.vueComponents["web-api-standards"].render,
staticRenderFns: window.WEB_API_MANAGER.vueComponents["web-api-standards"].staticRenderFns,
methods: {
onStandardChecked: function () {
this.$root.$data.setSelectedStandards(this.selectedStandards);
},
onLiteClicked: function () {
this.$root.$data.setSelectedStandards(standardsDefaults.lite);
},
onConservativeClicked: function () {
this.$root.$data.setSelectedStandards(standardsDefaults.conservative);
},
onAggressiveClicked: function () {
this.$root.$data.setSelectedStandards(standardsDefaults.aggressive);
},
onClearClicked: function () {
this.$root.$data.setSelectedStandards([]);
},
onAllClicked: function () {
const allStandards = Object.keys(this.standards)
.map(aStdName => this.standards[aStdName].info.identifier);
this.$root.$data.setSelectedStandards(allStandards);
}
}
});
}());