-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(form): [form] refactor form style #2196
Changes from 5 commits
ba63fad
7ba6f9b
4409116
2b14dcc
4219529
86133b4
47e4ebd
386c418
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
export default { | ||
icons: { | ||
validateIcon: '' | ||
}, | ||
state: { | ||
labelWidth: '100px', | ||
tooltipType: 'error' | ||
} | ||
}, | ||
hideRequiredAsterisk: false, | ||
messageType: '' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
export default { | ||
icons: { | ||
validateIcon: '' | ||
}, | ||
state: { | ||
labelWidth: '100px', | ||
tooltipType: 'error' | ||
} | ||
}, | ||
hideRequiredAsterisk: false, | ||
messageType: '' | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,13 +47,13 @@ export const computedAutoLabelWidth = | |
export const computedHideRequiredAsterisk = | ||
({ props, designConfig }: Pick<IFormRenderlessParams, 'props' | 'designConfig'>) => | ||
(): boolean => { | ||
return props.hideRequiredAsterisk ?? designConfig?.hideRequiredAsterisk ?? false | ||
return props.hideRequiredAsterisk ?? designConfig?.hideRequiredAsterisk ?? true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Impact of Changing Default Behavior for Hiding Required Asterisks Changing the default value of
🔗 Analysis chainVerify the impact of changing the default behavior for hiding required asterisks. The default behavior for To check the impact, run the following script: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for usages of hideRequiredAsterisk prop
rg --type vue 'hideRequiredAsterisk'
Length of output: 71 Script: #!/bin/bash
# Search for usages of hideRequiredAsterisk prop in TypeScript files
rg --type typescript 'hideRequiredAsterisk'
Length of output: 78 Script: #!/bin/bash
# Search for usages of hideRequiredAsterisk prop in TypeScript files
rg 'hideRequiredAsterisk' --glob '*.ts' --glob '*.tsx'
Length of output: 770 |
||
} | ||
|
||
export const computedValidateIcon = | ||
({ props, designConfig }: Pick<IFormRenderlessParams, 'props' | 'designConfig'>) => | ||
(): object | null => { | ||
return props.validateIcon ?? designConfig?.icons?.validateIcon ?? null | ||
return props.validateIcon ?? designConfig?.icons?.validateIcon ?? 'icon-error' | ||
} | ||
|
||
export const computedIsErrorInline = | ||
|
@@ -65,7 +65,7 @@ export const computedIsErrorInline = | |
if (typeof props.inlineMessage === 'boolean') { | ||
return props.inlineMessage | ||
} | ||
return designConfig?.messageType === 'inline' || false | ||
return designConfig?.messageType === 'inline' | ||
} | ||
|
||
export const computedIsErrorBlock = | ||
|
@@ -74,7 +74,10 @@ export const computedIsErrorBlock = | |
if (props.messageType) { | ||
return props.messageType === 'block' | ||
} | ||
return designConfig?.messageType === 'block' || false | ||
if (designConfig && Object.hasOwnProperty.call(designConfig, 'messageType')) { | ||
return designConfig.messageType === 'block' | ||
} | ||
return true | ||
} | ||
|
||
export const created = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Significant change in default behavior for
hide-required-asterisk
The default value for
hide-required-asterisk
has been changed fromfalse
totrue
. This means that by default, the red asterisk next to mandatory fields will now be hidden unless explicitly set tofalse
.The description update improves clarity and internationalization.
Please ensure that this change in default behavior is intentional and documented in the changelog, as it may affect existing implementations.
The updated description is clear and concise.