Skip to content

Commit

Permalink
docs(textarea): sync vue example (#3213)
Browse files Browse the repository at this point in the history
* docs(textarea): sync vue example

* chore: update snapshot

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
liweijie0812 and github-actions[bot] authored Nov 27, 2024
1 parent b5ecce4 commit b91ea9b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 108 deletions.
49 changes: 0 additions & 49 deletions src/textarea/_example/status.tsx

This file was deleted.

5 changes: 5 additions & 0 deletions src/textarea/_example/type.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export default function InputExample() {
<Space direction="vertical" style={{ width: '100%' }}>
<Textarea placeholder="请输入内容" readonly value="只读状态" />
<Textarea placeholder="请输入内容" disabled value="禁用状态" />

<Textarea placeholder="normal" value={'普通状态'} tips={'正常提示'} />
<Textarea status="success" placeholder="success" value={'成功状态'} tips={'成功提示'} />
<Textarea status="warning" placeholder="warning" value={'警告状态'} tips={'警告提示'} />
<Textarea status="error" placeholder="error" value={'错误状态'} tips={'错误提示'} />
</Space>
);
}
6 changes: 0 additions & 6 deletions src/textarea/textarea.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
:: BASE_DOC ::

### 不同状态的输入框

输入框状态可分为:正常、禁用、异常、带额外内容提示。

{{ status }}

## API
### Textarea Props

Expand Down
96 changes: 46 additions & 50 deletions test/snap/__snapshots__/csr.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -121500,12 +121500,44 @@ exports[`csr snapshot test > csr test src/textarea/_example/maxlength.tsx 1`] =
</div>
`;

exports[`csr snapshot test > csr test src/textarea/_example/status.tsx 1`] = `
exports[`csr snapshot test > csr test src/textarea/_example/type.tsx 1`] = `
<div>
<div
class="t-space t-space-vertical"
style="width: 100%; gap: 16px;"
>
<div
class="t-space-item"
>
<div
class="t-textarea"
>
<textarea
class="t-textarea__inner"
placeholder="请输入内容"
readonly=""
style="height: auto; min-height: auto;"
>
只读状态
</textarea>
</div>
</div>
<div
class="t-space-item"
>
<div
class="t-textarea"
>
<textarea
class="t-textarea__inner t-is-disabled"
disabled=""
placeholder="请输入内容"
style="height: auto; min-height: auto;"
>
禁用状态
</textarea>
</div>
</div>
<div
class="t-space-item"
>
Expand All @@ -121516,7 +121548,9 @@ exports[`csr snapshot test > csr test src/textarea/_example/status.tsx 1`] = `
class="t-textarea__inner"
placeholder="normal"
style="height: auto; min-height: auto;"
/>
>
普通状态
</textarea>
<div
class="t-textarea__info_wrapper"
>
Expand All @@ -121538,7 +121572,9 @@ exports[`csr snapshot test > csr test src/textarea/_example/status.tsx 1`] = `
class="t-textarea__inner t-is-success"
placeholder="success"
style="height: auto; min-height: auto;"
/>
>
成功状态
</textarea>
<div
class="t-textarea__info_wrapper"
>
Expand All @@ -121560,7 +121596,9 @@ exports[`csr snapshot test > csr test src/textarea/_example/status.tsx 1`] = `
class="t-textarea__inner t-is-warning"
placeholder="warning"
style="height: auto; min-height: auto;"
/>
>
警告状态
</textarea>
<div
class="t-textarea__info_wrapper"
>
Expand All @@ -121582,7 +121620,9 @@ exports[`csr snapshot test > csr test src/textarea/_example/status.tsx 1`] = `
class="t-textarea__inner t-is-error"
placeholder="error"
style="height: auto; min-height: auto;"
/>
>
错误状态
</textarea>
<div
class="t-textarea__info_wrapper"
>
Expand All @@ -121598,48 +121638,6 @@ exports[`csr snapshot test > csr test src/textarea/_example/status.tsx 1`] = `
</div>
`;

exports[`csr snapshot test > csr test src/textarea/_example/type.tsx 1`] = `
<div>
<div
class="t-space t-space-vertical"
style="width: 100%; gap: 16px;"
>
<div
class="t-space-item"
>
<div
class="t-textarea"
>
<textarea
class="t-textarea__inner"
placeholder="请输入内容"
readonly=""
style="height: auto; min-height: auto;"
>
只读状态
</textarea>
</div>
</div>
<div
class="t-space-item"
>
<div
class="t-textarea"
>
<textarea
class="t-textarea__inner t-is-disabled"
disabled=""
placeholder="请输入内容"
style="height: auto; min-height: auto;"
>
禁用状态
</textarea>
</div>
</div>
</div>
</div>
`;

exports[`csr snapshot test > csr test src/time-picker/_example/disabled.tsx 1`] = `
<div>
<div
Expand Down Expand Up @@ -135651,9 +135649,7 @@ exports[`ssr snapshot test > ssr test src/textarea/_example/events.tsx 1`] = `"<

exports[`ssr snapshot test > ssr test src/textarea/_example/maxlength.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,超出限制无法输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--normal">这里可以放一些提示文字</div><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,超出限制可以输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper t-textarea__info_wrapper_align"><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,一个中文汉字表示两个字符长度,超出限制无法输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper t-textarea__info_wrapper_align"><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,一个中文汉字表示两个字符长度,超出限制可以输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper t-textarea__info_wrapper_align"><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div></div>"`;

