10000 feat(result): add result component (#451) · atinc/ngx-tethys@811c2b2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 811c2b2

Browse files
HandsomeButterballwalkerkay
authored andcommitted
feat(result): add result component (#451)
* feat(result): add result component * feat(result): add result component * fix(action-menu): change action-menu-divider-margin-y * fix(result): change parmas name and add icon template * fix(result): change element spacing and $primary in demo
1 parent eacab2d commit 811c2b2

19 files changed

+1207
-5
lines changed

demo/src/app/app.routes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import { DemoLinkSectionComponent } from './global/+link';
5959
import { DemoRebootSectionComponent } from './global/+reboot';
6060
import { DemoTypographyComponent } from './components/+typography/typography.component';
6161
import { DemoSkeletonSectionComponent } from './components/+skeleton';
62+
import { DemoResultSectionComponent } from './components/+result/result-section.component';
6263

6364
const appRoutes = [
6465
{
@@ -305,6 +306,10 @@ const appRoutes = [
305306
{
306307
path: 'components/skeleton',
307308
component: DemoSkeletonSectionComponent
309+
},
310+
{
311+
path: 'components/result',
312+
component: DemoResultSectionComponent
308313
}
309314
];
310315

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export const apiParameters = [
2+
{
3+
property: 'thyTitle',
4+
description: 'result title',
5+
type: 'string',
6+
default: ''
7+
},
8+
{
9+
property: 'thySubtitle',
10+
description: 'result subtitle',
11+
type: 'string',
12+
default: ''
13+
},
14+
{
15+
property: 'thyStatus',
16+
description: 'result status',
17+
type: '"success" | "warning" | "error"',
18+
default: ''
19+
},
20+
{
21+
property: 'thySrc',
22+
description: 'result icon url',
23+
type: 'string',
24+
default: ''
25+
},
26+
{
27+
property: 'thyExtra',
28+
description: 'result extra template',
29+
type: 'template',
30+
default: ''
31+
}
32+
];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="demo-card">
2+
<thy-result thyStatus="success" thyTitle="支付成功" thySubtitle="恭喜您!订单支付已成功">
3+
<ng-template #thyExtra>
4+
<button thyButton="primary-square">关闭</button>
5+
<button thyButton="outline-primary-square">查看详情</button>
6+
</ng-template>
7+
</thy-result>
8+
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-demo-result-basic',
5+
templateUrl: './basic.component.html'
6+
})
7+
export class DemoResultBasicComponent implements OnInit {
8+
constructor() {}
9+
ngOnInit() {}
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './basic/basic.component';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<app-live-demos [data]="liveDemos"></app-live-demos>
2+
3+
<api-parameters title="thy-result 参数" [parameters]="apiParameters"></api-parameters>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { apiParameters } from './api-parameters';
3+
import { LiveDemoCodeExample } from '../../core/live-demo/live-demo.component';
4+
import { DemoResultBasicComponent } from './basic/basic.component';
5+
6+
@Component({
7+
selector: 'result-section',
8+
templateUrl: './result-section.component.html'
9+
})
10+
export class DemoResultSectionComponent implements OnInit {
11+
liveDemos: LiveDemoCodeExample[] = [
12+
{
13+
title: 'Result Basic',
14+
component: DemoResultBasicComponent,
15+
codeExamples: [
16+
{
17+
type: 'html',
18+
name: 'basic.component.html',
19+
content: require('!!raw-loader!./basic/basic.component.html')
20+
},
21+
{
22+
type: 'ts',
23+
name: 'basic.component.ts',
24+
content: require('!!raw-loader!./basic/basic.component.ts')
25+
}
26+
]
27+
}
28+
];
29+
30+
apiParameters = apiParameters;
31+
32+
constructor() {}
33+
34+
ngOnInit() {}
35+
}

demo/src/app/components/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ import { DemoUploaderSectionComponent } from './+uploader/uploader-section.compo
8383
import { DemoWTDSectionLinkComponent } from './+wtd/wtd.component';
8484
import { DemoSkeletonModule } from './+skeleton';
8585
import { DemoAlertModule } from './+alert/module';
86+
import { DemoResultBasicComponent } from './+result/basic/basic.component';
87+
import { DemoResultSectionComponent } from './+result/result-section.component';
8688
import { DemoCopySectionComponent } from './+copy/copy-section.component';
8789

8890
export const COMPONENTS = [
@@ -172,7 +174,10 @@ export const COMPONENTS = [
172174
CustomSelectDisplayComponent,
173175
CustomSelectGroupComponent,
174176
NativeSelectBasicComponent,
175-
CustomSelectScrollComponent
177+
CustomSelectScrollComponent,
178+
179+
DemoResultBasicComponent,
180+
DemoResultSectionComponent
176181
];
177182

178183
export const ENTRY_COMPONENTS = [
@@ -210,7 +215,9 @@ export const ENTRY_COMPONENTS = [
210215
CustomSelectDisplayComponent,
211216
CustomSelectGroupComponent,
212217
NativeSelectBasicComponent,
213-
CustomSelectScrollComponent
218+
CustomSelectScrollComponent,
219+
220+
DemoResultBasicComponent
214221
];
215222

216223
export const DEMO_MODULES = [

demo/src/app/core/menu.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ export const allMenus = [
115115
{ name: 'Tree', zhName: '树', routePath: 'tree' },
116116
{ name: 'Stepper', zhName: '步骤条', routePath: 'stepper' },
117117
{ name: C95D 'Progress', zhName: '进度条', routePath: 'progress' },
118-
{ name: 'Markdown', zhName: 'markdown 解析', routePath: 'markdown' }
118+
{ name: 'Markdown', zhName: 'markdown 解析', routePath: 'markdown' },
119+
{ name: 'Result', zhName: '结果页', routePath: 'result' }
119120
]
120121
},
121122
{

demo/src/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// @import '~bootstrap/scss/bootstrap';
44
// $primary: #338FE5;
5-
5+
$primary: #348fe4;
66
$demo-toc-width: 200px;
77

88
@import '../../src/styles/index.scss';

src/module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { ThyFlexibleTextModule } from './flexible-text';
5353
import { ThyDragDropModule } from './drag-drop/module';
5454
import { ThySelectCommonModule } from './core/select/module';
5555
import { ThySkeletonModule } from './skeleton';
56+
import { ThyResultModule } from './result';
5657

5758
const IMPORT_EXPORT_MODULES = [
5859
BrowserAnimationsModule,
@@ -109,7 +110,8 @@ const IMPORT_EXPORT_MODULES = [
109110
ThyFlexibleTextModule,
110111
ThyDragDropModule,
111112
ThySelectCommonModule,
112-
ThySkeletonModule
113+
ThySkeletonModule,
114+
ThyResultModule
113115
];
114116

115117
@NgModule({

src/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ export * from './popover';
5555
export * from './flexible-text';
5656
export * from './drag-drop';
5757
export * from './skeleton';
58+
export * from './result';

src/result/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './result.module';
2+
export * from './result.component';

0 commit comments

Comments
 (0)
0