Skip to content

Commit

Permalink
3.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Sep 14, 2018
1 parent 4dea15b commit b74215c
Show file tree
Hide file tree
Showing 245 changed files with 11,426 additions and 379 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

# Change Log

# [v3.3.0](https://github.com/framework7io/framework7/compare/v3.2.1...v3.3.0) - September 14, 2018
* Core
* Added TypeScript definitions for whole core framework APIs (with huge help of @JasonKleban)! 🎉
* Swiper update to latest 4.4.1:
* Core
* New `centerInsufficientSlides` parameter to center slides if the amount of slides less than `slidesPerView`
* New `breakpointsInverse` parameter (boolean), if enabled then it will count breakpoints in reversed direction, e.g. will override parameters if window width is more than specified breakpoint
* Virtual Slides
* New `addSlidesBefore` and `addSlidesAfter` parameters to increase amount of pre-rendered slides
* Thumbs
* All new "Thumbs" module/component designed to control slider thumbnails, in more logical and correct way than with Controller module.
* Virtual DOM Router Components
* Added snabbdom's "style" module that allows to make fancy and smooth custom animations
* Input
* Now input placeholder will be visible on item with floating label when it receives focus
* Phenome
* Added TypeScript definitions for all React components 🎉
* Added TypeScript definitions for F7-Vue and F7-React components extensions (e.g. `this.$f7`, `this.$f7router`, etc.) 🎉
* List Component
* new `noChevron` prop to disable "chevron" icon on all nested list items with link
* new `chevronCenter` prop to set "chevron" icon in the middle of all nested media list items with link
* ListItem Component
* `disabled` prop will now set "disabled" class on list item if it is not a checkbox or radio
* new `noChevron` prop to disable "chevron" icon on list item with link
* new `chevronCenter` prop to set "chevron" icon in the middle of media list item with link
* Improved Framework7 initialization routine
* Fixed issue when `f7ready` callback fired before `deviceready` event in Cordova environment
* Lots of fixes

# [v3.2.1](https://github.com/framework7io/framework7/compare/v3.2.0...v3.2.1) - August 31, 2018
* Template7 - updated to latest 1.4.0
* Added TypeScript Definitions
Expand Down
37 changes: 37 additions & 0 deletions packages/core/components/accordion/accordion.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Framework7 from '../app/app-class';
import { CSSSelector, Framework7Plugin } from '../app/app-class';

export namespace Accordion {
interface AppMethods {
accordion: {
/** open specified accordion item */
open(el : HTMLElement | CSSSelector) : void

/** close specified accordion item */
close(el : HTMLElement | CSSSelector) : void

/** toggle specified accordion item */
toggle(el : HTMLElement | CSSSelector) : void
}
}
interface AppParams {

}
interface AppEvents {
/** Event will be triggered when accordion content starts its opening animation */
accordionOpen : (el : HTMLElement | CSSSelector) => void

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

/** Event will be triggered when accordion content starts its closing animation */
accordionClose : (el : HTMLElement | CSSSelector) => void

/** Event will be triggered after accordion content completes its closing animation */
accordionClosed : (el : HTMLElement | CSSSelector) => void
}
}

declare const AccordionComponent: Framework7Plugin;

