Skip to content
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
33 changes: 9 additions & 24 deletions projects/dxc-ngx-cdk/src/lib/dxc-footer/dxc-footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,7 @@ import { CssUtils } from "../utils";
import { responsiveSizes } from "../variables";
import { coerceNumberProperty } from "@angular/cdk/coercion";
import { BackgroundProviderService } from "../background-provider/service/background-provider.service";

type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";

type Margin = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};

export interface DxcFooterInputs {
margin: Space | Margin;
padding: Space | Margin;
}
import { FooterProperties, Space, Spacing } from "./dxc-footer.types";

@Component({
selector: "dxc-footer",
Expand Down Expand Up @@ -69,14 +49,14 @@ export class DxcFooterComponent implements OnChanges {
* can pass an object with 'top', 'bottom', 'left' and 'right' properties
* in order to specify different margin sizes.
*/
@Input() margin: Space | Margin;
@Input() margin: Space | Spacing;
/**
* Size of the padding to be applied to the custom area of the component
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' |
* 'xxlarge'). You can pass an object with 'top', 'bottom', 'left' and
* 'right' properties in order to specify different padding sizes.
*/
@Input() padding: Space | Margin;
@Input() padding: Space | Spacing;
/**
* The path of an icon to replace the theme logo.
*/
Expand All @@ -100,9 +80,14 @@ export class DxcFooterComponent implements OnChanges {
bottomLinksLength: number;
currentBackgroundColor: string;

defaultInputs = new BehaviorSubject<DxcFooterInputs>({
defaultInputs = new BehaviorSubject<FooterProperties>({
margin: null,
padding: null,
socialLinks: [],
bottomLinks: [],
copyright: "© DXC Technology 2022. All rights reserved.",
logoSrc: null,
tabIndexValue: 0,
});

@HostListener("window:resize", ["$event"])
Expand Down
25 changes: 25 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-footer/dxc-footer.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export interface FooterProperties {
margin?: Space | Spacing;
socialLinks?: { href?: string; logoSrc?: string }[];
bottomLinks?: { href?: string; text?: string }[];
copyright?: string;
padding?: Space | Spacing;
logoSrc: string;
tabIndexValue: number;
}

export type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";

export type Spacing = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};