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
feat: instant applying of built-in editor #1611
Conversation
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.
์ง๊ธ์ ๋จ๋ฐ์ฑ์ผ๋ก ํ์ํ ๋ถ๋ถ์๋ง ๊ธฐ๋ฅ์ ์ถ๊ฐํ ๊ฒ์ ์ง๋์ง ์์์ ์ ํ ์ถ์ํ๊ฐ ๋์ด์์ง ์๋ค์.
instantApply
์์ฑ์ด ์ ์ฉ๋ ๊ฐ๋ฅ์ฑ์ด ์๋ ๋ชจ๋์ ๊ฒฝ์ฐ ๊ทธ ์์ฑ์ ๊ฐ์ง ์ ์๋๋ก ๊ณตํต๋ ์ธํฐํ์ด์ค๋ฅผ ์ถ์ถํด์ ๋ง๋ ๋ค ์ด ์ต์
์ ์ ์ฉํด์ผ ํ๋ ํด๋์ค๊ฐ implements
ํค์๋๋ฅผ ํตํด ์ธํฐํ์ด์ค๋ฅผ ์ฐ๋๋ก ๊ฐ์ ํ๋๊ฒ ์ข๊ฒ ์ด์.
interface InstantlyAppliable {
instantApplyCallback: Function | null;
}
// ...
class CheckboxEditor implements CellEditor, InstantlyAppliable {}
์๋๋ฉด ๋์ค์ ์๊ตฌ์ฌํญ์ ๋ฐ๋ผ ๊ฐ์ ์ต์ ์ ์ ์ฉํ๋ ๋ชจ๋์ด ์ถ๊ฐ๋ ์๋ ์๊ณ , ํด๋น ๊ธฐ๋ฅ์ ์ ์ฉํด์ผํ๋ ๋ชจ๋๋ค์ด ํต์ผ์ฑ์ ๊ฐ์ง๊ธฐ ๋๋ฌธ์ ์ฝ๋๋ฅผ ์ฝ๊ณ ์ ์ง๋ณด์ํ๋๊ฒ ์ฌ์์ง๋๊น์.
์ฐธ๊ณ ๋ก Function
์ ์ค์ ํ์
์ ๋ณด๋ฉด ๋๋ผ์ฐ๋ฆฌ๋ง์น ํจ์๋ ๋ณ๋ก ์๊ด์ด ์๋ค๋๊ฑธ ์ ์ ์์ด์. ๊ทธ๋์ ๊ฐ๊ธ์ ์ด๋ฉด ํจ์ ํ์
์ Function
์ ์ฐ์ง ๋ง๊ณ ์ง์ ์ ์ผ๋ก ํจ์ ์๊ทธ๋์ฒ๋ฅผ ๊ฐ์ง ํํ๋ก ์ง์ ํ์
์ ๋ง๋ค์ด ์ฐ๋๊ฒ ์ข์๊ฑฐ์์. ๊ฐ๋ น ์บ๋ฆฐ๋๋ ์ด๋ ๊ฒ ํ๊ณ ์์ต๋๋ค.
type AnyFunc = (...args: any[]) => any;
๊ทผ๋ฐ ๊ฐ๊ธ์ ์ด๋ฉด ํ์คํ void
์ธ ๊ฒฝ์ฐ๋ ๋ช
์๋ฅผ ํด์ฃผ๋๊ฒ ์ข์์. ๋ฆฌํด ํ์
์ด ์๋๊ฑฐ๋ก ์๋ชป ์ด์ฉํ ํ๋ฅ ์ด ์์ผ๋๊น์.
https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#callback-types
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.
๋ฆฌ๋ทฐ ์๋ฃํฉ๋๋ค.
@@ -119,6 +127,9 @@ export class CheckboxEditor implements CellEditor { | |||
private onChange = (ev: Event) => { | |||
const value = (ev.target as HTMLInputElement).value; | |||
this.setLabelClass(value); | |||
|
|||
// eslint-disable-next-line no-unused-expressions |
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.
๋ต, ๊ธฐ์กด์ ๋ค๋ฅธ ๋ถ๋ถ์์๋ ์ด๋ป๊ฒ ์ฌ์ฉํ๋ ๋ดค๋๋ ์ฃผ์์ฒ๋ฆฌ ํด์ ์ฌ์ฉํ๊ณ ์์์ต๋๋ค...
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
instantApply
option totrue
in property of options of editor of column.Before use it
After use it
Thank you for your contribution to TOAST UI product. ๐ ๐ โจ