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

(enhc) Update form-entry styling post carbon-styles upgrade #83

Merged
merged 3 commits into from
Oct 2, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class TextAreaDirective {
* `light` or `dark` input theme
*/
@Input() theme: 'light' | 'dark' = 'dark';

@HostBinding('class.cds--text-area') baseClass = true;
@HostBinding('class.custom-text-area') customClass = true;
@HostBinding('class.cds--text-area--invalid') @Input() invalid = false;
@HostBinding('class.cds--skeleton') @Input() skeleton = false;
@HostBinding('class.cds--text-area--light') get isLightTheme() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
<div class="tab-container">
<div class="tab" *ngIf="tabs.length > 1">
<button
ofeHoverClass="hover"
class="tablinks completed"
*ngFor="let tab of tabs"
(click)="selectTab(tab)"
[class]="getStatusClasses(tab.active, tab.disabled)"
>
<span>{{ tab.tabTitle }}</span>
</button>
</div>
<div
<div
[ngClass]="{
'tab-container': tabs.length > 1,
'tab-container-one-column': tabs.length === 1
}"
>
<section *ngIf="tabs.length > 1">
<div class="tab">
<button
ofeHoverClass="hover"
class="tablinks completed"
*ngFor="let tab of tabs"
(click)="selectTab(tab)"
[class]="getStatusClasses(tab.active, tab.disabled)"
>
<span>{{ tab.tabTitle }}</span>
</button>
</div>
</section>
<section
id="tab"
[ngClass]="{
'tab-content': tabs.length > 1,
'tab-content-no-margin': tabs.length === 1
}"
>
<ng-content></ng-content>
</div>
</section>
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.tab-container {
overflow-x: hidden;
display: flex;
}

.tab {
width: 10rem;
position: fixed;
Expand Down Expand Up @@ -119,11 +114,18 @@
color: #da1e28;
}

.tab-content {
width: 100%;
margin-left: 10rem;
.tab-container {
display: grid;
grid-template-columns: 179px auto;
}

.tab-container-one-column {
display: grid;
grid-template-columns: 1fr;
}

.tab-content-no-margin {
width: 100%;
display: grid;
grid-template-columns: 1fr;
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,57 +78,47 @@
></ofe-form-renderer>
</div>
<div *ngIf="node.question.renderingType === 'section' && checkSection(node)">
<div
class="cds--accordion__item"
[ngClass]="{ 'cds--accordion__item--active': !isCollapsed }"
>
<button
class="cds--accordion__heading"
type="button"
[attr.aria-expanded]="isCollapsed ? 'false' : 'true'"
aria-controls="accordion-item-0"
(click)="isCollapsed = !isCollapsed"
>
<svg
class="cds--accordion__arrow"
ibmIcon="chevron--right"
size="16"
xmlns="http://www.w3.org/2000/svg"
focusable="false"
preserveAspectRatio="xMidYMid meet"
aria-hidden="true"
width="16"
height="16"
viewBox="0 0 16 16"
>
<path d="M11 8L6 13 5.3 12.3 9.6 8 5.3 3.7 6 3z"></path>
</svg>
<p class="cds--accordion__title">
{{ node.question.label | translate }}
</p>
</button>
<div ofeCollapse="isCollapsed">
<!--Section Components-->
<ofe-custom-component-wrapper
[dark]="theme === 'light'"
[componentConfigs]="node.question.componentConfigs"
<div class="cds--layout">
<ul class="cds--accordion cds--accordion--end">
<li
class="cds--accordion__item accordion-content-override"
[ngClass]="{ 'cds--accordion__item--active': !isCollapsed }"
>
</ofe-custom-component-wrapper>
<div
class="cds--accordion__content accordion-content-override"
[ngClass]="{
'accordion-content-dark': theme === 'light'
}"
>
<ofe-form-renderer
*ngFor="let question of node.question.questions"
[parentComponent]="this"
[node]="node.children[question.key]"
[parentGroup]="parentGroup"
[labelMap]="labelMap"
></ofe-form-renderer>
</div>
</div>
<button
type="button"
aria-controls="accordion-item-:r27:"
aria-expanded="false"
(click)="isCollapsed = !isCollapsed"
class="cds--accordion__heading"
>
<svg
focusable="false"
preserveAspectRatio="xMidYMid meet"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
width="16"
height="16"
viewBox="0 0 16 16"
aria-hidden="true"
class="cds--accordion__arrow"
>
<path d="M11 8L6 13 5.3 12.3 9.6 8 5.3 3.7 6 3z"></path>
</svg>
<div class="cds--accordion__title">
{{ node.question.label | translate }}
</div>
</button>
<div id="accordion-item-:r27:" class="cds--accordion__content">
<ofe-form-renderer
*ngFor="let question of node.question.questions"
[parentComponent]="this"
[node]="node.children[question.key]"
[parentGroup]="parentGroup"
[labelMap]="labelMap"
></ofe-form-renderer>
</div>
</li>
</ul>
</div>
</div>

Expand Down Expand Up @@ -346,7 +336,7 @@
style="margin-top: 2px"
>
<div class="container-fluid">
<div class="row">
<div class="use-value">
<div class="col-xs-9">
<span class="text-warning"
>{{ 'previousValue' | translate }}:
Expand Down Expand Up @@ -448,13 +438,15 @@ <h4 style="margin: 2px; font-weight: bold">
[labelMap]="labelMap"
></ofe-form-renderer>
<div>{{ child.orderNumber }}</div>
<button
type="button "
class="cds--btn cds--btn--danger cds--btn--sm"
(click)="node.removeAt(i)"
>
{{ 'remove' | translate }}
</button>
<div class="cds--layout">
<button
type="button "
class="cds--btn cds--btn--danger cds--btn--sm"
(click)="node.removeAt(i)"
>
{{ 'remove' | translate }}
</button>
</div>
<br />
<hr
style="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,32 @@ ng-select.form-control {
}
.accordion-content-override {
box-sizing: content-box;
border-bottom: none;
padding: 0 0;
text-wrap: wrap;
}
.accordion-content-override:hover {
opacity: unset;
border-bottom: none;
}

.question-area {
width: 100%;
max-width: 95%;
width: 18rem;
max-width: 18rem; // Design specification for the questions
& > label {
text-wrap: wrap;
}
}

.in-line {
display: inline-block;
padding-right: 0.5rem;
}

.use-value {
text-wrap: wrap;
}

.custom-text-area {
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'ofe-form-renderer',
templateUrl: 'form-renderer.component.html',
styleUrls: ['../../style/app.css', './form-renderer.component.css']
styleUrls: ['../../style/app.css', './form-renderer.component.scss']
})
export class FormRendererComponent implements OnInit, OnChanges {
@Input() public parentComponent: FormRendererComponent;
Expand Down
Loading