-
Notifications
You must be signed in to change notification settings - Fork 132
feat(resetsetter): 重置属性setter #77
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { IconProps, SVGIcon } from '@alilc/lowcode-utils'; | ||
|
||
export function ResetIcon(props: IconProps) { | ||
return ( | ||
<SVGIcon viewBox="0 0 1024 1024" {...props}> | ||
<path d="M193.070545 70.353455l5.422546 0.930909A34.909091 34.909091 0 0 1 226.862545 111.709091l-0.023272 0.069818-12.869818 72.541091a448.698182 448.698182 0 0 1 293.888-108.939636c246.830545 0 447.022545 197.911273 447.022545 442.181818s-200.192 442.181818-447.022545 442.181818c-160.186182 0-305.687273-84.084364-385.466182-218.158545a37.794909 37.794909 0 0 1 13.358545-51.921455 38.167273 38.167273 0 0 1 52.154182 13.288727c66.210909 111.243636 186.903273 180.992 319.953455 180.992 204.869818 0 370.850909-164.096 370.850909-366.382545S712.727273 151.179636 507.857455 151.179636c-107.287273 0-206.801455 45.265455-276.317091 121.995637h141.498181a34.909091 34.909091 0 0 1 0 69.818182h-209.454545c-2.606545 0-5.189818-0.279273-7.656727-0.837819a34.629818 34.629818 0 0 1-5.259637-0.512l-5.422545-0.930909a34.909091 34.909091 0 0 1-28.346182-40.494545L152.669091 98.629818a34.909091 34.909091 0 0 1 40.401454-28.276363z" /> | ||
</SVGIcon> | ||
); | ||
} | ||
ResetIcon.displayName = 'Reset'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,3 +70,7 @@ | |
transform: none; | ||
} | ||
} | ||
|
||
.lc-setter-mixed.lc-setter-mixeds { | ||
margin-right: 46px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* write style here */ | ||
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. 这个文件是不是可以删掉 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. 可以删除的,我把他和variable-setter的一块删除了吧 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { PureComponent } from 'react'; | ||
import './index.less'; | ||
import { intlNode } from '../mixed-setter/locale'; | ||
|
||
export default class SetterReset extends PureComponent { | ||
static displayName = 'ResetSetter'; | ||
static isPopup = true; | ||
|
||
render() { | ||
const tipContext = intlNode('Reset Attribute'); | ||
|
||
// return <a onClick={ this.resetIconClickHandler }> {tipContext} </a>; | ||
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. 这里的注释去掉。 |
||
return <a > {tipContext} </a>; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { IconProps, SVGIcon } from '@alilc/lowcode-utils'; | ||
|
||
export function ResetIcon(props: IconProps) { | ||
return ( | ||
<SVGIcon viewBox="0 0 1024 1024" {...props}> | ||
<path d="M193.070545 70.353455l5.422546 0.930909A34.909091 34.909091 0 0 1 226.862545 111.709091l-0.023272 0.069818-12.869818 72.541091a448.698182 448.698182 0 0 1 293.888-108.939636c246.830545 0 447.022545 197.911273 447.022545 442.181818s-200.192 442.181818-447.022545 442.181818c-160.186182 0-305.687273-84.084364-385.466182-218.158545a37.794909 37.794909 0 0 1 13.358545-51.921455 38.167273 38.167273 0 0 1 52.154182 13.288727c66.210909 111.243636 186.903273 180.992 319.953455 180.992 204.869818 0 370.850909-164.096 370.850909-366.382545S712.727273 151.179636 507.857455 151.179636c-107.287273 0-206.801455 45.265455-276.317091 121.995637h141.498181a34.909091 34.909091 0 0 1 0 69.818182h-209.454545c-2.606545 0-5.189818-0.279273-7.656727-0.837819a34.629818 34.629818 0 0 1-5.259637-0.512l-5.422545-0.930909a34.909091 34.909091 0 0 1-28.346182-40.494545L152.669091 98.629818a34.909091 34.909091 0 0 1 40.401454-28.276363z" /> | ||
</SVGIcon> | ||
); | ||
} | ||
ResetIcon.displayName = 'Reset'; |
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.
这块的逻辑,可以在PR里面补充一些截图吗?我想看看交互/逻辑上要不要优化。
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.
ResetSetter不会单独存在,两个setter的时候resetset在最后面。大于两个了前面是切换setter后面是resetsetter

一开始想把resetsetter合到切换setter中,但是重置的时候使用不方便,但是放两个图标有的不开启resetsetter又不太好看
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.
都超过2个了这种ui看着还凑合

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.
这种场景下展示的效果呢?
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.
另外,这里没有重置按钮吗?
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.
可以开启全局,我看一下这里的效果。
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.
之前那个截图就是开启了全局的

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.
开启全局会影响这个地方吗?
我觉得不影响比较好。重置的时候,清空变量绑定,并将值还原。
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.
嗯,那就按你说的这个逻辑我改一下。在有三个setter并且有variable和reset setter时,最后一个位置放resetsetter,倒数第二个放variableSetter。如果没有variableSetter第二个位置就是switchAction。
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.
如果没有variableSetter,就直接放 reset setter 就好。