mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
refactor(ionicons): update to ionicons v5 (#19670)
* refactor(ionicons): update to ionicons v5 * refactor(back-button): update back button icon to v5 ionicons * refactor(item): update default detail icon to chevron-forward * refactor(reorder): update reorder icon for ionicons v5 * refactor(searchbar): use search-sharp * refactor(searchIcon): update v5 ionicon * refactor(clearIcon): update searchbar clear icon * refactor(cancelButton): update to arrow-back-sharp * refactor(menuIcon): update to v5 ionicons * api readme updates * update react and vue ionicons * add ionicons to react deps * add ionicons to ionic/vue deps * add icon to react test * updates * fix back button regression for no icon * update tests * fix more tests * fix more icons * update ionicons version * fix circle icons * add correct ellipsis
This commit is contained in:

committed by
Liam DeBeasi

parent
5bbb95fae1
commit
69e10de718
@ -19,7 +19,7 @@ import { createColorClasses, openURL } from '../../utils/theme';
|
||||
})
|
||||
export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
|
||||
private mode = getIonMode(this);
|
||||
mode = getIonMode(this);
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
/**
|
||||
@ -54,20 +54,32 @@ export class BackButton implements ComponentInterface, ButtonInterface {
|
||||
*/
|
||||
@Prop() type: 'submit' | 'reset' | 'button' = 'button';
|
||||
|
||||
private get backButtonIcon() {
|
||||
return this.icon != null ? this.icon : config.get('backButtonIcon', 'arrow-back');
|
||||
get backButtonIcon() {
|
||||
const icon = this.icon;
|
||||
if (icon != null) {
|
||||
// icon is set on the component or by the config
|
||||
return icon;
|
||||
}
|
||||
|
||||
if (this.mode === 'ios') {
|
||||
// default ios back button icon
|
||||
return config.get('backButtonIcon', 'chevron-back');
|
||||
}
|
||||
|
||||
// default md back button icon
|
||||
return config.get('backButtonIcon', 'arrow-back-sharp');
|
||||
}
|
||||
|
||||
private get backButtonText() {
|
||||
get backButtonText() {
|
||||
const defaultBackButtonText = this.mode === 'ios' ? 'Back' : null;
|
||||
return this.text != null ? this.text : config.get('backButtonText', defaultBackButtonText);
|
||||
}
|
||||
|
||||
private get hasIconOnly() {
|
||||
get hasIconOnly() {
|
||||
return this.backButtonIcon && !this.backButtonText;
|
||||
}
|
||||
|
||||
private get rippleType() {
|
||||
get rippleType() {
|
||||
// If the button only has an icon we use the unbounded
|
||||
// "circular" ripple effect
|
||||
if (this.hasIconOnly) {
|
||||
|
Reference in New Issue
Block a user