Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mode selections #204

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added devextreme-23.2.0.tgz
Binary file not shown.
Binary file added devextreme-angular-23.2.0.tgz
Binary file not shown.
Binary file added devextreme-themebuilder-23.2.0.tgz
Binary file not shown.
15 changes: 13 additions & 2 deletions src/app/preview/button-group/button-group.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@
</div>
</ng-template>
<ng-template #expandedBlock>
<div class="component-options">
<div class="options-block">
<div class="option">
<span>Buttons Style</span>
<div>
<dx-select-box
width="200px"
[(value)]="typeValue"
[items]="['default', 'normal', 'success', 'danger']"
(onValueChanged)="changeType($event)"
stylingMode="outlined">
</dx-select-box>
</div>
</div>
<dx-check-box
text="Show icons"
[value]="true"
Expand All @@ -36,7 +48,6 @@
(onValueChanged)="toogleText($event)"
></dx-check-box>
</div>

<div class="btn-container">
<div class="btn-row">
<div class="btn-cell btn-cell--empty"></div>
Expand Down
15 changes: 15 additions & 0 deletions src/app/preview/button-group/button-group.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BehaviorSubject } from 'rxjs';
import { DxButtonTypes } from 'devextreme-angular/ui/button';
import { DxButtonGroupTypes } from 'devextreme-angular/ui/button-group';
import { DxCheckBoxTypes } from 'devextreme-angular/ui/check-box';
import { DxSelectBoxTypes } from 'devextreme-angular/ui/select-box';
import dxButtonGroup from 'devextreme/ui/button_group';

type CustomButtonGroupItem = DxButtonGroupTypes.Item & {
Expand All @@ -17,6 +18,8 @@ type CustomButtonGroupItem = DxButtonGroupTypes.Item & {
export class ButtonGroupComponent {
listButtonGroup: dxButtonGroup[] = [];

typeValue = 'default';

capitalizeFirstLetter(str: string) {
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
return str.charAt(0).toUpperCase() + str.slice(1);
Expand All @@ -40,6 +43,18 @@ export class ButtonGroupComponent {
});
}

changeType(event: DxSelectBoxTypes.ValueChangedEvent) {
this.listButtonGroup.forEach((component) => {
const items = component.option('items');
const changedItems = items.map((item: CustomButtonGroupItem) => {
item.type = event.value;
return item;
});

component.option('items', changedItems);
});
}

toogleIcons(event: DxCheckBoxTypes.ValueChangedEvent) {
this.listButtonGroup.forEach((component) => {
const items = component.option('items');
Expand Down
19 changes: 16 additions & 3 deletions src/app/preview/buttons/buttons.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
</div>
</ng-template>
<ng-template #expandedBlock>
<div class="options-block">
<div class="option">
<span>Buttons Style</span>
<div>
<dx-select-box
width="200px"
[(value)]="typeValue"
[items]="['default', 'normal', 'success', 'danger']"
stylingMode="outlined">
</dx-select-box>
</div>
</div>
</div>
<div class="btn-container">
<div class="btn-row">
<div class="btn-cell btn-cell--empty"></div>
Expand Down Expand Up @@ -95,22 +108,22 @@
<div class="btn-list">
<dx-button
text="Button"
type="default"
[type]="typeValue"
[stylingMode]="mode"
[disabled]="disabled"
(onContentReady)="initState ? initState($event) : null"
></dx-button>
<dx-button
text="Button"
icon="favorites"
type="default"
[type]="typeValue"
[stylingMode]="mode"
[disabled]="disabled"
(onContentReady)="initState ? initState($event) : null"
></dx-button>
<dx-button
icon="favorites"
type="default"
[type]="typeValue"
[stylingMode]="mode"
[disabled]="disabled"
(onContentReady)="initState ? initState($event) : null"
Expand Down
2 changes: 2 additions & 0 deletions src/app/preview/buttons/buttons.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { DxButtonTypes } from 'devextreme-angular/ui/button';
})

export class ButtonsComponent {
typeValue = 'default';

initStateHover(event: DxButtonTypes.ClickEvent) {
event.component.element().classList.add('dx-state-hover');
}
Expand Down
77 changes: 54 additions & 23 deletions src/app/preview/editors/editors.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,24 @@
margin-right: 10px;
}

:host ::ng-deep .dx-radiogroup {
display: inline-block;
vertical-align: middle;
.collapsed-block {
display: flex;
align-items: center;
}

.editors {
width: 100%;
margin-bottom: 30px;
flex-direction: column;
}

.editors .block {
width: 480px;
display: inline-flex;
flex-wrap: wrap;
margin-right: 30px;
}

.editors .block .field {
margin: 0 10px 20px 0;
flex: 1 0 150px;
max-width: 150px;
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
Expand All @@ -47,7 +44,7 @@
}

::ng-deep .dx-theme-material-typography .editors .block .field {
min-height: 90px;
min-height: 60px;
}

:host ::ng-deep .editors .dx-texteditor {
Expand All @@ -72,26 +69,31 @@
font-size: 14px;
}

.radiogroup > *,
.checkbox > *,
.calendar > *,
.daterangebox > * {
display: flex;
width: auto;
margin-bottom: 10px;
}

.checkbox > * {
display: flex;;
}

::ng-deep .dx-radiogroup .dx-radiobutton {
margin-bottom: 0;
margin-top: 0;
}

.daterangebox {
min-width: 270px;
}

.calendar {
margin-right: 30px;
min-width: 280px;
}

.radiogroup,
.checkbox,
.switch {
margin: 0 30px;
}

:host ::ng-deep .checkbox .dx-checkbox {
margin-right: 0;
}
Expand All @@ -101,18 +103,47 @@
}

.switch .field {
width: auto;
margin-bottom: 10px;
display: flex;
gap: 10px;
}

.switch .field > div {
display: inline-block;
margin-right: 10px;
.switch .value {
display: flex;
}

.switchers {
gap: 48px;
}

.component-container {
height: 32px;
display: flex;
align-items: center;
}

.fileuploader {
width: 250px;
width: 360px;
}

.component-section {
display: flex;
gap: 48px;
}

.component-section .block {
flex: 1;
display: flex;
}

.grouped-fields {
display: flex;
width: 100%;
}

.editors .grouped-fields .field.validation {
flex-basis: 32%;
}

.editors .grouped-fields .field.daterangebox {
flex-basis: 66%;
}
Loading
Loading