Skip to content

Commit 2a0706a

Browse files
committed
change position prop
1 parent a89dc35 commit 2a0706a

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

core/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ ion-backdrop,event,ionBackdropTap,void,true
314314
ion-badge,shadow
315315
ion-badge,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
316316
ion-badge,prop,mode,"ios" | "md",undefined,false,false
317-
ion-badge,prop,position,"bottom-right" | "static" | "top-right",'static',false,false
317+
ion-badge,prop,position,"bottom" | "top" | undefined,undefined,false,false
318318
ion-badge,prop,shape,"round | rectangular" | "soft" | undefined,undefined,false,false
319319
ion-badge,prop,size,"large" | "medium" | "small" | "xlarge" | "xsmall" | "xxsmall" | undefined,undefined,false,false
320320
ion-badge,prop,theme,"ios" | "md" | "ionic",undefined,false,false

core/src/components.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,9 @@ export namespace Components {
429429
*/
430430
"mode"?: "ios" | "md";
431431
/**
432-
* Set to `"top-right"` to position the badge on top right absolute position of the parent element. Set to `"bottom-right"` to position the badge on bottom right absolute position of the parent element. Defaults to `"static"`.
432+
* Set to `"top"` to position the badge on top right absolute position of the parent element. Set to `"bottom"` to position the badge on bottom right absolute position of the parent element.
433433
*/
434-
"position": 'top-right' | 'bottom-right' | 'static';
434+
"position"?: 'top' | 'bottom';
435435
/**
436436
* Set to `"rectangular"` for non-rounded corners. Set to `"soft"` for slightly rounded corners. Set to `"round"` for fully rounded corners. Defaults to `"round"` for the `ionic` theme, undefined for all other themes.
437437
*/
@@ -5797,9 +5797,9 @@ declare namespace LocalJSX {
57975797
*/
57985798
"mode"?: "ios" | "md";
57995799
/**
5800-
* Set to `"top-right"` to position the badge on top right absolute position of the parent element. Set to `"bottom-right"` to position the badge on bottom right absolute position of the parent element. Defaults to `"static"`.
5800+
* Set to `"top"` to position the badge on top right absolute position of the parent element. Set to `"bottom"` to position the badge on bottom right absolute position of the parent element.
58015801
*/
5802-
"position"?: 'top-right' | 'bottom-right' | 'static';
5802+
"position"?: 'top' | 'bottom';
58035803
/**
58045804
* Set to `"rectangular"` for non-rounded corners. Set to `"soft"` for slightly rounded corners. Set to `"round"` for fully rounded corners. Defaults to `"round"` for the `ionic` theme, undefined for all other themes.
58055805
*/

core/src/components/badge/badge.common.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@
5151
// Badge Empty (hint)
5252
// --------------------------------------------------
5353

54-
:host(:empty:not(.badge-static)) {
54+
:host(:empty[position]) {
5555
@include position(null, 0, null, null);
5656
position: absolute;
5757
}
5858

59-
:host(:empty.badge-top-right) {
59+
:host(:empty.badge-top) {
6060
top: 0;
6161
}
6262

63-
:host(:empty.badge-bottom-right) {
63+
:host(:empty.badge-bottom) {
6464
bottom: 0;
6565
}

core/src/components/badge/badge.ionic.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
--padding-end: 0;
155155
}
156156

157-
:host(:empty:not(.badge-static)) {
157+
:host(:empty[position]) {
158158
border: globals.$ion-border-size-025 globals.$ion-border-style-solid globals.$ion-bg-surface-inverse;
159159
}
160160

core/src/components/badge/badge.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ export class Badge implements ComponentInterface {
4848
@Prop() size?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
4949

5050
/**
51-
* Set to `"top-right"` to position the badge on top right absolute position of the parent element.
52-
* Set to `"bottom-right"` to position the badge on bottom right absolute position of the parent element.
53-
*
54-
* Defaults to `"static"`.
51+
* Set to `"top"` to position the badge on top right absolute position of the parent element.
52+
* Set to `"bottom"` to position the badge on bottom right absolute position of the parent element.
5553
*/
56-
@Prop() position: 'top-right' | 'bottom-right' | 'static' = 'static';
54+
@Prop() position?: 'top' | 'bottom';
5755

5856
private getShape(): string | undefined {
5957
const theme = getIonTheme(this);
@@ -97,7 +95,7 @@ export class Badge implements ComponentInterface {
9795
[theme]: true,
9896
[`badge-${shape}`]: shape !== undefined,
9997
[`badge-${size}`]: size !== undefined,
100-
[`badge-${this.position}`]: true,
98+
[`badge-${this.position}`]: this.position !== undefined,
10199
})}
102100
>
103101
<slot></slot>

0 commit comments

Comments
 (0)