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

@ -45,6 +45,7 @@
--min-height: auto;
--height: auto;
--max-height: calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));
--backdrop-opacity: 0;
@include font-smoothing();
@include position(0, 0, 0, 0);

View File

@ -1,7 +1,7 @@
import type { ComponentInterface, EventEmitter } from '@stencil/core';
import { Watch, Component, Element, Event, Host, Method, Prop, h, readTask } from '@stencil/core';
import { getIonMode } from '../../global/ionic-global';
import { getIonStylesheet, getIonBehavior } from '../../global/ionic-global';
import type {
ActionSheetButton,
AnimationBuilder,
@ -31,11 +31,13 @@ import { mdEnterAnimation } from './animations/md.enter';
import { mdLeaveAnimation } from './animations/md.leave';
/**
* @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-action-sheet',
styleUrls: {
base: 'action-sheet.scss',
ios: 'action-sheet.ios.scss',
md: 'action-sheet.md.scss',
},
@ -324,7 +326,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
* 3. A wrapper ref does not exist
*/
const { groupEl, wrapperEl } = this;
if (this.gesture || getIonMode(this) === 'md' || !wrapperEl || !groupEl) {
if (this.gesture || getIonBehavior(this) === 'md' || !wrapperEl || !groupEl) {
return;
}
@ -341,7 +343,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
render() {
const { header, htmlAttributes, overlayIndex } = this;
const mode = getIonMode(this);
const mode = getIonStylesheet(this);
const allButtons = this.getButtons();
const cancelButton = allButtons.find((b) => b.role === 'cancel');
const buttons = allButtons.filter((b) => b.role !== 'cancel');