调整部分NumberInput组件为VariableInput组件

This commit is contained in:
fofolee 2025-02-17 12:14:28 +08:00
parent 174d3ed7e7
commit daef39b02a
10 changed files with 181 additions and 154 deletions

View File

@ -135,12 +135,11 @@ export const browserCommands = {
config: [
{
label: "浏览器实例端口",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "label",
width: 12,
min: 9222,
max: 9322,
step: 1,
placeholder: "留空关闭当前操控的实例",
},
],
@ -176,13 +175,11 @@ export const browserCommands = {
config: [
{
label: "浏览器实例端口",
component: "NumberInput",
component: "VariableInput",
icon: "label",
width: 12,
defaultValue: 9222,
min: 9222,
max: 9322,
step: 1,
defaultValue: newVarInputVal("var"),
disableToggleType: true,
},
],
},
@ -701,17 +698,19 @@ export const browserCommands = {
config: [
{
label: "X坐标",
component: "NumberInput",
component: "VariableInput",
icon: "arrow_right",
width: 12,
defaultValue: 0,
defaultValue: newVarInputVal("var", "0"),
disableToggleType: true,
},
{
label: "Y坐标",
component: "NumberInput",
component: "VariableInput",
icon: "arrow_drop_down",
width: 12,
defaultValue: 0,
defaultValue: newVarInputVal("var", "0"),
disableToggleType: true,
},
],
},

View File

@ -71,18 +71,18 @@ export const dataCommands = {
},
{
label: "起始位置",
component: "NumberInput",
min: 0,
step: 1,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 6,
},
{
label: "结束位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page",
min: 0,
step: 1,
width: 6,
},
],
@ -169,9 +169,9 @@ export const dataCommands = {
},
{
label: "目标长度",
component: "NumberInput",
min: 0,
step: 1,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten",
width: 4,
},
@ -264,9 +264,9 @@ export const dataCommands = {
},
{
label: "重复次数",
component: "NumberInput",
min: 0,
step: 1,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "repeat",
width: 4,
defaultValue: 1,
@ -357,9 +357,9 @@ export const dataCommands = {
},
{
label: "每行字符数",
component: "NumberInput",
min: 1,
step: 1,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten",
width: 4,
defaultValue: 80,
@ -397,9 +397,9 @@ export const dataCommands = {
},
{
label: "总宽度",
component: "NumberInput",
min: 1,
step: 1,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten",
width: 6,
defaultValue: 80,
@ -487,16 +487,18 @@ export const dataCommands = {
},
{
label: "起始位置",
component: "NumberInput",
step: 1,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 4,
},
{
label: "结束位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page",
step: 1,
width: 4,
},
],
@ -520,13 +522,17 @@ export const dataCommands = {
},
{
label: "偏移量",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 4,
},
{
label: "长度",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten",
width: 4,
},
@ -568,13 +574,17 @@ export const dataCommands = {
},
{
label: "起始位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 4,
},
{
label: "结束位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page",
width: 4,
},
@ -616,19 +626,25 @@ export const dataCommands = {
},
{
label: "目标起始位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 4,
},
{
label: "源起始位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 4,
},
{
label: "源结束位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page",
width: 4,
},
@ -669,7 +685,9 @@ export const dataCommands = {
},
{
label: "总长度(可选)",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "straighten",
width: 12,
},
@ -688,13 +706,17 @@ export const dataCommands = {
},
{
label: "起始位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 6,
},
{
label: "结束位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "last_page",
width: 6,
},
@ -719,7 +741,9 @@ export const dataCommands = {
},
{
label: "起始位置",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
icon: "first_page",
width: 4,
},
@ -1062,19 +1086,19 @@ export const dataCommands = {
},
{
label: "起始位置",
component: "NumberInput",
component: "VariableInput",
icon: "first_page",
min: 0,
step: 1,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
width: 6,
placeholder: "1",
},
{
label: "结束位置",
component: "NumberInput",
component: "VariableInput",
icon: "last_page",
min: 0,
step: 1,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
width: 6,
placeholder: "3",
},
@ -1094,11 +1118,10 @@ export const dataCommands = {
},
{
label: "扁平化深度",
component: "NumberInput",
component: "VariableInput",
icon: "format_indent_decrease",
min: 1,
step: 1,
defaultValue: 1,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
width: 4,
},
],
@ -1201,11 +1224,10 @@ export const dataCommands = {
},
{
label: "块大小",
component: "NumberInput",
component: "VariableInput",
icon: "straighten",
min: 1,
step: 1,
defaultValue: 2,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
width: 4,
},
],
@ -1344,10 +1366,11 @@ export const dataCommands = {
},
{
label: "数值",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var", "1"),
icon: "exposure",
width: 6,
defaultValue: 1,
},
{
label: "单位",

View File

@ -140,19 +140,19 @@ export const imageCommands = {
},
{
label: "宽度(像素)",
component: "NumberInput",
component: "VariableInput",
icon: "compare_arrows",
width: 6,
min: 1,
step: 10,
disableToggleType: true,
defaultValue: newVarInputVal("var", "100"),
},
{
label: "高度(像素)",
component: "NumberInput",
component: "VariableInput",
icon: "height",
width: 6,
min: 1,
step: 10,
disableToggleType: true,
defaultValue: newVarInputVal("var", "100"),
},
{
label: "保持宽高比",
@ -293,39 +293,35 @@ export const imageCommands = {
},
{
label: "起始X坐标",
component: "NumberInput",
component: "VariableInput",
icon: "arrow_right",
width: 6,
min: 0,
step: 10,
defaultValue: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var", "0"),
},
{
label: "起始Y坐标",
component: "NumberInput",
component: "VariableInput",
icon: "arrow_downward",
width: 6,
min: 0,
step: 10,
defaultValue: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var", "0"),
},
{
label: "裁剪宽度",
component: "NumberInput",
component: "VariableInput",
icon: "compare_arrows",
width: 6,
min: 1,
step: 10,
defaultValue: "",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "裁剪高度",
component: "NumberInput",
component: "VariableInput",
icon: "height",
width: 6,
min: 1,
step: 10,
defaultValue: "",
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "图片质量(0-1)",

View File

@ -1,3 +1,5 @@
import { newVarInputVal } from "js/composer/varInputValManager";
const windowOutputStructure = {
name: { label: "应用名称", suggestName: "appName" },
displayedName: {
@ -432,10 +434,10 @@ export const macosCommands = {
config: [
{
label: "窗口索引",
component: "NumberInput",
component: "VariableInput",
icon: "window",
min: 1,
defaultValue: 1,
disableToggleType: true,
defaultValue: newVarInputVal("var", "1"),
width: 12,
},
],

View File

@ -201,10 +201,11 @@ export const mathCommands = {
config: [
{
label: "半径",
component: "NumberInput",
component: "VariableInput",
icon: "radio_button_checked",
width: 12,
min: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
],
},
@ -215,17 +216,19 @@ export const mathCommands = {
config: [
{
label: "宽度",
component: "NumberInput",
component: "VariableInput",
icon: "swap_horiz",
width: 6,
min: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "高度",
component: "NumberInput",
component: "VariableInput",
icon: "height",
width: 6,
min: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
],
},
@ -236,24 +239,27 @@ export const mathCommands = {
config: [
{
label: "边长a",
component: "NumberInput",
component: "VariableInput",
icon: "straighten",
width: 4,
min: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "边长b",
component: "NumberInput",
component: "VariableInput",
icon: "straighten",
width: 4,
min: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "边长c",
component: "NumberInput",
component: "VariableInput",
icon: "straighten",
width: 4,
min: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
],
},
@ -266,9 +272,11 @@ export const mathCommands = {
config: [
{
label: "角度值",
component: "NumberInput",
component: "VariableInput",
icon: "rotate_right",
width: 12,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
],
subCommands: [

View File

@ -152,18 +152,16 @@ export const simulateCommands = {
x: {
label: "X坐标",
icon: "drag_handle",
component: "NumberInput",
min: 0,
step: 10,
component: "VariableInput",
disableToggleType: true,
width: 6,
placeholder: "XY任意留空原地点击",
},
y: {
label: "Y坐标",
icon: "drag_handle",
component: "NumberInput",
min: 0,
step: 10,
component: "VariableInput",
disableToggleType: true,
width: 6,
placeholder: "XY任意留空原地点击",
},
@ -185,6 +183,8 @@ export const simulateCommands = {
},
defaultValue: {
count: 1,
x: newVarInputVal("var"),
y: newVarInputVal("var"),
},
},
],
@ -201,19 +201,17 @@ export const simulateCommands = {
{
label: "X坐标",
icon: "drag_handle",
defaultValue: 0,
component: "NumberInput",
min: 0,
step: 10,
defaultValue: newVarInputVal("var", "0"),
component: "VariableInput",
disableToggleType: true,
width: 6,
},
{
label: "Y坐标",
icon: "drag_handle",
defaultValue: 0,
component: "NumberInput",
min: 0,
step: 10,
defaultValue: newVarInputVal("var", "0"),
component: "VariableInput",
disableToggleType: true,
width: 6,
},
],

View File

@ -549,9 +549,8 @@ export const systemCommands = {
config: [
{
label: "进程ID",
component: "NumberInput",
min: 0,
step: 100,
component: "VariableInput",
disableToggleType: true,
icon: "developer_board",
width: 7,
},

View File

@ -444,21 +444,17 @@ export const uiCommands = {
label: "标题",
component: "VariableInput",
width: 6,
defaultValue: newVarInputVal("str", "进度"),
},
text: {
label: "文本",
component: "VariableInput",
width: 6,
defaultValue: newVarInputVal("str", "处理中..."),
},
value: {
label: "初始进度值",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
width: 3,
min: 0,
max: 100,
defaultValue: 0,
},
position: {
label: "位置",
@ -470,7 +466,6 @@ export const uiCommands = {
{ label: "屏幕左下角", value: "bottom-left" },
{ label: "屏幕右下角", value: "bottom-right" },
],
defaultValue: "bottom-right",
},
onClose: {
label: "关闭按钮回调函数",
@ -496,7 +491,7 @@ export const uiCommands = {
defaultValue: {
title: newVarInputVal("str", "进度"),
text: newVarInputVal("str", "处理中..."),
value: 0,
value: newVarInputVal("var", "0"),
position: "bottom-right",
onClose: newVarInputVal("var"),
onPause: newVarInputVal("var"),
@ -515,11 +510,9 @@ export const uiCommands = {
options: {
value: {
label: "进度值",
component: "NumberInput",
component: "VariableInput",
width: 4,
min: 0,
max: 100,
defaultValue: 0,
disableToggleType: true,
},
text: {
label: "文本",
@ -534,7 +527,7 @@ export const uiCommands = {
},
},
defaultValue: {
value: 0,
value: newVarInputVal("var", "0"),
text: newVarInputVal("str"),
complete: false,
},

View File

@ -1,3 +1,5 @@
import { newVarInputVal } from "js/composer/varInputValManager";
export const utoolsCommands = {
label: "uTools功能",
icon: "insights",
@ -49,9 +51,9 @@ export const utoolsCommands = {
config: [
{
label: "高度",
component: "NumberInput",
min: 0,
step: 100,
component: "VariableInput",
disableToggleType: true,
defaultValue: newVarInputVal("var", "100"),
icon: "straighten",
width: 12,
},

View File

@ -293,19 +293,27 @@ export const windowsCommands = {
options: {
x: {
label: "X坐标",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
icon: "arrow_right",
placeholder: "留空使用当前鼠标位置",
width: 6,
disableToggleType: true,
},
y: {
label: "Y坐标",
component: "NumberInput",
component: "VariableInput",
disableToggleType: true,
icon: "arrow_drop_down",
placeholder: "留空使用当前鼠标位置",
width: 6,
disableToggleType: true,
},
},
defaultValue: {
x: newVarInputVal("var"),
y: newVarInputVal("var"),
},
},
],
outputs: {
@ -352,12 +360,11 @@ export const windowsCommands = {
config: [
{
label: "透明度",
component: "NumberInput",
component: "VariableInput",
icon: "opacity",
width: 12,
min: 0,
max: 100,
defaultValue: 80,
disableToggleType: true,
defaultValue: newVarInputVal("var", "80"),
},
],
},
@ -368,33 +375,35 @@ export const windowsCommands = {
config: [
{
label: "X坐标",
component: "NumberInput",
component: "VariableInput",
icon: "arrow_right",
width: 6,
defaultValue: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "Y坐标",
component: "NumberInput",
component: "VariableInput",
icon: "arrow_drop_down",
width: 6,
defaultValue: 0,
disableToggleType: true,
defaultValue: newVarInputVal("var"),
},
{
label: "宽度",
component: "NumberInput",
component: "VariableInput",
icon: "swap_horiz",
width: 6,
min: 0,
defaultValue: 800,
disableToggleType: true,
defaultValue: newVarInputVal("var", "800"),
},
{
label: "高度",
component: "NumberInput",
component: "VariableInput",
icon: "height",
width: 6,
min: 0,
defaultValue: 600,
disableToggleType: true,
defaultValue: newVarInputVal("var", "600"),
},
],
},
@ -629,17 +638,15 @@ export const windowsCommands = {
},
amount: {
label: "位置",
component: "NumberInput",
component: "VariableInput",
icon: "straighten",
width: 6,
min: 0,
max: 100,
step: 10,
disableToggleType: true,
},
},
defaultValue: {
direction: "vertical",
amount: 0,
amount: newVarInputVal("var"),
},
},
],