Skip to content

Commit

Permalink
FitScreenHeight, window-resize, Breakpoints class, fixes - release 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed Jan 19, 2021
1 parent bc2fa1f commit ac23804
Show file tree
Hide file tree
Showing 19 changed files with 1,052 additions and 664 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
# Change Log
All notable changes to this project will be documented in this file.

## [Unreleased]
## [1.2.2] - 2021-01-20

### Features
- Added `fitHeight` property for usage pane without breakpoints. On `fitHeight: true`, pane height will automatically calculated before present. Then height will be applied as top breakpoint height, bottom and middle breakpoint will be disabled. See [Bulletin demo](https://output.jsbin.com/maqigod) on example. [#113](https://github.com/roman-rr/cupertino-pane/issues/113)
- Added `fitScreenHeight` property. On `fitScreenHeight: true`, pane height will not be more than screen height.

### Enhancements
- Button close renamed to button destroy to avoid confuses. Option renamed `buttonClose` -> `buttonDestroy` [#116](https://github.com/roman-rr/cupertino-pane/issues/112)
- `window.resize` events and orientation changing now automatically reset breakpoints and pane to proper position. May be good using in pair with `fitScreenHeight: true` [#119](https://github.com/roman-rr/cupertino-pane/issues/119)

### Bug Fixes
- Cordova keyboard hide if pane is hidden [#112](https://github.com/roman-rr/cupertino-pane/issues/112)
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ new CupertinoPane(element); // HTMLElement
| **parentElement** | `string` | Parent element selector | Element selector where pane will rendered |
| **followerElement** | `string` | Follower element selector | Element with selector will following pane transitions |
| **fitHeight** | `boolean` | 'false' | Automatically calc and define content height as top breakpoint. Middle and bottom breakpoint will be disabled |
| **fitScreenHeight** | `boolean` | 'false' | On `true` will automatically adjust pane maximum height to screen height |
| **pushElement** | `string` | Push element selector | DOM Element will be pushed and scaled |
| **pushMinHeight** | `number` | Most bottom available point | Height from which 3d push effect will be started |
| **pushYOffset** | `number` | Negative margin value to place pushed element upper |
Expand Down Expand Up @@ -355,15 +356,11 @@ If you would like handle this part by yourself, set option `handleKeyboard: fals

## Future Goals
- [Docs] ($150 budget) -> Package branding
- [Bugs] Fix `window.resize` events
- [Enhancements] Handle keyboard only for Pane inputs
- [Enhancements] Represent constructor without issues
- [Code] Fix immutable issue in breakpoint class
- [Accurance] Draw experiment application (Normal/TimeStamp/Native) - Native Touch Plugin
- [Docs] (Traffic + Carbon ads) -> Docs engine (F7, Netlify, Gatsby, GH pages)
- [Showcase] Apple Music F7
- [Technologies] CSS3D
- [Technologies] Web Animation
- [Accurance] Draw experiment application (Normal/TimeStamp/Native) - Native Touch Plugin
- [Platforms] React Native version
- [Platforms] C++ QT version

## Contributing
Expand Down
29 changes: 29 additions & 0 deletions dist/breakpoints.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { CupertinoPane, CupertinoSettings } from 'cupertino-pane';
import { PaneBreaks } from './models';
/**
* Breakpoints builde
*/
export declare class Breakpoints {
private instance;
private settings;
topper: number;
bottomer: number;
breaks: {};
lockedBreakpoints: any;
currentBreakpoint: number;
prevBreakpoint: string;
brs: number[];
private defaultBreaksConf;
constructor(instance: CupertinoPane, settings: CupertinoSettings);
/**
* Function builder for breakpoints and heights
* @param conf breakpoints
*/
buildBreakpoints(conf?: PaneBreaks, lock?: boolean): Promise<void>;
getCurrentBreakName(): (string | null);
/**
* Private class methods
*/
private getPaneFitHeight;
getClosestBreakY(): number;
}
29 changes: 11 additions & 18 deletions dist/cupertino-pane.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,47 @@ import { PaneSettings, PaneBreaks } from './models';
export declare type CupertinoSettings = Partial<PaneSettings>;
export declare class CupertinoPane {
private selector;
private defaultBreaksConf;
topper: number;
bottomer: number;
disableDragEvents: boolean;
currentBreakpoint: number;
prevBreakpoint: string;
breaks: {};
screen_height: number;
private screenHeightOffset;
private rendered;
screenHeightOffset: number;
preventDismissEvent: boolean;
preventedDismiss: boolean;
private iconCloseColor;
private brs;
private rendered;
wrapperEl: HTMLDivElement;
paneEl: HTMLDivElement;
overflowEl: HTMLElement;
private el;
el: HTMLElement;
contentEl: HTMLElement;
private parentEl;
private draggableEl;
private moveEl;
private contentEl;
private backdropEl;
private destroyButtonEl;
private followerEl;
private pushElement;
private settings;
private device;
private events;
private breakpoints;
constructor(selector: (string | HTMLElement), conf?: CupertinoSettings);
private drawBaseElements;
present(conf?: {
animate: boolean;
}): Promise<void>;
getPaneHeight(): number;
/**
* Private Utils methods
*/
private getPaneHeight;
private attachAllEvents;
private detachAllEvents;
private resetEvents;
getClosestBreakY(): number;
private scrollElementInit;
scrollElementInit(): void;
setOverflowHeight(offset?: number): void;
private getPaneFitHeight;
private getTimingFunction;
checkOpacityAttr(val: any): void;
checkOverflowAttr(val: any): void;
private isPanePresented;
isPanePresented(): boolean;
swipeNextPoint: (diff: any, maxDiff: any, closest: any) => any;
private isBackdropPresented;
private renderBackdrop;
Expand Down Expand Up @@ -86,8 +78,8 @@ export declare class CupertinoPane {
enable: boolean;
}): void;
/**
* Function builder for breakpoints and heights
* @param conf breakpoints
* Public user method to reset breakpoints
* @param conf
*/
setBreakpoints(conf?: PaneBreaks): Promise<void>;
moveToBreak(val: string): any;
Expand All @@ -98,6 +90,7 @@ export declare class CupertinoPane {
private destroyResets;
destroy(conf?: {
animate: boolean;
destroyButton?: boolean;
}): any;
private pushTransition;
/***********************************
Expand Down
Loading

0 comments on commit ac23804

Please sign in to comment.