Skip to content

Commit

Permalink
fix: fix field order issue. #12
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Feb 26, 2024
1 parent a625923 commit 2c70d7e
Show file tree
Hide file tree
Showing 25 changed files with 115 additions and 15 deletions.
12 changes: 11 additions & 1 deletion pages/base/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ export const Password: FC<InputProps> = (props) => {
const { keyname = 'password', name, rename, ...elmProps } = props;
const nameBase = name || rename || keyname;
const key = (keyname || name) as string;
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
return (
<Input
type="password"
placeholder="Password"
index={2}
autoComplete="on"
{...elmProps}
name={nameBase}
keyname={key}
/>
);
};

Password.displayName = 'BaseLogin.Password';
2 changes: 1 addition & 1 deletion pages/base/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const Username: FC<InputProps> = (props) => {
const { keyname = 'username', name, rename, ...elmProps } = props;
const nameBase = name || rename || keyname;
const key = (keyname || name) as string;
return <Input placeholder="Username" spellCheck={false} {...elmProps} name={nameBase} keyname={key} />;
return <Input placeholder="Username" spellCheck={false} index={1} {...elmProps} name={nameBase} keyname={key} />;
};

Username.displayName = 'BaseLogin.Username';
12 changes: 11 additions & 1 deletion pages/page1/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ export const Password: FC<InputProps> = (props) => {
const { keyname = 'password', name, rename, ...elmProps } = props;
const nameBase = name || rename || keyname;
const key = (keyname || name) as string;
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
return (
<Input
type="password"
index={2}
placeholder="Password"
autoComplete="on"
{...elmProps}
name={nameBase}
keyname={key}
/>
);
};

Password.displayName = 'Login.Password';
2 changes: 1 addition & 1 deletion pages/page1/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const Username: FC<InputProps> = (props) => {
const { keyname = 'username', name, rename, ...elmProps } = props;
const nameBase = name || rename || keyname;
const key = (keyname || name) as string;
return <Input type="password" placeholder="Password" {...elmProps} name={nameBase} keyname={key} />;
return <Input type="text" index={1} placeholder="Username" {...elmProps} name={nameBase} keyname={key} />;
};

