feat(base-components): add ability to remove ios and md theme (#26669)

This commit is contained in:
Liam DeBeasi
2023-01-24 16:18:35 -05:00
committed by GitHub
parent 4d24b328e2
commit 18f109c7da
114 changed files with 1585 additions and 383 deletions

View File

@ -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);