mirror of
https://github.com/apache/superset.git
synced 2026-04-27 20:14:54 +00:00
refactor(ProgressBar): Upgrade ProgressBar to Antd 5 (#29666)
(cherry picked from commit 3de2b7c989)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { AntdThemeProvider } from 'src/components/AntdThemeProvider';
|
||||
import ProgressBar, { ProgressBarProps } from '.';
|
||||
|
||||
export default {
|
||||
@@ -24,32 +25,39 @@ export default {
|
||||
};
|
||||
|
||||
export const InteractiveProgressBar = (args: ProgressBarProps) => (
|
||||
<ProgressBar {...args} />
|
||||
<AntdThemeProvider>
|
||||
<ProgressBar {...args} type="line" />
|
||||
</AntdThemeProvider>
|
||||
);
|
||||
|
||||
InteractiveProgressBar.args = {
|
||||
export const InteractiveProgressCircle = (args: ProgressBarProps) => (
|
||||
<AntdThemeProvider>
|
||||
<ProgressBar {...args} type="circle" />
|
||||
</AntdThemeProvider>
|
||||
);
|
||||
|
||||
export const InteractiveProgressDashboard = (args: ProgressBarProps) => (
|
||||
<AntdThemeProvider>
|
||||
<ProgressBar {...args} type="dashboard" />
|
||||
</AntdThemeProvider>
|
||||
);
|
||||
|
||||
const commonArgs = {
|
||||
striped: true,
|
||||
percent: 90,
|
||||
showInfo: true,
|
||||
status: 'normal',
|
||||
strokeColor: '#FF0000',
|
||||
trailColor: '#000',
|
||||
strokeLinecap: 'round',
|
||||
type: 'line',
|
||||
};
|
||||
|
||||
InteractiveProgressBar.argTypes = {
|
||||
status: {
|
||||
control: {
|
||||
type: 'select',
|
||||
},
|
||||
options: ['normal', 'success', 'exception', 'active'],
|
||||
},
|
||||
const commonArgTypes = {
|
||||
strokeLinecap: {
|
||||
control: {
|
||||
type: 'select',
|
||||
},
|
||||
options: ['round', 'square'],
|
||||
options: ['round', 'butt', 'square'],
|
||||
},
|
||||
type: {
|
||||
control: {
|
||||
@@ -58,3 +66,26 @@ InteractiveProgressBar.argTypes = {
|
||||
options: ['line', 'circle', 'dashboard'],
|
||||
},
|
||||
};
|
||||
|
||||
InteractiveProgressBar.args = {
|
||||
...commonArgs,
|
||||
status: 'normal',
|
||||
};
|
||||
|
||||
InteractiveProgressBar.argTypes = {
|
||||
...commonArgTypes,
|
||||
status: {
|
||||
control: {
|
||||
type: 'select',
|
||||
},
|
||||
options: ['normal', 'success', 'exception', 'active'],
|
||||
},
|
||||
};
|
||||
|
||||
InteractiveProgressCircle.args = commonArgs;
|
||||
|
||||
InteractiveProgressCircle.argTypes = commonArgTypes;
|
||||
|
||||
InteractiveProgressDashboard.args = commonArgs;
|
||||
|
||||
InteractiveProgressDashboard.argTypes = commonArgTypes;
|
||||
|
||||
Reference in New Issue
Block a user