mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
Dropdown implementation, switch refactoring
* Various fixes * Fix tests * Dropdown names deduced from pin names * Remove update callbacks * Fix double pins issue * return undefined if not switch
This commit is contained in:
@@ -31,6 +31,13 @@ export default class Utility {
|
||||
}
|
||||
}
|
||||
|
||||
static arrayConverter = {
|
||||
/** @param {String} value */
|
||||
fromAttribute: (value, type) => value.split(/(?<!\\),/).map(v => v.trim()),
|
||||
/** @param {String[]} value */
|
||||
toAttribute: (value, type) => value.join(","),
|
||||
}
|
||||
|
||||
/** @param {Number} x */
|
||||
static sigmoid(x, curvature = 1.7) {
|
||||
return 1 / (1 + (x / (1 - x) ** -curvature))
|
||||
@@ -316,7 +323,7 @@ export default class Utility {
|
||||
static clearHTMLWhitespace(value) {
|
||||
return value
|
||||
.replaceAll(" ", "\u00A0") // whitespace
|
||||
.replaceAll(/<br\s*\/>|<br>/, "\n") // newlines
|
||||
.replaceAll(/<br\s*\/>|<br>/g, "\n") // newlines
|
||||
.replaceAll(/(\<!--.*?\-->)/g, "") // html comments
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user