-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b65773e
commit a1413bb
Showing
28 changed files
with
385 additions
and
395 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<nz-drawer | ||
[nzClosable]="false" | ||
[nzVisible]="visible" | ||
nzPlacement="right" | ||
[nzTitle]="$t('_edit')" | ||
(nzOnClose)="handleClose()" | ||
[nzFooter]="footerTpl" | ||
> | ||
<form nz-form [formGroup]="validateForm" *nzDrawerContent> | ||
<nz-form-item> | ||
<nz-form-label [nzSpan]="4">HTML</nz-form-label> | ||
<nz-form-control [nzSpan]="20"> | ||
<textarea | ||
formControlName="html" | ||
nz-input | ||
[nzAutosize]="{ minRows: 5, maxRows: 25 }" | ||
> | ||
</textarea> | ||
</nz-form-control> | ||
</nz-form-item> | ||
</form> | ||
|
||
<ng-template #footerTpl> | ||
<div style="float: right"> | ||
<button nz-button style="margin-right: 8px" (click)="handleClose()"> | ||
{{ $t('_cancel') }} | ||
</button> | ||
<button nz-button nzType="primary" (click)="handleSubmit()"> | ||
{{ $t('_submit') }} | ||
</button> | ||
</div> | ||
</ng-template> | ||
</nz-drawer> |
Empty file.
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,48 @@ | ||
// 开源项目,未经作者同意,不得以抄袭/复制代码/修改源代码版权信息。 | ||
// Copyright @ 2018-present xiejiahe. All rights reserved. | ||
// See https://github.com/xjh22222228/nav | ||
|
||
import { Component, EventEmitter, Output } from '@angular/core' | ||
import { $t } from 'src/locale' | ||
import { FormBuilder, FormGroup } from '@angular/forms' | ||
|
||
@Component({ | ||
selector: 'html-drawer', | ||
templateUrl: './index.component.html', | ||
styleUrls: ['./index.component.scss'], | ||
}) | ||
export class HTMLDrawerComponent { | ||
@Output() ok = new EventEmitter<void>() | ||
|
||
$t = $t | ||
visible = false | ||
validateForm!: FormGroup | ||
index = 0 | ||
|
||
constructor(private fb: FormBuilder) { | ||
this.validateForm = this.fb.group({ | ||
html: [''], | ||
}) | ||
} | ||
|
||
open(data: any, idx: number) { | ||
this.index = idx | ||
for (const k in data) { | ||
this.validateForm.get(k)!?.setValue(data[k]) | ||
} | ||
this.visible = true | ||
} | ||
|
||
handleClose() { | ||
this.visible = false | ||
} | ||
|
||
handleSubmit() { | ||
const values = this.validateForm.value | ||
this.ok.emit({ | ||
...values, | ||
index: this.index, | ||
}) | ||
this.handleClose() | ||
} | ||
} |
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 @@ | ||
<div class="html family citems" [innerHTML]="data['html'] | safeHtml"></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,10 @@ | ||
.html { | ||
position: relative; | ||
width: var(--componentHeight); | ||
height: var(--componentHeight); | ||
max-width: 100%; | ||
max-height: 100%; | ||
border-radius: 12px; | ||
overflow: hidden; | ||
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); | ||
} |
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 @@ | ||
// 开源项目,未经作者同意,不得以抄袭/复制代码/修改源代码版权信息。 | ||
// Copyright @ 2018-present xiejiahe. All rights reserved. | ||
// See https://github.com/xjh22222228/nav | ||
|
||
import { Component, Input, ChangeDetectionStrategy } from '@angular/core' | ||
import { IComponentProps } from 'src/types' | ||
|
||
@Component({ | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
selector: 'app-html', | ||
templateUrl: './index.component.html', | ||
styleUrls: ['./index.component.scss'], | ||
}) | ||
export class HTMLComponent { | ||
@Input() data!: IComponentProps | ||
|
||
constructor() {} | ||
} |
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,6 +1,6 @@ | ||
<div | ||
class="cimage family citems" | ||
[style.backgroundImage]="component['url'] && 'url(' + component['url'] + ')'" | ||
[style.backgroundImage]="data['url'] && 'url(' + data['url'] + ')'" | ||
> | ||
<div class="text">{{ component['text'] }}</div> | ||
<div class="text">{{ data['text'] }}</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
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
&.rest { | ||
.title { | ||
font-size: 22px; | ||
color: #666; | ||
} | ||
} | ||
.title { | ||
|
Oops, something went wrong.