Skip to content

Commit

Permalink
Fixed after designer review (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
dxvladislavvolkov authored Nov 7, 2023
1 parent 81e267d commit 3714cc4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/preview/buttons/buttons.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@
<div class="btn-cell">
<div class="btn-list">
<dx-button
text="BUTTON"
text="Button"
type="default"
[stylingMode]="mode"
[disabled]="disabled"
(onContentReady)="initState ? initState($event) : null"
></dx-button>
<dx-button
text="BUTTON"
text="Button"
icon="favorites"
type="default"
[stylingMode]="mode"
Expand Down
4 changes: 2 additions & 2 deletions src/app/preview/editors/editors.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<ng-template #collapsedBlock>
<dx-text-box width="140" value="Text Box"></dx-text-box>
<dx-tag-box width="140" [items]="['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']" [value]="['Monday']"></dx-tag-box>
<dx-tag-box width="140" [multiline]="false" [items]="['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']" [value]="['Monday']"></dx-tag-box>
<dx-select-box width="140" [items]="['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']"></dx-select-box>
<dx-lookup width="140" [items]="['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']"></dx-lookup>
<dx-check-box [value]="true"></dx-check-box>
Expand Down Expand Up @@ -40,7 +40,7 @@
</dx-text-box>
</div>
<div class="field daterangebox">
<dx-date-range-box stylingMode="outlined" [dropDownOptions]="dropDownOptions"></dx-date-range-box>
<dx-date-range-box stylingMode="outlined" [dropDownOptions]="dropDownOptions" [labelMode]="labelMode"></dx-date-range-box>
</div>
</div>
<div class="block filled">
Expand Down
2 changes: 1 addition & 1 deletion src/app/preview/preview/preview.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

.component-display:hover,
.component-item.component-item--active .component-display {
.component-item.selected-component-item .component-display {
border-color: #2190F7;
}

Expand Down
4 changes: 4 additions & 0 deletions src/app/preview/preview/preview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class PreviewComponent implements AfterViewInit, OnChanges {

createPreviewContent(widget: any): void {
const EXPAND_CLASS_NAME = 'component-item--active';
const SELECTED_ITEM_CLASS_NAME = 'selected-component-item';
const flexContainers = document.getElementsByClassName('component-item');
const scrollableContainer = this.scrollView.instance.element().querySelector('.dx-scrollable-container');
const currentWidget: string = widget.currentValue || widget;
Expand All @@ -38,6 +39,7 @@ export class PreviewComponent implements AfterViewInit, OnChanges {
/* eslint @typescript-eslint/prefer-for-of: 'off' */
for(let i = 0; i < flexContainers.length; i++) {
flexContainers[i].classList.remove(EXPAND_CLASS_NAME);
flexContainers[i].classList.remove(SELECTED_ITEM_CLASS_NAME);
}

this.widgetElements.forEach((widgetEl) => {
Expand All @@ -63,6 +65,8 @@ export class PreviewComponent implements AfterViewInit, OnChanges {
const flexParentContainer = widgetContainer[0].parentElement.parentElement;
const scrollTop = 30;

flexParentContainer.classList.add(SELECTED_ITEM_CLASS_NAME);

if(this.notExpandableWidgets.indexOf(currentWidget) >= 0) {
scrollableContainer.scrollTo({
top: flexParentContainer.offsetTop - scrollTop,
Expand Down
1 change: 0 additions & 1 deletion src/app/preview/treeview/treeview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export class TreeviewComponent {
{
id: 11,
text: 'Individual Platforms',
selected: true,
items: [
{ id: 111, text: 'WinForms' },
{ id: 112, text: 'ASP.NET' },
Expand Down

0 comments on commit 3714cc4

Please sign in to comment.