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

Feature/color picker #1806

Merged
merged 2 commits into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_common
Submodule _common updated 168 files
24 changes: 12 additions & 12 deletions src/calendar/__tests__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
1 月
一月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1790,7 +1790,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
2 月
二月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1806,7 +1806,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
3 月
三月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1822,7 +1822,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
4 月
四月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1842,7 +1842,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
5 月
五月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1858,7 +1858,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
6 月
六月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1874,7 +1874,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
7 月
七月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1890,7 +1890,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
8 月
八月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1910,7 +1910,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
9 月
九月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1926,7 +1926,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
10 月
十月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1942,7 +1942,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
11 月
十一月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -1958,7 +1958,7 @@ exports[`Calendar > :props > :mode 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
12 月
十二月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand Down
6 changes: 2 additions & 4 deletions src/color-picker/panel/linear-gradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default defineComponent({
};

// 移动开始
const handleStart = (id: string, e: MouseEvent) => {
const handleStart = (id: string) => {
const rect = refSlider.value.getBoundingClientRect();
sliderRect.left = rect.left;
sliderRect.width = rect.width || GRADIENT_SLIDER_DEFAULT_WIDTH;
Expand All @@ -121,8 +121,6 @@ export default defineComponent({
}
isMoved.value = false;
isDragging.value = true;
e.preventDefault();
e.stopPropagation();
handleSelectedIdChange(id);
// 让slider获取焦点,以便键盘事件生效。
refSlider.value.focus();
Expand Down Expand Up @@ -260,7 +258,7 @@ export default defineComponent({
left,
}}
onClick={(e: MouseEvent) => e.stopPropagation()}
onMousedown={(e: MouseEvent) => this.handleStart(t.id, e)}
onMousedown={() => this.handleStart(t.id)}
>
<span class={['gradient-thumbs__item-inner', `${baseClassName}--bg-alpha`]}></span>
</li>
Expand Down
24 changes: 12 additions & 12 deletions test/snap/__snapshots__/csr.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12616,7 +12616,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
1 月
一月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12632,7 +12632,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
2 月
二月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12648,7 +12648,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
3 月
三月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12664,7 +12664,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
4 月
四月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12684,7 +12684,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
5 月
五月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12700,7 +12700,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
6 月
六月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12716,7 +12716,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
7 月
七月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12732,7 +12732,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
8 月
八月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12752,7 +12752,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
9 月
九月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12768,7 +12768,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
10 月
十月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12784,7 +12784,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
11 月
十一月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand All @@ -12800,7 +12800,7 @@ exports[`csr snapshot test > csr test ./src/calendar/_example/mode.vue 1`] = `
<div
class="t-calendar__table-body-cell-display"
>
12 月
十二月
</div>
<div
class="t-calendar__table-body-cell-content"
Expand Down
Loading