mirror of https://github.com/Squidex/squidex.git
13 changed files with 205 additions and 5 deletions
@ -0,0 +1,3 @@ |
|||
<div [formGroup]="editForm"> |
|||
<span>Nothing to setup</span> |
|||
<div> |
|||
@ -0,0 +1,2 @@ |
|||
@import '_vars'; |
|||
@import '_mixins'; |
|||
@ -0,0 +1,25 @@ |
|||
/* |
|||
* Squidex Headless CMS |
|||
* |
|||
* @license |
|||
* Copyright (c) Sebastian Stehle. All rights reserved |
|||
*/ |
|||
|
|||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; |
|||
import { FormGroup } from '@angular/forms'; |
|||
|
|||
import { AssetsFieldPropertiesDto } from 'shared'; |
|||
|
|||
@Component({ |
|||
selector: 'sqx-tags-ui', |
|||
styleUrls: ['tags-ui.component.scss'], |
|||
templateUrl: 'tags-ui.component.html', |
|||
changeDetection: ChangeDetectionStrategy.OnPush |
|||
}) |
|||
export class TagsUIComponent { |
|||
@Input() |
|||
public editForm: FormGroup; |
|||
|
|||
@Input() |
|||
public properties: AssetsFieldPropertiesDto; |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
<div [formGroup]="editForm"> |
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-checkbox-label" for="field-required">Required</label> |
|||
|
|||
<div class="col col-6"> |
|||
<input type="checkbox" class="form-check-input" id="field-required" formControlName="isRequired" /> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label">Items</label> |
|||
|
|||
<div class="col col-3 minlength-col"> |
|||
<input type="number" class="form-control" id="field-min-items" formControlName="minItems" placeholder="Min Items" /> |
|||
|
|||
<label class="col-form-label minitems-label">-</label> |
|||
</div> |
|||
<div class="col col-3"> |
|||
<input type="number" class="form-control" id="field-max-items" formControlName="maxItems" placeholder="Max Items" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,20 @@ |
|||
@import '_vars'; |
|||
@import '_mixins'; |
|||
|
|||
.minitems { |
|||
&-col { |
|||
position: relative; |
|||
} |
|||
|
|||
&-label { |
|||
@include absolute(0, -.2rem, auto, auto); |
|||
} |
|||
} |
|||
|
|||
.form-check-input { |
|||
margin: 0; |
|||
} |
|||
|
|||
.form-group { |
|||
margin-top: .5rem; |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/* |
|||
* Squidex Headless CMS |
|||
* |
|||
* @license |
|||
* Copyright (c) Sebastian Stehle. All rights reserved |
|||
*/ |
|||
|
|||
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; |
|||
import { FormControl, FormGroup } from '@angular/forms'; |
|||
|
|||
import { AssetsFieldPropertiesDto } from 'shared'; |
|||
|
|||
@Component({ |
|||
selector: 'sqx-tags-validation', |
|||
styleUrls: ['tags-validation.component.scss'], |
|||
templateUrl: 'tags-validation.component.html', |
|||
changeDetection: ChangeDetectionStrategy.OnPush |
|||
}) |
|||
export class TagsValidationComponent implements OnInit { |
|||
@Input() |
|||
public editForm: FormGroup; |
|||
|
|||
@Input() |
|||
public properties: AssetsFieldPropertiesDto; |
|||
|
|||
public ngOnInit() { |
|||
this.editForm.setControl('maxItems', |
|||
new FormControl(this.properties.maxItems)); |
|||
|
|||
this.editForm.setControl('minItems', |
|||
new FormControl(this.properties.minItems)); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue