diff --git a/projects/common/directives/media-player-element-component.directive.ts b/projects/common/directives/media-player-element-component.directive.ts index de525feb42cbab1cd0df6b466e762da5a3602e39..812567cdacc216ac27978cf81e878165ba98eee4 100644 --- a/projects/common/directives/media-player-element-component.directive.ts +++ b/projects/common/directives/media-player-element-component.directive.ts @@ -3,10 +3,10 @@ import { } from '@angular/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { ElementComponent } from './element-component.directive'; import { AudioElement } from 'common/models/elements/media-elements/audio'; import { VideoElement } from 'common/models/elements/media-elements/video'; import { ValueChangeElement } from 'common/models/elements/element'; +import { ElementComponent } from './element-component.directive'; @Directive() export abstract class MediaPlayerElementComponent extends ElementComponent implements OnInit, OnDestroy { diff --git a/projects/common/models/elements/button/button.ts b/projects/common/models/elements/button/button.ts index 02de40b0bda1066d1acb4594d9111ddc4792f01c..4b44a4cc2c79e14acb660667ef62c04f9c781592 100644 --- a/projects/common/models/elements/button/button.ts +++ b/projects/common/models/elements/button/button.ts @@ -1,6 +1,8 @@ import { Type } from '@angular/core'; import { ElementFactory } from 'common/util/element.factory'; -import { BasicStyles, PositionedUIElement, PositionProperties, UIElement } from 'common/models/elements/element'; +import { + BasicStyles, PositionedUIElement, PositionProperties, UIElement +} from 'common/models/elements/element'; import { ButtonComponent } from 'common/components/button/button.component'; import { ElementComponent } from 'common/directives/element-component.directive'; diff --git a/projects/common/models/elements/compound-elements/cloze/cloze-child-elements/drop-list-simple.ts b/projects/common/models/elements/compound-elements/cloze/cloze-child-elements/drop-list-simple.ts index 6ea1db8933661f01e75bab76d225021d8731e209..7a86b022f18384e1e1dfcb9f076cad2a814e0d54 100644 --- a/projects/common/models/elements/compound-elements/cloze/cloze-child-elements/drop-list-simple.ts +++ b/projects/common/models/elements/compound-elements/cloze/cloze-child-elements/drop-list-simple.ts @@ -1,5 +1,7 @@ import { ElementFactory } from 'common/util/element.factory'; -import { BasicStyles, DragNDropValueObject, InputElement, UIElementValue } from 'common/models/elements/element'; +import { + BasicStyles, DragNDropValueObject, InputElement, UIElementValue +} from 'common/models/elements/element'; import { Type } from '@angular/core'; import { ElementComponent } from 'common/directives/element-component.directive'; import { @@ -25,12 +27,15 @@ export class DropListSimpleElement extends InputElement { if (element.connectedTo) this.connectedTo = element.connectedTo; if (element.copyOnDrop) this.copyOnDrop = element.copyOnDrop; if (element.highlightReceivingDropList) this.highlightReceivingDropList = element.highlightReceivingDropList; - if (element.highlightReceivingDropListColor) this.highlightReceivingDropListColor = element.highlightReceivingDropListColor; + if (element.highlightReceivingDropListColor) { + this.highlightReceivingDropListColor = element.highlightReceivingDropListColor; + } this.styling = { ...ElementFactory.initStylingProps({ backgroundColor: '#f4f4f2', itemBackgroundColor: '#c9e0e0', - ...element.styling }) + ...element.styling + }) }; } diff --git a/projects/common/models/elements/compound-elements/likert/likert.ts b/projects/common/models/elements/compound-elements/likert/likert.ts index 47bf26e20fa071c83a6e51083eea76eb412bcd3f..13054281a1b67ea733cdefa79773805c760776e3 100644 --- a/projects/common/models/elements/compound-elements/likert/likert.ts +++ b/projects/common/models/elements/compound-elements/likert/likert.ts @@ -2,7 +2,7 @@ import { Type } from '@angular/core'; import { ElementFactory } from 'common/util/element.factory'; import { BasicStyles, CompoundElement, UIElement, - PositionedUIElement, PositionProperties, UIElementValue, TextImageLabel, OptionElement, Label + PositionedUIElement, PositionProperties, UIElementValue, TextImageLabel, OptionElement } from 'common/models/elements/element'; import { LikertRowElement } from 'common/models/elements/compound-elements/likert/likert-row'; import { ElementComponent } from 'common/directives/element-component.directive'; @@ -20,7 +20,7 @@ export class LikertElement extends CompoundElement implements PositionedUIElemen }; constructor(element: Partial<LikertElement>, ...args: unknown[]) { - super({width: 250, height: 200, ...element}, ...args); + super({ width: 250, height: 200, ...element }, ...args); if (element.options) this.options = [...element.options]; if (element.firstColumnSizeRatio) this.firstColumnSizeRatio = element.firstColumnSizeRatio; this.rows = element.rows !== undefined ? element.rows?.map(row => new LikertRowElement(row, ...args)) : []; diff --git a/projects/common/models/elements/frame/frame.ts b/projects/common/models/elements/frame/frame.ts index 50bfc3a564a763518c0ecec6c2983b87dc0dc060..14b1ccc76f8b5516bf19fd527df2473d05936bd4 100644 --- a/projects/common/models/elements/frame/frame.ts +++ b/projects/common/models/elements/frame/frame.ts @@ -1,6 +1,8 @@ import { Type } from '@angular/core'; import { ElementFactory } from 'common/util/element.factory'; -import { BasicStyles, PositionedUIElement, PositionProperties, UIElement } from 'common/models/elements/element'; +import { + BasicStyles, PositionedUIElement, PositionProperties, UIElement +} from 'common/models/elements/element'; import { FrameComponent } from 'common/components/frame/frame.component'; import { ElementComponent } from 'common/directives/element-component.directive'; @@ -22,7 +24,7 @@ export class FrameElement extends UIElement implements PositionedUIElement { borderWidth: 1, borderColor: 'black', borderStyle: 'solid', - borderRadius: 0, + borderRadius: 0, ...element.styling }) }; diff --git a/projects/common/models/elements/input-elements/checkbox.ts b/projects/common/models/elements/input-elements/checkbox.ts index 382b8793cdecd6a7352f0bd1f4e4f03508232b00..1d9dc42a997514301b90a30c081e19aa1b33fb8d 100644 --- a/projects/common/models/elements/input-elements/checkbox.ts +++ b/projects/common/models/elements/input-elements/checkbox.ts @@ -1,6 +1,8 @@ import { Type } from '@angular/core'; import { ElementFactory } from 'common/util/element.factory'; -import { BasicStyles, InputElement, PositionedUIElement, PositionProperties } from 'common/models/elements/element'; +import { + BasicStyles, InputElement, PositionedUIElement, PositionProperties +} from 'common/models/elements/element'; import { ElementComponent } from 'common/directives/element-component.directive'; import { CheckboxComponent } from 'common/components/input-elements/checkbox.component'; diff --git a/projects/common/models/elements/input-elements/drop-list.ts b/projects/common/models/elements/input-elements/drop-list.ts index 900c6089d4a9f15cdd9fb17627fa6df7ba2aa1fe..bb54bf92cf6cb12206a1f7167f3a594c06fc8d12 100644 --- a/projects/common/models/elements/input-elements/drop-list.ts +++ b/projects/common/models/elements/input-elements/drop-list.ts @@ -33,8 +33,9 @@ export class DropListElement extends InputElement implements PositionedUIElement if (element.copyOnDrop) this.copyOnDrop = element.copyOnDrop; if (element.orientation) this.orientation = element.orientation; if (element.highlightReceivingDropList) this.highlightReceivingDropList = element.highlightReceivingDropList; - if (element.highlightReceivingDropListColor) this.highlightReceivingDropListColor = - element.highlightReceivingDropListColor; + if (element.highlightReceivingDropListColor) { + this.highlightReceivingDropListColor = element.highlightReceivingDropListColor; + } this.position = ElementFactory.initPositionProps({ useMinHeight: true, ...element.position }); this.styling = { ...ElementFactory.initStylingProps({ diff --git a/projects/common/models/elements/input-elements/dropdown.ts b/projects/common/models/elements/input-elements/dropdown.ts index ccf32e0b6c2714a22c8abce7a52485af1118ae64..90e4c8f04aaaa665ccac466c075e48d13d0e7da0 100644 --- a/projects/common/models/elements/input-elements/dropdown.ts +++ b/projects/common/models/elements/input-elements/dropdown.ts @@ -1,7 +1,7 @@ import { Type } from '@angular/core'; import { ElementFactory } from 'common/util/element.factory'; import { - BasicStyles, InputElement, TextLabel, PositionedUIElement, PositionProperties, OptionElement, Label + BasicStyles, InputElement, TextLabel, PositionedUIElement, PositionProperties, OptionElement } from 'common/models/elements/element'; import { ElementComponent } from 'common/directives/element-component.directive'; import { DropdownComponent } from 'common/components/input-elements/dropdown.component'; diff --git a/projects/common/models/elements/input-elements/slider.ts b/projects/common/models/elements/input-elements/slider.ts index 61b067a78bedfb632346814625b6cf0e3537927e..18204b2b874e47e3c4536b8fe69e33c3a57d7980 100644 --- a/projects/common/models/elements/input-elements/slider.ts +++ b/projects/common/models/elements/input-elements/slider.ts @@ -1,6 +1,8 @@ import { Type } from '@angular/core'; import { ElementFactory } from 'common/util/element.factory'; -import { BasicStyles, InputElement, PositionedUIElement, PositionProperties } from 'common/models/elements/element'; +import { + BasicStyles, InputElement, PositionedUIElement, PositionProperties +} from 'common/models/elements/element'; import { ElementComponent } from 'common/directives/element-component.directive'; import { SliderComponent } from 'common/components/input-elements/slider.component'; diff --git a/projects/common/models/section.ts b/projects/common/models/section.ts index 152367a05658b7714662dcdff7599cecafaf7fb1..2ae465ae34fe6e9cc1bdb01b3cffa01f0ec4139a 100644 --- a/projects/common/models/section.ts +++ b/projects/common/models/section.ts @@ -1,6 +1,8 @@ import { Type } from '@angular/core'; import { IDManager } from 'common/util/id-manager'; -import { PositionedUIElement, UIElement, UIElementValue } from 'common/models/elements/element'; +import { + CompoundElement, PositionedUIElement, UIElement, UIElementValue +} from 'common/models/elements/element'; import { ButtonElement } from 'common/models/elements/button/button'; import { TextElement } from 'common/models/elements/text/text'; import { TextFieldElement } from 'common/models/elements/input-elements/text-field'; @@ -39,25 +41,25 @@ export class Section { activeAfterID: string | null = null; static ELEMENT_CLASSES: Record<string, Type<UIElement>> = { - 'text': TextElement, - 'button': ButtonElement, + text: TextElement, + button: ButtonElement, 'text-field': TextFieldElement, 'text-field-simple': TextFieldSimpleElement, 'text-area': TextAreaElement, - 'checkbox': CheckboxElement, - 'dropdown': DropdownElement, - 'radio': RadioButtonGroupElement, - 'image': ImageElement, - 'audio': AudioElement, - 'video': VideoElement, - 'likert': LikertElement, + checkbox: CheckboxElement, + dropdown: DropdownElement, + radio: RadioButtonGroupElement, + image: ImageElement, + audio: AudioElement, + video: VideoElement, + likert: LikertElement, 'radio-group-images': RadioButtonGroupComplexElement, 'drop-list': DropListElement, 'drop-list-simple': DropListSimpleElement, - 'cloze': ClozeElement, - 'slider': SliderElement, + cloze: ClozeElement, + slider: SliderElement, 'spell-correct': SpellCorrectElement, - 'frame': FrameElement, + frame: FrameElement, 'toggle-button': ToggleButtonElement }; diff --git a/projects/editor/src/app/app.module.ts b/projects/editor/src/app/app.module.ts index 1d912758416774513d60865a20f75957fa88c960..9fdc907640b065f1a2363d7e15e61cce90f79120 100644 --- a/projects/editor/src/app/app.module.ts +++ b/projects/editor/src/app/app.module.ts @@ -70,16 +70,19 @@ import { ButtonPropertiesComponent } from import { SliderPropertiesComponent } from './components/properties-panel/model-properties-tab/input-groups/slider-properties.component'; import { TextFieldElementPropertiesComponent } from - './components/properties-panel/model-properties-tab/input-groups/text-field-element-properties.component'; + './components/properties-panel/model-properties-tab/input-groups/text-field-element-properties.component'; import { ScaleAndZoomPropertiesComponent } from - './components/properties-panel/model-properties-tab/input-groups/scale-and-zoom-properties.component'; + './components/properties-panel/model-properties-tab/input-groups/scale-and-zoom-properties.component'; import { DropListPropertiesComponent } from './components/properties-panel/model-properties-tab/input-groups/drop-list-properties.component'; import { RichTextEditorSimpleComponent } from './text-editor-simple/rich-text-editor-simple.component'; import { RichTextSimpleEditDialogComponent } from './components/dialogs/rich-text-simple-edit-dialog.component'; -import { SelectPropertiesComponent } from './components/properties-panel/model-properties-tab/input-groups/select-properties.component'; -import { InputElementPropertiesComponent } from './components/properties-panel/model-properties-tab/input-groups/input-element-properties.component'; -import { PresetValuePropertiesComponent } from './components/properties-panel/model-properties-tab/input-groups/preset-value-properties.component'; +import { SelectPropertiesComponent } from + './components/properties-panel/model-properties-tab/input-groups/select-properties.component'; +import { InputElementPropertiesComponent } from + './components/properties-panel/model-properties-tab/input-groups/input-element-properties.component'; +import { PresetValuePropertiesComponent } from + './components/properties-panel/model-properties-tab/input-groups/preset-value-properties.component'; import { OptionListPanelComponent } from './components/properties-panel/option-list-panel.component'; import { LikertRowLabelPipe } from './components/properties-panel/likert-row-label.pipe'; import { LabelEditDialogComponent } from './components/dialogs/label-edit-dialog.component';