Username.displayName = 'Login.Username';
1 change: 1 addition & 0 deletions pages/page1/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const RenderLogin = () => {
{fields
.sort((a, b) => a.index - b.index)
.map((item, idx) => {
console.log('item', item);
if (!item.children) return null;
return <label key={item.name + idx}>{item.children}</label>;
})}
Expand Down
1 change: 1 addition & 0 deletions pages/page10/src/control/login/Email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const Email: FC<EmailProps> = memo((props) => {
placeholder="Your Email"
spellCheck={false}
visible={visible}
index={1}
{...elmProps}
name={nameBase}
keyname={`$$${panel}${key}`}
Expand Down
1 change: 1 addition & 0 deletions pages/page10/src/control/login/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
type="password"
placeholder="Your Password"
autoComplete="on"
index={1}
{...elmProps}
name={nameBase}
visible={visible}
Expand Down
12 changes: 11 additions & 1 deletion pages/page11/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ export const Password: FC<PasswordProps> = (props) => {
const { dispatch } = useStore();
useEffect(() => dispatch({ [`$${key}`]: label }), [label]);

return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
return (
<Input
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={nameBase}
keyname={key}
/>
);
};

Password.displayName = 'Login.Password';
10 changes: 9 additions & 1 deletion pages/page11/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ export const Username: FC<UsernameProps> = (props) => {
useEffect(() => dispatch({ [`$${key}`]: label }), [label]);

return (
<Input placeholder="Username" autoComplete="on" spellCheck={false} {...elmProps} name={nameBase} keyname={key} />
<Input
placeholder="Username"
autoComplete="on"
spellCheck={false}
index={1}
{...elmProps}
name={nameBase}
keyname={key}
/>
);
};

Expand Down
4 changes: 3 additions & 1 deletion pages/page2/src/control/Email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const Email: FC<EmailProps> = (props) => {
if (!elmProps.children) {
elmProps.children = EmailIcon;
}
return <Input placeholder="Email" spellCheck={false} {...elmProps} type="email" name={nameBase} keyname={key} />;
return (
<Input placeholder="Email" spellCheck={false} index={1} {...elmProps} type="email" name={nameBase} keyname={key} />
);
};

Email.displayName = 'Login.Email';
12 changes: 11 additions & 1 deletion pages/page2/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ export const Password: FC<PasswordProps> = (props) => {
if (!elmProps.children) {
elmProps.children = LockIcon;
}
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
return (
<Input
type="password"
placeholder="Password"
index={2}
autoComplete="on"
{...elmProps}
name={nameBase}
keyname={key}
/>
);
};

Password.displayName = 'Login.Password';
4 changes: 3 additions & 1 deletion pages/page3/src/control/Email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const Email: FC<EmailProps> = memo((props) => {

useEffect(() => dispatch({ [`$${key}`]: label }), [label]);

return <Input type="email" placeholder="Email" spellCheck={false} {...elmProps} name={nameBase} keyname={key} />;
return (
<Input type="email" placeholder="Email" index={1} spellCheck={false} {...elmProps} name={nameBase} keyname={key} />
);
});

Email.displayName = 'Login.Email';
1 change: 1 addition & 0 deletions pages/page3/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={name || rename || keyname}
keyname={key}
Expand Down
1 change: 1 addition & 0 deletions pages/page4/src/control/Email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const Email: FC<EmailProps> = memo((props) => {
type="email"
placeholder="Email"
spellCheck={false}
index={1}
{...elmProps}
name={name || rename || keyname}
keyname={key}
Expand Down
1 change: 1 addition & 0 deletions pages/page4/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={name || rename || keyname}
keyname={key}
Expand Down
1 change: 1 addition & 0 deletions pages/page5/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const Password: FC<InputProps> = (props) => {
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={name || rename || keyname}
keyname={key}
Expand Down
9 changes: 8 additions & 1 deletion pages/page5/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ export const Username: FC<InputProps> = (props) => {
const { keyname = 'email', name, rename, ...elmProps } = props;
const key = (keyname || name) as string;
return (
<Input placeholder="Username" spellCheck={false} {...elmProps} name={name || rename || keyname} keyname={key} />
<Input
placeholder="Username"
spellCheck={false}
index={1}
{...elmProps}
name={name || rename || keyname}
keyname={key}
/>
);
};

Expand Down
1 change: 1 addition & 0 deletions pages/page6/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={name || rename || keyname}
keyname={key}
Expand Down
9 changes: 8 additions & 1 deletion pages/page6/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ export const Username: FC<UsernameProps> = memo((props) => {
useEffect(() => dispatch({ [`$${key}`]: label }), [label]);

return (
<Input placeholder="Username" spellCheck={false} {...elmProps} name={name || rename || keyname} keyname={key} />
<Input
placeholder="Username"
spellCheck={false}
index={1}
{...elmProps}
name={name || rename || keyname}
keyname={key}
/>
);
});

Expand Down
1 change: 1 addition & 0 deletions pages/page7/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={name || rename || keyname}
keyname={key}
Expand Down
9 changes: 8 additions & 1 deletion pages/page7/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ export const Username: FC<UsernameProps> = memo((props) => {
useEffect(() => dispatch({ [`$${key}`]: label }), [label]);

return (
<Input placeholder="Username" spellCheck={false} {...elmProps} name={name || rename || keyname} keyname={key} />
<Input
placeholder="Username"
spellCheck={false}
index={1}
{...elmProps}
name={name || rename || keyname}
keyname={key}
/>
);
});

Expand Down
1 change: 1 addition & 0 deletions pages/page8/src/control/login/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const Password: FC<PasswordProps> = memo((props) => {
type="password"
placeholder="Password"
autoComplete="on"
index={2}
{...elmProps}
name={nameBase}
keyname={`$$${panelName}${key}`}
Expand Down
9 changes: 8 additions & 1 deletion pages/page8/src/control/login/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ export const Username: FC<UsernameProps> = memo((props) => {
const nameBase = name || rename || keyname;

return (
<Input placeholder="Username" spellCheck={false} {...elmProps} name={nameBase} keyname={`$$${panelName}${key}`} />
<Input
placeholder="Username"
spellCheck={false}
index={1}
{...elmProps}
name={nameBase}
keyname={`$$${panelName}${key}`}
/>
);
});

Expand Down
12 changes: 11 additions & 1 deletion pages/page9/src/control/Password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ export const Password: FC<InputProps> = (props) => {
const { keyname = 'password', name, ...elmProps } = props;
const nameBase = name || keyname;
const key = (keyname || name) as string;
return <Input type="password" placeholder="Password" autoComplete="on" {...elmProps} name={nameBase} keyname={key} />;
return (
<Input
type="password"
placeholder="Password"
index={2}
autoComplete="on"
{...elmProps}
name={nameBase}
keyname={key}
/>
);
};

Password.displayName = 'BaseLogin.Password';
2 changes: 1 addition & 1 deletion pages/page9/src/control/Username.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const Username: FC<InputProps> = (props) => {
const { keyname = 'username', name, ...elmProps } = props;
const nameBase = name || keyname;
const key = (keyname || name) as string;
return <Input placeholder="Username" spellCheck={false} {...elmProps} name={nameBase} keyname={key} />;
return <Input placeholder="Username" spellCheck={false} index={1} {...elmProps} name={nameBase} keyname={key} />;
};

Username.displayName = 'BaseLogin.Username';

0 comments on commit 2c70d7e

Please sign in to comment.