Skip to content

Commit cd276fc

Browse files
committed
Merge branch 'next' of github.com:ionic-team/ionic-framework into FW-7137
2 parents d6332e7 + 69e5ee1 commit cd276fc

95 files changed

Lines changed: 814 additions & 73 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/api.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,7 @@ ion-segment-view,prop,swipeGesture,boolean,true,false,false
22472247
ion-segment-view,event,ionSegmentViewScroll,SegmentViewScrollEvent,true
22482248

22492249
ion-select,shadow
2250+
ion-select,prop,cancelIcon,boolean,false,false,false
22502251
ion-select,prop,cancelText,string,'Cancel',false,false
22512252
ion-select,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
22522253
ion-select,prop,compareWith,((currentValue: any, compareValue: any) => boolean) | null | string | undefined,undefined,false,false
@@ -2360,6 +2361,7 @@ ion-select,part,text
23602361
ion-select,part,wrapper
23612362

23622363
ion-select-modal,scoped
2364+
ion-select-modal,prop,cancelIcon,boolean,false,false,false
23632365
ion-select-modal,prop,cancelText,string,'Close',false,false
23642366
ion-select-modal,prop,header,string | undefined,undefined,false,false
23652367
ion-select-modal,prop,multiple,boolean | undefined,undefined,false,false
@@ -2422,6 +2424,7 @@ ion-tab,method,setActive,setActive() => Promise<void>
24222424
ion-tab-bar,shadow
24232425
ion-tab-bar,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
24242426
ion-tab-bar,prop,expand,"compact" | "full",'full',false,false
2427+
ion-tab-bar,prop,hideOnScroll,boolean,false,false,false
24252428
ion-tab-bar,prop,mode,"ios" | "md",undefined,false,false
24262429
ion-tab-bar,prop,selectedTab,string | undefined,undefined,false,false
24272430
ion-tab-bar,prop,shape,"rectangular" | "round" | "soft" | undefined,undefined,false,false

core/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"fs-extra": "^9.0.1",
6969
"jest": "^29.7.0",
7070
"jest-cli": "^29.7.0",
71-
"outsystems-design-tokens": "^1.3.7",
71+
"outsystems-design-tokens": "^1.3.8",
7272
"playwright-core": "^1.58.2",
7373
"prettier": "^2.8.8",
7474
"rollup": "^2.26.4",

