-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(descriptions): add descriptions
- Loading branch information
1 parent
0de55f8
commit 38b1c52
Showing
28 changed files
with
850 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule _common
updated
12 files
+58 −58 | docs/mobile/overview.en-US.md | |
+1 −1 | docs/web/api/descriptions.en-US.md | |
+1 −1 | docs/web/api/descriptions.md | |
+71 −64 | docs/web/overview.en-US.md | |
+7 −7 | docs/web/overview.md | |
+1 −1 | js/table/tree-store.ts | |
+241 −0 | js/tree-v1/tree-node-model.ts | |
+1,335 −0 | js/tree-v1/tree-node.ts | |
+945 −0 | js/tree-v1/tree-store.ts | |
+273 −0 | js/tree-v1/types.ts | |
+4 −4 | style/web/components/table/_index.less | |
+2 −1 | style/web/components/tree/_index.less |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<t-descriptions title="Shipping address"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<t-descriptions title="Shipping address" bordered :column="3"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-checkbox v-model="checked">展示引号</t-checkbox> | ||
<t-descriptions title="Shipping address" bordered :colon="checked" :column="3"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</t-space> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const checked = ref(true); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-radio-group v-model="column" :options="columnOptions"></t-radio-group> | ||
<t-descriptions bordered :column="column"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</t-space> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const columnOptions = [2, 3, 4]; | ||
const column = ref(2); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<t-descriptions | ||
title="Shipping address" | ||
bordered | ||
:label-style="{ width: '100px', textAlign: 'left' }" | ||
:content-style="{ textAlign: 'right' }" | ||
:column="3" | ||
> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<t-descriptions title="Shipping address" :items="items" :column="3" /> | ||
</template> | ||
|
||
<script setup lang="jsx"> | ||
const items = [ | ||
{ label: 'Name', content: 'TDesign' }, | ||
{ label: <button>Telephone Number</button>, content: '139****0609' }, | ||
{ label: 'Area', content: <h3>China Tencent Headquarters</h3> }, | ||
{ label: () => <i>'Address'</i>, content: () => <mark> 'Shenzhen Penguin Island D1 4A Mail Center'</mark> }, | ||
]; | ||
</script> | ||
|
||
<!-- <template> | ||
<t-descriptions title="Shipping address" :items="items" /> | ||
</template> | ||
<script setup> | ||
import Base from './base.vue'; | ||
const items = [ | ||
{ label: 'Name', content: 'TDesign' }, | ||
{ label: Base, content: '139****0609' }, | ||
]; | ||
</script> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-row> | ||
<span>layout:</span> | ||
<t-radio-group v-model="layout" :options="layoutOptions"></t-radio-group> | ||
</t-row> | ||
|
||
<t-row> | ||
<span>itemLayout:</span> | ||
<t-radio-group v-model="itemLayout" :options="itemLayoutOptions"></t-radio-group> | ||
</t-row> | ||
|
||
<t-descriptions title="Shipping address" bordered :layout="layout" :item-layout="itemLayout" :column="3"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</t-space> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const layout = ref('horizontal'); | ||
const itemLayout = ref('horizontal'); | ||
const layoutOptions = ['horizontal', 'vertical']; | ||
const itemLayoutOptions = ['horizontal', 'vertical']; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<t-space direction="vertical"> | ||
<t-radio-group v-model="size" :options="sizeOptions"></t-radio-group> | ||
<t-descriptions bordered :size="size" :column="3"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</t-space> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const sizeOptions = ['large', 'medium', 'small']; | ||
const size = ref('medium'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!-- 该脚本为自动生成,如有需要请在 /script/generate-usage.js 中调整 --> | ||
<template> | ||
<base-usage :code="usageCode" :config-list="configList" :panel-list="panelList" @PanelChange="onPanelChange"> | ||
<template #descriptions="{ configProps }"> | ||
<t-descriptions title="Shipping address" v-bind="configProps"> | ||
<t-descriptions-item label="Name">TDesign</t-descriptions-item> | ||
<t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item> | ||
<t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item> | ||
<t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item> | ||
</t-descriptions> | ||
</template> | ||
</base-usage> | ||
</template> | ||
|
||
<script setup lang="jsx"> | ||
/* eslint-disable */ | ||
import { ref, onMounted } from '@vue/composition-api'; | ||
import configJson from './props.json'; | ||
const configList = ref(configJson); | ||
const panelList = [{ label: 'descriptions', value: 'descriptions' }]; | ||
const usageCodeMap = { | ||
descriptions: | ||
'\n <t-descriptions title="Shipping address" v-bind="configProps">\n <t-descriptions-item label="Name">TDesign</t-descriptions-item>\n <t-descriptions-item label="Telephone Number">139****0609</t-descriptions-item>\n <t-descriptions-item label="Area">China Tencent Headquarters</t-descriptions-item>\n <t-descriptions-item label="Address">Shenzhen Penguin Island D1 4A Mail Center</t-descriptions-item>\n </t-descriptions>\n ', | ||
}; | ||
const usageCode = ref(`<template>${usageCodeMap[panelList[0].value].trim()}</template>`); | ||
function onPanelChange(panel) { | ||
usageCode.value = `<template>${usageCodeMap[panel].trim()}</template>`; | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
[ | ||
{ | ||
"name": "bordered", | ||
"type": "Boolean", | ||
"defaultValue": false, | ||
"options": [] | ||
}, | ||
{ | ||
"name": "colon", | ||
"type": "Boolean", | ||
"defaultValue": false, | ||
"options": [] | ||
}, | ||
{ | ||
"name": "size", | ||
"type": "enum", | ||
"defaultValue": "medium", | ||
"options": [ | ||
{ | ||
"label": "large", | ||
"value": "large" | ||
}, | ||
{ | ||
"label": "medium", | ||
"value": "medium" | ||
}, | ||
{ | ||
"label": "small", | ||
"value": "small" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "layout", | ||
"type": "enum", | ||
"defaultValue": "horizontal", | ||
"options": [ | ||
{ | ||
"label": "horizontal", | ||
"value": "horizontal" | ||
}, | ||
{ | ||
"label": "vertical", | ||
"value": "vertical" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "itemLayout", | ||
"type": "enum", | ||
"defaultValue": "horizontal", | ||
"options": [ | ||
{ | ||
"label": "horizontal", | ||
"value": "horizontal" | ||
}, | ||
{ | ||
"label": "vertical", | ||
"value": "vertical" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { InjectionKey } from '@vue/composition-api'; | ||
import { TdDescriptionsProps } from '../type'; | ||
|
||
const descriptionsKey: InjectionKey<TdDescriptionsProps> = Symbol('TDescriptions'); | ||
|
||
export default descriptionsKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdDescriptionItemProps } from '../descriptions/type'; | ||
import { PropType } from 'vue'; | ||
|
||
export default { | ||
/** 描述项内容 */ | ||
content: { | ||
type: [String, Function] as PropType<TdDescriptionItemProps['content']>, | ||
}, | ||
/** 描述项内容,同 `content` */ | ||
default: { | ||
type: [String, Function] as PropType<TdDescriptionItemProps['default']>, | ||
}, | ||
/** 描述项标签 */ | ||
label: { | ||
type: [String, Function] as PropType<TdDescriptionItemProps['label']>, | ||
}, | ||
/** 占用的宽度数量 */ | ||
span: { | ||
type: Number, | ||
default: 1, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { defineComponent } from '@vue/composition-api'; | ||
import props from './props'; | ||
|
||
export default defineComponent({ | ||
name: 'TDescriptionsItem', | ||
props, | ||
}); |
Oops, something went wrong.