@xenknight/framework7 0.0.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/LICENSE +20 -0
- package/README.md +32 -0
- package/components/accordion/accordion-ios.less +2 -0
- package/components/accordion/accordion-md.less +2 -0
- package/components/accordion/accordion-rtl.css +1 -0
- package/components/accordion/accordion-vars.less +0 -0
- package/components/accordion/accordion.css +1 -0
- package/components/accordion/accordion.d.ts +55 -0
- package/components/accordion/accordion.js +118 -0
- package/components/accordion/accordion.less +215 -0
- package/components/actions/actions-class.js +325 -0
- package/components/actions/actions-ios.less +51 -0
- package/components/actions/actions-md.less +24 -0
- package/components/actions/actions-rtl.css +1 -0
- package/components/actions/actions-vars.less +72 -0
- package/components/actions/actions.css +1 -0
- package/components/actions/actions.d.ts +164 -0
- package/components/actions/actions.js +47 -0
- package/components/actions/actions.less +182 -0
- package/components/app/app-class.d.ts +189 -0
- package/components/app/app-class.js +349 -0
- package/components/app/app-ios.less +23 -0
- package/components/app/app-md.less +8 -0
- package/components/app/app-vars.less +122 -0
- package/components/app/app.less +121 -0
- package/components/app/load-module.js +125 -0
- package/components/area-chart/area-chart-class.js +467 -0
- package/components/area-chart/area-chart-ios.less +2 -0
- package/components/area-chart/area-chart-md.less +2 -0
- package/components/area-chart/area-chart-rtl.css +1 -0
- package/components/area-chart/area-chart-vars.less +35 -0
- package/components/area-chart/area-chart.css +1 -0
- package/components/area-chart/area-chart.d.ts +128 -0
- package/components/area-chart/area-chart.js +44 -0
- package/components/area-chart/area-chart.less +131 -0
- package/components/autocomplete/autocomplete-class.js +813 -0
- package/components/autocomplete/autocomplete-ios.less +9 -0
- package/components/autocomplete/autocomplete-md.less +30 -0
- package/components/autocomplete/autocomplete-rtl.css +1 -0
- package/components/autocomplete/autocomplete-vars.less +36 -0
- package/components/autocomplete/autocomplete.css +1 -0
- package/components/autocomplete/autocomplete.d.ts +193 -0
- package/components/autocomplete/autocomplete.js +81 -0
- package/components/autocomplete/autocomplete.less +102 -0
- package/components/badge/badge-ios.less +2 -0
- package/components/badge/badge-md.less +2 -0
- package/components/badge/badge-vars.less +18 -0
- package/components/badge/badge.d.ts +14 -0
- package/components/badge/badge.js +3 -0
- package/components/badge/badge.less +45 -0
- package/components/block/block-ios.less +2 -0
- package/components/block/block-md.less +2 -0
- package/components/block/block-vars.less +77 -0
- package/components/block/block.d.ts +14 -0
- package/components/block/block.js +3 -0
- package/components/block/block.less +209 -0
- package/components/breadcrumbs/breadcrumbs-ios.less +2 -0
- package/components/breadcrumbs/breadcrumbs-md.less +2 -0
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -0
- package/components/breadcrumbs/breadcrumbs-vars.less +52 -0
- package/components/breadcrumbs/breadcrumbs.css +1 -0
- package/components/breadcrumbs/breadcrumbs.d.ts +15 -0
- package/components/breadcrumbs/breadcrumbs.js +11 -0
- package/components/breadcrumbs/breadcrumbs.less +91 -0
- package/components/button/button-ios.less +21 -0
- package/components/button/button-md.less +11 -0
- package/components/button/button-vars.less +114 -0
- package/components/button/button.d.ts +14 -0
- package/components/button/button.js +3 -0
- package/components/button/button.less +421 -0
- package/components/calendar/calendar-class.js +1872 -0
- package/components/calendar/calendar-ios.less +2 -0
- package/components/calendar/calendar-md.less +2 -0
- package/components/calendar/calendar-rtl.css +1 -0
- package/components/calendar/calendar-vars.less +108 -0
- package/components/calendar/calendar.css +1 -0
- package/components/calendar/calendar.d.ts +312 -0
- package/components/calendar/calendar.js +118 -0
- package/components/calendar/calendar.less +448 -0
- package/components/card/card-ios.less +2 -0
- package/components/card/card-md.less +2 -0
- package/components/card/card-rtl.css +1 -0
- package/components/card/card-vars.less +80 -0
- package/components/card/card.css +1 -0
- package/components/card/card.d.ts +69 -0
- package/components/card/card.js +504 -0
- package/components/card/card.less +307 -0
- package/components/checkbox/checkbox-ios.less +23 -0
- package/components/checkbox/checkbox-md.less +17 -0
- package/components/checkbox/checkbox-rtl.css +1 -0
- package/components/checkbox/checkbox-vars.less +25 -0
- package/components/checkbox/checkbox.css +1 -0
- package/components/checkbox/checkbox.d.ts +14 -0
- package/components/checkbox/checkbox.js +3 -0
- package/components/checkbox/checkbox.less +155 -0
- package/components/chip/chip-ios.less +25 -0
- package/components/chip/chip-md.less +30 -0
- package/components/chip/chip-rtl.css +1 -0
- package/components/chip/chip-vars.less +42 -0
- package/components/chip/chip.css +1 -0
- package/components/chip/chip.d.ts +14 -0
- package/components/chip/chip.js +3 -0
- package/components/chip/chip.less +106 -0
- package/components/color-picker/color-picker-class.js +871 -0
- package/components/color-picker/color-picker-ios.less +2 -0
- package/components/color-picker/color-picker-md.less +2 -0
- package/components/color-picker/color-picker-rtl.css +1 -0
- package/components/color-picker/color-picker-vars.less +39 -0
- package/components/color-picker/color-picker.css +1 -0
- package/components/color-picker/color-picker.d.ts +233 -0
- package/components/color-picker/color-picker.js +92 -0
- package/components/color-picker/color-picker.less +557 -0
- package/components/color-picker/modules/alpha-slider.js +91 -0
- package/components/color-picker/modules/brightness-slider.js +80 -0
- package/components/color-picker/modules/current-color.js +14 -0
- package/components/color-picker/modules/hex.js +71 -0
- package/components/color-picker/modules/hs-spectrum.js +118 -0
- package/components/color-picker/modules/hsb-sliders.js +191 -0
- package/components/color-picker/modules/hue-slider.js +73 -0
- package/components/color-picker/modules/initial-current-colors.js +43 -0
- package/components/color-picker/modules/palette.js +46 -0
- package/components/color-picker/modules/rgb-bars.js +183 -0
- package/components/color-picker/modules/rgb-sliders.js +185 -0
- package/components/color-picker/modules/sb-spectrum.js +119 -0
- package/components/color-picker/modules/wheel.js +173 -0
- package/components/contacts-list/contacts-list-ios.less +2 -0
- package/components/contacts-list/contacts-list-md.less +21 -0
- package/components/contacts-list/contacts-list-rtl.css +1 -0
- package/components/contacts-list/contacts-list-vars.less +24 -0
- package/components/contacts-list/contacts-list.css +1 -0
- package/components/contacts-list/contacts-list.d.ts +14 -0
- package/components/contacts-list/contacts-list.js +3 -0
- package/components/contacts-list/contacts-list.less +26 -0
- package/components/data-table/data-table-class.js +141 -0
- package/components/data-table/data-table-ios.less +70 -0
- package/components/data-table/data-table-md.less +88 -0
- package/components/data-table/data-table-rtl.css +1 -0
- package/components/data-table/data-table-vars.less +77 -0
- package/components/data-table/data-table.css +1 -0
- package/components/data-table/data-table.d.ts +61 -0
- package/components/data-table/data-table.js +64 -0
- package/components/data-table/data-table.less +429 -0
- package/components/dialog/dialog-class.js +196 -0
- package/components/dialog/dialog-ios.less +94 -0
- package/components/dialog/dialog-md.less +86 -0
- package/components/dialog/dialog-rtl.css +1 -0
- package/components/dialog/dialog-vars.less +93 -0
- package/components/dialog/dialog.css +1 -0
- package/components/dialog/dialog.d.ts +245 -0
- package/components/dialog/dialog.js +242 -0
- package/components/dialog/dialog.less +142 -0
- package/components/fab/fab-ios.less +9 -0
- package/components/fab/fab-md.less +11 -0
- package/components/fab/fab-rtl.css +1 -0
- package/components/fab/fab-vars.less +46 -0
- package/components/fab/fab.css +1 -0
- package/components/fab/fab.d.ts +32 -0
- package/components/fab/fab.js +172 -0
- package/components/fab/fab.less +523 -0
- package/components/form/form-ios.less +0 -0
- package/components/form/form-md.less +0 -0
- package/components/form/form-rtl.css +0 -0
- package/components/form/form.css +0 -0
- package/components/form/form.d.ts +64 -0
- package/components/form/form.js +311 -0
- package/components/form/form.less +7 -0
- package/components/gauge/gauge-class.js +298 -0
- package/components/gauge/gauge-ios.less +2 -0
- package/components/gauge/gauge-md.less +2 -0
- package/components/gauge/gauge-rtl.css +1 -0
- package/components/gauge/gauge.css +1 -0
- package/components/gauge/gauge.d.ts +100 -0
- package/components/gauge/gauge.js +90 -0
- package/components/gauge/gauge.less +24 -0
- package/components/grid/grid-ios.less +2 -0
- package/components/grid/grid-md.less +2 -0
- package/components/grid/grid-rtl.css +1 -0
- package/components/grid/grid-vars.less +3 -0
- package/components/grid/grid.css +1 -0
- package/components/grid/grid.d.ts +15 -0
- package/components/grid/grid.js +3 -0
- package/components/grid/grid.less +78 -0
- package/components/icon/icon-ios.less +44 -0
- package/components/icon/icon-md.less +56 -0
- package/components/icon/icon.d.ts +14 -0
- package/components/icon/icon.js +3 -0
- package/components/icon/icon.less +33 -0
- package/components/infinite-scroll/infinite-scroll-ios.less +11 -0
- package/components/infinite-scroll/infinite-scroll-md.less +6 -0
- package/components/infinite-scroll/infinite-scroll-rtl.css +1 -0
- package/components/infinite-scroll/infinite-scroll.css +1 -0
- package/components/infinite-scroll/infinite-scroll.d.ts +27 -0
- package/components/infinite-scroll/infinite-scroll.js +94 -0
- package/components/infinite-scroll/infinite-scroll.less +15 -0
- package/components/input/input-ios.less +129 -0
- package/components/input/input-md.less +171 -0
- package/components/input/input-rtl.css +1 -0
- package/components/input/input-vars.less +94 -0
- package/components/input/input.css +1 -0
- package/components/input/input.d.ts +60 -0
- package/components/input/input.js +339 -0
- package/components/input/input.less +355 -0
- package/components/link/link-ios.less +9 -0
- package/components/link/link-md.less +2 -0
- package/components/link/link-vars.less +9 -0
- package/components/link/link.d.ts +14 -0
- package/components/link/link.js +3 -0
- package/components/link/link.less +37 -0
- package/components/list/list-ios.less +15 -0
- package/components/list/list-md.less +5 -0
- package/components/list/list-vars.less +184 -0
- package/components/list/list.d.ts +14 -0
- package/components/list/list.js +3 -0
- package/components/list/list.less +718 -0
- package/components/list-index/list-index-class.js +333 -0
- package/components/list-index/list-index-ios.less +21 -0
- package/components/list-index/list-index-md.less +7 -0
- package/components/list-index/list-index-rtl.css +1 -0
- package/components/list-index/list-index-vars.less +25 -0
- package/components/list-index/list-index.css +1 -0
- package/components/list-index/list-index.d.ts +101 -0
- package/components/list-index/list-index.js +65 -0
- package/components/list-index/list-index.less +130 -0
- package/components/login-screen/login-screen-class.js +38 -0
- package/components/login-screen/login-screen-ios.less +2 -0
- package/components/login-screen/login-screen-md.less +2 -0
- package/components/login-screen/login-screen-rtl.css +1 -0
- package/components/login-screen/login-screen-vars.less +33 -0
- package/components/login-screen/login-screen.css +1 -0
- package/components/login-screen/login-screen.d.ts +99 -0
- package/components/login-screen/login-screen.js +32 -0
- package/components/login-screen/login-screen.less +100 -0
- package/components/messagebar/messagebar-class.js +367 -0
- package/components/messagebar/messagebar-ios.less +88 -0
- package/components/messagebar/messagebar-md.less +114 -0
- package/components/messagebar/messagebar-rtl.css +1 -0
- package/components/messagebar/messagebar-vars.less +75 -0
- package/components/messagebar/messagebar.css +1 -0
- package/components/messagebar/messagebar.d.ts +165 -0
- package/components/messagebar/messagebar.js +66 -0
- package/components/messagebar/messagebar.less +162 -0
- package/components/messages/messages-class.js +487 -0
- package/components/messages/messages-ios.less +165 -0
- package/components/messages/messages-md.less +140 -0
- package/components/messages/messages-rtl.css +1 -0
- package/components/messages/messages-vars.less +82 -0
- package/components/messages/messages.css +1 -0
- package/components/messages/messages.d.ts +162 -0
- package/components/messages/messages.js +65 -0
- package/components/messages/messages.less +218 -0
- package/components/modal/custom-modal-class.js +66 -0
- package/components/modal/modal-class.js +224 -0
- package/components/modal/modal.d.ts +82 -0
- package/components/modal/modal.js +22 -0
- package/components/modal/modal.less +14 -0
- package/components/navbar/navbar-ios.less +755 -0
- package/components/navbar/navbar-md.less +65 -0
- package/components/navbar/navbar-vars.less +74 -0
- package/components/navbar/navbar.d.ts +77 -0
- package/components/navbar/navbar.js +712 -0
- package/components/navbar/navbar.less +311 -0
- package/components/notification/notification-class.js +212 -0
- package/components/notification/notification-ios.less +55 -0
- package/components/notification/notification-md.less +87 -0
- package/components/notification/notification-rtl.css +1 -0
- package/components/notification/notification-vars.less +75 -0
- package/components/notification/notification.css +1 -0
- package/components/notification/notification.d.ts +122 -0
- package/components/notification/notification.js +33 -0
- package/components/notification/notification.less +94 -0
- package/components/page/page-ios.less +154 -0
- package/components/page/page-md.less +83 -0
- package/components/page/page-transitions/circle.less +107 -0
- package/components/page/page-transitions/cover-v.less +61 -0
- package/components/page/page-transitions/cover.less +71 -0
- package/components/page/page-transitions/dive.less +77 -0
- package/components/page/page-transitions/fade.less +53 -0
- package/components/page/page-transitions/flip.less +91 -0
- package/components/page/page-transitions/parallax.less +75 -0
- package/components/page/page-transitions/push.less +75 -0
- package/components/page/page-vars.less +47 -0
- package/components/page/page.d.ts +14 -0
- package/components/page/page.js +3 -0
- package/components/page/page.less +204 -0
- package/components/panel/panel-class.js +556 -0
- package/components/panel/panel-ios.less +2 -0
- package/components/panel/panel-md.less +11 -0
- package/components/panel/panel-rtl.css +3 -0
- package/components/panel/panel-vars.less +24 -0
- package/components/panel/panel.css +3 -0
- package/components/panel/panel.d.ts +198 -0
- package/components/panel/panel.js +189 -0
- package/components/panel/panel.less +403 -0
- package/components/panel/resizable-panel.js +160 -0
- package/components/panel/swipe-panel.js +311 -0
- package/components/photo-browser/photo-browser-class.js +734 -0
- package/components/photo-browser/photo-browser-ios.less +2 -0
- package/components/photo-browser/photo-browser-md.less +2 -0
- package/components/photo-browser/photo-browser-rtl.css +1 -0
- package/components/photo-browser/photo-browser-vars.less +16 -0
- package/components/photo-browser/photo-browser.css +1 -0
- package/components/photo-browser/photo-browser.d.ts +204 -0
- package/components/photo-browser/photo-browser.js +73 -0
- package/components/photo-browser/photo-browser.less +358 -0
- package/components/picker/picker-class.js +588 -0
- package/components/picker/picker-column.js +121 -0
- package/components/picker/picker-ios.less +12 -0
- package/components/picker/picker-md.less +8 -0
- package/components/picker/picker-rtl.css +1 -0
- package/components/picker/picker-vars.less +35 -0
- package/components/picker/picker.css +1 -0
- package/components/picker/picker.d.ts +209 -0
- package/components/picker/picker.js +59 -0
- package/components/picker/picker.less +180 -0
- package/components/pie-chart/pie-chart-class.js +250 -0
- package/components/pie-chart/pie-chart-ios.less +2 -0
- package/components/pie-chart/pie-chart-md.less +2 -0
- package/components/pie-chart/pie-chart-rtl.css +1 -0
- package/components/pie-chart/pie-chart.css +1 -0
- package/components/pie-chart/pie-chart.d.ts +99 -0
- package/components/pie-chart/pie-chart.js +32 -0
- package/components/pie-chart/pie-chart.less +43 -0
- package/components/popover/popover-class.js +293 -0
- package/components/popover/popover-ios.less +6 -0
- package/components/popover/popover-md.less +41 -0
- package/components/popover/popover-rtl.css +1 -0
- package/components/popover/popover-vars.less +25 -0
- package/components/popover/popover.css +1 -0
- package/components/popover/popover.d.ts +137 -0
- package/components/popover/popover.js +75 -0
- package/components/popover/popover.less +168 -0
- package/components/popup/popup-class.js +329 -0
- package/components/popup/popup-ios.less +2 -0
- package/components/popup/popup-md.less +2 -0
- package/components/popup/popup-rtl.css +1 -0
- package/components/popup/popup-vars.less +21 -0
- package/components/popup/popup.css +1 -0
- package/components/popup/popup.d.ts +143 -0
- package/components/popup/popup.js +46 -0
- package/components/popup/popup.less +204 -0
- package/components/preloader/preloader-ios.less +57 -0
- package/components/preloader/preloader-md.less +114 -0
- package/components/preloader/preloader-rtl.css +1 -0
- package/components/preloader/preloader-vars.less +16 -0
- package/components/preloader/preloader.css +1 -0
- package/components/preloader/preloader.d.ts +26 -0
- package/components/preloader/preloader.js +106 -0
- package/components/preloader/preloader.less +60 -0
- package/components/progressbar/progressbar-ios.less +59 -0
- package/components/progressbar/progressbar-md.less +141 -0
- package/components/progressbar/progressbar-rtl.css +1 -0
- package/components/progressbar/progressbar-vars.less +22 -0
- package/components/progressbar/progressbar.css +1 -0
- package/components/progressbar/progressbar.d.ts +31 -0
- package/components/progressbar/progressbar.js +150 -0
- package/components/progressbar/progressbar.less +111 -0
- package/components/pull-to-refresh/pull-to-refresh-class.js +512 -0
- package/components/pull-to-refresh/pull-to-refresh-ios.less +88 -0
- package/components/pull-to-refresh/pull-to-refresh-md.less +129 -0
- package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -0
- package/components/pull-to-refresh/pull-to-refresh-vars.less +14 -0
- package/components/pull-to-refresh/pull-to-refresh.css +1 -0
- package/components/pull-to-refresh/pull-to-refresh.d.ts +103 -0
- package/components/pull-to-refresh/pull-to-refresh.js +62 -0
- package/components/pull-to-refresh/pull-to-refresh.less +38 -0
- package/components/radio/radio-ios.less +61 -0
- package/components/radio/radio-md.less +64 -0
- package/components/radio/radio-rtl.css +1 -0
- package/components/radio/radio-vars.less +24 -0
- package/components/radio/radio.css +1 -0
- package/components/radio/radio.d.ts +14 -0
- package/components/radio/radio.js +3 -0
- package/components/radio/radio.less +64 -0
- package/components/range/range-class.js +577 -0
- package/components/range/range-ios.less +9 -0
- package/components/range/range-md.less +41 -0
- package/components/range/range-rtl.css +1 -0
- package/components/range/range-vars.less +61 -0
- package/components/range/range.css +1 -0
- package/components/range/range.d.ts +143 -0
- package/components/range/range.js +75 -0
- package/components/range/range.less +235 -0
- package/components/searchbar/remove-diacritics.js +271 -0
- package/components/searchbar/searchbar-class.js +592 -0
- package/components/searchbar/searchbar-ios.less +107 -0
- package/components/searchbar/searchbar-md.less +147 -0
- package/components/searchbar/searchbar-rtl.css +1 -0
- package/components/searchbar/searchbar-vars.less +77 -0
- package/components/searchbar/searchbar.css +1 -0
- package/components/searchbar/searchbar.d.ts +161 -0
- package/components/searchbar/searchbar.js +122 -0
- package/components/searchbar/searchbar.less +322 -0
- package/components/sheet/sheet-class.js +673 -0
- package/components/sheet/sheet-ios.less +2 -0
- package/components/sheet/sheet-md.less +9 -0
- package/components/sheet/sheet-rtl.css +1 -0
- package/components/sheet/sheet-vars.less +27 -0
- package/components/sheet/sheet.css +1 -0
- package/components/sheet/sheet.d.ts +170 -0
- package/components/sheet/sheet.js +76 -0
- package/components/sheet/sheet.less +196 -0
- package/components/skeleton/skeleton-ios.less +2 -0
- package/components/skeleton/skeleton-md.less +2 -0
- package/components/skeleton/skeleton-rtl.css +1 -0
- package/components/skeleton/skeleton-vars.less +8 -0
- package/components/skeleton/skeleton.css +1 -0
- package/components/skeleton/skeleton.d.ts +14 -0
- package/components/skeleton/skeleton.js +3 -0
- package/components/skeleton/skeleton.less +11 -0
- package/components/smart-select/smart-select-class.js +874 -0
- package/components/smart-select/smart-select-ios.less +2 -0
- package/components/smart-select/smart-select-md.less +2 -0
- package/components/smart-select/smart-select-rtl.css +1 -0
- package/components/smart-select/smart-select-vars.less +6 -0
- package/components/smart-select/smart-select.css +1 -0
- package/components/smart-select/smart-select.d.ts +204 -0
- package/components/smart-select/smart-select.js +138 -0
- package/components/smart-select/smart-select.less +42 -0
- package/components/sortable/sortable-ios.less +7 -0
- package/components/sortable/sortable-md.less +7 -0
- package/components/sortable/sortable-rtl.css +1 -0
- package/components/sortable/sortable-vars.less +22 -0
- package/components/sortable/sortable.css +1 -0
- package/components/sortable/sortable.d.ts +50 -0
- package/components/sortable/sortable.js +286 -0
- package/components/sortable/sortable.less +133 -0
- package/components/statusbar/statusbar-ios.less +2 -0
- package/components/statusbar/statusbar-md.less +2 -0
- package/components/statusbar/statusbar.d.ts +54 -0
- package/components/statusbar/statusbar.js +190 -0
- package/components/statusbar/statusbar.less +7 -0
- package/components/stepper/stepper-class.js +403 -0
- package/components/stepper/stepper-ios.less +36 -0
- package/components/stepper/stepper-md.less +16 -0
- package/components/stepper/stepper-rtl.css +1 -0
- package/components/stepper/stepper-vars.less +40 -0
- package/components/stepper/stepper.css +1 -0
- package/components/stepper/stepper.d.ts +121 -0
- package/components/stepper/stepper.js +82 -0
- package/components/stepper/stepper.less +178 -0
- package/components/subnavbar/subnavbar-ios.less +51 -0
- package/components/subnavbar/subnavbar-md.less +47 -0
- package/components/subnavbar/subnavbar-vars.less +36 -0
- package/components/subnavbar/subnavbar.d.ts +11 -0
- package/components/subnavbar/subnavbar.js +17 -0
- package/components/subnavbar/subnavbar.less +128 -0
- package/components/swipeout/swipeout-ios.less +2 -0
- package/components/swipeout/swipeout-md.less +2 -0
- package/components/swipeout/swipeout-rtl.css +1 -0
- package/components/swipeout/swipeout-vars.less +24 -0
- package/components/swipeout/swipeout.css +1 -0
- package/components/swipeout/swipeout.d.ts +68 -0
- package/components/swipeout/swipeout.js +513 -0
- package/components/swipeout/swipeout.less +109 -0
- package/components/swiper/swiper-ios.less +2 -0
- package/components/swiper/swiper-md.less +2 -0
- package/components/swiper/swiper-rtl.css +1 -0
- package/components/swiper/swiper.css +1 -0
- package/components/swiper/swiper.d.ts +25 -0
- package/components/swiper/swiper.js +141 -0
- package/components/swiper/swiper.less +5 -0
- package/components/tabs/tabs-ios.less +2 -0
- package/components/tabs/tabs-md.less +2 -0
- package/components/tabs/tabs-rtl.css +1 -0
- package/components/tabs/tabs.css +1 -0
- package/components/tabs/tabs.d.ts +39 -0
- package/components/tabs/tabs.js +243 -0
- package/components/tabs/tabs.less +45 -0
- package/components/text-editor/text-editor-class.js +516 -0
- package/components/text-editor/text-editor-ios.less +9 -0
- package/components/text-editor/text-editor-md.less +11 -0
- package/components/text-editor/text-editor-rtl.css +1 -0
- package/components/text-editor/text-editor-vars.less +51 -0
- package/components/text-editor/text-editor.css +1 -0
- package/components/text-editor/text-editor.d.ts +166 -0
- package/components/text-editor/text-editor.js +81 -0
- package/components/text-editor/text-editor.less +153 -0
- package/components/timeline/timeline-ios.less +11 -0
- package/components/timeline/timeline-md.less +7 -0
- package/components/timeline/timeline-rtl.css +1 -0
- package/components/timeline/timeline-vars.less +64 -0
- package/components/timeline/timeline.css +1 -0
- package/components/timeline/timeline.d.ts +14 -0
- package/components/timeline/timeline.js +3 -0
- package/components/timeline/timeline.less +413 -0
- package/components/toast/toast-class.js +105 -0
- package/components/toast/toast-ios.less +81 -0
- package/components/toast/toast-md.less +72 -0
- package/components/toast/toast-rtl.css +1 -0
- package/components/toast/toast-vars.less +24 -0
- package/components/toast/toast.css +1 -0
- package/components/toast/toast.d.ts +121 -0
- package/components/toast/toast.js +40 -0
- package/components/toast/toast.less +62 -0
- package/components/toggle/toggle-class.js +165 -0
- package/components/toggle/toggle-ios.less +70 -0
- package/components/toggle/toggle-md.less +44 -0
- package/components/toggle/toggle-rtl.css +1 -0
- package/components/toggle/toggle-vars.less +30 -0
- package/components/toggle/toggle.css +1 -0
- package/components/toggle/toggle.d.ts +73 -0
- package/components/toggle/toggle.js +57 -0
- package/components/toggle/toggle.less +52 -0
- package/components/toolbar/toolbar-ios.less +47 -0
- package/components/toolbar/toolbar-md.less +77 -0
- package/components/toolbar/toolbar-vars.less +71 -0
- package/components/toolbar/toolbar.d.ts +43 -0
- package/components/toolbar/toolbar.js +198 -0
- package/components/toolbar/toolbar.less +306 -0
- package/components/tooltip/tooltip-class.js +336 -0
- package/components/tooltip/tooltip-ios.less +2 -0
- package/components/tooltip/tooltip-md.less +2 -0
- package/components/tooltip/tooltip-rtl.css +1 -0
- package/components/tooltip/tooltip-vars.less +19 -0
- package/components/tooltip/tooltip.css +1 -0
- package/components/tooltip/tooltip.d.ts +105 -0
- package/components/tooltip/tooltip.js +129 -0
- package/components/tooltip/tooltip.less +39 -0
- package/components/touch-ripple/touch-ripple-class.js +85 -0
- package/components/touch-ripple/touch-ripple-ios.less +2 -0
- package/components/touch-ripple/touch-ripple-md.less +2 -0
- package/components/touch-ripple/touch-ripple-vars.less +8 -0
- package/components/touch-ripple/touch-ripple.d.ts +25 -0
- package/components/touch-ripple/touch-ripple.js +18 -0
- package/components/touch-ripple/touch-ripple.less +114 -0
- package/components/treeview/treeview-ios.less +2 -0
- package/components/treeview/treeview-md.less +2 -0
- package/components/treeview/treeview-rtl.css +1 -0
- package/components/treeview/treeview-vars.less +38 -0
- package/components/treeview/treeview.css +1 -0
- package/components/treeview/treeview.d.ts +42 -0
- package/components/treeview/treeview.js +74 -0
- package/components/treeview/treeview.less +160 -0
- package/components/typography/typography-ios.less +2 -0
- package/components/typography/typography-md.less +2 -0
- package/components/typography/typography-rtl.css +1 -0
- package/components/typography/typography-vars.less +4 -0
- package/components/typography/typography.css +1 -0
- package/components/typography/typography.d.ts +14 -0
- package/components/typography/typography.js +3 -0
- package/components/typography/typography.less +220 -0
- package/components/view/resizable-view.js +125 -0
- package/components/view/view-class.js +206 -0
- package/components/view/view-ios.less +2 -0
- package/components/view/view-md.less +2 -0
- package/components/view/view.d.ts +199 -0
- package/components/view/view.js +173 -0
- package/components/view/view.less +35 -0
- package/components/virtual-list/virtual-list-class.js +583 -0
- package/components/virtual-list/virtual-list-ios.less +2 -0
- package/components/virtual-list/virtual-list-md.less +2 -0
- package/components/virtual-list/virtual-list-rtl.css +0 -0
- package/components/virtual-list/virtual-list.css +0 -0
- package/components/virtual-list/virtual-list.d.ts +142 -0
- package/components/virtual-list/virtual-list.js +17 -0
- package/components/virtual-list/virtual-list.less +7 -0
- package/framework7-bundle-rtl.css +19821 -0
- package/framework7-bundle-rtl.min.css +19 -0
- package/framework7-bundle.css +19802 -0
- package/framework7-bundle.esm.js +93 -0
- package/framework7-bundle.js +48416 -0
- package/framework7-bundle.js.map +1 -0
- package/framework7-bundle.less +92 -0
- package/framework7-bundle.min.css +19 -0
- package/framework7-bundle.min.js +14 -0
- package/framework7-bundle.min.js.map +1 -0
- package/framework7-lite-bundle.esm.js +86 -0
- package/framework7-lite.esm.js +37 -0
- package/framework7-lite.js +31 -0
- package/framework7-rtl.css +5252 -0
- package/framework7-rtl.min.css +17 -0
- package/framework7-types.d.ts +336 -0
- package/framework7.css +5245 -0
- package/framework7.d.ts +322 -0
- package/framework7.esm.js +41 -0
- package/framework7.js +42 -0
- package/framework7.less +41 -0
- package/framework7.min.css +17 -0
- package/less/mixins.less +281 -0
- package/less/plugin.js +15 -0
- package/less/vars.less +7 -0
- package/modules/clicks/clicks.d.ts +19 -0
- package/modules/clicks/clicks.js +94 -0
- package/modules/component/$h.js +15 -0
- package/modules/component/$jsx.js +17 -0
- package/modules/component/component-class.js +517 -0
- package/modules/component/component.d.ts +111 -0
- package/modules/component/component.js +44 -0
- package/modules/component/custom-components.js +1 -0
- package/modules/component/eventslisteners.js +74 -0
- package/modules/component/parse-component.js +79 -0
- package/modules/component/patch.js +8 -0
- package/modules/component/snabbdom/h.d.ts +10 -0
- package/modules/component/snabbdom/h.js +50 -0
- package/modules/component/snabbdom/helpers/attachto.d.ts +9 -0
- package/modules/component/snabbdom/helpers/attachto.js +49 -0
- package/modules/component/snabbdom/hooks.d.ts +23 -0
- package/modules/component/snabbdom/hooks.js +0 -0
- package/modules/component/snabbdom/htmldomapi.d.ts +19 -0
- package/modules/component/snabbdom/htmldomapi.js +67 -0
- package/modules/component/snabbdom/is.d.ts +2 -0
- package/modules/component/snabbdom/is.js +4 -0
- package/modules/component/snabbdom/modules/attributes.d.ts +4 -0
- package/modules/component/snabbdom/modules/attributes.js +51 -0
- package/modules/component/snabbdom/modules/class.d.ts +4 -0
- package/modules/component/snabbdom/modules/class.js +27 -0
- package/modules/component/snabbdom/modules/dataset.d.ts +4 -0
- package/modules/component/snabbdom/modules/dataset.js +37 -0
- package/modules/component/snabbdom/modules/eventlisteners.d.ts +8 -0
- package/modules/component/snabbdom/modules/eventlisteners.js +93 -0
- package/modules/component/snabbdom/modules/hero.d.ts +6 -0
- package/modules/component/snabbdom/modules/hero.js +147 -0
- package/modules/component/snabbdom/modules/module.d.ts +9 -0
- package/modules/component/snabbdom/modules/module.js +0 -0
- package/modules/component/snabbdom/modules/props.d.ts +4 -0
- package/modules/component/snabbdom/modules/props.js +29 -0
- package/modules/component/snabbdom/modules/style.d.ts +7 -0
- package/modules/component/snabbdom/modules/style.js +93 -0
- package/modules/component/snabbdom/snabbdom.bundle.d.ts +5 -0
- package/modules/component/snabbdom/snabbdom.bundle.js +13 -0
- package/modules/component/snabbdom/snabbdom.d.ts +6 -0
- package/modules/component/snabbdom/snabbdom.js +282 -0
- package/modules/component/snabbdom/thunk.d.ts +14 -0
- package/modules/component/snabbdom/thunk.js +50 -0
- package/modules/component/snabbdom/tovnode.d.ts +4 -0
- package/modules/component/snabbdom/tovnode.js +40 -0
- package/modules/component/snabbdom/vnode.d.ts +36 -0
- package/modules/component/snabbdom/vnode.js +12 -0
- package/modules/component/vdom.js +319 -0
- package/modules/demo-module.js +44 -0
- package/modules/device/device.d.ts +14 -0
- package/modules/device/device.js +44 -0
- package/modules/history/history.js +12 -0
- package/modules/resize/resize.d.ts +25 -0
- package/modules/resize/resize.js +62 -0
- package/modules/router/app-router-check.js +5 -0
- package/modules/router/async-component.js +27 -0
- package/modules/router/back.js +723 -0
- package/modules/router/clear-previous-history.js +31 -0
- package/modules/router/component-loader.js +200 -0
- package/modules/router/modal.js +223 -0
- package/modules/router/navigate.js +814 -0
- package/modules/router/process-route-queue.js +66 -0
- package/modules/router/redirect.js +38 -0
- package/modules/router/router-class.js +1268 -0
- package/modules/router/router.d.ts +354 -0
- package/modules/router/router.js +26 -0
- package/modules/router/swipe-back.js +589 -0
- package/modules/router/tab.js +230 -0
- package/modules/service-worker/service-worker.d.ts +38 -0
- package/modules/service-worker/service-worker.js +86 -0
- package/modules/store/create-store.js +138 -0
- package/modules/store/store.d.ts +40 -0
- package/modules/store/store.js +11 -0
- package/modules/support/support.d.ts +15 -0
- package/modules/support/support.js +7 -0
- package/modules/touch/touch.d.ts +60 -0
- package/modules/touch/touch.js +482 -0
- package/modules/utils/utils.d.ts +15 -0
- package/modules/utils/utils.js +10 -0
- package/package.json +458 -0
- package/shared/$jsx.js +21 -0
- package/shared/class.js +146 -0
- package/shared/constructor-methods.js +52 -0
- package/shared/dom7.js +7 -0
- package/shared/events-class.js +95 -0
- package/shared/get-device.d.ts +52 -0
- package/shared/get-device.js +147 -0
- package/shared/get-support.d.ts +12 -0
- package/shared/get-support.js +35 -0
- package/shared/history.js +171 -0
- package/shared/material-color-utils.js +1377 -0
- package/shared/material-colors.js +75 -0
- package/shared/modal-methods.js +80 -0
- package/shared/utils.d.ts +88 -0
- package/shared/utils.js +535 -0
|
@@ -0,0 +1,813 @@
|
|
|
1
|
+
/* eslint "no-useless-escape": "off" */
|
|
2
|
+
import $ from '../../shared/dom7.js';
|
|
3
|
+
import { extend, id, nextTick, deleteProps, iosPreloaderContent, mdPreloaderContent } from '../../shared/utils.js';
|
|
4
|
+
import { getDevice } from '../../shared/get-device.js';
|
|
5
|
+
import Framework7Class from '../../shared/class.js';
|
|
6
|
+
/** @jsx $jsx */
|
|
7
|
+
import $jsx from '../../shared/$jsx.js';
|
|
8
|
+
class Autocomplete extends Framework7Class {
|
|
9
|
+
constructor(app, params) {
|
|
10
|
+
if (params === void 0) {
|
|
11
|
+
params = {};
|
|
12
|
+
}
|
|
13
|
+
super(params, [app]);
|
|
14
|
+
const ac = this;
|
|
15
|
+
ac.app = app;
|
|
16
|
+
const device = getDevice();
|
|
17
|
+
const defaults = extend({
|
|
18
|
+
on: {}
|
|
19
|
+
}, app.params.autocomplete);
|
|
20
|
+
|
|
21
|
+
// Extend defaults with modules params
|
|
22
|
+
ac.useModulesParams(defaults);
|
|
23
|
+
ac.params = extend(defaults, params);
|
|
24
|
+
let $openerEl;
|
|
25
|
+
if (ac.params.openerEl) {
|
|
26
|
+
$openerEl = $(ac.params.openerEl);
|
|
27
|
+
if ($openerEl.length) $openerEl[0].f7Autocomplete = ac;
|
|
28
|
+
}
|
|
29
|
+
let $inputEl;
|
|
30
|
+
if (ac.params.inputEl) {
|
|
31
|
+
$inputEl = $(ac.params.inputEl);
|
|
32
|
+
if ($inputEl.length) $inputEl[0].f7Autocomplete = ac;
|
|
33
|
+
}
|
|
34
|
+
const uniqueId = id();
|
|
35
|
+
let url = params.url;
|
|
36
|
+
if (!url && $openerEl && $openerEl.length) {
|
|
37
|
+
if ($openerEl.attr('href')) url = $openerEl.attr('href');else if ($openerEl.find('a').length > 0) {
|
|
38
|
+
url = $openerEl.find('a').attr('href');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!url || url === '#' || url === '') url = ac.params.url;
|
|
42
|
+
const inputType = ac.params.multiple ? 'checkbox' : 'radio';
|
|
43
|
+
extend(ac, {
|
|
44
|
+
$openerEl,
|
|
45
|
+
openerEl: $openerEl && $openerEl[0],
|
|
46
|
+
$inputEl,
|
|
47
|
+
inputEl: $inputEl && $inputEl[0],
|
|
48
|
+
id: uniqueId,
|
|
49
|
+
url,
|
|
50
|
+
value: ac.params.value || [],
|
|
51
|
+
inputType,
|
|
52
|
+
inputName: `${inputType}-${uniqueId}`,
|
|
53
|
+
$modalEl: undefined,
|
|
54
|
+
$dropdownEl: undefined
|
|
55
|
+
});
|
|
56
|
+
let previousQuery = '';
|
|
57
|
+
function onInputChange() {
|
|
58
|
+
let query = ac.$inputEl.val().trim();
|
|
59
|
+
if (!ac.params.source) return;
|
|
60
|
+
ac.params.source.call(ac, query, items => {
|
|
61
|
+
let itemsHTML = '';
|
|
62
|
+
const limit = ac.params.limit ? Math.min(ac.params.limit, items.length) : items.length;
|
|
63
|
+
ac.items = items;
|
|
64
|
+
let regExp;
|
|
65
|
+
if (ac.params.highlightMatches) {
|
|
66
|
+
query = query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
67
|
+
regExp = new RegExp(`(${query})`, 'i');
|
|
68
|
+
}
|
|
69
|
+
let firstValue;
|
|
70
|
+
let firstItem;
|
|
71
|
+
for (let i = 0; i < limit; i += 1) {
|
|
72
|
+
const itemValue = typeof items[i] === 'object' ? items[i][ac.params.valueProperty] : items[i];
|
|
73
|
+
const itemText = typeof items[i] === 'object' ? items[i][ac.params.textProperty] : items[i];
|
|
74
|
+
if (i === 0) {
|
|
75
|
+
firstValue = itemValue;
|
|
76
|
+
firstItem = ac.items[i];
|
|
77
|
+
}
|
|
78
|
+
itemsHTML += ac.renderItem({
|
|
79
|
+
value: itemValue,
|
|
80
|
+
text: ac.params.highlightMatches ? itemText.replace(regExp, '<b>$1</b>') : itemText
|
|
81
|
+
}, i);
|
|
82
|
+
}
|
|
83
|
+
if (itemsHTML === '' && query === '' && ac.params.dropdownPlaceholderText) {
|
|
84
|
+
itemsHTML += ac.renderItem({
|
|
85
|
+
placeholder: true,
|
|
86
|
+
text: ac.params.dropdownPlaceholderText
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
ac.$dropdownEl.find('ul').html(itemsHTML);
|
|
90
|
+
if (ac.params.typeahead) {
|
|
91
|
+
if (!firstValue || !firstItem) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (firstValue.toLowerCase().indexOf(query.toLowerCase()) !== 0) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (previousQuery.toLowerCase() === query.toLowerCase()) {
|
|
98
|
+
ac.value = [];
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (previousQuery.toLowerCase().indexOf(query.toLowerCase()) === 0) {
|
|
102
|
+
previousQuery = query;
|
|
103
|
+
ac.value = [];
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
$inputEl.val(firstValue);
|
|
107
|
+
$inputEl[0].setSelectionRange(query.length, firstValue.length);
|
|
108
|
+
const previousValue = typeof ac.value[0] === 'object' ? ac.value[0][ac.params.valueProperty] : ac.value[0];
|
|
109
|
+
if (!previousValue || firstValue.toLowerCase() !== previousValue.toLowerCase()) {
|
|
110
|
+
ac.value = [firstItem];
|
|
111
|
+
ac.emit('local::change autocompleteChange', [firstItem]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
previousQuery = query;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function onPageInputChange() {
|
|
118
|
+
const inputEl = this;
|
|
119
|
+
const value = inputEl.value;
|
|
120
|
+
const isValues = $(inputEl).parents('.autocomplete-values').length > 0;
|
|
121
|
+
let item;
|
|
122
|
+
let itemValue;
|
|
123
|
+
let aValue;
|
|
124
|
+
if (isValues) {
|
|
125
|
+
if (ac.inputType === 'checkbox' && !inputEl.checked) {
|
|
126
|
+
for (let i = 0; i < ac.value.length; i += 1) {
|
|
127
|
+
aValue = typeof ac.value[i] === 'string' ? ac.value[i] : ac.value[i][ac.params.valueProperty];
|
|
128
|
+
if (aValue === value || aValue * 1 === value * 1) {
|
|
129
|
+
ac.value.splice(i, 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
ac.updateValues();
|
|
133
|
+
ac.emit('local::change autocompleteChange', ac.value);
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Find Related Item
|
|
139
|
+
for (let i = 0; i < ac.items.length; i += 1) {
|
|
140
|
+
itemValue = typeof ac.items[i] === 'object' ? ac.items[i][ac.params.valueProperty] : ac.items[i];
|
|
141
|
+
if (itemValue === value || itemValue * 1 === value * 1) item = ac.items[i];
|
|
142
|
+
}
|
|
143
|
+
if (ac.inputType === 'radio') {
|
|
144
|
+
ac.value = [item];
|
|
145
|
+
} else if (inputEl.checked) {
|
|
146
|
+
ac.value.push(item);
|
|
147
|
+
} else {
|
|
148
|
+
for (let i = 0; i < ac.value.length; i += 1) {
|
|
149
|
+
aValue = typeof ac.value[i] === 'object' ? ac.value[i][ac.params.valueProperty] : ac.value[i];
|
|
150
|
+
if (aValue === value || aValue * 1 === value * 1) {
|
|
151
|
+
ac.value.splice(i, 1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Update Values Block
|
|
157
|
+
ac.updateValues();
|
|
158
|
+
|
|
159
|
+
// On Select Callback
|
|
160
|
+
if (ac.inputType === 'radio' && inputEl.checked || ac.inputType === 'checkbox') {
|
|
161
|
+
ac.emit('local::change autocompleteChange', ac.value);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function onHtmlClick(e) {
|
|
165
|
+
const $targetEl = $(e.target);
|
|
166
|
+
if ($targetEl.is(ac.$inputEl[0]) || ac.$dropdownEl && $targetEl.closest(ac.$dropdownEl[0]).length) return;
|
|
167
|
+
ac.close();
|
|
168
|
+
}
|
|
169
|
+
function onOpenerClick() {
|
|
170
|
+
ac.open();
|
|
171
|
+
}
|
|
172
|
+
function onInputFocus() {
|
|
173
|
+
ac.open();
|
|
174
|
+
}
|
|
175
|
+
function onInputBlur() {
|
|
176
|
+
if (ac.$dropdownEl.find('label.active-state').length > 0) return;
|
|
177
|
+
setTimeout(() => {
|
|
178
|
+
ac.close();
|
|
179
|
+
}, 0);
|
|
180
|
+
}
|
|
181
|
+
function onResize() {
|
|
182
|
+
ac.positionDropdown();
|
|
183
|
+
}
|
|
184
|
+
function onKeyDown(e) {
|
|
185
|
+
if (!ac.opened) return;
|
|
186
|
+
if (e.keyCode === 27) {
|
|
187
|
+
// ESC
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
ac.$inputEl.blur();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (e.keyCode === 13) {
|
|
193
|
+
// Enter
|
|
194
|
+
const $selectedItemLabel = ac.$dropdownEl.find('.autocomplete-dropdown-selected label');
|
|
195
|
+
if ($selectedItemLabel.length) {
|
|
196
|
+
e.preventDefault();
|
|
197
|
+
$selectedItemLabel.trigger('click');
|
|
198
|
+
ac.$inputEl.blur();
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (ac.params.typeahead) {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
ac.$inputEl.blur();
|
|
204
|
+
}
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (e.keyCode !== 40 && e.keyCode !== 38) return;
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
const $selectedItem = ac.$dropdownEl.find('.autocomplete-dropdown-selected');
|
|
210
|
+
let $newItem;
|
|
211
|
+
if ($selectedItem.length) {
|
|
212
|
+
$newItem = $selectedItem[e.keyCode === 40 ? 'next' : 'prev']('li');
|
|
213
|
+
if (!$newItem.length) {
|
|
214
|
+
$newItem = ac.$dropdownEl.find('li').eq(e.keyCode === 40 ? 0 : ac.$dropdownEl.find('li').length - 1);
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
$newItem = ac.$dropdownEl.find('li').eq(e.keyCode === 40 ? 0 : ac.$dropdownEl.find('li').length - 1);
|
|
218
|
+
}
|
|
219
|
+
if ($newItem.hasClass('autocomplete-dropdown-placeholder')) return;
|
|
220
|
+
$selectedItem.removeClass('autocomplete-dropdown-selected');
|
|
221
|
+
$newItem.addClass('autocomplete-dropdown-selected');
|
|
222
|
+
}
|
|
223
|
+
function onDropdownClick() {
|
|
224
|
+
const $clickedEl = $(this);
|
|
225
|
+
let clickedItem;
|
|
226
|
+
for (let i = 0; i < ac.items.length; i += 1) {
|
|
227
|
+
const itemValue = typeof ac.items[i] === 'object' ? ac.items[i][ac.params.valueProperty] : ac.items[i];
|
|
228
|
+
const value = $clickedEl.attr('data-value');
|
|
229
|
+
if (itemValue === value || itemValue * 1 === value * 1) {
|
|
230
|
+
clickedItem = ac.items[i];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (ac.params.updateInputValueOnSelect) {
|
|
234
|
+
ac.$inputEl.val(typeof clickedItem === 'object' ? clickedItem[ac.params.valueProperty] : clickedItem);
|
|
235
|
+
ac.$inputEl.trigger('input change');
|
|
236
|
+
}
|
|
237
|
+
ac.value = [clickedItem];
|
|
238
|
+
ac.emit('local::change autocompleteChange', [clickedItem]);
|
|
239
|
+
ac.close();
|
|
240
|
+
}
|
|
241
|
+
ac.attachEvents = function attachEvents() {
|
|
242
|
+
if (ac.params.openIn !== 'dropdown' && ac.$openerEl) {
|
|
243
|
+
ac.$openerEl.on('click', onOpenerClick);
|
|
244
|
+
}
|
|
245
|
+
if (ac.params.openIn === 'dropdown' && ac.$inputEl) {
|
|
246
|
+
ac.$inputEl.on('focus', onInputFocus);
|
|
247
|
+
ac.$inputEl.on(ac.params.inputEvents, onInputChange);
|
|
248
|
+
if (device.android) {
|
|
249
|
+
$('html').on('click', onHtmlClick);
|
|
250
|
+
} else {
|
|
251
|
+
ac.$inputEl.on('blur', onInputBlur);
|
|
252
|
+
}
|
|
253
|
+
ac.$inputEl.on('keydown', onKeyDown);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
ac.detachEvents = function attachEvents() {
|
|
257
|
+
if (ac.params.openIn !== 'dropdown' && ac.$openerEl) {
|
|
258
|
+
ac.$openerEl.off('click', onOpenerClick);
|
|
259
|
+
}
|
|
260
|
+
if (ac.params.openIn === 'dropdown' && ac.$inputEl) {
|
|
261
|
+
ac.$inputEl.off('focus', onInputFocus);
|
|
262
|
+
ac.$inputEl.off(ac.params.inputEvents, onInputChange);
|
|
263
|
+
if (device.android) {
|
|
264
|
+
$('html').off('click', onHtmlClick);
|
|
265
|
+
} else {
|
|
266
|
+
ac.$inputEl.off('blur', onInputBlur);
|
|
267
|
+
}
|
|
268
|
+
ac.$inputEl.off('keydown', onKeyDown);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
ac.attachDropdownEvents = function attachDropdownEvents() {
|
|
272
|
+
ac.$dropdownEl.on('click', 'label', onDropdownClick);
|
|
273
|
+
app.on('resize', onResize);
|
|
274
|
+
};
|
|
275
|
+
ac.detachDropdownEvents = function detachDropdownEvents() {
|
|
276
|
+
ac.$dropdownEl.off('click', 'label', onDropdownClick);
|
|
277
|
+
app.off('resize', onResize);
|
|
278
|
+
};
|
|
279
|
+
ac.attachPageEvents = function attachPageEvents() {
|
|
280
|
+
ac.$el.on('change', 'input[type="radio"], input[type="checkbox"]', onPageInputChange);
|
|
281
|
+
if (ac.params.closeOnSelect && !ac.params.multiple) {
|
|
282
|
+
ac.$el.once('click', '.list label', () => {
|
|
283
|
+
nextTick(() => {
|
|
284
|
+
ac.close();
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
ac.detachPageEvents = function detachPageEvents() {
|
|
290
|
+
ac.$el.off('change', 'input[type="radio"], input[type="checkbox"]', onPageInputChange);
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
// Install Modules
|
|
294
|
+
ac.useModules();
|
|
295
|
+
|
|
296
|
+
// Init
|
|
297
|
+
ac.init();
|
|
298
|
+
return ac;
|
|
299
|
+
}
|
|
300
|
+
get view() {
|
|
301
|
+
const ac = this;
|
|
302
|
+
const {
|
|
303
|
+
$openerEl,
|
|
304
|
+
$inputEl,
|
|
305
|
+
app
|
|
306
|
+
} = ac;
|
|
307
|
+
let view;
|
|
308
|
+
if (ac.params.view) {
|
|
309
|
+
view = ac.params.view;
|
|
310
|
+
} else if ($openerEl || $inputEl) {
|
|
311
|
+
const $el = $openerEl || $inputEl;
|
|
312
|
+
view = $el.closest('.view').length && $el.closest('.view')[0].f7View;
|
|
313
|
+
}
|
|
314
|
+
if (!view) view = app.views.main;
|
|
315
|
+
return view;
|
|
316
|
+
}
|
|
317
|
+
positionDropdown() {
|
|
318
|
+
const ac = this;
|
|
319
|
+
const {
|
|
320
|
+
$inputEl,
|
|
321
|
+
app,
|
|
322
|
+
$dropdownEl
|
|
323
|
+
} = ac;
|
|
324
|
+
const $pageContentEl = $inputEl.parents('.page-content');
|
|
325
|
+
if ($pageContentEl.length === 0) return;
|
|
326
|
+
const inputOffset = $inputEl.offset();
|
|
327
|
+
const inputOffsetWidth = $inputEl[0].offsetWidth;
|
|
328
|
+
const inputOffsetHeight = $inputEl[0].offsetHeight;
|
|
329
|
+
const $listEl = $inputEl.parents('.list');
|
|
330
|
+
let $listParent;
|
|
331
|
+
$listEl.parents().each(parentEl => {
|
|
332
|
+
if ($listParent) return;
|
|
333
|
+
const $parentEl = $(parentEl);
|
|
334
|
+
if ($parentEl.parent($pageContentEl).length) $listParent = $parentEl;
|
|
335
|
+
});
|
|
336
|
+
const listOffset = $listEl.offset();
|
|
337
|
+
const paddingBottom = parseInt($pageContentEl.css('padding-bottom'), 10);
|
|
338
|
+
const listOffsetLeft = $listEl.length > 0 ? listOffset.left - $pageContentEl.offset().left : 0;
|
|
339
|
+
const inputOffsetLeft = inputOffset.left - ($listEl.length > 0 ? listOffset.left : 0) - (app.rtl ? 0 : 0);
|
|
340
|
+
const inputOffsetTop = inputOffset.top - ($pageContentEl.offset().top - $pageContentEl[0].scrollTop);
|
|
341
|
+
const maxHeight = $pageContentEl[0].scrollHeight - paddingBottom - (inputOffsetTop + $pageContentEl[0].scrollTop) - $inputEl[0].offsetHeight;
|
|
342
|
+
const paddingProp = app.rtl ? 'padding-right' : 'padding-left';
|
|
343
|
+
let paddingValue;
|
|
344
|
+
if ($listEl.length) {
|
|
345
|
+
paddingValue = (app.rtl ? $listEl[0].offsetWidth - inputOffsetLeft - inputOffsetWidth : inputOffsetLeft) - (app.theme === 'md' ? 16 : 15);
|
|
346
|
+
}
|
|
347
|
+
$dropdownEl.css({
|
|
348
|
+
left: `${$listEl.length > 0 ? listOffsetLeft : inputOffsetLeft}px`,
|
|
349
|
+
top: `${inputOffsetTop + $pageContentEl[0].scrollTop + inputOffsetHeight}px`,
|
|
350
|
+
width: `${$listEl.length > 0 ? $listEl[0].offsetWidth : inputOffsetWidth}px`
|
|
351
|
+
});
|
|
352
|
+
$dropdownEl.children('.autocomplete-dropdown-inner').css({
|
|
353
|
+
maxHeight: `${maxHeight}px`,
|
|
354
|
+
[paddingProp]: $listEl.length > 0 ? `${paddingValue}px` : ''
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
focus() {
|
|
358
|
+
const ac = this;
|
|
359
|
+
ac.$el.find('input[type=search]').focus();
|
|
360
|
+
}
|
|
361
|
+
source(query) {
|
|
362
|
+
const ac = this;
|
|
363
|
+
if (!ac.params.source) return;
|
|
364
|
+
const {
|
|
365
|
+
$el
|
|
366
|
+
} = ac;
|
|
367
|
+
ac.params.source.call(ac, query, items => {
|
|
368
|
+
let itemsHTML = '';
|
|
369
|
+
const limit = ac.params.limit ? Math.min(ac.params.limit, items.length) : items.length;
|
|
370
|
+
ac.items = items;
|
|
371
|
+
for (let i = 0; i < limit; i += 1) {
|
|
372
|
+
let selected = false;
|
|
373
|
+
const itemValue = typeof items[i] === 'object' ? items[i][ac.params.valueProperty] : items[i];
|
|
374
|
+
for (let j = 0; j < ac.value.length; j += 1) {
|
|
375
|
+
const aValue = typeof ac.value[j] === 'object' ? ac.value[j][ac.params.valueProperty] : ac.value[j];
|
|
376
|
+
if (aValue === itemValue || aValue * 1 === itemValue * 1) selected = true;
|
|
377
|
+
}
|
|
378
|
+
itemsHTML += ac.renderItem({
|
|
379
|
+
value: itemValue,
|
|
380
|
+
text: typeof items[i] === 'object' ? items[i][ac.params.textProperty] : items[i],
|
|
381
|
+
inputType: ac.inputType,
|
|
382
|
+
id: ac.id,
|
|
383
|
+
inputName: ac.inputName,
|
|
384
|
+
selected
|
|
385
|
+
}, i);
|
|
386
|
+
}
|
|
387
|
+
$el.find('.autocomplete-found ul').html(itemsHTML);
|
|
388
|
+
if (items.length === 0) {
|
|
389
|
+
if (query.length !== 0) {
|
|
390
|
+
$el.find('.autocomplete-not-found').show();
|
|
391
|
+
$el.find('.autocomplete-found, .autocomplete-values').hide();
|
|
392
|
+
} else {
|
|
393
|
+
$el.find('.autocomplete-values').show();
|
|
394
|
+
$el.find('.autocomplete-found, .autocomplete-not-found').hide();
|
|
395
|
+
}
|
|
396
|
+
} else {
|
|
397
|
+
$el.find('.autocomplete-found').show();
|
|
398
|
+
$el.find('.autocomplete-not-found, .autocomplete-values').hide();
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
updateValues() {
|
|
403
|
+
const ac = this;
|
|
404
|
+
let valuesHTML = '';
|
|
405
|
+
for (let i = 0; i < ac.value.length; i += 1) {
|
|
406
|
+
valuesHTML += ac.renderItem({
|
|
407
|
+
value: typeof ac.value[i] === 'object' ? ac.value[i][ac.params.valueProperty] : ac.value[i],
|
|
408
|
+
text: typeof ac.value[i] === 'object' ? ac.value[i][ac.params.textProperty] : ac.value[i],
|
|
409
|
+
inputType: ac.inputType,
|
|
410
|
+
id: ac.id,
|
|
411
|
+
inputName: `${ac.inputName}-checked}`,
|
|
412
|
+
selected: true
|
|
413
|
+
}, i);
|
|
414
|
+
}
|
|
415
|
+
ac.$el.find('.autocomplete-values ul').html(valuesHTML);
|
|
416
|
+
}
|
|
417
|
+
preloaderHide() {
|
|
418
|
+
const ac = this;
|
|
419
|
+
if (ac.params.openIn === 'dropdown' && ac.$dropdownEl) {
|
|
420
|
+
ac.$dropdownEl.find('.autocomplete-preloader').removeClass('autocomplete-preloader-visible');
|
|
421
|
+
} else {
|
|
422
|
+
$('.autocomplete-preloader').removeClass('autocomplete-preloader-visible');
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
preloaderShow() {
|
|
426
|
+
const ac = this;
|
|
427
|
+
if (ac.params.openIn === 'dropdown' && ac.$dropdownEl) {
|
|
428
|
+
ac.$dropdownEl.find('.autocomplete-preloader').addClass('autocomplete-preloader-visible');
|
|
429
|
+
} else {
|
|
430
|
+
$('.autocomplete-preloader').addClass('autocomplete-preloader-visible');
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
renderPreloader() {
|
|
434
|
+
const ac = this;
|
|
435
|
+
const preloaders = {
|
|
436
|
+
iosPreloaderContent,
|
|
437
|
+
mdPreloaderContent
|
|
438
|
+
};
|
|
439
|
+
return $jsx("div", {
|
|
440
|
+
class: `autocomplete-preloader preloader ${ac.params.preloaderColor ? `color-${ac.params.preloaderColor}` : ''}`
|
|
441
|
+
}, preloaders[`${ac.app.theme}PreloaderContent`] || '');
|
|
442
|
+
}
|
|
443
|
+
renderSearchbar() {
|
|
444
|
+
const ac = this;
|
|
445
|
+
if (ac.params.renderSearchbar) return ac.params.renderSearchbar.call(ac);
|
|
446
|
+
return $jsx("form", {
|
|
447
|
+
class: "searchbar"
|
|
448
|
+
}, $jsx("div", {
|
|
449
|
+
class: "searchbar-inner"
|
|
450
|
+
}, $jsx("div", {
|
|
451
|
+
class: "searchbar-input-wrap"
|
|
452
|
+
}, $jsx("input", {
|
|
453
|
+
type: "search",
|
|
454
|
+
spellcheck: ac.params.searchbarSpellcheck || 'false',
|
|
455
|
+
placeholder: ac.params.searchbarPlaceholder
|
|
456
|
+
}), $jsx("i", {
|
|
457
|
+
class: "searchbar-icon"
|
|
458
|
+
}), $jsx("span", {
|
|
459
|
+
class: "input-clear-button"
|
|
460
|
+
})), ac.params.searchbarDisableButton && $jsx("span", {
|
|
461
|
+
class: "searchbar-disable-button"
|
|
462
|
+
}, ac.params.searchbarDisableText)));
|
|
463
|
+
}
|
|
464
|
+
renderItem(item, index) {
|
|
465
|
+
const ac = this;
|
|
466
|
+
if (ac.params.renderItem) return ac.params.renderItem.call(ac, item, index);
|
|
467
|
+
const itemValue = item.value && typeof item.value === 'string' ? item.value.replace(/"/g, '"') : item.value;
|
|
468
|
+
if (ac.params.openIn !== 'dropdown') {
|
|
469
|
+
return $jsx("li", null, $jsx("label", {
|
|
470
|
+
class: `item-${item.inputType} item-content`
|
|
471
|
+
}, $jsx("input", {
|
|
472
|
+
type: item.inputType,
|
|
473
|
+
name: item.inputName,
|
|
474
|
+
value: itemValue,
|
|
475
|
+
_checked: item.selected
|
|
476
|
+
}), $jsx("i", {
|
|
477
|
+
class: `icon icon-${item.inputType}`
|
|
478
|
+
}), $jsx("div", {
|
|
479
|
+
class: "item-inner"
|
|
480
|
+
}, $jsx("div", {
|
|
481
|
+
class: "item-title"
|
|
482
|
+
}, item.text))));
|
|
483
|
+
}
|
|
484
|
+
// Dropdown
|
|
485
|
+
if (!item.placeholder) {
|
|
486
|
+
return $jsx("li", null, $jsx("label", {
|
|
487
|
+
class: "item-radio item-content",
|
|
488
|
+
"data-value": itemValue
|
|
489
|
+
}, $jsx("div", {
|
|
490
|
+
class: "item-inner"
|
|
491
|
+
}, $jsx("div", {
|
|
492
|
+
class: "item-title"
|
|
493
|
+
}, item.text))));
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// Dropwdown placeholder
|
|
497
|
+
return $jsx("li", {
|
|
498
|
+
class: "autocomplete-dropdown-placeholder"
|
|
499
|
+
}, $jsx("label", {
|
|
500
|
+
class: "item-content"
|
|
501
|
+
}, $jsx("div", {
|
|
502
|
+
class: "item-inner"
|
|
503
|
+
}, $jsx("div", {
|
|
504
|
+
class: "item-title"
|
|
505
|
+
}, item.text))));
|
|
506
|
+
}
|
|
507
|
+
renderNavbar() {
|
|
508
|
+
const ac = this;
|
|
509
|
+
if (ac.params.renderNavbar) return ac.params.renderNavbar.call(ac);
|
|
510
|
+
let pageTitle = ac.params.pageTitle;
|
|
511
|
+
if (typeof pageTitle === 'undefined' && ac.$openerEl && ac.$openerEl.length) {
|
|
512
|
+
pageTitle = ac.$openerEl.find('.item-title').text().trim();
|
|
513
|
+
}
|
|
514
|
+
const inPopup = ac.params.openIn === 'popup';
|
|
515
|
+
|
|
516
|
+
// eslint-disable-next-line
|
|
517
|
+
const navbarLeft = inPopup ? ac.params.preloader && $jsx("div", {
|
|
518
|
+
class: "left"
|
|
519
|
+
}, ac.renderPreloader()) : $jsx("div", {
|
|
520
|
+
class: "left sliding"
|
|
521
|
+
}, $jsx("a", {
|
|
522
|
+
class: "link back"
|
|
523
|
+
}, $jsx("i", {
|
|
524
|
+
class: "icon icon-back"
|
|
525
|
+
}), $jsx("span", {
|
|
526
|
+
class: "if-not-md"
|
|
527
|
+
}, ac.params.pageBackLinkText)));
|
|
528
|
+
const navbarRight = inPopup ? $jsx("div", {
|
|
529
|
+
class: "right"
|
|
530
|
+
}, $jsx("a", {
|
|
531
|
+
class: "link popup-close",
|
|
532
|
+
"data-popup": ".autocomplete-popup"
|
|
533
|
+
}, ac.params.popupCloseLinkText)) : ac.params.preloader && $jsx("div", {
|
|
534
|
+
class: "right"
|
|
535
|
+
}, ac.renderPreloader());
|
|
536
|
+
return $jsx("div", {
|
|
537
|
+
class: `navbar ${ac.params.navbarColorTheme ? `color-${ac.params.navbarColorTheme}` : ''}`
|
|
538
|
+
}, $jsx("div", {
|
|
539
|
+
class: "navbar-bg"
|
|
540
|
+
}), $jsx("div", {
|
|
541
|
+
class: `navbar-inner ${ac.params.navbarColorTheme ? `color-${ac.params.navbarColorTheme}` : ''}`
|
|
542
|
+
}, navbarLeft, pageTitle && $jsx("div", {
|
|
543
|
+
class: "title sliding"
|
|
544
|
+
}, pageTitle), navbarRight, $jsx("div", {
|
|
545
|
+
class: "subnavbar sliding"
|
|
546
|
+
}, ac.renderSearchbar())));
|
|
547
|
+
}
|
|
548
|
+
renderDropdown() {
|
|
549
|
+
const ac = this;
|
|
550
|
+
if (ac.params.renderDropdown) return ac.params.renderDropdown.call(ac, ac.items);
|
|
551
|
+
return $jsx("div", {
|
|
552
|
+
class: "autocomplete-dropdown"
|
|
553
|
+
}, $jsx("div", {
|
|
554
|
+
class: "autocomplete-dropdown-inner"
|
|
555
|
+
}, $jsx("div", {
|
|
556
|
+
class: `list no-safe-areas`
|
|
557
|
+
}, $jsx("ul", null))), ac.params.preloader && ac.renderPreloader());
|
|
558
|
+
}
|
|
559
|
+
renderPage(inPopup) {
|
|
560
|
+
const ac = this;
|
|
561
|
+
if (ac.params.renderPage) return ac.params.renderPage.call(ac, ac.items);
|
|
562
|
+
return $jsx("div", {
|
|
563
|
+
class: "page page-with-subnavbar autocomplete-page",
|
|
564
|
+
"data-name": "autocomplete-page"
|
|
565
|
+
}, ac.renderNavbar(inPopup), $jsx("div", {
|
|
566
|
+
class: "searchbar-backdrop"
|
|
567
|
+
}), $jsx("div", {
|
|
568
|
+
class: "page-content"
|
|
569
|
+
}, $jsx("div", {
|
|
570
|
+
class: `list autocomplete-list autocomplete-found autocomplete-list-${ac.id} ${ac.params.formColorTheme ? `color-${ac.params.formColorTheme}` : ''}`
|
|
571
|
+
}, $jsx("ul", null)), $jsx("div", {
|
|
572
|
+
class: "list autocomplete-not-found"
|
|
573
|
+
}, $jsx("ul", null, $jsx("li", {
|
|
574
|
+
class: "item-content"
|
|
575
|
+
}, $jsx("div", {
|
|
576
|
+
class: "item-inner"
|
|
577
|
+
}, $jsx("div", {
|
|
578
|
+
class: "item-title"
|
|
579
|
+
}, ac.params.notFoundText))))), $jsx("div", {
|
|
580
|
+
class: "list autocomplete-values"
|
|
581
|
+
}, $jsx("ul", null))));
|
|
582
|
+
}
|
|
583
|
+
renderPopup() {
|
|
584
|
+
const ac = this;
|
|
585
|
+
if (ac.params.renderPopup) return ac.params.renderPopup.call(ac, ac.items);
|
|
586
|
+
return $jsx("div", {
|
|
587
|
+
class: "popup autocomplete-popup"
|
|
588
|
+
}, $jsx("div", {
|
|
589
|
+
class: "view"
|
|
590
|
+
}, ac.renderPage(true), ";"));
|
|
591
|
+
}
|
|
592
|
+
onOpen(type, el) {
|
|
593
|
+
const ac = this;
|
|
594
|
+
const app = ac.app;
|
|
595
|
+
const $el = $(el);
|
|
596
|
+
ac.$el = $el;
|
|
597
|
+
ac.el = $el[0];
|
|
598
|
+
ac.openedIn = type;
|
|
599
|
+
ac.opened = true;
|
|
600
|
+
if (ac.params.openIn === 'dropdown') {
|
|
601
|
+
ac.attachDropdownEvents();
|
|
602
|
+
ac.$dropdownEl.addClass('autocomplete-dropdown-in');
|
|
603
|
+
ac.$inputEl.trigger('input');
|
|
604
|
+
} else {
|
|
605
|
+
// Init SB
|
|
606
|
+
let $searchbarEl = $el.find('.searchbar');
|
|
607
|
+
if (ac.params.openIn === 'page' && app.theme === 'ios' && $searchbarEl.length === 0) {
|
|
608
|
+
$searchbarEl = $(app.navbar.getElByPage($el)).find('.searchbar');
|
|
609
|
+
}
|
|
610
|
+
ac.searchbar = app.searchbar.create({
|
|
611
|
+
el: $searchbarEl,
|
|
612
|
+
backdropEl: $el.find('.searchbar-backdrop'),
|
|
613
|
+
customSearch: true,
|
|
614
|
+
on: {
|
|
615
|
+
search(sb, query) {
|
|
616
|
+
if (query.length === 0 && ac.searchbar.enabled) {
|
|
617
|
+
ac.searchbar.backdropShow();
|
|
618
|
+
} else {
|
|
619
|
+
ac.searchbar.backdropHide();
|
|
620
|
+
}
|
|
621
|
+
ac.source(query);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
// Attach page events
|
|
627
|
+
ac.attachPageEvents();
|
|
628
|
+
|
|
629
|
+
// Update Values On Page Init
|
|
630
|
+
ac.updateValues();
|
|
631
|
+
|
|
632
|
+
// Source on load
|
|
633
|
+
if (ac.params.requestSourceOnOpen) ac.source('');
|
|
634
|
+
}
|
|
635
|
+
ac.emit('local::open autocompleteOpen', ac);
|
|
636
|
+
}
|
|
637
|
+
autoFocus() {
|
|
638
|
+
const ac = this;
|
|
639
|
+
if (ac.searchbar && ac.searchbar.$inputEl) {
|
|
640
|
+
ac.searchbar.$inputEl.focus();
|
|
641
|
+
}
|
|
642
|
+
return ac;
|
|
643
|
+
}
|
|
644
|
+
onOpened() {
|
|
645
|
+
const ac = this;
|
|
646
|
+
if (ac.params.openIn !== 'dropdown' && ac.params.autoFocus) {
|
|
647
|
+
ac.autoFocus();
|
|
648
|
+
}
|
|
649
|
+
ac.emit('local::opened autocompleteOpened', ac);
|
|
650
|
+
}
|
|
651
|
+
onClose() {
|
|
652
|
+
const ac = this;
|
|
653
|
+
if (ac.destroyed) return;
|
|
654
|
+
|
|
655
|
+
// Destroy SB
|
|
656
|
+
if (ac.searchbar && ac.searchbar.destroy) {
|
|
657
|
+
ac.searchbar.destroy();
|
|
658
|
+
ac.searchbar = null;
|
|
659
|
+
delete ac.searchbar;
|
|
660
|
+
}
|
|
661
|
+
if (ac.params.openIn === 'dropdown') {
|
|
662
|
+
ac.detachDropdownEvents();
|
|
663
|
+
ac.$dropdownEl.removeClass('autocomplete-dropdown-in').remove();
|
|
664
|
+
} else {
|
|
665
|
+
ac.detachPageEvents();
|
|
666
|
+
}
|
|
667
|
+
ac.emit('local::close autocompleteClose', ac);
|
|
668
|
+
}
|
|
669
|
+
onClosed() {
|
|
670
|
+
const ac = this;
|
|
671
|
+
if (ac.destroyed) return;
|
|
672
|
+
ac.opened = false;
|
|
673
|
+
ac.$el = null;
|
|
674
|
+
ac.el = null;
|
|
675
|
+
delete ac.$el;
|
|
676
|
+
delete ac.el;
|
|
677
|
+
ac.emit('local::closed autocompleteClosed', ac);
|
|
678
|
+
}
|
|
679
|
+
openPage() {
|
|
680
|
+
const ac = this;
|
|
681
|
+
if (ac.opened) return ac;
|
|
682
|
+
const pageHtml = ac.renderPage();
|
|
683
|
+
ac.view.router.navigate({
|
|
684
|
+
url: ac.url,
|
|
685
|
+
route: {
|
|
686
|
+
content: pageHtml,
|
|
687
|
+
path: ac.url,
|
|
688
|
+
on: {
|
|
689
|
+
pageBeforeIn(e, page) {
|
|
690
|
+
ac.onOpen('page', page.el);
|
|
691
|
+
},
|
|
692
|
+
pageAfterIn(e, page) {
|
|
693
|
+
ac.onOpened('page', page.el);
|
|
694
|
+
},
|
|
695
|
+
pageBeforeOut(e, page) {
|
|
696
|
+
ac.onClose('page', page.el);
|
|
697
|
+
},
|
|
698
|
+
pageAfterOut(e, page) {
|
|
699
|
+
ac.onClosed('page', page.el);
|
|
700
|
+
}
|
|
701
|
+
},
|
|
702
|
+
options: {
|
|
703
|
+
animate: ac.params.animate
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
return ac;
|
|
708
|
+
}
|
|
709
|
+
openPopup() {
|
|
710
|
+
const ac = this;
|
|
711
|
+
if (ac.opened) return ac;
|
|
712
|
+
const popupHtml = ac.renderPopup();
|
|
713
|
+
const popupParams = {
|
|
714
|
+
content: popupHtml,
|
|
715
|
+
animate: ac.params.animate,
|
|
716
|
+
push: ac.params.popupPush,
|
|
717
|
+
swipeToClose: ac.params.popupSwipeToClose,
|
|
718
|
+
on: {
|
|
719
|
+
popupOpen(popup) {
|
|
720
|
+
ac.onOpen('popup', popup.el);
|
|
721
|
+
},
|
|
722
|
+
popupOpened(popup) {
|
|
723
|
+
ac.onOpened('popup', popup.el);
|
|
724
|
+
},
|
|
725
|
+
popupClose(popup) {
|
|
726
|
+
ac.onClose('popup', popup.el);
|
|
727
|
+
},
|
|
728
|
+
popupClosed(popup) {
|
|
729
|
+
ac.onClosed('popup', popup.el);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
if (ac.params.routableModals && ac.view) {
|
|
734
|
+
ac.view.router.navigate({
|
|
735
|
+
url: ac.url,
|
|
736
|
+
route: {
|
|
737
|
+
path: ac.url,
|
|
738
|
+
popup: popupParams
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
} else {
|
|
742
|
+
ac.modal = ac.app.popup.create(popupParams).open(ac.params.animate);
|
|
743
|
+
}
|
|
744
|
+
return ac;
|
|
745
|
+
}
|
|
746
|
+
openDropdown() {
|
|
747
|
+
const ac = this;
|
|
748
|
+
if (!ac.$dropdownEl) {
|
|
749
|
+
ac.$dropdownEl = $(ac.renderDropdown());
|
|
750
|
+
}
|
|
751
|
+
const $pageContentEl = ac.$inputEl.parents('.page-content');
|
|
752
|
+
if (ac.params.dropdownContainerEl) {
|
|
753
|
+
$(ac.params.dropdownContainerEl).append(ac.$dropdownEl);
|
|
754
|
+
} else if ($pageContentEl.length === 0) {
|
|
755
|
+
ac.$dropdownEl.insertAfter(ac.$inputEl);
|
|
756
|
+
} else {
|
|
757
|
+
ac.positionDropdown();
|
|
758
|
+
$pageContentEl.append(ac.$dropdownEl);
|
|
759
|
+
}
|
|
760
|
+
ac.onOpen('dropdown', ac.$dropdownEl);
|
|
761
|
+
ac.onOpened('dropdown', ac.$dropdownEl);
|
|
762
|
+
}
|
|
763
|
+
open() {
|
|
764
|
+
const ac = this;
|
|
765
|
+
if (ac.opened) return ac;
|
|
766
|
+
const openIn = ac.params.openIn;
|
|
767
|
+
ac[`open${openIn.split('').map((el, index) => {
|
|
768
|
+
if (index === 0) return el.toUpperCase();
|
|
769
|
+
return el;
|
|
770
|
+
}).join('')}`]();
|
|
771
|
+
return ac;
|
|
772
|
+
}
|
|
773
|
+
close() {
|
|
774
|
+
const ac = this;
|
|
775
|
+
if (!ac.opened) return ac;
|
|
776
|
+
if (ac.params.openIn === 'dropdown') {
|
|
777
|
+
ac.onClose();
|
|
778
|
+
ac.onClosed();
|
|
779
|
+
} else if (ac.params.routableModals && ac.view || ac.openedIn === 'page') {
|
|
780
|
+
ac.view.router.back({
|
|
781
|
+
animate: ac.params.animate
|
|
782
|
+
});
|
|
783
|
+
} else {
|
|
784
|
+
ac.modal.once('modalClosed', () => {
|
|
785
|
+
nextTick(() => {
|
|
786
|
+
if (ac.destroyed) return;
|
|
787
|
+
ac.modal.destroy();
|
|
788
|
+
delete ac.modal;
|
|
789
|
+
});
|
|
790
|
+
});
|
|
791
|
+
ac.modal.close();
|
|
792
|
+
}
|
|
793
|
+
return ac;
|
|
794
|
+
}
|
|
795
|
+
init() {
|
|
796
|
+
const ac = this;
|
|
797
|
+
ac.attachEvents();
|
|
798
|
+
}
|
|
799
|
+
destroy() {
|
|
800
|
+
const ac = this;
|
|
801
|
+
ac.emit('local::beforeDestroy autocompleteBeforeDestroy', ac);
|
|
802
|
+
ac.detachEvents();
|
|
803
|
+
if (ac.$inputEl && ac.$inputEl[0]) {
|
|
804
|
+
delete ac.$inputEl[0].f7Autocomplete;
|
|
805
|
+
}
|
|
806
|
+
if (ac.$openerEl && ac.$openerEl[0]) {
|
|
807
|
+
delete ac.$openerEl[0].f7Autocomplete;
|
|
808
|
+
}
|
|
809
|
+
deleteProps(ac);
|
|
810
|
+
ac.destroyed = true;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
export default Autocomplete;
|