Skip to content

Commit 2f234f1

Browse files
committed
fix(#2003): popover remove relative prop
1 parent 946eedb commit 2f234f1

File tree

23 files changed

+104
-81
lines changed

23 files changed

+104
-81
lines changed

apps/angular-tests/src/app/dropdown/dropdown.component.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ <h1>Dropdown</h1>
3232
</goab-form-item>
3333

3434
<goab-form-item label="Country">
35-
<goab-dropdown [filterable]="true" [relative]="true" name="country" width="30ch">
36-
<goab-dropdown-item *ngFor="let opt of countries" [value]="opt.code" [label]="opt.name"></goab-dropdown-item>
35+
<goab-dropdown [filterable]="true" name="country" width="30ch">
36+
<goab-dropdown-item
37+
*ngFor="let opt of countries"
38+
[value]="opt.code"
39+
[label]="opt.name"
40+
></goab-dropdown-item>
3741
</goab-dropdown>
3842
</goab-form-item>
3943
</form>
@@ -57,8 +61,12 @@ <h1>Dropdown</h1>
5761
<goab-container accent="thin">
5862
<form [formGroup]="form">
5963
<goab-form-item label="Select Option">
60-
<goab-dropdown [relative]="true" name="option" formControlName="option" width="100%">
61-
<goab-dropdown-item *ngFor="let option of options" [value]="option.value" [label]="option.displayValue" />
64+
<goab-dropdown name="option" formControlName="option" width="100%">
65+
<goab-dropdown-item
66+
*ngFor="let option of options"
67+
[value]="option.value"
68+
[label]="option.displayValue"
69+
/>
6270
</goab-dropdown>
6371
</goab-form-item>
6472
</form>

libs/angular-components/src/lib/components/date-picker/date-picker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export class GoabDatePicker implements ControlValueAccessor {
4646
@Input() max?: Date | string;
4747
@Input() error?: boolean;
4848
@Input() disabled?: boolean;
49+
/***
50+
* @deprecated This property has no effect and will be removed in a future version
51+
*/
4952
@Input() relative?: boolean;
5053
@Input() testId?: string;
5154
@Input() mt?: Spacing;

libs/angular-components/src/lib/components/dropdown/dropdown.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class TestDropdownComponent {
5555
placeholder?: string;
5656
testId?: string;
5757
width?: string;
58-
relative?: boolean;
5958
mt?: Spacing;
6059
mb?: Spacing;
6160
ml?: Spacing;

libs/angular-components/src/lib/components/dropdown/dropdown.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export class GoabDropdown implements ControlValueAccessor{
5959
@Input() placeholder?: string;
6060
@Input() testId?: string;
6161
@Input() width?: string;
62+
/***
63+
* @deprecated This property has no effect and will be removed in a future version
64+
*/
6265
@Input() relative?: boolean;
6366
@Input() mt?: Spacing;
6467
@Input() mb?: Spacing;

libs/angular-components/src/lib/components/popover/popover.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { GoabButton } from "../button/button";
1111
[maxWidth]="maxWidth"
1212
[padded]="padded"
1313
[position]="position"
14-
[relative]="relative"
1514
[mt]="mt"
1615
[mb]="mb"
1716
[ml]="ml"
@@ -29,7 +28,6 @@ class TestPopoverComponent {
2928
maxWidth = "320px";
3029
padded = true;
3130
position?: GoabPopoverPosition;
32-
relative?: boolean;
3331
testId?: string;
3432
mt?: Spacing;
3533
mb?: Spacing;
@@ -55,7 +53,6 @@ describe("GoABPopover", () => {
5553
component.maxWidth = "500px";
5654
component.padded = false;
5755
component.position = "above" as GoabPopoverPosition;
58-
component.relative = true;
5956
component.mt = "l" as Spacing;
6057
component.mb = "s" as Spacing;
6158
component.ml = "xs" as Spacing;
@@ -75,7 +72,6 @@ describe("GoABPopover", () => {
7572
expect(el.getAttribute("maxwidth")).toBe(component.maxWidth);
7673
expect(el.getAttribute("padded")).toBe(`${component.padded}`);
7774
expect(el.getAttribute("position")).toBe(component.position);
78-
expect(el.getAttribute("relative")).toBe(`${component.relative}`);
7975

8076
expect(el.getAttribute("mt")).toBe("l");
8177
expect(el.getAttribute("mb")).toBe("s");

libs/angular-components/src/lib/components/popover/popover.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export class GoabPopover {
3232
@Input() minWidth?: string;
3333
@Input() padded = true;
3434
@Input() position?: GoabPopoverPosition;
35+
/***
36+
* @deprecated This property has no effect and will be removed in a future version
37+
*/
3538
@Input() relative?: boolean;
3639
@Input() testId?: string;
3740
@Input() mt?: Spacing;

libs/common/src/lib/common.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ export interface GoabPopoverProps extends Margins {
255255
maxWidth?: string;
256256
padded?: boolean;
257257
position?: GoabPopoverPosition;
258+
/***
259+
* @deprecated This property has no effect and will be removed in a future version
260+
*/
258261
relative?: boolean;
259262
}
260263

libs/react-components/src/lib/date-picker/date-picker.spec.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ describe("DatePicker", () => {
1515
const min = addMonths(value, -1);
1616
const max = addMonths(value, 1);
1717
const disabled = true;
18-
const relative = true;
1918

2019
const { baseElement } = render(
2120
<DatePicker
@@ -26,7 +25,6 @@ describe("DatePicker", () => {
2625
testId="foo"
2726
error={error}
2827
disabled={disabled}
29-
relative={relative}
3028
onChange={noop}
3129
/>,
3230
);
@@ -41,7 +39,6 @@ describe("DatePicker", () => {
4139
expect(el?.getAttribute("disabled")).toBe("true");
4240
expect(el?.getAttribute("min")).toBe(min.toISOString());
4341
expect(el?.getAttribute("max")).toBe(max.toISOString());
44-
expect(el?.getAttribute("relative")).toBe("true");
4542
expect(el?.getAttribute("testid")).toBe("foo");
4643
});
4744

@@ -71,15 +68,4 @@ describe("DatePicker", () => {
7168
expect(onChange).toHaveBeenCalledTimes(1);
7269
expect(onChange).toBeCalledWith({ name, value, type: "date" });
7370
});
74-
75-
it("should render without relative property", () => {
76-
const value = new Date();
77-
const { baseElement } = render(
78-
<DatePicker name="foo" value={value} onChange={noop} />,
79-
);
80-
81-
const el = baseElement.querySelector("goa-date-picker");
82-
expect(el).toBeTruthy();
83-
expect(el?.getAttribute("relative")).toBeNull();
84-
});
8571
});

libs/react-components/src/lib/date-picker/date-picker.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export interface GoabDatePickerProps extends Margins {
3030
min?: Date;
3131
max?: Date;
3232
testId?: string;
33+
/***
34+
* @deprecated This property has no effect and will be removed in a future version
35+
*/
3336
relative?: boolean;
3437
disabled?: boolean;
3538
onChange: (detail: GoabDatePickerOnChangeDetail) => void;

libs/react-components/src/lib/dropdown/dropdown.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export interface GoabDropdownProps extends Margins {
5555
placeholder?: string;
5656
testId?: string;
5757
width?: string;
58+
/***
59+
* @deprecated This property has no effect and will be removed in a future version
60+
*/
5861
relative?: boolean;
5962
}
6063

0 commit comments

Comments
 (0)