JSFiddle - React, Tailwind, and code Playground
by Yurii Shpylovyi
JavaScript
class coupler {
constructor(cableTypeVocabulary, vendor, cableType, wires) {
this.tubeSchema = cableTypeVocabulary.vendor.cableType.tubeSchema,
this.wiresSchema = cableTypeVocabulary.vendor.cableType.wiresSchema
}
showCabeSchema() {
console.log({
tubeSchema: this.tubeSchema,
wiresSchema: this.wiresSchema
});
}
}
let vocabulary = {
vendor: {
finmark: {
ut: {
tube:
[{
text: 'синій',
color: '#0000ff'
}, {
text: 'помаранчевий',
color: '#ff6600'
}, {
text: 'зелений',
color: '#009933'
}, {
text: 'коричневий',
color: '#663300'
}, {
text: 'сірий',
color: '#808080'
}, {
text: 'білий',
color: '#ffffff'
}, {
text: 'червоний',
color: '#ff0000'
}, {
text: 'чорний',
color: '#000000'
}, {
text: 'жовтий',
color: '#ffff00'
}, {
text: 'фіолетовий',
color: '#ee82ee'
}, {
text: 'рожевий',
color: '#ffc0cb'
}, {
text: 'бірюзовий',
color: '#00ffff'
}],
wires:
[{
text: 'синій',
color: '#0000ff'
}, {
text: 'помаранчевий',
color: '#ff6600'
}, {
text: 'зелений',
color: '#009933'
}, {
text: 'коричневий',
color: '#663300'
}, {
text: 'сірий',
color: '#808080'
}, {
text: 'білий',
color: '#ffffff'
}, {
text: 'червоний',
color: '#ff0000'
}, {
text: 'чорний',
color: '#000000'
}, {
text: 'жовтий',
color: '#ffff00'
...