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

fix: 修复编辑表的输入框未回填格式化后的数据 close #2528 #2549

Merged
merged 8 commits into from
Feb 23, 2024

Conversation

lijinke666
Copy link
Member

@lijinke666 lijinke666 commented Feb 18, 2024

👀 PR includes

🐛 Bugfix

📝 Description

  1. 修复输入框未展示格式化的值, 并简单重构了下相关代码.

image

- const [inputVal, setInputVal] = useState(cell.getMeta().fieldValue);
+ const [inputVal, setInputVal] = React.useState(() => cell.getFieldValue());
  1. 修复编辑时光标不再在文本末尾的问题.
  2. 修复编辑完成后, 数值被重复格式化的问题.
  3. 增加 onDataCellEditStart, 同时 onDataCellEditStartonDataCellEditEnd 增加第二个参数 cell

🖼️ Screenshot

Before After

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Feb 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Feb 23, 2024 7:18am

Copy link
Contributor

github-actions bot commented Feb 18, 2024

你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。

Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it.

Copy link
Contributor

github-actions bot commented Feb 18, 2024

Size Change: -458 B (0%)

Total Size: 7.93 MB

Filename Size Change
./packages/s2-core/dist/index.min.js 181 kB +17 B (0%)
./packages/s2-react/dist/index.min.js 67.1 kB -526 B (-1%)
./packages/s2-react/node_modules/@antv/s2/dist/index.min.js 181 kB +17 B (0%)
./packages/s2-shared/node_modules/@antv/s2/dist/index.min.js 181 kB +17 B (0%)
./packages/s2-vue/node_modules/@antv/s2/dist/index.min.js 181 kB +17 B (0%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 389 B
./packages/s2-core/node_modules/@antv/g-canvas/dist/g.min.js 61.4 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js 22.1 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js 21.5 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js 86.6 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.umd.min.js 48.6 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/config.js 1.15 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/DOMElementFilter.js 1.85 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/event-map.js 1.19 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/events.js 1.54 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/get-node-text.js 298 B
./packages/s2-core/node_modules/@testing-library/dom/dist/get-queries-for-element.js 737 B
./packages/s2-core/node_modules/@testing-library/dom/dist/get-user-code-frame.js 805 B
./packages/s2-core/node_modules/@testing-library/dom/dist/helpers.js 1.09 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/index.js 1.14 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/label-helpers.js 1.05 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/matches.js 1.14 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/pretty-dom.js 1.72 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/all-utils.js 337 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/alt-text.js 571 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/display-value.js 711 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/index.js 418 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/label-text.js 1.79 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/placeholder-text.js 490 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/role.js 2.66 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/test-id.js 497 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/text.js 1.02 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/title.js 716 B
./packages/s2-core/node_modules/@testing-library/dom/dist/query-helpers.js 1.8 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/role-helpers.js 2.83 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/screen.js 1.64 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/suggestions.js 1.5 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/wait-for-element-to-be-removed.js 738 B
./packages/s2-core/node_modules/@testing-library/dom/dist/wait-for.js 2.36 kB
./packages/s2-core/node_modules/d3-dsv/dist/d3-dsv.js 2.3 kB
./packages/s2-core/node_modules/d3-dsv/dist/d3-dsv.min.js 1.52 kB
./packages/s2-core/node_modules/d3-interpolate/dist/d3-interpolate.js 4.53 kB
./packages/s2-core/node_modules/d3-interpolate/dist/d3-interpolate.min.js 3.19 kB
./packages/s2-core/node_modules/d3-timer/dist/d3-timer.js 1.45 kB
./packages/s2-core/node_modules/d3-timer/dist/d3-timer.min.js 919 B
./packages/s2-core/node_modules/tinycolor2/dist/tinycolor-min.js 5.45 kB
./packages/s2-react/dist/style.min.css 3.43 kB
./packages/s2-react/node_modules/@ant-design/icons/dist/index.umd.js 201 kB
./packages/s2-react/node_modules/@ant-design/icons/dist/index.umd.min.js 170 kB
./packages/s2-react/node_modules/@antv/g-canvas/dist/g.min.js 61.4 kB
./packages/s2-react/node_modules/@antv/s2/dist/style.min.css 389 B
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.cjs.js 4.28 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.esm.js 3.9 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.cjs.js 3.98 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.esm.js 3.59 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.js 74.6 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.min.js 39 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.umd.js 74.9 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.umd.min.js 39.1 kB
./packages/s2-react/node_modules/@testing-library/react/dist/act-compat.js 1.86 kB
./packages/s2-react/node_modules/@testing-library/react/dist/fire-event.js 853 B
./packages/s2-react/node_modules/@testing-library/react/dist/index.js 634 B
./packages/s2-react/node_modules/@testing-library/react/dist/pure.js 2.06 kB
./packages/s2-react/node_modules/ahooks/dist/ahooks.js 32.1 kB
./packages/s2-react/node_modules/antd/dist/antd-with-locales.js 765 kB
./packages/s2-react/node_modules/antd/dist/antd-with-locales.min.js 347 kB
./packages/s2-react/node_modules/antd/dist/antd.compact.css 72.3 kB
./packages/s2-react/node_modules/antd/dist/antd.compact.min.css 67.8 kB
./packages/s2-react/node_modules/antd/dist/antd.css 72.3 kB
./packages/s2-react/node_modules/antd/dist/antd.dark.css 73.6 kB
./packages/s2-react/node_modules/antd/dist/antd.dark.min.css 69.1 kB
./packages/s2-react/node_modules/antd/dist/antd.js 691 kB
./packages/s2-react/node_modules/antd/dist/antd.min.css 67.8 kB
./packages/s2-react/node_modules/antd/dist/antd.min.js 292 kB
./packages/s2-react/node_modules/antd/dist/antd.variable.css 77.2 kB
./packages/s2-react/node_modules/antd/dist/antd.variable.min.css 68.4 kB
./packages/s2-react/node_modules/antd/dist/compact-theme.js 120 B
./packages/s2-react/node_modules/antd/dist/dark-theme.js 118 B
./packages/s2-react/node_modules/antd/dist/default-theme.js 7.72 kB
./packages/s2-react/node_modules/antd/dist/theme.js 4.29 kB
./packages/s2-react/node_modules/antd/dist/variable-theme.js 122 B
./packages/s2-react/node_modules/d3-dsv/dist/d3-dsv.js 2.3 kB
./packages/s2-react/node_modules/d3-dsv/dist/d3-dsv.min.js 1.52 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.cjs.js 45.8 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js 45.6 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.js 73.6 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.min.js 31.4 kB
./packages/s2-react/node_modules/vite-plugin-svgr/dist/index.js 823 B
./packages/s2-shared/node_modules/@antv/s2/dist/style.min.css 389 B
./packages/s2-vue/dist/index.min.js 20.3 kB
./packages/s2-vue/dist/style.min.css 1.68 kB
./packages/s2-vue/node_modules/@antv/s2/dist/style.min.css 389 B
./packages/s2-vue/node_modules/@testing-library/vue/dist/fire-event.js 1.4 kB
./packages/s2-vue/node_modules/@testing-library/vue/dist/index.js 586 B
./packages/s2-vue/node_modules/@testing-library/vue/dist/render.js 1.57 kB
./packages/s2-vue/node_modules/@vue/shared/dist/shared.cjs.js 7.86 kB
./packages/s2-vue/node_modules/@vue/shared/dist/shared.cjs.prod.js 7.85 kB
./packages/s2-vue/node_modules/@vue/shared/dist/shared.esm-bundler.js 7.63 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd-with-locales.js 742 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd-with-locales.min.js 365 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.compact.css 72.9 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.compact.min.css 66 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.css 72.9 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.dark.css 74.2 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.dark.min.css 67.2 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.js 676 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.min.css 66 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.min.js 316 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.variable.css 78.5 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.variable.min.css 66.6 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/compact-theme.js 120 B
./packages/s2-vue/node_modules/ant-design-vue/dist/dark-theme.js 118 B
./packages/s2-vue/node_modules/ant-design-vue/dist/default-theme.js 7.63 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/theme.js 4.24 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/variable-theme.js 122 B
./packages/s2-vue/node_modules/vue/dist/vue.cjs.js 1.01 kB
./packages/s2-vue/node_modules/vue/dist/vue.cjs.prod.js 817 B
./packages/s2-vue/node_modules/vue/dist/vue.esm-browser.js 106 kB
./packages/s2-vue/node_modules/vue/dist/vue.esm-browser.prod.js 51 kB
./packages/s2-vue/node_modules/vue/dist/vue.esm-bundler.js 915 B
./packages/s2-vue/node_modules/vue/dist/vue.global.js 106 kB
./packages/s2-vue/node_modules/vue/dist/vue.global.prod.js 49.9 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.esm-browser.js 72.5 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.esm-browser.prod.js 33.3 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.esm-bundler.js 306 B
./packages/s2-vue/node_modules/vue/dist/vue.runtime.global.js 73.9 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.global.prod.js 33.1 kB

compressed-size-action

Copy link

codecov bot commented Feb 18, 2024

Codecov Report

Attention: Patch coverage is 40.62500% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 77.64%. Comparing base (1adc25d) to head (9d80225).
Report is 133 commits behind head on master.

Files Patch % Lines
...mponents/sheets/editable-sheet/edit-cell/index.tsx 26.08% 12 Missing and 5 partials ⚠️
packages/s2-core/src/cell/data-cell.ts 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2549      +/-   ##
==========================================
+ Coverage   76.48%   77.64%   +1.15%     
==========================================
  Files         240      249       +9     
  Lines       12312    11992     -320     
  Branches     2630     2367     -263     
==========================================
- Hits         9417     9311     -106     
+ Misses       1377     1183     -194     
+ Partials     1518     1498      -20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added the 🚨 test failed 单元测试挂了 label Feb 23, 2024
wjgogogo
wjgogogo previously approved these changes Feb 23, 2024
@lijinke666 lijinke666 merged commit 8d9c5b2 into master Feb 23, 2024
9 of 11 checks passed
@lijinke666 lijinke666 deleted the fix-2528 branch February 23, 2024 08:10
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-v1.54.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-react-v1.46.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

lijinke666 added a commit that referenced this pull request Feb 26, 2024
* fix: 修复编辑表的输入框未回填格式化后的数据 close #2528

* fix: 修复循环引用

* fix: 编辑后不应该再次格式化

* fix: 移除定义

* test: 修复单测

* test: 增加单测
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants