Skip to content

Commit 8475542

Browse files
committed
style: upload
1 parent 40a65d1 commit 8475542

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

components/typography/Base.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const isTextOverflowSupport = isStyleSupport('textOverflow');
3838

3939
export interface CopyConfig {
4040
text?: string;
41-
onCopy?: () => void;
41+
onCopy?: (event?: MouseEvent) => void;
4242
tooltip?: boolean;
4343
}
4444

@@ -248,7 +248,7 @@ const Base = defineComponent({
248248
state.copied = true;
249249
nextTick(() => {
250250
if (copyConfig.onCopy) {
251-
copyConfig.onCopy();
251+
copyConfig.onCopy(e);
252252
}
253253

254254
state.copyId = setTimeout(() => {
@@ -457,6 +457,7 @@ const Base = defineComponent({
457457
onCancel={onEditCancel}
458458
onEnd={onEnd}
459459
direction={direction.value}
460+
component={props.component}
460461
v-slots={{ enterIcon: slots.editableEnterIcon }}
461462
/>
462463
);
@@ -517,7 +518,6 @@ const Base = defineComponent({
517518
'keyboard',
518519
'onUpdate:content',
519520
]);
520-
521521
const cssEllipsis = canUseCSSEllipsis.value;
522522
const cssTextOverflow = rows === 1 && cssEllipsis;
523523
const cssLineClamp = rows && rows > 1 && cssEllipsis;

components/typography/Editable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const editableProps = () => ({
1818
onChange: Function as PropType<(val: string) => void>,
1919
originContent: String,
2020
direction: String as PropType<Direction>,
21+
component: String,
2122
});
2223
export type EditableProps = Partial<ExtractPropTypes<ReturnType<typeof editableProps>>>;
2324
const Editable = defineComponent({
@@ -112,6 +113,7 @@ const Editable = defineComponent({
112113
[`${props.prefixCls}`]: true,
113114
[`${props.prefixCls}-edit-content`]: true,
114115
[`${props.prefixCls}-rtl`]: props.direction === 'rtl',
116+
[props.component ? `${props.prefixCls}-${props.component}` : '']: true,
115117
}));
116118
return () => (
117119
<div class={textAreaClassName.value}>

components/typography/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Basic text writing, including headings, body text, lists, and more.
8181
```json
8282
{
8383
text: string,
84-
onCopy: function,
84+
onCopy: function(event),
8585
tooltip: false,
8686
}
8787
```

components/typography/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/GOM1KQ24O/Typography.svg
8282
```json
8383
{
8484
text: string,
85-
onCopy: function,
85+
onCopy: function(event),
8686
tooltip: false,
8787
}
8888
```

components/typography/style/index.less

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@
2424
color: @error-color;
2525

2626
a&:active,
27-
a&:focus,
27+
a&:focus {
28+
color: @error-color-active;
29+
}
30+
2831
a&:hover {
29-
color: ~`colorPalette('@{error-color}', 5) `;
32+
color: @error-color-hover;
3033
}
3134
}
3235

@@ -43,26 +46,36 @@
4346
}
4447

4548
h1&,
49+
div&-h1,
50+
div&-h1 > textarea,
4651
h1 {
4752
.typography-title-1();
4853
}
4954

5055
h2&,
56+
div&-h2,
57+
div&-h2 > textarea,
5158
h2 {
5259
.typography-title-2();
5360
}
5461

5562
h3&,
63+
div&-h3,
64+
div&-h3 > textarea,
5665
h3 {
5766
.typography-title-3();
5867
}
5968

6069
h4&,
70+
div&-h4,
71+
div&-h4 > textarea,
6172
h4 {
6273
.typography-title-4();
6374
}
6475

6576
h5&,
77+
div&-h5,
78+
div&-h5 > textarea,
6679
h5 {
6780
.typography-title-5();
6881
}
@@ -198,11 +211,18 @@
198211
right: 10px;
199212
bottom: 8px;
200213
color: @text-color-secondary;
214+
// default style
215+
font-weight: normal;
216+
font-size: @font-size-base;
217+
font-style: normal;
201218
pointer-events: none;
202219
}
203220

204221
// Fix Editable Textarea flash in Firefox
205222
textarea {
223+
// https://stackoverflow.com/a/7695964/3040605
224+
height: 1em;
225+
margin: 0 !important;
206226
/* stylelint-disable-next-line property-no-vendor-prefix */
207227
-moz-transition: none;
208228
}

0 commit comments

Comments
 (0)