mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
fix(label): inline position by default
This commit is contained in:
6
core/package-lock.json
generated
6
core/package-lock.json
generated
@ -14,9 +14,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@stencil/core": {
|
"@stencil/core": {
|
||||||
"version": "0.7.22",
|
"version": "0.7.23",
|
||||||
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-0.7.22.tgz",
|
"resolved": "https://registry.npmjs.org/@stencil/core/-/core-0.7.23.tgz",
|
||||||
"integrity": "sha512-DKZU73P6DaWA58sIWiu1jlSY6KBjRaOl3xzQjDFjktoQWZTNgC0mZLExTbPp21CaqsVmyGJjDxnQzy+Ja931fg==",
|
"integrity": "sha512-12gdCOmVWt1zqo3q757mlWCnSHvJGJNuc8Sxv1YvRfzhzoGjJNPzjBabpTODQXAGRvvblbyCbwrIqyYC1qyM+A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chokidar": "2.0.3",
|
"chokidar": "2.0.3",
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"ionicons": "4.0.0-19"
|
"ionicons": "4.0.0-19"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@stencil/core": "0.7.22",
|
"@stencil/core": "0.7.23",
|
||||||
"@stencil/dev-server": "latest",
|
"@stencil/dev-server": "latest",
|
||||||
"@stencil/sass": "0.0.3",
|
"@stencil/sass": "0.0.3",
|
||||||
"@stencil/utils": "latest",
|
"@stencil/utils": "latest",
|
||||||
|
4
core/src/components.d.ts
vendored
4
core/src/components.d.ts
vendored
@ -3013,7 +3013,7 @@ declare global {
|
|||||||
/**
|
/**
|
||||||
* The position determines where and how the label behaves inside an item. Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating'
|
* The position determines where and how the label behaves inside an item. Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating'
|
||||||
*/
|
*/
|
||||||
'position': 'inline' | 'fixed' | 'stacked' | 'floating' | undefined;
|
'position': 'fixed' | 'stacked' | 'floating';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3051,7 +3051,7 @@ declare global {
|
|||||||
/**
|
/**
|
||||||
* The position determines where and how the label behaves inside an item. Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating'
|
* The position determines where and how the label behaves inside an item. Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating'
|
||||||
*/
|
*/
|
||||||
'position'?: 'inline' | 'fixed' | 'stacked' | 'floating' | undefined;
|
'position'?: 'fixed' | 'stacked' | 'floating';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ export class Label {
|
|||||||
* The position determines where and how the label behaves inside an item.
|
* The position determines where and how the label behaves inside an item.
|
||||||
* Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating'
|
* Possible values are: 'inline' | 'fixed' | 'stacked' | 'floating'
|
||||||
*/
|
*/
|
||||||
@Prop({mutable: true}) position: 'inline' | 'fixed' | 'stacked' | 'floating' | undefined;
|
@Prop() position?: 'fixed' | 'stacked' | 'floating';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emitted when the styles change.
|
* Emitted when the styles change.
|
||||||
@ -44,28 +44,24 @@ export class Label {
|
|||||||
return this.el.textContent || '';
|
return this.el.textContent || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillLoad() {
|
|
||||||
if (this.position === undefined) {
|
|
||||||
this.position = (this.mode === 'ios') ? 'inline' : 'floating';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidLoad() {
|
componentDidLoad() {
|
||||||
this.positionChanged();
|
this.positionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('position')
|
@Watch('position')
|
||||||
positionChanged() {
|
positionChanged() {
|
||||||
|
const position = this.position;
|
||||||
return this.ionStyle.emit({
|
return this.ionStyle.emit({
|
||||||
[`label-${this.position}`]: true,
|
[`label-${position}`]: !!position,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
hostData() {
|
hostData() {
|
||||||
|
const position = this.position;
|
||||||
return {
|
return {
|
||||||
class: {
|
class: {
|
||||||
[`label-${this.position}`]: true,
|
[`label-${position}`]: !!position,
|
||||||
[`label-${this.mode}-${this.position}`]: true
|
[`label-${this.mode}-${position}`]: !!position
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user