added more attributes and generateCode to more widgets

This commit is contained in:
paul
2024-09-27 19:22:33 +05:30
parent 77b1c5a0f0
commit 2c7a1ada48
13 changed files with 252 additions and 218 deletions

View File

@@ -57,5 +57,16 @@ export function isNumeric(str) {
if (typeof str != "string") return false // we only process strings!
return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
!isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail
}
}
/**
* given an object with key value returns key1=value1, key2=value2 format
* @param {Object} obj
* @returns
*/
export function convertObjectToKeyValueString(obj){
return Object.entries(obj)
.map(([key, value]) => `${key}=${value}`)
.join(', ')
}