export default AccordionComponent;
11 changes: 6 additions & 5 deletions packages/core/components/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const Accordion = {
if ($el.hasClass('accordion-item-opened')) {
$contentEl.transition(0);
$contentEl.css('height', 'auto');
$contentEl._clientLeft = $contentEl[0].clientLeft;
Utils.nextFrame(() => {
$contentEl.transition('');
});
$contentEl.transition('');
$el.trigger('accordion:opened');
app.emit('accordionOpened', $el[0]);
Expand All @@ -56,15 +58,14 @@ const Accordion = {
$contentEl.attr('aria-hidden', true);
$contentEl.transition(0);
$contentEl.css('height', `${$contentEl[0].scrollHeight}px`);
$contentEl._clientLeft = $contentEl[0].clientLeft;
$contentEl.transition('');
// Close
$contentEl.transitionEnd(() => {
if ($el.hasClass('accordion-item-opened')) {
$contentEl.transition(0);
$contentEl.css('height', 'auto');
$contentEl._clientLeft = $contentEl[0].clientLeft;
$contentEl.transition('');
Utils.nextFrame(() => {
$contentEl.transition('');
});
$el.trigger('accordion:opened');
app.emit('accordionOpened', $el[0]);
} else {
Expand Down
150 changes: 150 additions & 0 deletions packages/core/components/actions/actions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import { Dom7Instance } from 'dom7';
import Framework7, { CSSSelector, Framework7EventsClass, Framework7Plugin } from '../app/app-class';

export namespace Actions {
interface Actions extends Framework7EventsClass<Events> {
/** Link to global app instance */
app : Framework7
/** Action sheet HTML element */
el : HTMLElement
/** Dom7 instance with action sheet HTML element */
$el : Dom7Instance
/** Backdrop HTML element */
backdropEl : HTMLElement
/** Dom7 instance with backdrop HTML element */
$backdropEl : Dom7Instance
/** Action sheet instance parameters */
params : Parameters
/** Boolean prop indicating whether action sheet is opened or not */
opened : boolean

/** Open action sheet. Where animate - boolean (by default true) - defines whether it should be opened with animation */
open(animate : boolean) : void
/** Close action sheet. Where animate - boolean (by default true) - defines whether it should be closed with animation */
close(animate : boolean) : void
/** Destroy action sheet */
destroy() : void
}

interface Button {
/** String with Button's text (could be HTML string) */
text:string
/** HTML string of icon */
icon?:string
/** Enables bold button text */
bold?:boolean
/** Button color, one of default colors */
color?:string
/** Button background color, one of default colors */
bg?:string
/** If enabled then it will be rendered as label instead of button */
label?:boolean
/** Defines whether the button is disabled or not. */
disabled?:boolean
/** If enabled then button click will close Action Sheet */
close?:boolean
/** Callback function that will be executed after click on this button */
onClick?: (actions : Actions, e: unknown) => void
}

interface Parameters {
/** Action Sheet element. Can be useful if you already have Action Sheet element in your HTML and want to create new instance using this element*/
el?:HTMLElement
/** Full Action Sheet HTML content string. Can be useful if you want to create Action Sheet element with custom HTML*/
content?:string
/** Enables Action Sheet backdrop (dark semi transparent layer behind)*/
backdrop?:boolean
/** When enabled, action sheet will be closed on backdrop click*/
closeByBackdropClick?:boolean
/** When enabled, action sheet will be closed on when click outside of it*/
closeByOutsideClick?:boolean
/** Whether the Action Sheet should be opened/closed with animation or not. Can be overwritten in .open() and .close() methods*/
animate?:boolean
/** Action sheet groups/buttons. In this case Actions layout will be generated dynamically based on passed groups and buttons. In case of groups it should array where each item represent array with buttons for group.*/
buttons?: Button[]
/** Enables grid buttons layout*/
grid?:boolean
/** When enabled, action sheet will be converted to Popoveron large screens.*/
convertToPopover?:boolean
/** When enabled, action sheel will be always converted to Popover.*/
forceToPopover?:boolean
/** HTML element or string CSS selector of target element. Required when converstion to popover is in use*/
targetEl?: HTMLElement | CSSSelector
/** Virtual target element horizontal offset from left side of the screen. Required when converstion to popover is in use without using real target element (targetEl)*/
targetX?:number
/** Virtual target element vertical offset from top of the screen. Required when converstion to popover is in use without using real target element (targetEl)*/
targetY?:number
/** Virtual target element width (in px). Required when converstion to popover is in use without using real target element (targetEl)*/
targetWidth?:number
/** Virtual target element height (in px). Required when converstion to popover is in use without using real target element (targetEl)*/
targetHeight?:number
/** Callback function that will be executed after click on the Action Sheet button*/
onClick?: (actions : Actions, e: unknown) => void
/** Custom function to render Action Sheet. Must return Action Sheet html*/
render?: () => string
/** Custom function to render Popover when conversition to popover is in use. Must return Popover html*/
renderPopover?: () => string
/** Object with event handlers */
on?: {
[event in keyof Events] : Events[event]
}
}

interface Events {
/** Event will be triggered when Action Sheet starts its opening animation. As an argument event handler receives action sheet instance */
open : (actions : Actions) => void
/** Event will be triggered after Action Sheet completes its opening animation. As an argument event handler receives action sheet instance */
opened : (actions : Actions) => void
/** Event will be triggered when Action Sheet starts its closing animation. As an argument event handler receives action sheet instance */
close : (actions : Actions) => void
/** Event will be triggered after Action Sheet completes its closing animation. As an argument event handler receives action sheet instance */
closed : (actions : Actions) => void
/** Event will be triggered right before Action Sheet instance will be destroyed. As an argument event handler receives action sheet instance */
beforeDestroy : (actions : Actions) => void
}

interface DomEvents {
/** Event will be triggered when Action Sheet starts its opening animation */
'actions:open' : (actions : Actions) => void
/** Event will be triggered after Action Sheet completes its opening animation */
'actions:opened' : (actions : Actions) => void
/** Event will be triggered when Action Sheet starts its closing animation */
'actions:close' : (actions : Actions) => void
/** Event will be triggered after Action Sheet completes its closing animation */
'actions:closed' : (actions : Actions) => void
}

interface AppMethods {
actions: {
/** create Action Sheet instance */
create(parameters : Parameters) : Actions;
/** destroy Action Sheet instance */
destroy(el : HTMLElement | CSSSelector | Actions) : void;
/** get Action Sheet instance by HTML element */
get(el : HTMLElement | CSSSelector) : Actions;
/** opens Action Sheet */
open(el : HTMLElement | CSSSelector, animate : boolean) : Actions;
/** closes Action Sheet */
close(el : HTMLElement | CSSSelector, animate : boolean) : Actions;
}
}
interface AppParams {
actions?: Parameters | undefined
}
interface AppEvents {
/** Event will be triggered when Action Sheet starts its opening animation. As an argument event handler receives action sheet instance */
actionsOpen : (actions : Actions) => void
/** Event will be triggered after Action Sheet completes its opening animation. As an argument event handler receives action sheet instance */
actionsOpened : (actions : Actions) => void
/** Event will be triggered when Action Sheet starts its closing animation. As an argument event handler receives action sheet instance */
actionsClose : (actions : Actions) => void
/** Event will be triggered after Action Sheet completes its closing animation. As an argument event handler receives action sheet instance */
actionsClosed : (actions : Actions) => void
/** Event will be triggered right before Action Sheet instance will be destroyed. As an argument event handler receives action sheet instance */
actionsBeforeDestroy : (actions : Actions) => void
}
}

declare const ActionsComponent: Framework7Plugin;

export default ActionsComponent;
Loading

0 comments on commit b74215c

Please sign in to comment.