完成世界书、骰子、apiconfig页面处理
This commit is contained in:
5
frontend/node_modules/@iconify/utils/lib/customisations/bool.d.ts
generated
vendored
Normal file
5
frontend/node_modules/@iconify/utils/lib/customisations/bool.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Get boolean customisation value from attribute
|
||||
*/
|
||||
declare function toBoolean(name: string, value: unknown, defaultValue: boolean): boolean;
|
||||
export { toBoolean };
|
||||
18
frontend/node_modules/@iconify/utils/lib/customisations/flip.js
generated
vendored
Normal file
18
frontend/node_modules/@iconify/utils/lib/customisations/flip.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
const separator = /[\s,]+/;
|
||||
/**
|
||||
* Apply "flip" string to icon customisations
|
||||
*/
|
||||
function flipFromString(custom, flip) {
|
||||
flip.split(separator).forEach((str) => {
|
||||
switch (str.trim()) {
|
||||
case "horizontal":
|
||||
custom.hFlip = true;
|
||||
break;
|
||||
case "vertical":
|
||||
custom.vFlip = true;
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { flipFromString };
|
||||
31
frontend/node_modules/@iconify/utils/lib/customisations/rotate.js
generated
vendored
Normal file
31
frontend/node_modules/@iconify/utils/lib/customisations/rotate.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Get rotation value
|
||||
*/
|
||||
function rotateFromString(value, defaultValue = 0) {
|
||||
const units = value.replace(/^-?[0-9.]*/, "");
|
||||
function cleanup(value$1) {
|
||||
while (value$1 < 0) value$1 += 4;
|
||||
return value$1 % 4;
|
||||
}
|
||||
if (units === "") {
|
||||
const num = parseInt(value);
|
||||
return isNaN(num) ? 0 : cleanup(num);
|
||||
} else if (units !== value) {
|
||||
let split = 0;
|
||||
switch (units) {
|
||||
case "%":
|
||||
split = 25;
|
||||
break;
|
||||
case "deg": split = 90;
|
||||
}
|
||||
if (split) {
|
||||
let num = parseFloat(value.slice(0, value.length - units.length));
|
||||
if (isNaN(num)) return 0;
|
||||
num = num / split;
|
||||
return num % 1 === 0 ? cleanup(num) : 0;
|
||||
}
|
||||
}
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
export { rotateFromString };
|
||||
Reference in New Issue
Block a user