framework7 7.1.5 → 8.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.js +2 -16
- package/components/accordion/accordion.less +0 -3
- package/components/actions/actions-class.js +13 -58
- package/components/actions/actions-ios.less +42 -0
- package/components/actions/actions-md.less +12 -0
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions-vars.less +17 -42
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.d.ts +2 -2
- package/components/actions/actions.js +0 -4
- package/components/actions/actions.less +5 -35
- package/components/app/app-class.d.ts +14 -12
- package/components/app/app-class.js +93 -75
- package/components/app/app-ios.less +0 -2
- package/components/app/app-md.less +0 -2
- package/components/app/app-vars.less +13 -96
- package/components/app/app.less +1 -4
- package/components/app/load-module.js +17 -36
- package/components/area-chart/area-chart-class.js +8 -64
- package/components/area-chart/area-chart.js +0 -3
- package/components/area-chart/area-chart.less +0 -3
- package/components/autocomplete/autocomplete-class.js +30 -175
- package/components/autocomplete/autocomplete-ios.less +0 -8
- package/components/autocomplete/autocomplete-rtl.css +1 -1
- package/components/autocomplete/autocomplete-vars.less +8 -22
- package/components/autocomplete/autocomplete.css +1 -1
- package/components/autocomplete/autocomplete.d.ts +1 -3
- package/components/autocomplete/autocomplete.js +1 -6
- package/components/autocomplete/autocomplete.less +6 -18
- package/components/badge/badge-vars.less +3 -6
- package/components/badge/badge.less +1 -3
- package/components/block/block-vars.less +25 -52
- package/components/block/block.less +37 -12
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
- package/components/breadcrumbs/breadcrumbs-vars.less +31 -15
- package/components/breadcrumbs/breadcrumbs.css +1 -1
- package/components/breadcrumbs/breadcrumbs.js +0 -2
- package/components/breadcrumbs/breadcrumbs.less +4 -10
- package/components/button/button-vars.less +42 -43
- package/components/button/button.less +24 -26
- package/components/calendar/calendar-class.js +81 -401
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar-vars.less +32 -46
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.js +6 -4
- package/components/calendar/calendar.less +10 -21
- package/components/card/card-rtl.css +1 -1
- package/components/card/card-vars.less +41 -44
- package/components/card/card.css +1 -1
- package/components/card/card.js +0 -108
- package/components/card/card.less +18 -24
- package/components/checkbox/checkbox-rtl.css +1 -1
- package/components/checkbox/checkbox-vars.less +0 -8
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.less +32 -3
- package/components/chip/chip-ios.less +3 -0
- package/components/chip/chip-md.less +4 -3
- package/components/chip/chip-rtl.css +1 -1
- package/components/chip/chip-vars.less +17 -20
- package/components/chip/chip.css +1 -1
- package/components/chip/chip.less +16 -21
- package/components/color-picker/color-picker-class.js +27 -158
- package/components/color-picker/color-picker-rtl.css +1 -1
- package/components/color-picker/color-picker.css +1 -1
- package/components/color-picker/color-picker.js +0 -4
- package/components/color-picker/color-picker.less +18 -8
- package/components/color-picker/modules/alpha-slider.js +0 -12
- package/components/color-picker/modules/brightness-slider.js +0 -8
- package/components/color-picker/modules/current-color.js +0 -2
- package/components/color-picker/modules/hex.js +0 -12
- package/components/color-picker/modules/hs-spectrum.js +0 -20
- package/components/color-picker/modules/hsb-sliders.js +0 -18
- package/components/color-picker/modules/hue-slider.js +0 -7
- package/components/color-picker/modules/initial-current-colors.js +0 -7
- package/components/color-picker/modules/palette.js +2 -10
- package/components/color-picker/modules/rgb-bars.js +0 -17
- package/components/color-picker/modules/rgb-sliders.js +0 -17
- package/components/color-picker/modules/sb-spectrum.js +0 -20
- package/components/color-picker/modules/wheel.js +0 -28
- package/components/contacts-list/contacts-list-md.less +4 -3
- package/components/contacts-list/contacts-list-rtl.css +1 -1
- package/components/contacts-list/contacts-list-vars.less +3 -15
- package/components/contacts-list/contacts-list.css +1 -1
- package/components/contacts-list/contacts-list.less +0 -3
- package/components/data-table/data-table-class.js +10 -32
- package/components/data-table/data-table-rtl.css +1 -1
- package/components/data-table/data-table-vars.less +6 -39
- package/components/data-table/data-table.css +1 -1
- package/components/data-table/data-table.js +0 -8
- package/components/data-table/data-table.less +0 -3
- package/components/dialog/dialog-class.js +7 -41
- package/components/dialog/dialog-ios.less +0 -3
- package/components/dialog/dialog-md.less +9 -9
- package/components/dialog/dialog-rtl.css +1 -1
- package/components/dialog/dialog-vars.less +25 -70
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +12 -48
- package/components/dialog/dialog.less +8 -4
- package/components/fab/fab-rtl.css +1 -1
- package/components/fab/fab-vars.less +20 -14
- package/components/fab/fab.css +1 -1
- package/components/fab/fab.js +0 -21
- package/components/fab/fab.less +50 -53
- package/components/form/form.d.ts +4 -4
- package/components/form/form.js +58 -94
- package/components/form/form.less +0 -3
- package/components/gauge/gauge-class.js +4 -20
- package/components/gauge/gauge.js +0 -9
- package/components/gauge/gauge.less +0 -3
- package/components/grid/grid-rtl.css +1 -1
- package/components/grid/grid-vars.less +0 -7
- package/components/grid/grid.css +1 -1
- package/components/grid/grid.d.ts +2 -8
- package/components/grid/grid.js +1 -225
- package/components/grid/grid.less +54 -184
- package/components/icon/icon.less +0 -3
- package/components/infinite-scroll/infinite-scroll-rtl.css +1 -1
- package/components/infinite-scroll/infinite-scroll.css +1 -1
- package/components/infinite-scroll/infinite-scroll.js +0 -16
- package/components/infinite-scroll/infinite-scroll.less +0 -3
- package/components/input/input-ios.less +49 -41
- package/components/input/input-md.less +87 -19
- package/components/input/input-rtl.css +1 -1
- package/components/input/input-vars.less +26 -60
- package/components/input/input.css +1 -1
- package/components/input/input.js +8 -67
- package/components/input/input.less +67 -153
- package/components/link/link-vars.less +0 -5
- package/components/link/link.less +3 -3
- package/components/list/list-md.less +0 -7
- package/components/list/list-vars.less +59 -108
- package/components/list/list.less +122 -90
- package/components/list-index/list-index-class.js +12 -69
- package/components/list-index/list-index-rtl.css +1 -1
- package/components/list-index/list-index-vars.less +0 -7
- package/components/list-index/list-index.css +1 -1
- package/components/list-index/list-index.d.ts +1 -3
- package/components/list-index/list-index.js +0 -8
- package/components/list-index/list-index.less +4 -7
- package/components/login-screen/login-screen-class.js +4 -9
- package/components/login-screen/login-screen-rtl.css +1 -1
- package/components/login-screen/login-screen-vars.less +13 -12
- package/components/login-screen/login-screen.css +1 -1
- package/components/login-screen/login-screen.js +0 -4
- package/components/login-screen/login-screen.less +2 -8
- package/components/messagebar/messagebar-class.js +18 -79
- package/components/messagebar/messagebar-ios.less +36 -0
- package/components/messagebar/messagebar-md.less +96 -16
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar-vars.less +27 -50
- package/components/messagebar/messagebar.css +1 -1
- package/components/messagebar/messagebar.js +0 -8
- package/components/messagebar/messagebar.less +11 -42
- package/components/messages/messages-class.js +17 -110
- package/components/messages/messages-ios.less +9 -0
- package/components/messages/messages-md.less +63 -28
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages-vars.less +43 -50
- package/components/messages/messages.css +1 -1
- package/components/messages/messages.js +0 -8
- package/components/messages/messages.less +0 -11
- package/components/modal/custom-modal-class.js +4 -14
- package/components/modal/modal-class.js +19 -55
- package/components/modal/modal.js +0 -3
- package/components/navbar/navbar-ios.less +3 -39
- package/components/navbar/navbar-md.less +12 -0
- package/components/navbar/navbar-vars.less +20 -49
- package/components/navbar/navbar.d.ts +0 -2
- package/components/navbar/navbar.js +37 -166
- package/components/navbar/navbar.less +4 -26
- package/components/notification/notification-class.js +4 -39
- package/components/notification/notification-md.less +18 -8
- package/components/notification/notification-rtl.css +1 -1
- package/components/notification/notification-vars.less +15 -54
- package/components/notification/notification.css +1 -1
- package/components/notification/notification.js +0 -2
- package/components/notification/notification.less +0 -3
- package/components/page/page-md.less +40 -10
- package/components/page/page-transitions/circle.less +15 -9
- package/components/page/page-transitions/fade.less +17 -11
- package/components/page/page-transitions/flip.less +9 -4
- package/components/page/page-vars.less +3 -19
- package/components/page/page.less +2 -10
- package/components/panel/panel-class.js +27 -132
- package/components/panel/panel-md.less +9 -0
- package/components/panel/panel-rtl.css +1 -1
- package/components/panel/panel-vars.less +7 -21
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +2 -2
- package/components/panel/panel.js +0 -34
- package/components/panel/panel.less +56 -48
- package/components/panel/resizable-panel.js +2 -32
- package/components/panel/swipe-panel.js +16 -71
- package/components/photo-browser/photo-browser-class.js +41 -171
- package/components/photo-browser/photo-browser-rtl.css +1 -1
- package/components/photo-browser/photo-browser-vars.less +0 -3
- package/components/photo-browser/photo-browser.css +1 -1
- package/components/photo-browser/photo-browser.d.ts +2 -4
- package/components/photo-browser/photo-browser.js +1 -6
- package/components/photo-browser/photo-browser.less +0 -4
- package/components/picker/picker-class.js +26 -133
- package/components/picker/picker-column.js +11 -31
- package/components/picker/picker-ios.less +10 -0
- package/components/picker/picker-md.less +6 -0
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker-vars.less +9 -25
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.js +0 -4
- package/components/picker/picker.less +0 -11
- package/components/pie-chart/pie-chart-class.js +8 -31
- package/components/pie-chart/pie-chart.js +0 -3
- package/components/pie-chart/pie-chart.less +0 -3
- package/components/popover/popover-class.js +72 -126
- package/components/popover/popover-ios.less +0 -50
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover-vars.less +6 -23
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.d.ts +2 -0
- package/components/popover/popover.js +1 -12
- package/components/popover/popover.less +62 -5
- package/components/popup/popup-class.js +12 -78
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup-vars.less +7 -9
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.js +0 -4
- package/components/popup/popup.less +4 -4
- package/components/preloader/preloader-ios.less +3 -1
- package/components/preloader/preloader-md.less +5 -1
- package/components/preloader/preloader-rtl.css +1 -1
- package/components/preloader/preloader-vars.less +0 -6
- package/components/preloader/preloader.css +1 -1
- package/components/preloader/preloader.js +8 -25
- package/components/preloader/preloader.less +6 -3
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar-vars.less +2 -12
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +2 -31
- package/components/progressbar/progressbar.less +0 -3
- package/components/pull-to-refresh/pull-to-refresh-class.js +15 -107
- package/components/pull-to-refresh/pull-to-refresh-md.less +2 -1
- package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh-vars.less +0 -4
- package/components/pull-to-refresh/pull-to-refresh.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh.js +0 -8
- package/components/pull-to-refresh/pull-to-refresh.less +0 -3
- package/components/radio/radio-rtl.css +1 -1
- package/components/radio/radio-vars.less +0 -7
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.less +12 -5
- package/components/range/range-class.js +27 -112
- package/components/range/range-rtl.css +1 -1
- package/components/range/range-vars.less +10 -32
- package/components/range/range.css +1 -1
- package/components/range/range.js +0 -12
- package/components/range/range.less +0 -3
- package/components/searchbar/remove-diacritics.js +0 -4
- package/components/searchbar/searchbar-class.js +17 -138
- package/components/searchbar/searchbar-md.less +41 -16
- package/components/searchbar/searchbar-rtl.css +1 -1
- package/components/searchbar/searchbar-vars.less +25 -76
- package/components/searchbar/searchbar.css +1 -1
- package/components/searchbar/searchbar.d.ts +2 -2
- package/components/searchbar/searchbar.js +0 -15
- package/components/searchbar/searchbar.less +14 -28
- package/components/sheet/sheet-class.js +15 -110
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet-vars.less +17 -6
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.js +0 -9
- package/components/sheet/sheet.less +10 -3
- package/components/skeleton/skeleton.less +0 -3
- package/components/smart-select/smart-select-class.js +39 -176
- package/components/smart-select/smart-select.d.ts +3 -3
- package/components/smart-select/smart-select.js +2 -14
- package/components/smart-select/smart-select.less +0 -3
- package/components/sortable/sortable-rtl.css +1 -1
- package/components/sortable/sortable-vars.less +8 -8
- package/components/sortable/sortable.css +1 -1
- package/components/sortable/sortable.js +0 -44
- package/components/sortable/sortable.less +0 -3
- package/components/statusbar/statusbar.js +0 -36
- package/components/statusbar/statusbar.less +0 -3
- package/components/stepper/stepper-class.js +10 -83
- package/components/stepper/stepper-rtl.css +1 -1
- package/components/stepper/stepper-vars.less +12 -24
- package/components/stepper/stepper.css +1 -1
- package/components/stepper/stepper.js +0 -12
- package/components/stepper/stepper.less +12 -23
- package/components/subnavbar/subnavbar-vars.less +3 -18
- package/components/subnavbar/subnavbar.js +0 -3
- package/components/subnavbar/subnavbar.less +1 -11
- package/components/swipeout/swipeout-rtl.css +1 -1
- package/components/swipeout/swipeout-vars.less +7 -6
- package/components/swipeout/swipeout.css +1 -1
- package/components/swipeout/swipeout.js +2 -99
- package/components/swipeout/swipeout.less +2 -7
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/swiper/swiper.js +15 -48
- package/components/swiper/swiper.less +0 -15
- package/components/tabs/tabs-rtl.css +1 -1
- package/components/tabs/tabs.css +1 -1
- package/components/tabs/tabs.js +23 -60
- package/components/tabs/tabs.less +1 -3
- package/components/text-editor/text-editor-class.js +16 -102
- package/components/text-editor/text-editor-rtl.css +1 -1
- package/components/text-editor/text-editor-vars.less +12 -16
- package/components/text-editor/text-editor.css +1 -1
- package/components/text-editor/text-editor.js +0 -8
- package/components/text-editor/text-editor.less +0 -6
- package/components/timeline/timeline-rtl.css +1 -1
- package/components/timeline/timeline-vars.less +13 -47
- package/components/timeline/timeline.css +1 -1
- package/components/timeline/timeline.less +2 -9
- package/components/toast/toast-class.js +2 -16
- package/components/toast/toast-rtl.css +1 -1
- package/components/toast/toast-vars.less +5 -9
- package/components/toast/toast.css +1 -1
- package/components/toast/toast.js +0 -3
- package/components/toast/toast.less +0 -3
- package/components/toggle/toggle-class.js +6 -30
- package/components/toggle/toggle-ios.less +5 -1
- package/components/toggle/toggle-md.less +27 -11
- package/components/toggle/toggle-rtl.css +1 -1
- package/components/toggle/toggle-vars.less +19 -21
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.js +0 -8
- package/components/toggle/toggle.less +0 -4
- package/components/toolbar/toolbar-ios.less +2 -2
- package/components/toolbar/toolbar-md.less +28 -4
- package/components/toolbar/toolbar-vars.less +17 -52
- package/components/toolbar/toolbar.js +5 -43
- package/components/toolbar/toolbar.less +27 -45
- package/components/tooltip/tooltip-class.js +10 -64
- package/components/tooltip/tooltip-rtl.css +1 -1
- package/components/tooltip/tooltip-vars.less +12 -3
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.js +0 -15
- package/components/tooltip/tooltip.less +0 -3
- package/components/touch-ripple/touch-ripple-class.js +0 -13
- package/components/touch-ripple/touch-ripple.js +0 -4
- package/components/touch-ripple/touch-ripple.less +1 -5
- package/components/treeview/treeview-rtl.css +1 -1
- package/components/treeview/treeview-vars.less +0 -3
- package/components/treeview/treeview.css +1 -1
- package/components/treeview/treeview.js +2 -11
- package/components/treeview/treeview.less +0 -3
- package/components/typography/typography-rtl.css +1 -1
- package/components/typography/typography.css +1 -1
- package/components/typography/typography.less +25 -3
- package/components/view/resizable-view.js +2 -24
- package/components/view/view-class.js +28 -53
- package/components/view/view.d.ts +0 -14
- package/components/view/view.js +8 -32
- package/components/view/view.less +1 -4
- package/components/virtual-list/virtual-list-class.js +58 -146
- package/components/virtual-list/virtual-list.d.ts +1 -1
- package/components/virtual-list/virtual-list.js +0 -2
- package/components/virtual-list/virtual-list.less +0 -3
- package/framework7-bundle-rtl.css +3064 -6057
- package/framework7-bundle-rtl.min.css +3 -3
- package/framework7-bundle.css +3063 -6059
- package/framework7-bundle.esm.js +4 -10
- package/framework7-bundle.js +6442 -12377
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +2 -27
- package/framework7-bundle.min.css +3 -3
- package/framework7-bundle.min.js +3 -3
- package/framework7-bundle.min.js.map +1 -1
- package/framework7-lite-bundle.esm.js +4 -10
- package/framework7-lite.esm.js +4 -6
- package/framework7-rtl.css +803 -1591
- package/framework7-rtl.min.css +3 -3
- package/framework7-types.d.ts +1 -32
- package/framework7.css +803 -1594
- package/framework7.d.ts +1 -32
- package/framework7.esm.js +4 -6
- package/framework7.less +2 -23
- package/framework7.min.css +3 -3
- package/less/mixins.less +7 -88
- package/modules/clicks/clicks.js +10 -22
- package/modules/component/$h.js +0 -3
- package/modules/component/$jsx.js +0 -5
- package/modules/component/component-class.js +13 -66
- package/modules/component/component.d.ts +1 -2
- package/modules/component/component.js +0 -8
- package/modules/component/eventslisteners.js +12 -20
- package/modules/component/parse-component.js +18 -20
- package/modules/component/snabbdom/h.js +3 -12
- package/modules/component/snabbdom/helpers/attachto.js +9 -14
- package/modules/component/snabbdom/htmldomapi.js +0 -16
- package/modules/component/snabbdom/modules/attributes.js +7 -11
- package/modules/component/snabbdom/modules/class.js +4 -8
- package/modules/component/snabbdom/modules/dataset.js +3 -7
- package/modules/component/snabbdom/modules/eventlisteners.js +16 -22
- package/modules/component/snabbdom/modules/hero.js +4 -44
- package/modules/component/snabbdom/modules/props.js +5 -9
- package/modules/component/snabbdom/modules/style.js +13 -30
- package/modules/component/snabbdom/snabbdom.bundle.js +0 -6
- package/modules/component/snabbdom/snabbdom.js +13 -72
- package/modules/component/snabbdom/thunk.js +3 -11
- package/modules/component/snabbdom/tovnode.js +1 -6
- package/modules/component/vdom.js +4 -62
- package/modules/demo-module.js +0 -8
- package/modules/device/device.js +6 -11
- package/modules/history/history.js +0 -1
- package/modules/resize/resize.js +8 -11
- package/modules/router/async-component.js +0 -3
- package/modules/router/back.js +86 -275
- package/modules/router/clear-previous-history.js +5 -18
- package/modules/router/component-loader.js +4 -25
- package/modules/router/modal.js +16 -43
- package/modules/router/navigate.js +80 -250
- package/modules/router/process-route-queue.js +0 -12
- package/modules/router/redirect.js +0 -8
- package/modules/router/router-class.js +92 -315
- package/modules/router/router.d.ts +3 -5
- package/modules/router/router.js +0 -3
- package/modules/router/swipe-back.js +35 -139
- package/modules/router/tab.js +14 -43
- package/modules/service-worker/service-worker.js +0 -11
- package/modules/store/create-store.js +10 -29
- package/modules/touch/touch.d.ts +2 -4
- package/modules/touch/touch.js +13 -108
- package/package.json +3 -14
- package/shared/$jsx.js +0 -6
- package/shared/class.js +18 -43
- package/shared/constructor-methods.js +0 -11
- package/shared/events-class.js +0 -17
- package/shared/get-device.js +18 -34
- package/shared/get-support.js +2 -8
- package/shared/history.js +2 -30
- package/shared/material-color-utils.js +728 -0
- package/shared/material-colors.js +75 -0
- package/shared/modal-methods.js +0 -18
- package/shared/utils.d.ts +0 -4
- package/shared/utils.js +191 -71
- package/components/accordion/accordion-aurora.less +0 -2
- package/components/accordion/accordion.lazy.js +0 -1
- package/components/actions/actions-aurora.less +0 -9
- package/components/actions/actions.lazy.js +0 -1
- package/components/app/app-aurora.less +0 -10
- package/components/appbar/appbar-aurora.less +0 -2
- package/components/appbar/appbar-ios.less +0 -2
- package/components/appbar/appbar-md.less +0 -2
- package/components/appbar/appbar-rtl.css +0 -1
- package/components/appbar/appbar-vars.less +0 -28
- package/components/appbar/appbar.css +0 -1
- package/components/appbar/appbar.d.ts +0 -14
- package/components/appbar/appbar.js +0 -3
- package/components/appbar/appbar.lazy.js +0 -1
- package/components/appbar/appbar.less +0 -106
- package/components/area-chart/area-chart-aurora.less +0 -2
- package/components/area-chart/area-chart.lazy.js +0 -1
- package/components/autocomplete/autocomplete-aurora.less +0 -17
- package/components/autocomplete/autocomplete.lazy.js +0 -1
- package/components/badge/badge-aurora.less +0 -2
- package/components/block/block-aurora.less +0 -2
- package/components/breadcrumbs/breadcrumbs-aurora.less +0 -2
- package/components/breadcrumbs/breadcrumbs.lazy.js +0 -1
- package/components/button/button-aurora.less +0 -25
- package/components/calendar/calendar-aurora.less +0 -2
- package/components/calendar/calendar.lazy.js +0 -1
- package/components/card/card-aurora.less +0 -2
- package/components/card/card.lazy.js +0 -1
- package/components/checkbox/checkbox-aurora.less +0 -39
- package/components/checkbox/checkbox.lazy.js +0 -1
- package/components/chip/chip-aurora.less +0 -14
- package/components/chip/chip.lazy.js +0 -1
- package/components/color-picker/color-picker-aurora.less +0 -2
- package/components/color-picker/color-picker.lazy.js +0 -1
- package/components/contacts-list/contacts-list-aurora.less +0 -2
- package/components/contacts-list/contacts-list.lazy.js +0 -1
- package/components/data-table/data-table-aurora.less +0 -64
- package/components/data-table/data-table.lazy.js +0 -1
- package/components/dialog/dialog-aurora.less +0 -112
- package/components/dialog/dialog.lazy.js +0 -1
- package/components/elevation/elevation-aurora.less +0 -2
- package/components/elevation/elevation-ios.less +0 -2
- package/components/elevation/elevation-md.less +0 -2
- package/components/elevation/elevation-rtl.css +0 -1
- package/components/elevation/elevation-vars.less +0 -51
- package/components/elevation/elevation.css +0 -1
- package/components/elevation/elevation.d.ts +0 -14
- package/components/elevation/elevation.js +0 -3
- package/components/elevation/elevation.lazy.js +0 -1
- package/components/elevation/elevation.less +0 -54
- package/components/fab/fab-aurora.less +0 -2
- package/components/fab/fab.lazy.js +0 -1
- package/components/form/form-aurora.less +0 -0
- package/components/form/form.lazy.js +0 -1
- package/components/gauge/gauge-aurora.less +0 -2
- package/components/gauge/gauge.lazy.js +0 -1
- package/components/grid/grid-aurora.less +0 -2
- package/components/grid/grid.lazy.js +0 -1
- package/components/icon/icon-aurora.less +0 -49
- package/components/infinite-scroll/infinite-scroll-aurora.less +0 -6
- package/components/infinite-scroll/infinite-scroll.lazy.js +0 -1
- package/components/input/input-aurora.less +0 -120
- package/components/input/input.lazy.js +0 -1
- package/components/lazy/lazy-aurora.less +0 -2
- package/components/lazy/lazy-ios.less +0 -2
- package/components/lazy/lazy-md.less +0 -2
- package/components/lazy/lazy-rtl.css +0 -1
- package/components/lazy/lazy.css +0 -1
- package/components/lazy/lazy.d.ts +0 -57
- package/components/lazy/lazy.js +0 -283
- package/components/lazy/lazy.lazy.js +0 -1
- package/components/lazy/lazy.less +0 -23
- package/components/link/link-aurora.less +0 -15
- package/components/list/list-aurora.less +0 -25
- package/components/list-index/list-index-aurora.less +0 -21
- package/components/list-index/list-index.lazy.js +0 -1
- package/components/login-screen/login-screen-aurora.less +0 -2
- package/components/login-screen/login-screen.lazy.js +0 -1
- package/components/menu/menu-aurora.less +0 -8
- package/components/menu/menu-ios.less +0 -2
- package/components/menu/menu-md.less +0 -2
- package/components/menu/menu-rtl.css +0 -1
- package/components/menu/menu-vars.less +0 -27
- package/components/menu/menu.css +0 -1
- package/components/menu/menu.d.ts +0 -32
- package/components/menu/menu.js +0 -87
- package/components/menu/menu.lazy.js +0 -1
- package/components/menu/menu.less +0 -232
- package/components/messagebar/messagebar-aurora.less +0 -53
- package/components/messagebar/messagebar.lazy.js +0 -1
- package/components/messages/messages-aurora.less +0 -137
- package/components/messages/messages.lazy.js +0 -1
- package/components/navbar/navbar-aurora.less +0 -70
- package/components/notification/notification-aurora.less +0 -59
- package/components/notification/notification.lazy.js +0 -1
- package/components/page/page-aurora.less +0 -49
- package/components/panel/panel-aurora.less +0 -2
- package/components/panel/panel.lazy.js +0 -1
- package/components/photo-browser/photo-browser-aurora.less +0 -2
- package/components/photo-browser/photo-browser.lazy.js +0 -1
- package/components/picker/picker-aurora.less +0 -2
- package/components/picker/picker.lazy.js +0 -1
- package/components/pie-chart/pie-chart-aurora.less +0 -2
- package/components/pie-chart/pie-chart.lazy.js +0 -1
- package/components/popover/popover-aurora.less +0 -56
- package/components/popover/popover.lazy.js +0 -1
- package/components/popup/popup-aurora.less +0 -2
- package/components/popup/popup.lazy.js +0 -1
- package/components/preloader/preloader-aurora.less +0 -53
- package/components/preloader/preloader.lazy.js +0 -1
- package/components/progressbar/progressbar-aurora.less +0 -72
- package/components/progressbar/progressbar.lazy.js +0 -1
- package/components/pull-to-refresh/pull-to-refresh-aurora.less +0 -122
- package/components/pull-to-refresh/pull-to-refresh.lazy.js +0 -1
- package/components/radio/radio-aurora.less +0 -86
- package/components/radio/radio.lazy.js +0 -1
- package/components/range/range-aurora.less +0 -9
- package/components/range/range.lazy.js +0 -1
- package/components/searchbar/searchbar-aurora.less +0 -86
- package/components/searchbar/searchbar.lazy.js +0 -1
- package/components/sheet/sheet-aurora.less +0 -2
- package/components/sheet/sheet.lazy.js +0 -1
- package/components/skeleton/skeleton-aurora.less +0 -2
- package/components/skeleton/skeleton.lazy.js +0 -1
- package/components/smart-select/smart-select-aurora.less +0 -2
- package/components/smart-select/smart-select.lazy.js +0 -1
- package/components/sortable/sortable-aurora.less +0 -7
- package/components/sortable/sortable.lazy.js +0 -1
- package/components/statusbar/statusbar-aurora.less +0 -2
- package/components/stepper/stepper-aurora.less +0 -32
- package/components/stepper/stepper.lazy.js +0 -1
- package/components/subnavbar/subnavbar-aurora.less +0 -51
- package/components/swipeout/swipeout-aurora.less +0 -2
- package/components/swipeout/swipeout.lazy.js +0 -1
- package/components/swiper/swiper-aurora.less +0 -2
- package/components/swiper/swiper.lazy.js +0 -1
- package/components/tabs/tabs-aurora.less +0 -2
- package/components/tabs/tabs.lazy.js +0 -1
- package/components/text-editor/text-editor-aurora.less +0 -9
- package/components/text-editor/text-editor.lazy.js +0 -1
- package/components/timeline/timeline-aurora.less +0 -7
- package/components/timeline/timeline.lazy.js +0 -1
- package/components/toast/toast-aurora.less +0 -64
- package/components/toast/toast.lazy.js +0 -1
- package/components/toggle/toggle-aurora.less +0 -26
- package/components/toggle/toggle.lazy.js +0 -1
- package/components/toolbar/toolbar-aurora.less +0 -43
- package/components/tooltip/tooltip-aurora.less +0 -2
- package/components/tooltip/tooltip.lazy.js +0 -1
- package/components/touch-ripple/touch-ripple-aurora.less +0 -2
- package/components/treeview/treeview-aurora.less +0 -31
- package/components/treeview/treeview.lazy.js +0 -1
- package/components/typography/typography-aurora.less +0 -2
- package/components/typography/typography.lazy.js +0 -1
- package/components/view/view-aurora.less +0 -2
- package/components/virtual-list/virtual-list-aurora.less +0 -2
- package/components/virtual-list/virtual-list.lazy.js +0 -1
- package/framework7.js +0 -14715
- package/framework7.js.map +0 -1
- package/framework7.min.js +0 -14
- package/framework7.min.js.map +0 -1
- package/modules/request/request.d.ts +0 -15
- package/modules/request/request.js +0 -11
- package/shared/request.d.ts +0 -115
- package/shared/request.js +0 -512
|
@@ -4,13 +4,11 @@ import { extend, nextTick, deleteProps } from '../../shared/utils.js';
|
|
|
4
4
|
import FrameworkClass from '../../shared/class.js';
|
|
5
5
|
import { getDevice } from '../../shared/get-device.js';
|
|
6
6
|
import removeDiacritics from './remove-diacritics.js';
|
|
7
|
-
|
|
8
7
|
class Searchbar extends FrameworkClass {
|
|
9
8
|
constructor(app, params) {
|
|
10
9
|
if (params === void 0) {
|
|
11
10
|
params = {};
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
super(params, [app]);
|
|
15
13
|
const sb = this;
|
|
16
14
|
const defaults = {
|
|
@@ -27,13 +25,13 @@ class Searchbar extends FrameworkClass {
|
|
|
27
25
|
searchIn: undefined,
|
|
28
26
|
// where to search in item, CSS selector
|
|
29
27
|
searchGroup: '.list-group',
|
|
30
|
-
searchGroupTitle: '.
|
|
28
|
+
searchGroupTitle: '.list-group-title',
|
|
31
29
|
ignore: '.searchbar-ignore',
|
|
32
30
|
foundEl: '.searchbar-found',
|
|
33
31
|
notFoundEl: '.searchbar-not-found',
|
|
34
32
|
hideOnEnableEl: '.searchbar-hide-on-enable',
|
|
35
33
|
hideOnSearchEl: '.searchbar-hide-on-search',
|
|
36
|
-
backdrop:
|
|
34
|
+
backdrop: true,
|
|
37
35
|
removeDiacritics: true,
|
|
38
36
|
customSearch: false,
|
|
39
37
|
hideDividers: true,
|
|
@@ -41,8 +39,9 @@ class Searchbar extends FrameworkClass {
|
|
|
41
39
|
disableOnBackdropClick: true,
|
|
42
40
|
expandable: false,
|
|
43
41
|
inline: false
|
|
44
|
-
};
|
|
42
|
+
};
|
|
45
43
|
|
|
44
|
+
// Extend defaults with modules params
|
|
46
45
|
sb.useModulesParams(defaults);
|
|
47
46
|
sb.params = extend(defaults, params);
|
|
48
47
|
const $el = $(sb.params.el);
|
|
@@ -51,62 +50,47 @@ class Searchbar extends FrameworkClass {
|
|
|
51
50
|
$el[0].f7Searchbar = sb;
|
|
52
51
|
let $pageEl;
|
|
53
52
|
const $navbarEl = $el.parents('.navbar');
|
|
54
|
-
|
|
55
53
|
if ($el.parents('.page').length > 0) {
|
|
56
54
|
$pageEl = $el.parents('.page');
|
|
57
55
|
} else if ($navbarEl.length > 0) {
|
|
58
56
|
$pageEl = $(app.navbar.getPageByEl($navbarEl[0]));
|
|
59
|
-
|
|
60
57
|
if (!$pageEl.length) {
|
|
61
58
|
const $currentPageEl = $el.parents('.view').find('.page-current');
|
|
62
|
-
|
|
63
59
|
if ($currentPageEl[0] && $currentPageEl[0].f7Page && $currentPageEl[0].f7Page.navbarEl === $navbarEl[0]) {
|
|
64
60
|
$pageEl = $currentPageEl;
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
|
|
69
64
|
let $foundEl;
|
|
70
|
-
|
|
71
65
|
if (params.foundEl) {
|
|
72
66
|
$foundEl = $(params.foundEl);
|
|
73
67
|
} else if (typeof sb.params.foundEl === 'string' && $pageEl) {
|
|
74
68
|
$foundEl = $pageEl.find(sb.params.foundEl);
|
|
75
69
|
}
|
|
76
|
-
|
|
77
70
|
let $notFoundEl;
|
|
78
|
-
|
|
79
71
|
if (params.notFoundEl) {
|
|
80
72
|
$notFoundEl = $(params.notFoundEl);
|
|
81
73
|
} else if (typeof sb.params.notFoundEl === 'string' && $pageEl) {
|
|
82
74
|
$notFoundEl = $pageEl.find(sb.params.notFoundEl);
|
|
83
75
|
}
|
|
84
|
-
|
|
85
76
|
let $hideOnEnableEl;
|
|
86
|
-
|
|
87
77
|
if (params.hideOnEnableEl) {
|
|
88
78
|
$hideOnEnableEl = $(params.hideOnEnableEl);
|
|
89
79
|
} else if (typeof sb.params.hideOnEnableEl === 'string' && $pageEl) {
|
|
90
80
|
$hideOnEnableEl = $pageEl.find(sb.params.hideOnEnableEl);
|
|
91
81
|
}
|
|
92
|
-
|
|
93
82
|
let $hideOnSearchEl;
|
|
94
|
-
|
|
95
83
|
if (params.hideOnSearchEl) {
|
|
96
84
|
$hideOnSearchEl = $(params.hideOnSearchEl);
|
|
97
85
|
} else if (typeof sb.params.hideOnSearchEl === 'string' && $pageEl) {
|
|
98
86
|
$hideOnSearchEl = $pageEl.find(sb.params.hideOnSearchEl);
|
|
99
87
|
}
|
|
100
|
-
|
|
101
88
|
const expandable = sb.params.expandable || $el.hasClass('searchbar-expandable');
|
|
102
89
|
const inline = sb.params.inline || $el.hasClass('searchbar-inline');
|
|
103
|
-
|
|
104
90
|
if (typeof sb.params.backdrop === 'undefined') {
|
|
105
|
-
|
|
91
|
+
sb.params.backdrop = !inline;
|
|
106
92
|
}
|
|
107
|
-
|
|
108
93
|
let $backdropEl;
|
|
109
|
-
|
|
110
94
|
if (sb.params.backdrop) {
|
|
111
95
|
if (sb.params.backdropEl) {
|
|
112
96
|
$backdropEl = $(sb.params.backdropEl);
|
|
@@ -115,10 +99,8 @@ class Searchbar extends FrameworkClass {
|
|
|
115
99
|
} else {
|
|
116
100
|
$backdropEl = $el.siblings('.searchbar-backdrop');
|
|
117
101
|
}
|
|
118
|
-
|
|
119
102
|
if ($backdropEl.length === 0) {
|
|
120
103
|
$backdropEl = $('<div class="searchbar-backdrop"></div>');
|
|
121
|
-
|
|
122
104
|
if ($pageEl && $pageEl.length) {
|
|
123
105
|
if ($el.parents($pageEl).length > 0 && $navbarEl && $el.parents($navbarEl).length === 0) {
|
|
124
106
|
$backdropEl.insertBefore($el);
|
|
@@ -130,23 +112,17 @@ class Searchbar extends FrameworkClass {
|
|
|
130
112
|
}
|
|
131
113
|
}
|
|
132
114
|
}
|
|
133
|
-
|
|
134
115
|
let $searchContainer;
|
|
135
|
-
|
|
136
116
|
if (sb.params.searchContainer) {
|
|
137
117
|
$searchContainer = $(sb.params.searchContainer);
|
|
138
118
|
}
|
|
139
|
-
|
|
140
119
|
let $inputEl;
|
|
141
|
-
|
|
142
120
|
if (sb.params.inputEl) {
|
|
143
121
|
$inputEl = $(sb.params.inputEl);
|
|
144
122
|
} else {
|
|
145
123
|
$inputEl = $el.find('input[type="search"]').eq(0);
|
|
146
124
|
}
|
|
147
|
-
|
|
148
125
|
let $disableButtonEl;
|
|
149
|
-
|
|
150
126
|
if (sb.params.disableButton) {
|
|
151
127
|
if (sb.params.disableButtonEl) {
|
|
152
128
|
$disableButtonEl = $(sb.params.disableButtonEl);
|
|
@@ -154,7 +130,6 @@ class Searchbar extends FrameworkClass {
|
|
|
154
130
|
$disableButtonEl = $el.find('.searchbar-disable-button');
|
|
155
131
|
}
|
|
156
132
|
}
|
|
157
|
-
|
|
158
133
|
extend(sb, {
|
|
159
134
|
app,
|
|
160
135
|
view: app.views.get($el.parents('.view')),
|
|
@@ -188,132 +163,104 @@ class Searchbar extends FrameworkClass {
|
|
|
188
163
|
enabled: false,
|
|
189
164
|
expandable,
|
|
190
165
|
inline
|
|
191
|
-
});
|
|
166
|
+
});
|
|
192
167
|
|
|
168
|
+
// Events
|
|
193
169
|
function preventSubmit(e) {
|
|
194
170
|
e.preventDefault();
|
|
195
171
|
}
|
|
196
|
-
|
|
197
172
|
function onInputFocus(e) {
|
|
198
173
|
sb.enable(e);
|
|
199
174
|
sb.$el.addClass('searchbar-focused');
|
|
200
175
|
}
|
|
201
|
-
|
|
202
176
|
function onInputBlur() {
|
|
203
177
|
sb.$el.removeClass('searchbar-focused');
|
|
204
|
-
|
|
205
|
-
if (app.theme === 'aurora' && (!$disableButtonEl || !$disableButtonEl.length || !sb.params.disableButton) && !sb.query) {
|
|
206
|
-
sb.disable();
|
|
207
|
-
}
|
|
208
178
|
}
|
|
209
|
-
|
|
210
179
|
function onInputChange() {
|
|
211
180
|
const value = sb.$inputEl.val().trim();
|
|
212
|
-
|
|
213
181
|
if (sb.$searchContainer && sb.$searchContainer.length > 0 && (sb.params.searchIn || sb.isVirtualList || sb.params.searchIn === sb.params.searchItem) || sb.params.customSearch) {
|
|
214
182
|
sb.search(value, true);
|
|
215
183
|
}
|
|
216
184
|
}
|
|
217
|
-
|
|
218
185
|
function onInputClear(e, previousValue) {
|
|
219
186
|
sb.$el.trigger('searchbar:clear', previousValue);
|
|
220
187
|
sb.emit('local::clear searchbarClear', sb, previousValue);
|
|
221
188
|
}
|
|
222
|
-
|
|
223
189
|
function disableOnClick(e) {
|
|
224
190
|
sb.disable(e);
|
|
225
191
|
}
|
|
226
|
-
|
|
227
192
|
function onPageBeforeOut() {
|
|
228
193
|
if (!sb || sb && !sb.$el) return;
|
|
229
|
-
|
|
230
194
|
if (sb.enabled) {
|
|
231
195
|
sb.$el.removeClass('searchbar-enabled');
|
|
232
|
-
|
|
233
196
|
if (sb.expandable) {
|
|
234
197
|
sb.$el.parents('.navbar').removeClass('with-searchbar-expandable-enabled with-searchbar-expandable-enabled-no-transition');
|
|
235
198
|
}
|
|
236
199
|
}
|
|
237
200
|
}
|
|
238
|
-
|
|
239
201
|
function onPageBeforeIn() {
|
|
240
202
|
if (!sb || sb && !sb.$el) return;
|
|
241
|
-
|
|
242
203
|
if (sb.enabled) {
|
|
243
204
|
sb.$el.addClass('searchbar-enabled');
|
|
244
|
-
|
|
245
205
|
if (sb.expandable) {
|
|
246
206
|
sb.$el.parents('.navbar').addClass('with-searchbar-expandable-enabled-no-transition');
|
|
247
207
|
}
|
|
248
208
|
}
|
|
249
209
|
}
|
|
250
|
-
|
|
251
210
|
sb.attachEvents = function attachEvents() {
|
|
252
211
|
$el.on('submit', preventSubmit);
|
|
253
|
-
|
|
254
212
|
if (sb.params.disableButton) {
|
|
255
213
|
sb.$disableButtonEl.on('click', disableOnClick);
|
|
256
214
|
}
|
|
257
|
-
|
|
258
215
|
if (sb.params.disableOnBackdropClick && sb.$backdropEl) {
|
|
259
216
|
sb.$backdropEl.on('click', disableOnClick);
|
|
260
217
|
}
|
|
261
|
-
|
|
262
218
|
if (sb.expandable && app.theme === 'ios' && sb.view && $navbarEl.length && sb.$pageEl) {
|
|
263
219
|
sb.$pageEl.on('page:beforeout', onPageBeforeOut);
|
|
264
220
|
sb.$pageEl.on('page:beforein', onPageBeforeIn);
|
|
265
221
|
}
|
|
266
|
-
|
|
267
222
|
sb.$inputEl.on('focus', onInputFocus);
|
|
268
223
|
sb.$inputEl.on('blur', onInputBlur);
|
|
269
224
|
sb.$inputEl.on(sb.params.inputEvents, onInputChange);
|
|
270
225
|
sb.$inputEl.on('input:clear', onInputClear);
|
|
271
226
|
};
|
|
272
|
-
|
|
273
227
|
sb.detachEvents = function detachEvents() {
|
|
274
228
|
$el.off('submit', preventSubmit);
|
|
275
|
-
|
|
276
229
|
if (sb.params.disableButton) {
|
|
277
230
|
sb.$disableButtonEl.off('click', disableOnClick);
|
|
278
231
|
}
|
|
279
|
-
|
|
280
232
|
if (sb.params.disableOnBackdropClick && sb.$backdropEl) {
|
|
281
233
|
sb.$backdropEl.off('click', disableOnClick);
|
|
282
234
|
}
|
|
283
|
-
|
|
284
235
|
if (sb.expandable && app.theme === 'ios' && sb.view && $navbarEl.length && sb.$pageEl) {
|
|
285
236
|
sb.$pageEl.off('page:beforeout', onPageBeforeOut);
|
|
286
237
|
sb.$pageEl.off('page:beforein', onPageBeforeIn);
|
|
287
238
|
}
|
|
288
|
-
|
|
289
239
|
sb.$inputEl.off('focus', onInputFocus);
|
|
290
240
|
sb.$inputEl.off('blur', onInputBlur);
|
|
291
241
|
sb.$inputEl.off(sb.params.inputEvents, onInputChange);
|
|
292
242
|
sb.$inputEl.off('input:clear', onInputClear);
|
|
293
|
-
};
|
|
294
|
-
|
|
243
|
+
};
|
|
295
244
|
|
|
296
|
-
|
|
245
|
+
// Install Modules
|
|
246
|
+
sb.useModules();
|
|
297
247
|
|
|
248
|
+
// Init
|
|
298
249
|
sb.init();
|
|
299
250
|
return sb;
|
|
300
251
|
}
|
|
301
|
-
|
|
302
252
|
clear(e) {
|
|
303
253
|
const sb = this;
|
|
304
|
-
|
|
305
254
|
if (!sb.query && e && $(e.target).hasClass('searchbar-clear')) {
|
|
306
255
|
sb.disable();
|
|
307
256
|
return sb;
|
|
308
257
|
}
|
|
309
|
-
|
|
310
258
|
const previousQuery = sb.value;
|
|
311
259
|
sb.$inputEl.val('').trigger('change').focus();
|
|
312
260
|
sb.$el.trigger('searchbar:clear', previousQuery);
|
|
313
261
|
sb.emit('local::clear searchbarClear', sb, previousQuery);
|
|
314
262
|
return sb;
|
|
315
263
|
}
|
|
316
|
-
|
|
317
264
|
setDisableButtonMargin() {
|
|
318
265
|
const sb = this;
|
|
319
266
|
if (sb.expandable) return;
|
|
@@ -321,12 +268,10 @@ class Searchbar extends FrameworkClass {
|
|
|
321
268
|
sb.$disableButtonEl.transition(0).show();
|
|
322
269
|
sb.$disableButtonEl.css(`margin-${app.rtl ? 'left' : 'right'}`, `${-sb.disableButtonEl.offsetWidth}px`);
|
|
323
270
|
/* eslint no-underscore-dangle: ["error", { "allow": ["_clientLeft"] }] */
|
|
324
|
-
|
|
325
271
|
sb._clientLeft = sb.$disableButtonEl[0].clientLeft;
|
|
326
272
|
sb.$disableButtonEl.transition('');
|
|
327
273
|
sb.disableButtonHasMargin = true;
|
|
328
274
|
}
|
|
329
|
-
|
|
330
275
|
enable(setFocus) {
|
|
331
276
|
const sb = this;
|
|
332
277
|
if (sb.enabled) return sb;
|
|
@@ -334,34 +279,26 @@ class Searchbar extends FrameworkClass {
|
|
|
334
279
|
const document = getDocument();
|
|
335
280
|
const device = getDevice();
|
|
336
281
|
sb.enabled = true;
|
|
337
|
-
|
|
338
282
|
function enable() {
|
|
339
283
|
if (sb.$backdropEl && (sb.$searchContainer && sb.$searchContainer.length || sb.params.customSearch) && !sb.$el.hasClass('searchbar-enabled') && !sb.query) {
|
|
340
284
|
sb.backdropShow();
|
|
341
285
|
}
|
|
342
|
-
|
|
343
286
|
sb.$el.addClass('searchbar-enabled');
|
|
344
|
-
|
|
345
287
|
if (!sb.$disableButtonEl || sb.$disableButtonEl && sb.$disableButtonEl.length === 0) {
|
|
346
288
|
sb.$el.addClass('searchbar-enabled-no-disable-button');
|
|
347
289
|
}
|
|
348
|
-
|
|
349
290
|
if (!sb.expandable && sb.$disableButtonEl && sb.$disableButtonEl.length > 0 && app.theme !== 'md') {
|
|
350
291
|
if (!sb.disableButtonHasMargin) {
|
|
351
292
|
sb.setDisableButtonMargin();
|
|
352
293
|
}
|
|
353
|
-
|
|
354
294
|
sb.$disableButtonEl.css(`margin-${app.rtl ? 'left' : 'right'}`, '0px');
|
|
355
295
|
}
|
|
356
|
-
|
|
357
296
|
if (sb.expandable) {
|
|
358
297
|
const $navbarEl = sb.$el.parents('.navbar');
|
|
359
|
-
|
|
360
298
|
if ($navbarEl.hasClass('navbar-large') && sb.$pageEl) {
|
|
361
299
|
const $pageContentEl = sb.$pageEl.find('.page-content');
|
|
362
300
|
const $titleLargeEl = $navbarEl.find('.title-large');
|
|
363
301
|
$pageContentEl.addClass('with-searchbar-expandable-enabled');
|
|
364
|
-
|
|
365
302
|
if ($navbarEl.hasClass('navbar-large') && $navbarEl.hasClass('navbar-large-collapsed') && $titleLargeEl.length && $pageContentEl.length) {
|
|
366
303
|
$pageContentEl.transition(0);
|
|
367
304
|
$pageContentEl[0].scrollTop -= $titleLargeEl[0].offsetHeight;
|
|
@@ -370,40 +307,32 @@ class Searchbar extends FrameworkClass {
|
|
|
370
307
|
}, 200);
|
|
371
308
|
}
|
|
372
309
|
}
|
|
373
|
-
|
|
374
310
|
if (app.theme === 'md' && $navbarEl.length) {
|
|
375
311
|
$navbarEl.addClass('with-searchbar-expandable-enabled');
|
|
376
312
|
} else {
|
|
377
313
|
$navbarEl.addClass('with-searchbar-expandable-enabled');
|
|
378
|
-
|
|
379
314
|
if ($navbarEl.hasClass('navbar-large')) {
|
|
380
315
|
$navbarEl.addClass('navbar-large-collapsed');
|
|
381
316
|
}
|
|
382
317
|
}
|
|
383
318
|
}
|
|
384
|
-
|
|
385
319
|
if (sb.$hideOnEnableEl) sb.$hideOnEnableEl.addClass('hidden-by-searchbar');
|
|
386
320
|
sb.$el.trigger('searchbar:enable');
|
|
387
321
|
sb.emit('local::enable searchbarEnable', sb);
|
|
388
322
|
}
|
|
389
|
-
|
|
390
323
|
let needsFocus = false;
|
|
391
|
-
|
|
392
324
|
if (setFocus === true) {
|
|
393
325
|
if (document.activeElement !== sb.inputEl) {
|
|
394
326
|
needsFocus = true;
|
|
395
327
|
}
|
|
396
328
|
}
|
|
397
|
-
|
|
398
329
|
const isIos = device.ios && app.theme === 'ios';
|
|
399
|
-
|
|
400
330
|
if (isIos) {
|
|
401
331
|
if (sb.expandable) {
|
|
402
332
|
if (needsFocus) sb.$inputEl.focus();
|
|
403
333
|
enable();
|
|
404
334
|
} else {
|
|
405
335
|
if (needsFocus) sb.$inputEl.focus();
|
|
406
|
-
|
|
407
336
|
if (setFocus && (setFocus.type === 'focus' || setFocus === true)) {
|
|
408
337
|
nextTick(() => {
|
|
409
338
|
enable();
|
|
@@ -414,38 +343,30 @@ class Searchbar extends FrameworkClass {
|
|
|
414
343
|
}
|
|
415
344
|
} else {
|
|
416
345
|
if (needsFocus) sb.$inputEl.focus();
|
|
417
|
-
|
|
418
346
|
if (app.theme === 'md' && sb.expandable) {
|
|
419
347
|
sb.$el.parents('.page, .view, .navbar-inner, .navbar').scrollLeft(app.rtl ? 100 : 0);
|
|
420
348
|
}
|
|
421
|
-
|
|
422
349
|
enable();
|
|
423
350
|
}
|
|
424
|
-
|
|
425
351
|
return sb;
|
|
426
352
|
}
|
|
427
|
-
|
|
428
353
|
disable() {
|
|
429
354
|
const sb = this;
|
|
430
355
|
if (!sb.enabled) return sb;
|
|
431
356
|
const app = sb.app;
|
|
432
357
|
sb.$inputEl.val('').trigger('change');
|
|
433
358
|
sb.$el.removeClass('searchbar-enabled searchbar-focused searchbar-enabled-no-disable-button');
|
|
434
|
-
|
|
435
359
|
if (sb.expandable) {
|
|
436
360
|
const $navbarEl = sb.$el.parents('.navbar');
|
|
437
361
|
const $pageContentEl = sb.$pageEl && sb.$pageEl.find('.page-content');
|
|
438
|
-
|
|
439
362
|
if ($navbarEl.hasClass('navbar-large') && $pageContentEl.length) {
|
|
440
363
|
const $titleLargeEl = $navbarEl.find('.title-large');
|
|
441
364
|
sb.$el.transitionEnd(() => {
|
|
442
365
|
$pageContentEl.removeClass('with-searchbar-expandable-closing');
|
|
443
366
|
});
|
|
444
|
-
|
|
445
367
|
if ($navbarEl.hasClass('navbar-large') && $navbarEl.hasClass('navbar-large-collapsed') && $titleLargeEl.length) {
|
|
446
368
|
const scrollTop = $pageContentEl[0].scrollTop;
|
|
447
369
|
const titleLargeHeight = $titleLargeEl[0].offsetHeight;
|
|
448
|
-
|
|
449
370
|
if (scrollTop > titleLargeHeight) {
|
|
450
371
|
$pageContentEl.transition(0);
|
|
451
372
|
$pageContentEl[0].scrollTop = scrollTop + titleLargeHeight;
|
|
@@ -454,10 +375,8 @@ class Searchbar extends FrameworkClass {
|
|
|
454
375
|
}, 200);
|
|
455
376
|
}
|
|
456
377
|
}
|
|
457
|
-
|
|
458
378
|
$pageContentEl.removeClass('with-searchbar-expandable-enabled').addClass('with-searchbar-expandable-closing');
|
|
459
379
|
}
|
|
460
|
-
|
|
461
380
|
if (app.theme === 'md' && $navbarEl.length) {
|
|
462
381
|
$navbarEl.removeClass('with-searchbar-expandable-enabled with-searchbar-expandable-enabled-no-transition').addClass('with-searchbar-expandable-closing');
|
|
463
382
|
sb.$el.transitionEnd(() => {
|
|
@@ -468,21 +387,17 @@ class Searchbar extends FrameworkClass {
|
|
|
468
387
|
sb.$el.transitionEnd(() => {
|
|
469
388
|
$navbarEl.removeClass('with-searchbar-expandable-closing');
|
|
470
389
|
});
|
|
471
|
-
|
|
472
390
|
if (sb.$pageEl) {
|
|
473
391
|
sb.$pageEl.find('.page-content').trigger('scroll');
|
|
474
392
|
}
|
|
475
393
|
}
|
|
476
394
|
}
|
|
477
|
-
|
|
478
395
|
if (!sb.expandable && sb.$disableButtonEl && sb.$disableButtonEl.length > 0 && app.theme !== 'md') {
|
|
479
396
|
sb.$disableButtonEl.css(`margin-${app.rtl ? 'left' : 'right'}`, `${-sb.disableButtonEl.offsetWidth}px`);
|
|
480
397
|
}
|
|
481
|
-
|
|
482
398
|
if (sb.$backdropEl && (sb.$searchContainer && sb.$searchContainer.length || sb.params.customSearch)) {
|
|
483
399
|
sb.backdropHide();
|
|
484
400
|
}
|
|
485
|
-
|
|
486
401
|
sb.enabled = false;
|
|
487
402
|
sb.$inputEl.blur();
|
|
488
403
|
if (sb.$hideOnEnableEl) sb.$hideOnEnableEl.removeClass('hidden-by-searchbar');
|
|
@@ -490,47 +405,36 @@ class Searchbar extends FrameworkClass {
|
|
|
490
405
|
sb.emit('local::disable searchbarDisable', sb);
|
|
491
406
|
return sb;
|
|
492
407
|
}
|
|
493
|
-
|
|
494
408
|
toggle() {
|
|
495
409
|
const sb = this;
|
|
496
410
|
if (sb.enabled) sb.disable();else sb.enable(true);
|
|
497
411
|
return sb;
|
|
498
412
|
}
|
|
499
|
-
|
|
500
413
|
backdropShow() {
|
|
501
414
|
const sb = this;
|
|
502
|
-
|
|
503
415
|
if (sb.$backdropEl) {
|
|
504
416
|
sb.$backdropEl.addClass('searchbar-backdrop-in');
|
|
505
417
|
}
|
|
506
|
-
|
|
507
418
|
return sb;
|
|
508
419
|
}
|
|
509
|
-
|
|
510
420
|
backdropHide() {
|
|
511
421
|
const sb = this;
|
|
512
|
-
|
|
513
422
|
if (sb.$backdropEl) {
|
|
514
423
|
sb.$backdropEl.removeClass('searchbar-backdrop-in');
|
|
515
424
|
}
|
|
516
|
-
|
|
517
425
|
return sb;
|
|
518
426
|
}
|
|
519
|
-
|
|
520
427
|
search(query, internal) {
|
|
521
428
|
const sb = this;
|
|
522
429
|
sb.previousQuery = sb.query || '';
|
|
523
430
|
if (query === sb.previousQuery) return sb;
|
|
524
|
-
|
|
525
431
|
if (!internal) {
|
|
526
432
|
if (!sb.enabled) {
|
|
527
433
|
sb.enable();
|
|
528
434
|
}
|
|
529
|
-
|
|
530
435
|
sb.$inputEl.val(query);
|
|
531
436
|
sb.$inputEl.trigger('input');
|
|
532
437
|
}
|
|
533
|
-
|
|
534
438
|
sb.query = query;
|
|
535
439
|
sb.value = query;
|
|
536
440
|
const {
|
|
@@ -540,15 +444,15 @@ class Searchbar extends FrameworkClass {
|
|
|
540
444
|
$notFoundEl,
|
|
541
445
|
$hideOnSearchEl,
|
|
542
446
|
isVirtualList
|
|
543
|
-
} = sb;
|
|
447
|
+
} = sb;
|
|
544
448
|
|
|
449
|
+
// Hide on search element
|
|
545
450
|
if (query.length > 0 && $hideOnSearchEl) {
|
|
546
451
|
$hideOnSearchEl.addClass('hidden-by-searchbar');
|
|
547
452
|
} else if ($hideOnSearchEl) {
|
|
548
453
|
$hideOnSearchEl.removeClass('hidden-by-searchbar');
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
|
|
454
|
+
}
|
|
455
|
+
// Add active/inactive classes on overlay
|
|
552
456
|
if ($searchContainer && $searchContainer.length && $el.hasClass('searchbar-enabled') || sb.params.customSearch && $el.hasClass('searchbar-enabled')) {
|
|
553
457
|
if (query.length === 0) {
|
|
554
458
|
sb.backdropShow();
|
|
@@ -556,7 +460,6 @@ class Searchbar extends FrameworkClass {
|
|
|
556
460
|
sb.backdropHide();
|
|
557
461
|
}
|
|
558
462
|
}
|
|
559
|
-
|
|
560
463
|
if (sb.params.customSearch) {
|
|
561
464
|
$el.trigger('searchbar:search', {
|
|
562
465
|
query,
|
|
@@ -565,13 +468,10 @@ class Searchbar extends FrameworkClass {
|
|
|
565
468
|
sb.emit('local::search searchbarSearch', sb, query, sb.previousQuery);
|
|
566
469
|
return sb;
|
|
567
470
|
}
|
|
568
|
-
|
|
569
471
|
let foundItems = [];
|
|
570
472
|
let vlQuery;
|
|
571
|
-
|
|
572
473
|
if (isVirtualList) {
|
|
573
474
|
sb.virtualList = $searchContainer[0].f7VirtualList;
|
|
574
|
-
|
|
575
475
|
if (query.trim() === '') {
|
|
576
476
|
sb.virtualList.resetFilter();
|
|
577
477
|
if ($notFoundEl) $notFoundEl.hide();
|
|
@@ -583,9 +483,7 @@ class Searchbar extends FrameworkClass {
|
|
|
583
483
|
sb.emit('local::search searchbarSearch', sb, query, sb.previousQuery);
|
|
584
484
|
return sb;
|
|
585
485
|
}
|
|
586
|
-
|
|
587
486
|
vlQuery = sb.params.removeDiacritics ? removeDiacritics(query) : query;
|
|
588
|
-
|
|
589
487
|
if (sb.virtualList.params.searchAll) {
|
|
590
488
|
foundItems = sb.virtualList.params.searchAll(vlQuery, sb.virtualList.items) || [];
|
|
591
489
|
} else if (sb.virtualList.params.searchByItem) {
|
|
@@ -604,11 +502,9 @@ class Searchbar extends FrameworkClass {
|
|
|
604
502
|
const $itemEl = $(itemEl);
|
|
605
503
|
let compareWithText = [];
|
|
606
504
|
let $searchIn = sb.params.searchIn ? $itemEl.find(sb.params.searchIn) : $itemEl;
|
|
607
|
-
|
|
608
505
|
if (sb.params.searchIn === sb.params.searchItem) {
|
|
609
506
|
$searchIn = $itemEl;
|
|
610
507
|
}
|
|
611
|
-
|
|
612
508
|
$searchIn.each(searchInEl => {
|
|
613
509
|
let itemText = $(searchInEl).text().trim().toLowerCase();
|
|
614
510
|
if (sb.params.removeDiacritics) itemText = removeDiacritics(itemText);
|
|
@@ -616,47 +512,39 @@ class Searchbar extends FrameworkClass {
|
|
|
616
512
|
});
|
|
617
513
|
compareWithText = compareWithText.join(' ');
|
|
618
514
|
let wordsMatch = 0;
|
|
619
|
-
|
|
620
515
|
for (let i = 0; i < values.length; i += 1) {
|
|
621
516
|
if (compareWithText.indexOf(values[i]) >= 0) wordsMatch += 1;
|
|
622
517
|
}
|
|
623
|
-
|
|
624
518
|
if (wordsMatch !== values.length && !(sb.params.ignore && $itemEl.is(sb.params.ignore))) {
|
|
625
519
|
$itemEl.addClass('hidden-by-searchbar');
|
|
626
520
|
} else {
|
|
627
521
|
foundItems.push($itemEl[0]);
|
|
628
522
|
}
|
|
629
523
|
});
|
|
630
|
-
|
|
631
524
|
if (sb.params.hideDividers) {
|
|
632
525
|
$searchContainer.find(sb.params.searchGroupTitle).each(titleEl => {
|
|
633
526
|
const $titleEl = $(titleEl);
|
|
634
527
|
const $nextElements = $titleEl.nextAll(sb.params.searchItem);
|
|
635
528
|
let hide = true;
|
|
636
|
-
|
|
637
529
|
for (let i = 0; i < $nextElements.length; i += 1) {
|
|
638
530
|
const $nextEl = $nextElements.eq(i);
|
|
639
531
|
if ($nextEl.is(sb.params.searchGroupTitle)) break;
|
|
640
|
-
|
|
641
532
|
if (!$nextEl.hasClass('hidden-by-searchbar')) {
|
|
642
533
|
hide = false;
|
|
643
534
|
}
|
|
644
535
|
}
|
|
645
|
-
|
|
646
536
|
const ignore = sb.params.ignore && $titleEl.is(sb.params.ignore);
|
|
647
537
|
if (hide && !ignore) $titleEl.addClass('hidden-by-searchbar');else $titleEl.removeClass('hidden-by-searchbar');
|
|
648
538
|
});
|
|
649
539
|
}
|
|
650
|
-
|
|
651
540
|
if (sb.params.hideGroups) {
|
|
652
541
|
$searchContainer.find(sb.params.searchGroup).each(groupEl => {
|
|
653
542
|
const $groupEl = $(groupEl);
|
|
654
|
-
const ignore = sb.params.ignore && $groupEl.is(sb.params.ignore);
|
|
655
|
-
|
|
543
|
+
const ignore = sb.params.ignore && $groupEl.is(sb.params.ignore);
|
|
544
|
+
// eslint-disable-next-line
|
|
656
545
|
const notHidden = $groupEl.find(sb.params.searchItem).filter(el => {
|
|
657
546
|
return !$(el).hasClass('hidden-by-searchbar');
|
|
658
547
|
});
|
|
659
|
-
|
|
660
548
|
if (notHidden.length === 0 && !ignore) {
|
|
661
549
|
$groupEl.addClass('hidden-by-searchbar');
|
|
662
550
|
} else {
|
|
@@ -665,7 +553,6 @@ class Searchbar extends FrameworkClass {
|
|
|
665
553
|
});
|
|
666
554
|
}
|
|
667
555
|
}
|
|
668
|
-
|
|
669
556
|
if (foundItems.length === 0) {
|
|
670
557
|
if ($notFoundEl) $notFoundEl.show();
|
|
671
558
|
if ($foundEl) $foundEl.hide();
|
|
@@ -673,11 +560,9 @@ class Searchbar extends FrameworkClass {
|
|
|
673
560
|
if ($notFoundEl) $notFoundEl.hide();
|
|
674
561
|
if ($foundEl) $foundEl.show();
|
|
675
562
|
}
|
|
676
|
-
|
|
677
563
|
if (isVirtualList && sb.virtualList) {
|
|
678
564
|
sb.virtualList.filterItems(foundItems);
|
|
679
565
|
}
|
|
680
|
-
|
|
681
566
|
$el.trigger('searchbar:search', {
|
|
682
567
|
query,
|
|
683
568
|
previousQuery: sb.previousQuery,
|
|
@@ -686,28 +571,22 @@ class Searchbar extends FrameworkClass {
|
|
|
686
571
|
sb.emit('local::search searchbarSearch', sb, query, sb.previousQuery, foundItems);
|
|
687
572
|
return sb;
|
|
688
573
|
}
|
|
689
|
-
|
|
690
574
|
init() {
|
|
691
575
|
const sb = this;
|
|
692
576
|
if (sb.expandable && sb.$el) sb.$el.addClass('searchbar-expandable');
|
|
693
577
|
if (sb.inline && sb.$el) sb.$el.addClass('searchbar-inline');
|
|
694
578
|
sb.attachEvents();
|
|
695
579
|
}
|
|
696
|
-
|
|
697
580
|
destroy() {
|
|
698
581
|
const sb = this;
|
|
699
582
|
sb.emit('local::beforeDestroy searchbarBeforeDestroy', sb);
|
|
700
583
|
sb.$el.trigger('searchbar:beforedestroy');
|
|
701
584
|
sb.detachEvents();
|
|
702
|
-
|
|
703
585
|
if (sb.$el[0]) {
|
|
704
586
|
sb.$el[0].f7Searchbar = null;
|
|
705
587
|
delete sb.$el[0].f7Searchbar;
|
|
706
588
|
}
|
|
707
|
-
|
|
708
589
|
deleteProps(sb);
|
|
709
590
|
}
|
|
710
|
-
|
|
711
591
|
}
|
|
712
|
-
|
|
713
592
|
export default Searchbar;
|