-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[优化] JigsawButton现在采用纯css的形式居中,去掉line-height的计算,优化按钮的尺寸/文字大小等;[新增] di…
…alog现在可以设置弹框的高度
- Loading branch information
Showing
11 changed files
with
139 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.dialog-content { | ||
background: aquamarine; | ||
position: relative; | ||
} | ||
|
||
.dialog-content p { | ||
font-size: 24px; | ||
text-align: center; | ||
position: absolute; | ||
width: 100%; | ||
left: 0; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
} | ||
|
||
|
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,29 @@ | ||
<!-- ignore the following lines, they are not important to this demo --> | ||
<jigsaw-demo-description [summary]="summary" [content]="description"> | ||
</jigsaw-demo-description> | ||
|
||
|
||
<!-- start to learn the demo from here --> | ||
<div class="live-demo-wrap"> | ||
<h2>Dialog</h2> | ||
<div class="demo-1 live-demo"> | ||
<h3>Height</h3> | ||
<p class="comment"> | ||
一般dialog不设高度,dialog会随内容撑开,设置了高度,用户可以在自定义的content中加 | ||
<code>style="height: 100%"</code>,使内容撑满dialog-content</p> | ||
<jigsaw-button (click)="popupDialog1(dialog1)">popup</jigsaw-button> | ||
<ng-template #dialog1> | ||
<jigsaw-dialog width="80%" height="400" caption="dialog title" (close)="close()"> | ||
<div class="dialog-content" style="height: 100%"> | ||
<p>dialog content</p> | ||
</div> | ||
<div jigsaw-button-bar> | ||
<jigsaw-button colorType="danger" (click)="close()">OK</jigsaw-button> | ||
</div> | ||
</jigsaw-dialog> | ||
</ng-template> | ||
</div> | ||
</div> | ||
|
||
|
||
|
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 @@ | ||
import {Component, TemplateRef} from "@angular/core"; | ||
import {PopupInfo, PopupService} from "jigsaw/service/popup.service"; | ||
|
||
@Component({ | ||
templateUrl: './demo.component.html', | ||
styleUrls: ['./demo.component.css'] | ||
}) | ||
export class DialogHeightDemo { | ||
dialogInfo: PopupInfo; | ||
|
||
constructor(private popupService: PopupService) { | ||
} | ||
|
||
close() { | ||
this.dialogInfo.dispose(); | ||
} | ||
|
||
popupDialog1(ele: TemplateRef<any>) { | ||
this.dialogInfo = this.popupService.popup(ele); | ||
} | ||
|
||
// ==================================================================== | ||
// ignore the following lines, they are not important to this demo | ||
// ==================================================================== | ||
summary: string = '这个demo演示了如何使用`height`属性来控制弹出的对话框的高度'; | ||
description: string = ''; | ||
tags: string[] = [ | ||
'JigsawDialog.height', | ||
]; | ||
} |
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 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {JigsawButtonModule} from "jigsaw/component/button/button"; | ||
import {JigsawDialogModule} from "jigsaw/component/dialog/dialog"; | ||
import {JigsawInputModule} from "jigsaw/component/input/input"; | ||
import {PopupService} from "jigsaw/service/popup.service"; | ||
import {JigsawDemoDescriptionModule} from "app/demo-description/demo-description"; | ||
import {DialogHeightDemo} from "./demo.component"; | ||
|
||
@NgModule({ | ||
declarations: [DialogHeightDemo], | ||
exports: [DialogHeightDemo], | ||
imports: [JigsawDialogModule, JigsawButtonModule, JigsawInputModule, JigsawDemoDescriptionModule], | ||
providers: [PopupService] | ||
}) | ||
export class DialogHeightDemoModule { | ||
|
||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<ng-content></ng-content> | ||
<div class="jigsaw-button-content"><ng-content></ng-content></div> |
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
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
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