Skip to content

Commit 2c70d7e

Browse files
committed
fix: fix field order issue. #12
1 parent a625923 commit 2c70d7e

File tree

25 files changed

+115
-15
lines changed

25 files changed

+115
-15
lines changed

pages/base/src/control/Password.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ export const Password: FC<InputProps> = (props) => {
55
const { keyname = 'password', name, rename, ...elmProps } = props;
66
const nameBase = name || rename || keyname;
77
const key = (keyname || name) as string;
8-
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
8+
return (
9+
<Input
10+
type="password"
11+
placeholder="Password"
12+
index={2}
13+
autoComplete="on"
14+
{...elmProps}
15+
name={nameBase}
16+
keyname={key}
17+
/>
18+
);
919
};
1020

1121
Password.displayName = 'BaseLogin.Password';

pages/base/src/control/Username.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const Username: FC<InputProps> = (props) => {
55
const { keyname = 'username', name, rename, ...elmProps } = props;
66
const nameBase = name || rename || keyname;
77
const key = (keyname || name) as string;
8-
return <Input placeholder="Username" spellCheck={false} {...elmProps} name={nameBase} keyname={key} />;
8+
return <Input placeholder="Username" spellCheck={false} index={1} {...elmProps} name={nameBase} keyname={key} />;
99
};
1010

1111
Username.displayName = 'BaseLogin.Username';

pages/page1/src/control/Password.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ export const Password: FC<InputProps> = (props) => {
55
const { keyname = 'password', name, rename, ...elmProps } = props;
66
const nameBase = name || rename || keyname;
77
const key = (keyname || name) as string;
8-
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
8+
return (
9+
<Input
10+
type="password"
11+
index={2}
12+
placeholder="Password"
13+
autoComplete="on"
14+
{...elmProps}
15+
name={nameBase}
16+
keyname={key}
17+
/>
18+
);
919
};
1020

1121
Password.displayName = 'Login.Password';

pages/page1/src/control/Username.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const Username: FC<InputProps> = (props) => {
55
const { keyname = 'username', name, rename, ...elmProps } = props;
66
const nameBase = name || rename || keyname;
77
const key = (keyname || name) as string;
8-
return <Input type="password" placeholder="Password" {...elmProps} name={nameBase} keyname={key} />;
8+
return <Input type="text" index={1} placeholder="Username" {...elmProps} name={nameBase} keyname={key} />;
99
};
1010

1111
Username.displayName = 'Login.Username';

pages/page1/src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const RenderLogin = () => {
3030
{fields
3131
.sort((a, b) => a.index - b.index)
3232
.map((item, idx) => {
33+
console.log('item', item);
3334
if (!item.children) return null;
3435
return <label key={item.name + idx}>{item.children}</label>;
3536
})}

pages/page10/src/control/login/Email.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const Email: FC<EmailProps> = memo((props) => {
2323
placeholder="Your Email"
2424
spellCheck={false}
2525
visible={visible}
26+
index={1}
2627
{...elmProps}
2728
name={nameBase}
2829
keyname={`$$${panel}${key}`}

pages/page10/src/control/login/Password.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
2222
type="password"
2323
placeholder="Your Password"
2424
autoComplete="on"
25+
index={1}
2526
{...elmProps}
2627
name={nameBase}
2728
visible={visible}

pages/page11/src/control/Password.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ export const Password: FC<PasswordProps> = (props) => {
1212
const { dispatch } = useStore();
1313
useEffect(() => dispatch({ [`$${key}`]: label }), [label]);
1414

15-
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
15+
return (
16+
<Input
17+
type="password"
18+
placeholder="Password"
19+
autoComplete="on"
20+
index={2}
21+
{...elmProps}
22+
name={nameBase}
23+
keyname={key}
24+
/>
25+
);
1626
};
1727

1828
Password.displayName = 'Login.Password';

pages/page11/src/control/Username.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ export const Username: FC<UsernameProps> = (props) => {
1313
useEffect(() => dispatch({ [`$${key}`]: label }), [label]);
1414

1515
return (
16-
<Input placeholder="Username" autoComplete="on" spellCheck={false} {...elmProps} name={nameBase} keyname={key} />
16+
<Input
17+
placeholder="Username"
18+
autoComplete="on"
19+
spellCheck={false}
20+
index={1}
21+
{...elmProps}
22+
name={nameBase}
23+
keyname={key}
24+
/>
1725
);
1826
};
1927

pages/page2/src/control/Email.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const Email: FC<EmailProps> = (props) => {
1010
if (!elmProps.children) {
1111
elmProps.children = EmailIcon;
1212
}
13-
return <Input placeholder="Email" spellCheck={false} {...elmProps} type="email" name={nameBase} keyname={key} />;
13+
return (
14+
<Input placeholder="Email" spellCheck={false} index={1} {...elmProps} type="email" name={nameBase} keyname={key} />
15+
);
1416
};
1517

1618
Email.displayName = 'Login.Email';

0 commit comments

Comments
 (0)