From 62b2fb435601bc99da4a95ebbe88e471bb91bbbc Mon Sep 17 00:00:00 2001 From: flippedround <734243792@qq.com> Date: Sat, 12 Nov 2022 15:19:05 +0800 Subject: [PATCH] feat(TimeLine): init timeLine --- components.d.ts | 6 + src/components/Data/Timeline/constants.ts | 21 +++ .../Data/Timeline/timeline.story.md | 26 ++++ .../Data/Timeline/timeline.story.vue | 128 ++++++++++++++++++ src/constants/typeOptions.ts | 26 ++++ 5 files changed, 207 insertions(+) create mode 100644 src/components/Data/Timeline/constants.ts create mode 100644 src/components/Data/Timeline/timeline.story.md create mode 100644 src/components/Data/Timeline/timeline.story.vue create mode 100644 src/constants/typeOptions.ts diff --git a/components.d.ts b/components.d.ts index c8aff9e..eb4f356 100644 --- a/components.d.ts +++ b/components.d.ts @@ -25,6 +25,7 @@ declare module '@vue/runtime-core' { 'DatePicker.story': typeof import('./src/components/Form/datePicker.story.vue')['default'] 'DateTimePicker.story': typeof import('./src/components/Form/dateTimePicker.story.vue')['default'] 'Descriptions.story': typeof import('./src/components/Data/descriptions.story.vue')['default'] + 'Dialog.story': typeof import('./src/components/Feedback/dialog.story.vue')['default'] 'Divider.story': typeof import('./src/components/Others/divider.story.vue')['default'] ElAlert: typeof import('element-plus/es')['ElAlert'] ElAside: typeof import('element-plus/es')['ElAside'] @@ -51,6 +52,7 @@ declare module '@vue/runtime-core' { ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] + ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] @@ -80,9 +82,12 @@ declare module '@vue/runtime-core' { ElSpace: typeof import('element-plus/es')['ElSpace'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTag: typeof import('element-plus/es')['ElTag'] + ElTimeline: typeof import('element-plus/es')['ElTimeline'] + ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] 'Empty.story': typeof import('./src/components/Data/empty.story.vue')['default'] HstColor: typeof import('./src/controls-components/HstColor.vue')['default'] + HstDateTimePicker: typeof import('./src/controls-components/HstDateTimePicker.vue')['default'] HstDateTimePIcker: typeof import('./src/controls-components/HstDateTimePicker.vue')['default'] 'Icon.story': typeof import('./src/components/Basic/Icon/icon.story.vue')['default'] 'Image.story': typeof import('./src/components/Data/Image/image.story.vue')['default'] @@ -104,5 +109,6 @@ declare module '@vue/runtime-core' { 'Space.story': typeof import('./src/components/Basic/space.story.vue')['default'] 'Switch.story': typeof import('./src/components/Form/switch.story.vue')['default'] 'Tag.story': typeof import('./src/components/Data/tag.story.vue')['default'] + 'Timeline.story': typeof import('./src/components/Data/Timeline/timeline.story.vue')['default'] } } diff --git a/src/components/Data/Timeline/constants.ts b/src/components/Data/Timeline/constants.ts new file mode 100644 index 0000000..7c52334 --- /dev/null +++ b/src/components/Data/Timeline/constants.ts @@ -0,0 +1,21 @@ +export const placementList = [ + { + label: 'top', + value: 'top', + }, + { + label: 'bottom', + value: 'bottom', + }, +] + +export const sizeList = [ + { + label: 'normal', + value: 'normal', + }, + { + label: 'large', + value: 'large', + }, +] diff --git a/src/components/Data/Timeline/timeline.story.md b/src/components/Data/Timeline/timeline.story.md new file mode 100644 index 0000000..10c0d13 --- /dev/null +++ b/src/components/Data/Timeline/timeline.story.md @@ -0,0 +1,26 @@ +## Timeline Slots + +| Name | Description | Subtags | +| ---- | --------------------------- | ------------- | +| — | Custom content for timeline | Timeline-Item | + +## Timeline-Item Attributes + +| Name | Description | Type | Accepted Values | Default | +| -------------- | --------------------------- | --------------------- | ------------------------------------------- | ------- | +| timestamp | timestamp content | string | — | — | +| hide-timestamp | whether to show timestamp | boolean | — | false | +| center | Whether vertically centered | boolean | — | false | +| placement | position of timestamp | string | top / bottom | bottom | +| type | node type | string | primary / success / warning / danger / info | — | +| color | background color of node | string | hsl / hsv / hex / rgb | — | +| size | node size | string | normal / large | normal | +| icon | icon component | `string \| Component` | — | — | +| hollow | icon is hollow | boolean | — | false | + +## Timeline-Item Slots + +| Name | Description | +| ---- | -------------------------------- | +| — | Custom content for timeline item | +| dot | Custom defined node | diff --git a/src/components/Data/Timeline/timeline.story.vue b/src/components/Data/Timeline/timeline.story.vue new file mode 100644 index 0000000..79be55b --- /dev/null +++ b/src/components/Data/Timeline/timeline.story.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/constants/typeOptions.ts b/src/constants/typeOptions.ts new file mode 100644 index 0000000..8139309 --- /dev/null +++ b/src/constants/typeOptions.ts @@ -0,0 +1,26 @@ +export default [ + { + label: 'default', + value: '', + }, + { + label: 'primary', + value: 'primary', + }, + { + label: 'success', + value: 'success', + }, + { + label: 'warning', + value: 'warning', + }, + { + label: 'danger', + value: 'danger', + }, + { + label: 'info', + value: 'info', + }, +]