diff --git a/packages/opendesign/src/_components/in-textarea/types.ts b/packages/opendesign/src/_components/in-textarea/types.ts index 1b123fe91aca489a6a66f5ce699db99ae47938af..c8c439ca6ea7f86015b73b5d781760a9e2097406 100644 --- a/packages/opendesign/src/_components/in-textarea/types.ts +++ b/packages/opendesign/src/_components/in-textarea/types.ts @@ -69,7 +69,7 @@ export const inTextareaProps = { default: undefined, }, /** - * 显示的行数 + * 显示的列数 */ cols: { type: Number, diff --git a/packages/opendesign/src/textarea/__docs__/__case__/TextareaAutoHeight.vue b/packages/opendesign/src/textarea/__docs__/__case__/TextareaAutoHeight.vue new file mode 100644 index 0000000000000000000000000000000000000000..49def81e854262f4a8a18780ec393a262dc2caf4 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/__case__/TextareaAutoHeight.vue @@ -0,0 +1,36 @@ + + +### Auto Size + + +### Auto Size + + + + + + + default + + + + max-height: 120px: + + + + min-height: 200px; min-width: 200px: max-width: 400px + + + + + diff --git a/packages/opendesign/src/textarea/__docs__/__case__/TextareaBasic.vue b/packages/opendesign/src/textarea/__docs__/__case__/TextareaBasic.vue new file mode 100644 index 0000000000000000000000000000000000000000..eb4b6f3d9d3b9db07fa452fb57646395d154a8d8 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/__case__/TextareaBasic.vue @@ -0,0 +1,138 @@ + + +### Color & Variant + + +### Color & Variant + + + + + + Outline + + + + + + + Solid + + + + + + + Text + + + + + + + + Size & Round + + + default + + + + + + round="pill" + + + + + + round="12px" + + + + + + + + + Disabled + + Outline + + + + + + + Solid + + + + + + + + Text + + + + + + + + Resize + + + both: + + + + horizontal: + + + + vertical:(default) + + + + none: + + + + MaxLength + + + MaxLength: 10 | val2:{{ val2 }} + + + + input-out-limit:超出长度时不能输入 + + + + Clearable + + clearable="false" + + + beforeInput + + 输入内容不允许收尾有空格 + + + + diff --git a/packages/opendesign/src/textarea/__docs__/__case__/TextareaEvent.vue b/packages/opendesign/src/textarea/__docs__/__case__/TextareaEvent.vue new file mode 100644 index 0000000000000000000000000000000000000000..a21252d4beba72d584ea2a791991ecb7c6c284c4 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/__case__/TextareaEvent.vue @@ -0,0 +1,37 @@ + + +### Event API + + +### Event API + + + + + + + + + focus + blur + clear + + + diff --git a/packages/opendesign/src/textarea/__docs__/__case__/TextareaSlot.vue b/packages/opendesign/src/textarea/__docs__/__case__/TextareaSlot.vue new file mode 100644 index 0000000000000000000000000000000000000000..979259d7f3e85623da97922357b2a6ce5a4b8426 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/__case__/TextareaSlot.vue @@ -0,0 +1,31 @@ + + +### Slot + + +### Slot + + + + + + + Outline + + + + #CANN + + + #指示领域 + + + + + + diff --git a/packages/opendesign/src/textarea/__docs__/__case__/textareaUsage.ts b/packages/opendesign/src/textarea/__docs__/__case__/textareaUsage.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c8240f9e10bfa11612345a211e22fce5ea43c83 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/__case__/textareaUsage.ts @@ -0,0 +1,113 @@ +import { propsToAttrStr } from '../../../_demo/utils'; +import { reactive } from 'vue'; +import { DocDemoSchema, DocDemoTemplate } from '../../../_demo/types.ts'; + +export const docs = { + 'zh-CN': + '文本域是常见的表单类输入组件,提供了较长文本输入和查看的能力,可设置项如下: \n' + + '- 提示文本`placeholder` \n' + + '- 是否禁用`disabled` \n' + + '- 是否只读`readonly` \n' + + '- 是否可以清除`clearable` \n' + + '- 显示的行数`rows` \n' + + '- 显示的列数`cols` \n' + + '- 是否支持调整尺寸`resize` \n' + + '- 最小字符长度`minLength` \n' + + '- 最大字符长度`maxLength` \n' + + '- 超过最大字符长度时是否允许输入`inputOnOutlimit` \n' + + '- 根据内容自动计算高度`autoSize` \n' + + '- 大小`size` \n' + + '- 圆角值`round` \n' + + '- 颜色类型`color` \n' + + '- 按钮类型`variant` \n' + + '\n\n更多的可配置参数参考下方API小节', + 'en-US': + 'Textarea is a common form input component that provides capabilities for inputting and viewing longer text. Configurable items include: \n' + + '- Prompt text `placeholder` \n' + + '- Disabled state `disabled` \n' + + '- Readonly state `readonly` \n' + + '- Clearable option `clearable` \n' + + '- Number of displayed rows `rows` \n' + + '- Number of displayed columns `cols` \n' + + '- Resize support `resize` \n' + + '- Minimum character length `minLength` \n' + + '- Maximum character length `maxLength` \n' + + '- Input allowance beyond max length `inputOnOutlimit` \n' + + '- Auto height calculation based on content `autoSize` \n' + + '- Size `size` \n' + + '- Corner roundness `round` \n' + + '- Color type `color` \n' + + '- Button style variant `variant` \n' + + '\n\nFor more configurable parameters, refer to the API section below.' +}; + +export const ctx = reactive({ + modelValue: 'this is value' +}); + +export const schema = { + placeholder: { + type: 'string', + default: 'input something' + }, + disabled: { + type: 'boolean', + default: false + }, + readonly: { + type: 'boolean', + default: false + }, + clearable: { + type: 'boolean', + default: true + }, + rows: { + type: 'number', + default: undefined, + }, + cols: { + type: 'number', + default: undefined, + }, + resize: { + type: 'list', + list: ['both', 'horizontal', 'h', 'vertical', 'v', 'none'] as const + }, + minLength: { + type: 'number', + default: 0 + }, + maxLength: { + type: 'number', + default: 100 + }, + inputOnOutlimit: { + type: 'boolean', + default: true, + }, + autoSize: { + type: 'boolean', + default: undefined, + }, + size: { + type: 'list', + list: ['large', 'medium', 'small'] as const, + }, + round: { + type: 'string', + default: 'pill' + }, + color: { + type: 'list', + list: ['normal', 'success', 'warning', 'danger'] as const, + }, + variant: { + type: 'list', + list: ['solid', 'outline', 'text'] as const, + }, +} satisfies Record; + +export const template: DocDemoTemplate = (_props) => { + return ``; +}; diff --git a/packages/opendesign/src/textarea/__docs__/index.en-US.md b/packages/opendesign/src/textarea/__docs__/index.en-US.md new file mode 100644 index 0000000000000000000000000000000000000000..62714c65d0729ea2cdccac7008450b715930b201 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/index.en-US.md @@ -0,0 +1,20 @@ +--- +sidebar: OTextarea +--- + +# textarea + +## Usage + + + +## Cases + + + + + + +## Api + + \ No newline at end of file diff --git a/packages/opendesign/src/textarea/__docs__/index.zh-CN.md b/packages/opendesign/src/textarea/__docs__/index.zh-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..1eede390ad8acb37d32093d01463d2f2ea8d4e01 --- /dev/null +++ b/packages/opendesign/src/textarea/__docs__/index.zh-CN.md @@ -0,0 +1,20 @@ +--- +sidebar: OTextarea 文本域 +--- + +# 文本域 + +## 使用 + + + +## 示例 + + + + + + +## Api + + \ No newline at end of file