Skip to content

Commit f85ef9e

Browse files
fix(badge): fix badge export and api (#67)
Co-authored-by: huaweidevcloud <[email protected]>
1 parent 7b41866 commit f85ef9e

File tree

6 files changed

+43
-38
lines changed

6 files changed

+43
-38
lines changed

devui/badge/badge.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ViewChild
88
} from '@angular/core';
99

10-
import { BadgeStatusType, BadgePositionType } from './types';
10+
import { BadgeStatusType, BadgePositionType } from './badge.types';
1111

1212
@Component({
1313
selector: 'd-badge',
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
22
* Define Status Type
33
*/
4-
export type BadgeStatusType = 'dange' | 'warning' | 'waiting' | 'success' | 'info';
4+
export type BadgeStatusType = 'danger' | 'warning' | 'waiting' | 'success' | 'info';
55
export type BadgePositionType = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';

devui/badge/demo/dot/dot.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<section>
22
<div class="badge-group">
3-
<d-badge [showDot]="true" status="dange">
3+
<d-badge [showDot]="true" status="danger">
44
<i class="icon icon-feedback"></i>
55
</d-badge>
66

devui/badge/doc/api.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
### d-badge 参数
22

3-
| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
4-
| :---------: | :------------: | :-----: | :--------------------------------------------------------------------------- | |
3+
| 参数 | 类型 | 默认 | 说明 | 跳转Demo |
4+
| :---------: | :------------: | :-----: | :--------------------------------------------------------------------------- | :--------------------------- |
55
| count | `number` | -- | 可选,设置基本徽章和计数徽章中显示的数目 | [基本徽章](/components/badge/demo#badge-basic) |
66
| maxCount | `number` | 99 | 可选,设置基本徽章和计数徽章最大可显示数目,当 count > maxCount 时显示maxCount+ | [基本徽章](/components/badge/demo#badge-basic) |
77
| showDot | `boolean` | false | 可选,true时为点状徽章(有包裹)或状态徽章(无包裹),false时为基本徽章(有包裹)或计数徽章(无包裹) | [点状徽章](/components/badge/demo#badge-dot) |
8-
| status |`BadgeStatusType` | -- | 可选,状态色 'dange' \| 'warning' \| 'waiting' \| 'success' \| 'info' | [基本徽章](/components/badge/demo#badge-basic) |
8+
| status |`BadgeStatusType` | -- | 可选,状态色 'danger' \| 'warning' \| 'waiting' \| 'success' \| 'info' | [基本徽章](/components/badge/demo#badge-basic) |
99
| badgePos | `BadgeStatusType` | 'top-right' | 可选,徽标位置 'top-left' \| 'top-rihgt' \| 'bottpm-left' \| ''bottom-right'' | [基本徽章](/components/badge/demo#badge-basic) |
1010
| offsetXY | `[number, number]` | -- | 可选,有包裹时徽标位置偏移量,格式为[x,y],单位为px。x为相对right偏移量(right: -x px),y为相对top偏移量(top: y px) | [状态徽章](/components/badge/demo#badge-status) |
1111
| bgColor | `string` | -- | 可选, 可自定义徽标色 | [基本徽章](/components/badge/demo#badge-basic) |

devui/badge/public-api.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './badge.module';
22
export * from './badge.component';
3+
export * from './badge.types';

devui/devui.module.ts

+36-32
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { NgModule, ModuleWithProviders } from '@angular/core';
1+
import { ModuleWithProviders, NgModule } from '@angular/core';
22
import { AccordionModule } from 'ng-devui/accordion';
33
import { AlertModule } from 'ng-devui/alert';
44
import { AnchorModule } from 'ng-devui/anchor';
5+
import { AutoCompleteModule } from 'ng-devui/auto-complete';
6+
import { AvatarModule } from 'ng-devui/avatar';
7+
import { BadgeModule } from 'ng-devui/badge';
8+
import { BreadcrumbModule } from 'ng-devui/breadcrumb';
59
import { ButtonModule } from 'ng-devui/button';
610
import { CarouselModule } from 'ng-devui/carousel';
711
import { CheckBoxModule } from 'ng-devui/checkbox';
@@ -12,53 +16,51 @@ import { DragDropModule } from 'ng-devui/dragdrop';
1216
import { DrawerModule } from 'ng-devui/drawer';
1317
import { DropDownModule } from 'ng-devui/dropdown';
1418
import { EditableSelectModule } from 'ng-devui/editable-select';
19+
import { FormModule } from 'ng-devui/form';
20+
import { FullscreenModule } from 'ng-devui/fullscreen';
21+
import { GanttModule } from 'ng-devui/gantt';
22+
import { ImagePreviewModule } from 'ng-devui/image-preview';
23+
import { InputNumberModule } from 'ng-devui/input-number';
24+
import { LayoutModule } from 'ng-devui/layout';
1525
import { LoadingModule } from 'ng-devui/loading';
1626
import { ModalModule } from 'ng-devui/modal';
1727
import { MultiAutoCompleteModule } from 'ng-devui/multi-auto-complete';
1828
import { PaginationModule } from 'ng-devui/pagination';
1929
import { PanelModule } from 'ng-devui/panel';
2030
import { PopoverModule } from 'ng-devui/popover';
2131
import { ProgressModule } from 'ng-devui/progress';
32+
import { QuadrantDiagramModule } from 'ng-devui/quadrant-diagram';
2233
import { RadioModule } from 'ng-devui/radio';
34+
import { RateModule } from 'ng-devui/rate';
2335
import { SearchModule } from 'ng-devui/search';
2436
import { SelectModule } from 'ng-devui/select';
37+
import { SliderModule } from 'ng-devui/slider';
38+
import { SplitterModule } from 'ng-devui/splitter';
2539
import { StatusModule } from 'ng-devui/status';
40+
import { StepsGuideModule } from 'ng-devui/steps-guide';
2641
import { StickyModule } from 'ng-devui/sticky';
2742
import { TabsModule } from 'ng-devui/tabs';
2843
import { TagsModule } from 'ng-devui/tags';
2944
import { TagsInputModule } from 'ng-devui/tags-input';
45+
import { TextInputModule } from 'ng-devui/text-input';
46+
import { TextareaModule } from 'ng-devui/textarea';
3047
import { ToastModule } from 'ng-devui/toast';
3148
import { ToggleModule } from 'ng-devui/toggle';
3249
import { TooltipModule } from 'ng-devui/tooltip';
50+
import { TransferModule } from 'ng-devui/transfer';
3351
import { TreeModule } from 'ng-devui/tree';
34-
import { UploadModule } from 'ng-devui/upload';
35-
import { AutoCompleteModule } from 'ng-devui/auto-complete';
36-
import { InputNumberModule } from 'ng-devui/input-number';
37-
import { SliderModule } from 'ng-devui/slider';
3852
import { TreeSelectModule } from 'ng-devui/tree-select';
39-
import { TransferModule } from 'ng-devui/transfer';
40-
import { SplitterModule } from 'ng-devui/splitter';
41-
import { BreadcrumbModule } from 'ng-devui/breadcrumb';
42-
import { RateModule } from 'ng-devui/rate';
43-
import { FormModule } from 'ng-devui/form';
44-
import { TextInputModule } from 'ng-devui/text-input';
45-
import { TextareaModule } from 'ng-devui/textarea';
46-
import { FullscreenModule } from 'ng-devui/fullscreen';
47-
import { ImagePreviewModule } from 'ng-devui/image-preview';
48-
import { AvatarModule } from 'ng-devui/avatar';
49-
import { LayoutModule } from 'ng-devui/layout';
53+
import { UploadModule } from 'ng-devui/upload';
5054
import { WindowRefModule } from 'ng-devui/window-ref';
51-
import { StepsGuideModule } from 'ng-devui/steps-guide';
52-
import { QuadrantDiagramModule } from 'ng-devui/quadrant-diagram';
53-
import { GanttModule } from 'ng-devui/gantt';
55+
5456
export * from 'ng-devui/accordion';
5557
export * from 'ng-devui/alert';
5658
export * from 'ng-devui/anchor';
5759
export * from 'ng-devui/auto-complete';
5860
export * from 'ng-devui/avatar';
59-
export * from 'ng-devui/layout';
60-
export * from 'ng-devui/button';
61+
export * from 'ng-devui/badge';
6162
export * from 'ng-devui/breadcrumb';
63+
export * from 'ng-devui/button';
6264
export * from 'ng-devui/carousel';
6365
export * from 'ng-devui/checkbox';
6466
export * from 'ng-devui/common';
@@ -68,42 +70,43 @@ export * from 'ng-devui/dragdrop';
6870
export * from 'ng-devui/drawer';
6971
export * from 'ng-devui/dropdown';
7072
export * from 'ng-devui/editable-select';
71-
export * from 'ng-devui/fullscreen';
7273
export * from 'ng-devui/form';
74+
export * from 'ng-devui/fullscreen';
75+
export * from 'ng-devui/gantt';
7376
export * from 'ng-devui/image-preview';
77+
export * from 'ng-devui/input-number';
78+
export * from 'ng-devui/layout';
7479
export * from 'ng-devui/loading';
7580
export * from 'ng-devui/modal';
7681
export * from 'ng-devui/multi-auto-complete';
7782
export * from 'ng-devui/pagination';
7883
export * from 'ng-devui/panel';
7984
export * from 'ng-devui/popover';
8085
export * from 'ng-devui/progress';
86+
export * from 'ng-devui/quadrant-diagram';
8187
export * from 'ng-devui/radio';
8288
export * from 'ng-devui/rate';
8389
export * from 'ng-devui/search';
8490
export * from 'ng-devui/select';
91+
export * from 'ng-devui/slider';
92+
export * from 'ng-devui/splitter';
8593
export * from 'ng-devui/status';
94+
export * from 'ng-devui/steps-guide';
8695
export * from 'ng-devui/sticky';
8796
export * from 'ng-devui/tabs';
8897
export * from 'ng-devui/tags';
8998
export * from 'ng-devui/tags-input';
99+
export * from 'ng-devui/text-input';
100+
export * from 'ng-devui/textarea';
90101
export * from 'ng-devui/theme';
91102
export * from 'ng-devui/toast';
92103
export * from 'ng-devui/toggle';
93104
export * from 'ng-devui/tooltip';
105+
export * from 'ng-devui/transfer';
94106
export * from 'ng-devui/tree';
95-
export * from 'ng-devui/upload';
96-
export * from 'ng-devui/input-number';
97-
export * from 'ng-devui/slider';
98-
export * from 'ng-devui/splitter';
99107
export * from 'ng-devui/tree-select';
100-
export * from 'ng-devui/transfer';
101-
export * from 'ng-devui/text-input';
102-
export * from 'ng-devui/textarea';
108+
export * from 'ng-devui/upload';
103109
export * from 'ng-devui/window-ref';
104-
export * from 'ng-devui/steps-guide';
105-
export * from 'ng-devui/quadrant-diagram';
106-
export * from 'ng-devui/gantt';
107110
export * from './version';
108111

109112
@NgModule({
@@ -115,6 +118,7 @@ export * from './version';
115118
AutoCompleteModule,
116119
AvatarModule,
117120
DCommonModule,
121+
BadgeModule,
118122
ButtonModule,
119123
BreadcrumbModule,
120124
CarouselModule,

0 commit comments

Comments
 (0)