Skip to content

Commit

Permalink
3.0.0-beta.12 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Jun 22, 2018
1 parent 1ced382 commit 49d1287
Show file tree
Hide file tree
Showing 98 changed files with 1,283 additions and 639 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

# Change Log

# [v3.0.0-beta.12](https://github.com/framework7io/framework7/compare/v3.0.0-beta.11...v3.0.0-beta.12) - June 22, 2018
* Core
* Tooltip
* `el` parameter has been renamed to `targetEl`
* Accordion
* Now it toggles `aria-hidden` attribute on accordion content toggle

# [v3.0.0-beta.11](https://github.com/framework7io/framework7/compare/v3.0.0-beta.10...v3.0.0-beta.11) - June 19, 2018
* Core
* Fix touch ripple issues that happen from time to time in Edge
Expand Down
2 changes: 2 additions & 0 deletions packages/core/components/accordion/accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Accordion = {
const $el = $(el);
const $list = $el.parents('.accordion-list').eq(0);
let $contentEl = $el.children('.accordion-item-content');
$contentEl.removeAttr('aria-hidden');
if ($contentEl.length === 0) $contentEl = $el.find('.accordion-item-content');
if ($contentEl.length === 0) return;
const $openedItem = $list.length > 0 && $el.parent().children('.accordion-item-opened');
Expand Down Expand Up @@ -46,6 +47,7 @@ const Accordion = {
let $contentEl = $el.children('.accordion-item-content');
if ($contentEl.length === 0) $contentEl = $el.find('.accordion-item-content');
$el.removeClass('accordion-item-opened');
$contentEl.attr('aria-hidden', true);
$contentEl.transition(0);
$contentEl.css('height', `${$contentEl[0].scrollHeight}px`);
$contentEl._clientLeft = $contentEl[0].clientLeft;
Expand Down
19 changes: 10 additions & 9 deletions packages/core/components/actions/actions-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class Actions extends Modal {
if (actions.params.convertToPopover && (targetEl || (targetX !== undefined && targetY !== undefined))) {
// Popover
if (
actions.params.forceToPopover ||
(app.device.ios && app.device.ipad) ||
app.width >= 768
actions.params.forceToPopover
|| (app.device.ios && app.device.ipad)
|| app.width >= 768
) {
convertToPopover = true;
}
Expand Down Expand Up @@ -159,10 +159,10 @@ class Actions extends Modal {
const $target = $(target);
if ($target.closest(actions.el).length === 0) {
if (
actions.params.closeByBackdropClick &&
actions.params.backdrop &&
actions.backdropEl &&
actions.backdropEl === target
actions.params.closeByBackdropClick
&& actions.params.backdrop
&& actions.backdropEl
&& actions.backdropEl === target
) {
actions.close();
} else if (actions.params.closeByOutsideClick) {
Expand All @@ -188,14 +188,14 @@ class Actions extends Modal {

return actions;
}

render() {
const actions = this;
if (actions.params.render) return actions.params.render.call(actions, actions);
const { groups } = actions;
return `
<div class="actions-modal${actions.params.grid ? ' actions-grid' : ''}">
${groups.map(group =>
`<div class="actions-group">
${groups.map(group => `<div class="actions-group">
${group.map((button) => {
const buttonClasses = [`actions-${button.label ? 'label' : 'button'}`];
const { color, bg, bold, disabled, label, text, icon } = button;
Expand All @@ -216,6 +216,7 @@ class Actions extends Modal {
</div>
`.trim();
}

renderPopover() {
const actions = this;
if (actions.params.renderPopover) return actions.params.renderPopover.call(actions, actions);
Expand Down
5 changes: 5 additions & 0 deletions packages/core/components/app/app-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Framework7 extends Framework7Class {
// Return app instance
return app;
}

init() {
const app = this;
if (app.initialized) return app;
Expand Down Expand Up @@ -135,15 +136,19 @@ class Framework7 extends Framework7Class {
get t7() {
return Template7;
}

static get Dom7() {
return $;
}

static get $() {
return $;
}

static get Template7() {
return Template7;
}

static get Class() {
return Framework7Class;
}
Expand Down
23 changes: 23 additions & 0 deletions packages/core/components/autocomplete/autocomplete-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ class Autocomplete extends Framework7Class {

return ac;
}

positionDropdown() {
const ac = this;
const { $inputEl, app, $dropdownEl } = ac;
Expand Down Expand Up @@ -333,10 +334,12 @@ class Autocomplete extends Framework7Class {
[paddingProp]: $listEl.length > 0 && !ac.params.expandInput ? `${paddingValue}px` : '',
});
}

focus() {
const ac = this;
ac.$el.find('input[type=search]').focus();
}

source(query) {
const ac = this;
if (!ac.params.source) return;
Expand Down Expand Up @@ -378,6 +381,7 @@ class Autocomplete extends Framework7Class {
}
});
}

updateValues() {
const ac = this;
let valuesHTML = '';
Expand All @@ -393,6 +397,7 @@ class Autocomplete extends Framework7Class {
}
ac.$el.find('.autocomplete-values ul').html(valuesHTML);
}

preloaderHide() {
const ac = this;
if (ac.params.openIn === 'dropdown' && ac.$dropdownEl) {
Expand All @@ -401,6 +406,7 @@ class Autocomplete extends Framework7Class {
$('.autocomplete-preloader').removeClass('autocomplete-preloader-visible');
}
}

preloaderShow() {
const ac = this;
if (ac.params.openIn === 'dropdown' && ac.$dropdownEl) {
Expand All @@ -409,12 +415,14 @@ class Autocomplete extends Framework7Class {
$('.autocomplete-preloader').addClass('autocomplete-preloader-visible');
}
}

renderPreloader() {
const ac = this;
return `
<div class="autocomplete-preloader preloader ${ac.params.preloaderColor ? `color-${ac.params.preloaderColor}` : ''}">${ac.app.theme === 'md' ? Utils.mdPreloaderContent : ''}</div>
`.trim();
}

renderSearchbar() {
const ac = this;
if (ac.params.renderSearchbar) return ac.params.renderSearchbar.call(ac);
Expand All @@ -432,6 +440,7 @@ class Autocomplete extends Framework7Class {
`.trim();
return searchbarHTML;
}

renderItem(item, index) {
const ac = this;
if (ac.params.renderItem) return ac.params.renderItem.call(ac, item, index);
Expand Down Expand Up @@ -503,6 +512,7 @@ class Autocomplete extends Framework7Class {
`.trim();
return navbarHtml;
}

renderDropdown() {
const ac = this;
if (ac.params.renderDropdown) return ac.params.renderDropdown.call(ac, ac.items);
Expand All @@ -518,6 +528,7 @@ class Autocomplete extends Framework7Class {
`.trim();
return dropdownHtml;
}

renderPage() {
const ac = this;
if (ac.params.renderPage) return ac.params.renderPage.call(ac, ac.items);
Expand All @@ -543,6 +554,7 @@ class Autocomplete extends Framework7Class {
`.trim();
return pageHtml;
}

renderPopup() {
const ac = this;
if (ac.params.renderPopup) return ac.params.renderPopup.call(ac, ac.items);
Expand All @@ -555,6 +567,7 @@ class Autocomplete extends Framework7Class {
`.trim();
return popupHtml;
}

onOpen(type, el) {
const ac = this;
const app = ac.app;
Expand Down Expand Up @@ -603,13 +616,15 @@ class Autocomplete extends Framework7Class {

ac.emit('local::open autocompleteOpen', ac);
}

onOpened() {
const ac = this;
if (ac.params.openIn !== 'dropdown' && ac.params.autoFocus) {
ac.autoFocus();
}
ac.emit('local::opened autocompleteOpened', ac);
}

onClose() {
const ac = this;
if (ac.destroyed) return;
Expand All @@ -631,6 +646,7 @@ class Autocomplete extends Framework7Class {

ac.emit('local::close autocompleteClose', ac);
}

onClosed() {
const ac = this;
if (ac.destroyed) return;
Expand All @@ -642,6 +658,7 @@ class Autocomplete extends Framework7Class {

ac.emit('local::closed autocompleteClosed', ac);
}

openPage() {
const ac = this;
if (ac.opened) return ac;
Expand Down Expand Up @@ -672,6 +689,7 @@ class Autocomplete extends Framework7Class {
});
return ac;
}

openPopup() {
const ac = this;
if (ac.opened) return ac;
Expand Down Expand Up @@ -709,6 +727,7 @@ class Autocomplete extends Framework7Class {
}
return ac;
}

openDropdown() {
const ac = this;

Expand All @@ -732,6 +751,7 @@ class Autocomplete extends Framework7Class {
ac.onOpen('dropdown', ac.$dropdownEl);
ac.onOpened('dropdown', ac.$dropdownEl);
}

open() {
const ac = this;
if (ac.opened) return ac;
Expand All @@ -742,6 +762,7 @@ class Autocomplete extends Framework7Class {
}).join('')}`]();
return ac;
}

close() {
const ac = this;
if (!ac.opened) return ac;
Expand All @@ -761,10 +782,12 @@ class Autocomplete extends Framework7Class {
}
return ac;
}

init() {
const ac = this;
ac.attachEvents();
}

destroy() {
const ac = this;
ac.emit('local::beforeDestroy autocompleteBeforeDestroy', ac);
Expand Down
Loading

0 comments on commit 49d1287

Please sign in to comment.