exports[`ssr snapshot test > ssr test src/textarea/_example/status.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="normal" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--normal">正常提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="success" class="t-textarea__inner t-is-success"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--success">成功提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="warning" class="t-textarea__inner t-is-warning"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--warning">警告提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="error" class="t-textarea__inner t-is-error"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--error">错误提示</div></div></div></div></div>"`;

exports[`ssr snapshot test > ssr test src/textarea/_example/type.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner" readonly="">只读状态</textarea></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner t-is-disabled" disabled="">禁用状态</textarea></div></div></div>"`;
exports[`ssr snapshot test > ssr test src/textarea/_example/type.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner" readonly="">只读状态</textarea></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner t-is-disabled" disabled="">禁用状态</textarea></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="normal" class="t-textarea__inner">普通状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--normal">正常提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="success" class="t-textarea__inner t-is-success">成功状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--success">成功提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="warning" class="t-textarea__inner t-is-warning">警告状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--warning">警告提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="error" class="t-textarea__inner t-is-error">错误状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--error">错误提示</div></div></div></div></div>"`;

exports[`ssr snapshot test > ssr test src/time-picker/_example/disabled.tsx 1`] = `"<div style="gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><h3>禁用整个选择器</h3></div><div class="t-space-item"><div class="t-time-picker"><div class="t-time-picker__group t-select-input t-select-input--empty"><div class="t-input__wrap" spellcheck="false"><div class="t-input t-is-readonly t-is-disabled t-align-left t-input--prefix t-input--suffix"><div class="t-input__prefix"></div><input placeholder="select time" type="text" class="t-input__inner" readonly="" disabled="" value=""/><span class="t-input__suffix t-input__suffix-icon"><svg fill="none" viewBox="0 0 24 24" width="1em" height="1em" class="t-icon t-icon-time"><path fill="currentColor" d="M12 21a9 9 0 100-18 9 9 0 000 18zm11-9a11 11 0 11-22 0 11 11 0 0122 0zm-8 4.41l-4-4V5.5h2v6.09L16.41 15 15 16.41z"></path></svg></span></div></div></div></div></div><div class="t-space-item"><h3>禁用指定时间</h3></div><div class="t-space-item"><div class="t-time-picker"><div class="t-time-picker__group t-select-input t-select-input--empty"><div class="t-input__wrap" spellcheck="false"><div class="t-input t-is-readonly t-align-left t-input--prefix t-input--suffix"><div class="t-input__prefix"></div><input placeholder="select time" type="text" class="t-input__inner" readonly="" value=""/><span class="t-input__suffix t-input__suffix-icon"><svg fill="none" viewBox="0 0 24 24" width="1em" height="1em" class="t-icon t-icon-time"><path fill="currentColor" d="M12 21a9 9 0 100-18 9 9 0 000 18zm11-9a11 11 0 11-22 0 11 11 0 0122 0zm-8 4.41l-4-4V5.5h2v6.09L16.41 15 15 16.41z"></path></svg></span></div></div></div></div></div></div>"`;

Expand Down
4 changes: 1 addition & 3 deletions test/snap/__snapshots__/ssr.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,7 @@ exports[`ssr snapshot test > ssr test src/textarea/_example/events.tsx 1`] = `"<

exports[`ssr snapshot test > ssr test src/textarea/_example/maxlength.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,超出限制无法输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--normal">这里可以放一些提示文字</div><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,超出限制可以输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper t-textarea__info_wrapper_align"><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,一个中文汉字表示两个字符长度,超出限制无法输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper t-textarea__info_wrapper_align"><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容,一个中文汉字表示两个字符长度,超出限制可以输入" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper t-textarea__info_wrapper_align"><span class="t-textarea__limit">0<!-- -->/20</span></div></div></div></div>"`;

exports[`ssr snapshot test > ssr test src/textarea/_example/status.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="normal" class="t-textarea__inner"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--normal">正常提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="success" class="t-textarea__inner t-is-success"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--success">成功提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="warning" class="t-textarea__inner t-is-warning"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--warning">警告提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="error" class="t-textarea__inner t-is-error"></textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--error">错误提示</div></div></div></div></div>"`;

exports[`ssr snapshot test > ssr test src/textarea/_example/type.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner" readonly="">只读状态</textarea></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner t-is-disabled" disabled="">禁用状态</textarea></div></div></div>"`;
exports[`ssr snapshot test > ssr test src/textarea/_example/type.tsx 1`] = `"<div style="width:100%;gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner" readonly="">只读状态</textarea></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="请输入内容" class="t-textarea__inner t-is-disabled" disabled="">禁用状态</textarea></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="normal" class="t-textarea__inner">普通状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--normal">正常提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="success" class="t-textarea__inner t-is-success">成功状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--success">成功提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="warning" class="t-textarea__inner t-is-warning">警告状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--warning">警告提示</div></div></div></div><div class="t-space-item"><div class="t-textarea"><textarea placeholder="error" class="t-textarea__inner t-is-error">错误状态</textarea><div class="t-textarea__info_wrapper"><div class="t-textarea__tips t-textarea__tips--error">错误提示</div></div></div></div></div>"`;

exports[`ssr snapshot test > ssr test src/time-picker/_example/disabled.tsx 1`] = `"<div style="gap:16px" class="t-space t-space-vertical"><div class="t-space-item"><h3>禁用整个选择器</h3></div><div class="t-space-item"><div class="t-time-picker"><div class="t-time-picker__group t-select-input t-select-input--empty"><div class="t-input__wrap" spellcheck="false"><div class="t-input t-is-readonly t-is-disabled t-align-left t-input--prefix t-input--suffix"><div class="t-input__prefix"></div><input placeholder="select time" type="text" class="t-input__inner" readonly="" disabled="" value=""/><span class="t-input__suffix t-input__suffix-icon"><svg fill="none" viewBox="0 0 24 24" width="1em" height="1em" class="t-icon t-icon-time"><path fill="currentColor" d="M12 21a9 9 0 100-18 9 9 0 000 18zm11-9a11 11 0 11-22 0 11 11 0 0122 0zm-8 4.41l-4-4V5.5h2v6.09L16.41 15 15 16.41z"></path></svg></span></div></div></div></div></div><div class="t-space-item"><h3>禁用指定时间</h3></div><div class="t-space-item"><div class="t-time-picker"><div class="t-time-picker__group t-select-input t-select-input--empty"><div class="t-input__wrap" spellcheck="false"><div class="t-input t-is-readonly t-align-left t-input--prefix t-input--suffix"><div class="t-input__prefix"></div><input placeholder="select time" type="text" class="t-input__inner" readonly="" value=""/><span class="t-input__suffix t-input__suffix-icon"><svg fill="none" viewBox="0 0 24 24" width="1em" height="1em" class="t-icon t-icon-time"><path fill="currentColor" d="M12 21a9 9 0 100-18 9 9 0 000 18zm11-9a11 11 0 11-22 0 11 11 0 0122 0zm-8 4.41l-4-4V5.5h2v6.09L16.41 15 15 16.41z"></path></svg></span></div></div></div></div></div></div>"`;

Expand Down

0 comments on commit b91ea9b

Please sign in to comment.