v4.0.0 ‐ Shared IconStyle options (Fluent UI and MDI only) - sqville/ville.Embed GitHub Wiki
Recommended changes for a shared IconStyle API
File 1 - ville.embed.fluent.Abstract.js
ville.embed.fluent.Abstract.js
Change 1 - iconStyle property check
Line 62 add "outlined" to iconStyle property check. Property definition should look like:
iconStyle :
{
check : ["regular", "filled", "outlined"],
init: "regular",
apply: "_applyIconStyle",
event: "changeIconStyle",
nullable : true,
themeable : true
},
Change 2 - iconStyle property apply function
Add "outlined" case to _applyIconStyle property apply function. Property's apply function should look like:
// property apply
_applyIconStyle(value, old) {
switch (value) {
case 'regular':
this.setHtml(this._htmlregular);
break;
case 'filled':
this.setHtml(this._htmlfilled);
break;
case 'outlined':
this.setHtml(this._htmlregular);
break;
}
},
File 2 - ville.embed.mdi.AbstractBundle.js
ville.embed.mdi.AbstractBundle.js
Change 1 - iconStyle property check
Line 68 add "regular" to iconStyle property check. Property definition should look like:
iconStyle :
{
check : ["filled", "outlined", "regular"],
init: "filled",
apply: "_applyIconStyle",
event: "changeIconStyle",
nullable : true,
themeable : true
},
Change 2 - iconStyle property apply function
Add "regular" case to _applyIconStyle property apply function. Property's apply function should look like:
// property apply
_applyIconStyle(value, old) {
switch (value) {
case 'filled':
this.setHtml(this._htmlfilled);
break;
case 'outlined':
this.setHtml(this._htmloutlined);
break;
case 'regular':
this.setHtml(this._htmloutlined);
break;
}
},