core/src/components.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,6 +3684,11 @@ export namespace Components {
36843684
"swipeGesture": boolean;
36853685
}
36863686
interface IonSelect {
3687+
/**
3688+
* If `true`, the cancel button will display an icon instead of the `cancelText`. Only applies when `interface` is set to `"modal"`. Has no effect on `"action-sheet"`, `"alert"`, or `"popover"` interfaces. When `cancelIcon` is `true`, the `cancelText` property is ignored for display but is used as the accessible label for the icon button.
3689+
* @default false
3690+
*/
3691+
"cancelIcon": boolean;
36873692
/**
36883693
* The text to display on the cancel button.
36893694
* @default 'Cancel'
@@ -3800,6 +3805,11 @@ export namespace Components {
38003805
"value"?: any | null;
38013806
}
38023807
interface IonSelectModal {
3808+
/**
3809+
* If `true`, the cancel button will display a close icon instead of the `cancelText`. When `cancelIcon` is `true`, `cancelText` is not displayed visually but is still used as the accessible label (`aria-label`) for the button.
3810+
* @default false
3811+
*/
3812+
"cancelIcon": boolean;
38033813
/**
38043814
* The text to display on the cancel button.
38053815
* @default 'Close'
@@ -3974,6 +3984,11 @@ export namespace Components {
39743984
* @default 'full'
39753985
*/
39763986
"expand": 'compact' | 'full';
3987+
/**
3988+
* If `true`, the tab bar will be hidden when the user scrolls down and shown when the user scrolls up. Only applies when the theme is `"ionic"` and `expand` is `"compact"`.
3989+
* @default false
3990+
*/
3991+
"hideOnScroll": boolean;
39773992
/**
39783993
* The mode determines the platform behaviors of the component.
39793994
*/
@@ -9753,6 +9768,11 @@ declare namespace LocalJSX {
97539768
"swipeGesture"?: boolean;
97549769
}
97559770
interface IonSelect {
9771+
/**
9772+
* If `true`, the cancel button will display an icon instead of the `cancelText`. Only applies when `interface` is set to `"modal"`. Has no effect on `"action-sheet"`, `"alert"`, or `"popover"` interfaces. When `cancelIcon` is `true`, the `cancelText` property is ignored for display but is used as the accessible label for the icon button.
9773+
* @default false
9774+
*/
9775+
"cancelIcon"?: boolean;
97569776
/**
97579777
* The text to display on the cancel button.
97589778
* @default 'Cancel'
@@ -9888,6 +9908,11 @@ declare namespace LocalJSX {
98889908
"value"?: any | null;
98899909
}
98909910
interface IonSelectModal {
9911+
/**
9912+
* If `true`, the cancel button will display a close icon instead of the `cancelText`. When `cancelIcon` is `true`, `cancelText` is not displayed visually but is still used as the accessible label (`aria-label`) for the button.
9913+
* @default false
9914+
*/
9915+
"cancelIcon"?: boolean;
98919916
/**
98929917
* The text to display on the cancel button.
98939918
* @default 'Close'
@@ -10065,6 +10090,11 @@ declare namespace LocalJSX {
1006510090
* @default 'full'
1006610091
*/
1006710092
"expand"?: 'compact' | 'full';
10093+
/**
10094+
* If `true`, the tab bar will be hidden when the user scrolls down and shown when the user scrolls up. Only applies when the theme is `"ionic"` and `expand` is `"compact"`.
10095+
* @default false
10096+
*/
10097+
"hideOnScroll"?: boolean;
1006810098
/**
1006910099
* The mode determines the platform behaviors of the component.
1007010100
*/
@@ -11245,6 +11275,7 @@ declare namespace LocalJSX {
1124511275
}
1124611276
interface IonSelectAttributes {
1124711277
"cancelText": string;
11278+
"cancelIcon": boolean;
1124811279
"color": Color;
1124911280
"compareWith": string | SelectCompareFn | null;
1125011281
"disabled": boolean;
@@ -11271,6 +11302,7 @@ declare namespace LocalJSX {
1127111302
interface IonSelectModalAttributes {
1127211303
"header": string;
1127311304
"cancelText": string;
11305+
"cancelIcon": boolean;
1127411306
"multiple": boolean;
1127511307
}
1127611308
interface IonSelectOptionAttributes {
@@ -11307,6 +11339,7 @@ declare namespace LocalJSX {
1130711339
interface IonTabBarAttributes {
1130811340
"color": Color;
1130911341
"selectedTab": string;
11342+
"hideOnScroll": boolean;
1131011343
"translucent": boolean;
1131111344
"expand": 'compact' | 'full';
1131211345
"shape": 'soft' | 'round' | 'rectangular';
Loading
Loading
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { createAnimation } from '@utils/animation/animation';
2+
import { getElementRoot } from '@utils/helpers';
3+
4+
import type { Animation } from '../../../interface';
5+
import type { ModalAnimationOptions } from '../modal-interface';
6+
7+
import { createSheetEnterAnimation } from './sheet';
8+
9+
const createEnterAnimation = () => {
10+
const backdropAnimation = createAnimation()
11+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
12+
.beforeStyles({
13+
'pointer-events': 'none',
14+
})
15+
.afterClearStyles(['pointer-events']);
16+
17+
const wrapperAnimation = createAnimation().keyframes([
18+
{ offset: 0, opacity: 0.01, transform: 'translateY(40px)' },
19+
{ offset: 1, opacity: 1, transform: `translateY(0px)` },
20+
]);
21+
22+
return { backdropAnimation, wrapperAnimation, contentAnimation: undefined };
23+
};
24+
25+
/**
26+
* Ionic Modal Enter Animation
27+
*/
28+
export const ionicEnterAnimation = (baseEl: HTMLElement, opts: ModalAnimationOptions): Animation => {
29+
const { currentBreakpoint, expandToScroll } = opts;
30+
const root = getElementRoot(baseEl);
31+
const { wrapperAnimation, backdropAnimation, contentAnimation } =
32+
currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation();
33+
34+
backdropAnimation.addElement(root.querySelector('ion-backdrop')!);
35+
36+
wrapperAnimation.addElement(root.querySelector('.modal-wrapper')!);
37+
38+
// The content animation is only added if scrolling is enabled for
39+
// all the breakpoints.
40+
!expandToScroll && contentAnimation?.addElement(baseEl.querySelector('.ion-page')!);
41+
42+
backdropAnimation.duration(300).easing('ease-out');
43+
wrapperAnimation.duration(400).easing('cubic-bezier(0.32, 0.68, 0, 1)');
44+
contentAnimation?.duration(400).easing('cubic-bezier(0.32, 0.68, 0, 1)');
45+
46+
const baseAnimation = createAnimation().addElement(baseEl).addAnimation([backdropAnimation, wrapperAnimation]);
47+
48+
if (contentAnimation) {
49+
baseAnimation.addAnimation(contentAnimation);
50+
}
51+
52+
return baseAnimation;
53+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { createAnimation } from '@utils/animation/animation';
2+
import { getElementRoot } from '@utils/helpers';
3+
4+
import type { Animation } from '../../../interface';
5+
import type { ModalAnimationOptions } from '../modal-interface';
6+
7+
import { createSheetLeaveAnimation } from './sheet';
8+
9+
const createLeaveAnimation = () => {
10+
const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);
11+
12+
const wrapperAnimation = createAnimation().keyframes([
13+
{ offset: 0, opacity: 0.99, transform: `translateY(0px)` },
14+
{ offset: 1, opacity: 0, transform: 'translateY(40px)' },
15+
]);
16+
17+
return { backdropAnimation, wrapperAnimation };
18+
};
19+
20+
/**
21+
* Md Modal Leave Animation
22+
*/
23+
export const ionicLeaveAnimation = (baseEl: HTMLElement, opts: ModalAnimationOptions): Animation => {
24+
const { currentBreakpoint } = opts;
25+
const root = getElementRoot(baseEl);
26+
const { wrapperAnimation, backdropAnimation } =
27+
currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation();
28+
29+
backdropAnimation.addElement(root.querySelector('ion-backdrop')!);
30+
wrapperAnimation.addElement(root.querySelector('.modal-wrapper')!);
31+
32+
backdropAnimation.duration(250).easing('ease-in');
33+
wrapperAnimation.duration(400).easing('cubic-bezier(0.4, 0, 1, 1)');
34+
35+
const baseAnimation = createAnimation().addElement(baseEl).addAnimation([backdropAnimation, wrapperAnimation]);
36+
37+
return baseAnimation;
38+
};

0 commit comments

Comments
 (0)