Skip to content

Commit 00280a9

Browse files
committed
3.6.0 release
1 parent a74d066 commit 00280a9

File tree

140 files changed

+3273
-1459
lines changed

Some content is hidden

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

140 files changed

+3273
-1459
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
# Change Log
44

5+
# [v3.6.0](https://github.com/framework7io/framework7/compare/v3.5.2...v3.6.0) - December 7, 2018
6+
* Core
7+
* Router
8+
* New `keepAlive` routes. When route's page is specified with `keepAlive: true`, then it, instead of removing and destroying component, it will be detached from DOM and attached back when required.
9+
* New `router.clearPreviousPages()` method that removes all previous (stacked) pages from DOM
10+
* Accordion
11+
* New `accordion:beforeopen` event that is triggered right before accordion will be opened. `event.detail.prevent` contains function that will prevent it from opening if called;
12+
* New `accordion:beforeclose` event that is triggered right before accordion will be closed. `event.detail.prevent` contains function that will prevent it from closing if called;
13+
* Phenome (React / Vue)
14+
* AccordionItem and ListItem have new `accordion:beforeopen` / `accordionBeforeOpen` events, second argument passed to handler contains function that will prevent it from closing if called;
15+
* AccordionItem and ListItem have new `accordion:beforeclose` / `accordionBeforeClose` events, second argument passed to handler contains function that will prevent it from closing if called;
16+
* View component now accepts MD-theme related swipeback props: `mdSwipeBack`, `mdSwipeBackAnimateShadow`, `mdSwipeBackAnimateOpacity`, `mdSwipeBackActiveArea`, `mdSwipeBackThreshold`
17+
* ListItem has new `virtualListIndex: Number` property to specify item index when rendered inside of Virtual List
18+
* Searchbar has new `value` property to specify Searchbar input's value. Can be usefule when used with `customSearch` enabled
19+
* Lots of minor fixes and improvements
20+
521
# [v3.5.2](https://github.com/framework7io/framework7/compare/v3.5.1...v3.5.2) - November 12, 2018
622
* Core
723
* List

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/components/accordion/accordion.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ export namespace Accordion {
1818

1919
}
2020
interface AppEvents {
21+
/** Event will be triggered before accordion content starts its opening animation */
22+
accordionBeforeOpen : (el : HTMLElement | CSSSelector, prevent: () => void) => void
23+
2124
/** Event will be triggered when accordion content starts its opening animation */
2225
accordionOpen : (el : HTMLElement | CSSSelector) => void
2326

2427
/** Event will be triggered after accordion content completes its opening animation */
2528
accordionOpened : (el : HTMLElement | CSSSelector) => void
2629

30+
/** Event will be triggered before accordion content starts its closing animation */
31+
accordionBeforeClose : (el : HTMLElement | CSSSelector, prevent: () => void) => void
32+
2733
/** Event will be triggered when accordion content starts its closing animation */
2834
accordionClose : (el : HTMLElement | CSSSelector) => void
2935

packages/core/components/accordion/accordion.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ const Accordion = {
1919
open(el) {
2020
const app = this;
2121
const $el = $(el);
22+
let prevented = false;
23+
function prevent() {
24+
prevented = true;
25+
}
26+
$el.trigger('accordion:beforeopen', { prevent }, prevent);
27+
app.emit('accordionBeforeOpen', $el[0], prevent);
28+
if (prevented) return;
2229
const $list = $el.parents('.accordion-list').eq(0);
2330
let $contentEl = $el.children('.accordion-item-content');
2431
$contentEl.removeAttr('aria-hidden');
@@ -51,6 +58,13 @@ const Accordion = {
5158
close(el) {
5259
const app = this;
5360
const $el = $(el);
61+
let prevented = false;
62+
function prevent() {
63+
prevented = true;
64+
}
65+
$el.trigger('accordion:beforeclose', { prevent }, prevent);
66+
app.emit('accordionBeforeClose', $el[0], prevent);
67+
if (prevented) return;
5468
let $contentEl = $el.children('.accordion-item-content');
5569
if ($contentEl.length === 0) $contentEl = $el.find('.accordion-item-content');
5670
$el.removeClass('accordion-item-opened');

packages/core/components/actions/actions.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export namespace Actions {
1919
opened : boolean
2020

2121
/** Open action sheet. Where animate - boolean (by default true) - defines whether it should be opened with animation */
22-
open(animate : boolean) : void
22+
open(animate? : boolean) : void
2323
/** Close action sheet. Where animate - boolean (by default true) - defines whether it should be closed with animation */
24-
close(animate : boolean) : void
24+
close(animate? : boolean) : void
2525
/** Destroy action sheet */
2626
destroy() : void
2727
}
@@ -121,11 +121,11 @@ export namespace Actions {
121121
/** destroy Action Sheet instance */
122122
destroy(el : HTMLElement | CSSSelector | Actions) : void;
123123
/** get Action Sheet instance by HTML element */
124-
get(el : HTMLElement | CSSSelector) : Actions;
124+
get(el? : HTMLElement | CSSSelector) : Actions;
125125
/** opens Action Sheet */
126-
open(el : HTMLElement | CSSSelector, animate : boolean) : Actions;
126+
open(el? : HTMLElement | CSSSelector, animate? : boolean) : Actions;
127127
/** closes Action Sheet */
128-
close(el : HTMLElement | CSSSelector, animate : boolean) : Actions;
128+
close(el? : HTMLElement | CSSSelector, animate? : boolean) : Actions;
129129
}
130130
}
131131
interface AppParams {

packages/core/components/calendar/calendar-class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ class Calendar extends Framework7Class {
12521252
}
12531253

12541254
// Extra focus
1255-
if (!inline && $inputEl.length && app.theme === 'md') {
1255+
if (!inline && $inputEl && $inputEl.length && app.theme === 'md') {
12561256
$inputEl.trigger('focus');
12571257
}
12581258

packages/core/components/dialog/dialog.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ export namespace Dialog {
1919
opened : boolean
2020

2121
/** Open dialog */
22-
open(animate : boolean) : void
22+
open(animate?: boolean) : void
2323
/** Close dialog. */
24-
close(animate : boolean) : void
24+
close(animate?: boolean) : void
2525
/** Sets dialog progress when Dialog Progress shortcut in use */
2626
setProgress(
2727
/** progressbar progress (from 0 to 100) */
28-
progress : number,
28+
progress: number,
2929
/** (in ms) - progressbar progress change duration */
30-
duration : number) : void
30+
duration?: number) : void
3131
/** Sets dialog's title */
3232
setTitle(title : string) : void
3333
/** Sets dialog's text */
@@ -115,11 +115,11 @@ export namespace Dialog {
115115
/** destroy Dialog instance */
116116
destroy(el : HTMLElement | CSSSelector | Dialog) : void;
117117
/** get Dialog instance by HTML element */
118-
get(el : HTMLElement | CSSSelector) : Dialog;
118+
get(el? : HTMLElement | CSSSelector) : Dialog;
119119
/** opens Dialog */
120-
open(el : HTMLElement | CSSSelector, animate : boolean) : Dialog;
120+
open(el? : HTMLElement | CSSSelector, animate? : boolean) : Dialog;
121121
/** closes Dialog */
122-
close(el : HTMLElement | CSSSelector, animate : boolean) : Dialog;
122+
close(el? : HTMLElement | CSSSelector, animate? : boolean) : Dialog;
123123

124124
/** create Alert Dialog and open it */
125125
alert(text : string, title : string, callback?: () => void) : Dialog

packages/core/components/login-screen/login-screen.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export namespace LoginScreen {
1515
opened : boolean
1616

1717
/** Open login screen. Where */
18-
open(animate : boolean) : LoginScreen
18+
open(animate? : boolean) : LoginScreen
1919
/** Close login screen. Where */
20-
close(animate : boolean) : LoginScreen
20+
close(animate? : boolean) : LoginScreen
2121
/** Destroy login screen */
2222
destroy() : void
2323
}
@@ -64,11 +64,11 @@ export namespace LoginScreen {
6464
/** destroy LoginScreen instance */
6565
destroy(el : HTMLElement | CSSSelector | LoginScreen) : void
6666
/** get LoginScreen instance by HTML element */
67-
get(el : HTMLElement | CSSSelector) : LoginScreen
67+
get(el? : HTMLElement | CSSSelector) : LoginScreen
6868
/** open LoginScreen */
69-
open(el : HTMLElement | CSSSelector, animate?: boolean) : LoginScreen
69+
open(el? : HTMLElement | CSSSelector, animate?: boolean) : LoginScreen
7070
/** closes LoginScreen */
71-
close(el : HTMLElement | CSSSelector, animate?: boolean) : LoginScreen
71+
close(el? : HTMLElement | CSSSelector, animate?: boolean) : LoginScreen
7272
}
7373
}
7474
interface AppParams {

packages/core/components/navbar/navbar.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,16 @@ const Navbar = {
178178
$navbarInnerEl = $navbarInnerEl.find('.navbar-inner');
179179
if ($navbarInnerEl.length > 1) return undefined;
180180
}
181-
return $navbarInnerEl[0].f7Page;
181+
if ($navbarInnerEl.parents('.page').length) {
182+
return $navbarInnerEl.parents('.page')[0];
183+
}
184+
let pageEl;
185+
$navbarInnerEl.parents('.view').find('.page').each((index, el) => {
186+
if (el && el.f7Page && el.f7Page.navbarEl && $navbarInnerEl[0] === el.f7Page.navbarEl) {
187+
pageEl = el;
188+
}
189+
});
190+
return pageEl;
182191
},
183192
initHideNavbarOnScroll(pageEl, navbarInnerEl) {
184193
const app = this;
@@ -242,6 +251,7 @@ export default {
242251
hide: Navbar.hide.bind(app),
243252
show: Navbar.show.bind(app),
244253
getElByPage: Navbar.getElByPage.bind(app),
254+
getPageByEl: Navbar.getPageByEl.bind(app),
245255
initHideNavbarOnScroll: Navbar.initHideNavbarOnScroll.bind(app),
246256
},
247257
});

packages/core/components/panel/swipe-panel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function swipePanel(panel) {
2828
function handleTouchStart(e) {
2929
if (!panel.swipeable) return;
3030
if (!app.panel.allowOpen || (!params.swipe && !params.swipeOnlyClose) || isTouched) return;
31-
if ($('.modal-in, .photo-browser-in').length > 0) return;
31+
if ($('.modal-in:not(.toast):not(.notification), .photo-browser-in').length > 0) return;
3232
otherPanel = app.panel[side === 'left' ? 'right' : 'left'] || {};
3333
if (!panel.opened && otherPanel.opened) return;
3434
if (!(params.swipeCloseOpposite || params.swipeOnlyClose)) {

0 commit comments

Comments
 (0)