Skip to content
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

Merged
merged 3 commits into from Mar 18, 2022

Conversation

jajugoguma
Copy link
Contributor

@jajugoguma jajugoguma commented Mar 18, 2022

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

  • Added the feature that is instant applying of built-in editor.
    • It works only for built-in select, checkbox(radio), datePicker editor.
    • For use this, pass the instantApply option to true in property of options of editor of column.
    • If use it, apply new value by clicking a new value in the dropdown layer of built-in editor.

Before use it

After use it


Thank you for your contribution to TOAST UI product. ๐ŸŽ‰ ๐Ÿ˜˜ โœจ

Copy link

@adhrinae adhrinae left a 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

packages/toast-ui.grid/cypress/integration/editor.spec.ts Outdated Show resolved Hide resolved
Copy link

@lja1018 lja1018 left a 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฃผ์„์ฒ˜๋ฆฌ ์—†์ธ ๋ฃฐ ๋งŒ์กฑ์ด ์•ˆ๋˜๋‚˜์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„ต, ๊ธฐ์กด์— ๋‹ค๋ฅธ ๋ถ€๋ถ„์—์„œ๋Š” ์–ด๋–ป๊ฒŒ ์‚ฌ์šฉํ–ˆ๋‚˜ ๋ดค๋”๋‹ˆ ์ฃผ์„์ฒ˜๋ฆฌ ํ•ด์„œ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค...

@jajugoguma jajugoguma merged commit dea1811 into master Mar 18, 2022
@jajugoguma jajugoguma deleted the feat/instant-applying-of-editing branch March 24, 2022 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants