Skip to content

Commit

Permalink
chore: sync develop
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Jun 6, 2023
1 parent 8759d42 commit afb1d9e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/color-picker/color-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default defineComponent({
clearable={this.clearable}
input-props={this.inputProps}
handleTriggerChange={this.setInnerValue}
size={this.size}
/>,
)}
</div>
Expand Down
15 changes: 14 additions & 1 deletion src/color-picker/trigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Color } from './utils';
import { TdColorPickerProps } from './type';
import { useBaseClassName } from './hooks';
import { TdColorHandler } from './interfaces';
import useCommonClassName from '../hooks/useCommonClassName';

export default defineComponent({
name: 'DefaultTrigger',
Expand Down Expand Up @@ -38,10 +39,15 @@ export default defineComponent({
type: Boolean,
default: false,
},
size: {
type: String as PropType<TdColorPickerProps['size']>,
default: 'medium',
},
},
setup(props) {
const baseClassName = useBaseClassName();
const value = ref(props.color);
const { sizeClassNames } = useCommonClassName();

watch(
() => [props.color],
Expand All @@ -64,6 +70,7 @@ export default defineComponent({
baseClassName,
value,
handleChange,
sizeClassNames,
};
},

Expand All @@ -73,7 +80,12 @@ export default defineComponent({
label: () => (
<div class={[`${baseClassName}__trigger--default__color`, `${baseClassName}--bg-alpha`]}>
<span
class={['color-inner']}
class={[
'color-inner',
{
[this.sizeClassNames[this.size]]: this.size !== 'medium',
},
]}
style={{
background: this.value,
}}
Expand All @@ -94,6 +106,7 @@ export default defineComponent({
...this.inputProps,
},
}}
size={this.size}
/>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/dropdown/__tests__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ describe('Dropdown', () => {
},
});

console.log(wrapper);
expect(wrapper.find('.t-divider').element.parentElement.textContent).toBe(options[1].content);
});

Expand Down
2 changes: 1 addition & 1 deletion src/input-number/__tests__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ describe('InputNumber', () => {
const fn = vi.fn();
const wrapper = mount({
render() {
return <InputNumber onKeyup={fn} />;
return <InputNumber on={{ keyup: fn }} />;
},
});
const inputWrapper = wrapper.findComponent(InputNumber);
Expand Down

0 comments on commit afb1d9e

Please sign in to comment.