|
|
|
@ -5,13 +5,13 @@ |
|
|
|
|
|
|
|
<small class="field-disabled ps-1" *ngIf="field.isDisabled">Disabled</small> |
|
|
|
|
|
|
|
<sqx-control-errors *ngIf="form" [for]="editorControl" [fieldName]="field.displayName"></sqx-control-errors> |
|
|
|
<sqx-control-errors *ngIf="form" [for]="$any(fieldForm)" [fieldName]="field.displayName"></sqx-control-errors> |
|
|
|
|
|
|
|
<div> |
|
|
|
<ng-container *ngIf="field.properties.editorUrl; else noEditor"> |
|
|
|
<sqx-iframe-editor [url]="field.properties.editorUrl" #editor |
|
|
|
[context]="formContext" |
|
|
|
[formControl]="editorControl" |
|
|
|
[formControl]="$any(fieldForm)" |
|
|
|
[formValue]="form.valueChanges | async" |
|
|
|
[formIndex]="index" |
|
|
|
[language]="language?.iso2Code"> |
|
|
|
@ -31,16 +31,16 @@ |
|
|
|
</sqx-array-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Assets'"> |
|
|
|
<sqx-assets-editor [formControl]="editorControl" [folderId]="field.rawProperties.folderId"></sqx-assets-editor> |
|
|
|
<sqx-assets-editor [formControl]="$any(fieldForm)" [folderId]="field.rawProperties.folderId"></sqx-assets-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Boolean'"> |
|
|
|
<ng-container [ngSwitch]="field.rawProperties.editor"> |
|
|
|
<ng-container *ngSwitchCase="'Toggle'"> |
|
|
|
<sqx-toggle [formControl]="editorControl" [threeStates]="!field.properties.isRequired"></sqx-toggle> |
|
|
|
<sqx-toggle [formControl]="$any(fieldForm)" [threeStates]="!field.properties.isRequired"></sqx-toggle> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Checkbox'"> |
|
|
|
<div class="form-check"> |
|
|
|
<input class="form-check-input" type="checkbox" [formControl]="editorControl" id="{{uniqueId}}" sqxIndeterminateValue [threeStates]="!field.properties.isRequired"> |
|
|
|
<input class="form-check-input" type="checkbox" [formControl]="$any(fieldForm)" id="{{uniqueId}}" sqxIndeterminateValue [threeStates]="!field.properties.isRequired"> |
|
|
|
<label class="form-check-label" for="{{uniqueId}}"></label> |
|
|
|
</div> |
|
|
|
</ng-container> |
|
|
|
@ -67,31 +67,31 @@ |
|
|
|
</sqx-array-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'DateTime'"> |
|
|
|
<sqx-date-time-editor [formControl]="editorControl" [mode]="field.rawProperties.editor" [enforceTime]="true"></sqx-date-time-editor> |
|
|
|
<sqx-date-time-editor [formControl]="$any(fieldForm)" [mode]="field.rawProperties.editor" [enforceTime]="true"></sqx-date-time-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Geolocation'"> |
|
|
|
<sqx-geolocation-editor [formControl]="editorControl"></sqx-geolocation-editor> |
|
|
|
<sqx-geolocation-editor [formControl]="$any(fieldForm)"></sqx-geolocation-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Json'"> |
|
|
|
<sqx-code-editor [formControl]="editorControl" valueMode="Json" [height]="350"></sqx-code-editor> |
|
|
|
<sqx-code-editor [formControl]="$any(fieldForm)" valueMode="Json" [height]="350"></sqx-code-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Number'"> |
|
|
|
<ng-container [ngSwitch]="field.rawProperties.editor"> |
|
|
|
<ng-container *ngSwitchCase="'Input'"> |
|
|
|
<input class="form-control" type="number" [formControl]="editorControl" [placeholder]="field.displayPlaceholder"> |
|
|
|
<input class="form-control" type="number" [formControl]="$any(fieldForm)" [placeholder]="field.displayPlaceholder"> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Stars'"> |
|
|
|
<sqx-stars [formControl]="editorControl" [maximumStars]="field.rawProperties.maxValue"></sqx-stars> |
|
|
|
<sqx-stars [formControl]="$any(fieldForm)" [maximumStars]="field.rawProperties.maxValue"></sqx-stars> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Dropdown'"> |
|
|
|
<select class="form-select" [formControl]="editorControl"> |
|
|
|
<select class="form-select" [formControl]="$any(fieldForm)"> |
|
|
|
<option [ngValue]="null"></option> |
|
|
|
<option *ngFor="let value of field.rawProperties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Radio'"> |
|
|
|
<div class="form-check" *ngFor="let value of field.rawProperties.allowedValues"> |
|
|
|
<input class="form-check-input" type="radio" [value]="value" [formControl]="editorControl" [name]="uniqueId" id="{{uniqueId}}_{{value}}"> |
|
|
|
<input class="form-check-input" type="radio" [value]="value" [formControl]="$any(fieldForm)" [name]="uniqueId" id="{{uniqueId}}_{{value}}"> |
|
|
|
<label class="form-check-label" for="{{uniqueId}}_{{value}}"> |
|
|
|
{{value}} |
|
|
|
</label> |
|
|
|
@ -103,7 +103,7 @@ |
|
|
|
<ng-container [ngSwitch]="field.rawProperties.editor"> |
|
|
|
<ng-container *ngSwitchCase="'List'"> |
|
|
|
<sqx-references-editor |
|
|
|
[formControl]="editorControl" |
|
|
|
[formControl]="$any(fieldForm)" |
|
|
|
[allowDuplicates]="field.rawProperties.allowDuplicated" |
|
|
|
[formContext]="formContext" |
|
|
|
[language]="language" |
|
|
|
@ -114,21 +114,21 @@ |
|
|
|
<ng-container *ngSwitchCase="'Dropdown'"> |
|
|
|
<sqx-reference-dropdown |
|
|
|
mode="Array" |
|
|
|
[formControl]="editorControl" |
|
|
|
[formControl]="$any(fieldForm)" |
|
|
|
[language]="language" |
|
|
|
[schemaId]="field.rawProperties.singleId"> |
|
|
|
</sqx-reference-dropdown> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Tags'"> |
|
|
|
<sqx-references-tags |
|
|
|
[formControl]="editorControl" |
|
|
|
[formControl]="$any(fieldForm)" |
|
|
|
[language]="language" |
|
|
|
[schemaId]="field.rawProperties.singleId"> |
|
|
|
</sqx-references-tags> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Checkboxes'"> |
|
|
|
<sqx-references-checkboxes |
|
|
|
[formControl]="editorControl" |
|
|
|
[formControl]="$any(fieldForm)" |
|
|
|
[language]="language" |
|
|
|
[schemaId]="field.rawProperties.singleId"> |
|
|
|
</sqx-references-checkboxes> |
|
|
|
@ -138,55 +138,55 @@ |
|
|
|
<ng-container *ngSwitchCase="'String'"> |
|
|
|
<ng-container [ngSwitch]="field.rawProperties.editor"> |
|
|
|
<ng-container *ngSwitchCase="'Input'"> |
|
|
|
<input class="form-control" type="text" [formControl]="editorControl" [placeholder]="field.displayPlaceholder"> |
|
|
|
<input class="form-control" type="text" [formControl]="$any(fieldForm)" [placeholder]="field.displayPlaceholder"> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Slug'"> |
|
|
|
<input class="form-control" type="text" [formControl]="editorControl" [placeholder]="field.displayPlaceholder" sqxTransformInput="Slugify"> |
|
|
|
<input class="form-control" type="text" [formControl]="$any(fieldForm)" [placeholder]="field.displayPlaceholder" sqxTransformInput="Slugify"> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'TextArea'"> |
|
|
|
<textarea class="form-control" [formControl]="editorControl" [placeholder]="field.displayPlaceholder" rows="5"></textarea> |
|
|
|
<textarea class="form-control" [formControl]="$any(fieldForm)" [placeholder]="field.displayPlaceholder" rows="5"></textarea> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'RichText'"> |
|
|
|
<sqx-rich-editor [formControl]="editorControl" #editor [folderId]="field.rawProperties.folderId"></sqx-rich-editor> |
|
|
|
<sqx-rich-editor [formControl]="$any(fieldForm)" #editor [folderId]="field.rawProperties.folderId"></sqx-rich-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Html'"> |
|
|
|
<sqx-code-editor [formControl]="editorControl" #editor mode="ace/mode/html" [height]="350" ></sqx-code-editor> |
|
|
|
<sqx-code-editor [formControl]="$any(fieldForm)" #editor mode="ace/mode/html" [height]="350" ></sqx-code-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Markdown'"> |
|
|
|
<sqx-markdown-editor [formControl]="editorControl" #editor [folderId]="field.rawProperties.folderId"></sqx-markdown-editor> |
|
|
|
<sqx-markdown-editor [formControl]="$any(fieldForm)" #editor [folderId]="field.rawProperties.folderId"></sqx-markdown-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'StockPhoto'"> |
|
|
|
<sqx-stock-photo-editor [formControl]="editorControl"></sqx-stock-photo-editor> |
|
|
|
<sqx-stock-photo-editor [formControl]="$any(fieldForm)"></sqx-stock-photo-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Dropdown'"> |
|
|
|
<select class="form-select" [formControl]="editorControl"> |
|
|
|
<select class="form-select" [formControl]="$any(fieldForm)"> |
|
|
|
<option [ngValue]="null"></option> |
|
|
|
<option *ngFor="let value of field.rawProperties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Radio'"> |
|
|
|
<div class="form-check custom-control-inline" *ngFor="let value of field.rawProperties.allowedValues"> |
|
|
|
<input class="form-check-input" type="radio" [value]="value" [formControl]="editorControl" [name]="uniqueId" id="{{uniqueId}}_{{value}}"> |
|
|
|
<input class="form-check-input" type="radio" [value]="value" [formControl]="$any(fieldForm)" [name]="uniqueId" id="{{uniqueId}}_{{value}}"> |
|
|
|
<label class="form-check-label" for="{{uniqueId}}_{{value}}"> |
|
|
|
{{value}} |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Color'"> |
|
|
|
<sqx-color-picker [formControl]="editorControl" [placeholder]="field.displayPlaceholder"></sqx-color-picker> |
|
|
|
<sqx-color-picker [formControl]="$any(fieldForm)" [placeholder]="field.displayPlaceholder"></sqx-color-picker> |
|
|
|
</ng-container> |
|
|
|
</ng-container> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Tags'"> |
|
|
|
<ng-container [ngSwitch]="field.rawProperties.editor"> |
|
|
|
<ng-container *ngSwitchCase="'Tags'"> |
|
|
|
<sqx-tag-editor [formControl]="editorControl" [placeholder]="field.displayPlaceholder" [suggestions]="field.rawProperties.allowedValues"></sqx-tag-editor> |
|
|
|
<sqx-tag-editor [formControl]="$any(fieldForm)" [placeholder]="field.displayPlaceholder" [suggestions]="field.rawProperties.allowedValues"></sqx-tag-editor> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Checkboxes'"> |
|
|
|
<sqx-checkbox-group [formControl]="editorControl" [values]="field.rawProperties.allowedValues"></sqx-checkbox-group> |
|
|
|
<sqx-checkbox-group [formControl]="$any(fieldForm)" [values]="field.rawProperties.allowedValues"></sqx-checkbox-group> |
|
|
|
</ng-container> |
|
|
|
<ng-container *ngSwitchCase="'Dropdown'"> |
|
|
|
<select multiple class="form-select" [formControl]="editorControl"> |
|
|
|
<select multiple class="form-select" [formControl]="$any(fieldForm)"> |
|
|
|
<option *ngFor="let value of field.rawProperties.allowedValues" [ngValue]="value">{{value}}</option> |
|
|
|
</select> |
|
|
|
</ng-container> |
|
|
|
|