mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
feat(base-components): add ability to remove ios and md theme (#26669)
This commit is contained in:
@ -5,7 +5,7 @@ import type { LegacyFormController } from '@utils/forms';
|
||||
import { printIonWarning } from '@utils/logging';
|
||||
import { closeCircle, closeSharp } from 'ionicons/icons';
|
||||
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
import { getIonStylesheet, getIonBehavior } from '../../global/ionic-global';
|
||||
import type {
|
||||
AutocompleteTypes,
|
||||
Color,
|
||||
@ -21,11 +21,13 @@ import { createColorClasses, hostContext } from '../../utils/theme';
|
||||
import { getCounterText } from './input.utils';
|
||||
|
||||
/**
|
||||
* @virtualProp {true | false} useBase - useBase determines if base components is enabled.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-input',
|
||||
styleUrls: {
|
||||
base: 'input.scss',
|
||||
ios: 'input.ios.scss',
|
||||
md: 'input.md.scss',
|
||||
},
|
||||
@ -602,8 +604,8 @@ export class Input implements ComponentInterface {
|
||||
* when fill="outline".
|
||||
*/
|
||||
private renderLabelContainer() {
|
||||
const mode = getIonMode(this);
|
||||
const hasOutlineFill = mode === 'md' && this.fill === 'outline';
|
||||
const platform = getIonBehavior(this);
|
||||
const hasOutlineFill = platform === 'md' && this.fill === 'outline';
|
||||
|
||||
if (hasOutlineFill) {
|
||||
/**
|
||||
@ -636,7 +638,7 @@ export class Input implements ComponentInterface {
|
||||
|
||||
private renderInput() {
|
||||
const { disabled, fill, readonly, shape, inputId, labelPlacement } = this;
|
||||
const mode = getIonMode(this);
|
||||
const mode = getIonStylesheet(this);
|
||||
const value = this.getValue();
|
||||
const shouldRenderHighlight = mode === 'md' && fill !== 'outline';
|
||||
|
||||
@ -741,7 +743,7 @@ Developers can dismiss this warning by removing their usage of the "legacy" prop
|
||||
this.hasLoggedDeprecationWarning = true;
|
||||
}
|
||||
|
||||
const mode = getIonMode(this);
|
||||
const mode = getIonStylesheet(this);
|
||||
const value = this.getValue();
|
||||
const labelId = this.inputId + '-lbl';
|
||||
const label = findItemLabel(this.el);
|
||||
|
||||
Reference in New Issue
Block a user