Skip to content

Commit

Permalink
feat(yunti-ui): change Button design view
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Jul 9, 2024
1 parent 04ed62f commit 8f13194
Show file tree
Hide file tree
Showing 10 changed files with 994 additions and 1,118 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"devDependencies": {
"@types/react": "^17",
"@types/react-dom": "^17",
"@yuntijs/lint": "^1.5.1",
"@yuntijs/lint": "^1.7.0",
"commitlint": "^18",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@alilc/lowcode-utils": "^1.2.5",
"@types/lodash": "^4.14.200",
"@yunti/lowcode-plugin-code-generator": "^2.3.0",
"antd": "^5.10.3",
"antd": "^5.19.1",
"lodash": "^4.17.21"
},
"publishConfig": {
Expand Down
6 changes: 6 additions & 0 deletions packages/shared/src/setters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export const Setters = {
StringSetter: {
componentName: 'StringSetter',
},
/**
* 国际化文本设置器,不可换行
*/
I18nSetter: {
componentName: 'I18nSetter',
},
/**
* 数值型数据设置器
*/
Expand Down
19 changes: 19 additions & 0 deletions packages/yunti-ui-lowcode-materials/lowcode/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Button as OriginalButton, ButtonProps as OriginalButtonProps } from '@yuntijs/ui';
import React, { useMemo } from 'react';

export interface ButtonProps extends OriginalButtonProps {
__designMode?: string;
}

export const Button: React.FC<ButtonProps> = ({ __designMode, ...props }) => {
const designProps = useMemo(() => {
return {
href: __designMode === 'design' ? undefined : props.href,
};
}, [__designMode, props.href]);

if (props.disabled) {
return <OriginalButton {...props} {...designProps} />;
}
return <OriginalButton {...props} {...designProps} />;
};
Loading

0 comments on commit 8f13194

Please sign in to comment.