@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,588 @@
|
|
|
1
|
+
import { getWindow } from 'ssr-window';
|
|
2
|
+
import $ from '../../shared/dom7.js';
|
|
3
|
+
import { extend, nextTick, deleteProps } from '../../shared/utils.js';
|
|
4
|
+
import Framework7Class from '../../shared/class.js';
|
|
5
|
+
import { getDevice } from '../../shared/get-device.js';
|
|
6
|
+
import pickerColumn from './picker-column.js';
|
|
7
|
+
|
|
8
|
+
/** @jsx $jsx */
|
|
9
|
+
import $jsx from '../../shared/$jsx.js';
|
|
10
|
+
class Picker extends Framework7Class {
|
|
11
|
+
constructor(app, params) {
|
|
12
|
+
if (params === void 0) {
|
|
13
|
+
params = {};
|
|
14
|
+
}
|
|
15
|
+
super(params, [app]);
|
|
16
|
+
const picker = this;
|
|
17
|
+
const device = getDevice();
|
|
18
|
+
const window = getWindow();
|
|
19
|
+
picker.params = extend({}, app.params.picker, params);
|
|
20
|
+
let $containerEl;
|
|
21
|
+
if (picker.params.containerEl) {
|
|
22
|
+
$containerEl = $(picker.params.containerEl);
|
|
23
|
+
if ($containerEl.length === 0) return picker;
|
|
24
|
+
}
|
|
25
|
+
let $inputEl;
|
|
26
|
+
if (picker.params.inputEl) {
|
|
27
|
+
$inputEl = $(picker.params.inputEl);
|
|
28
|
+
}
|
|
29
|
+
let $scrollToEl = picker.params.scrollToInput ? $inputEl : undefined;
|
|
30
|
+
if (picker.params.scrollToEl) {
|
|
31
|
+
const scrollToEl = $(picker.params.scrollToEl);
|
|
32
|
+
if (scrollToEl.length > 0) {
|
|
33
|
+
$scrollToEl = scrollToEl;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
extend(picker, {
|
|
37
|
+
app,
|
|
38
|
+
$containerEl,
|
|
39
|
+
containerEl: $containerEl && $containerEl[0],
|
|
40
|
+
inline: $containerEl && $containerEl.length > 0,
|
|
41
|
+
needsOriginFix: device.ios || window.navigator.userAgent.toLowerCase().indexOf('safari') >= 0 && window.navigator.userAgent.toLowerCase().indexOf('chrome') < 0 && !device.android,
|
|
42
|
+
cols: [],
|
|
43
|
+
$inputEl,
|
|
44
|
+
inputEl: $inputEl && $inputEl[0],
|
|
45
|
+
$scrollToEl,
|
|
46
|
+
initialized: false,
|
|
47
|
+
opened: false,
|
|
48
|
+
url: picker.params.url
|
|
49
|
+
});
|
|
50
|
+
function onResize() {
|
|
51
|
+
picker.resizeCols();
|
|
52
|
+
}
|
|
53
|
+
function onInputClick() {
|
|
54
|
+
picker.open();
|
|
55
|
+
}
|
|
56
|
+
function onInputFocus(e) {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
}
|
|
59
|
+
let htmlTouchStartTarget = null;
|
|
60
|
+
function onHtmlTouchStart(e) {
|
|
61
|
+
htmlTouchStartTarget = e.target;
|
|
62
|
+
}
|
|
63
|
+
function onHtmlClick(e) {
|
|
64
|
+
if (picker.destroyed || !picker.params) return;
|
|
65
|
+
const $targetEl = $(e.target);
|
|
66
|
+
if (picker.isPopover()) return;
|
|
67
|
+
if (!picker.opened || picker.closing) return;
|
|
68
|
+
if ($targetEl.closest('[class*="backdrop"]').length) return;
|
|
69
|
+
if ($inputEl && $inputEl.length > 0) {
|
|
70
|
+
if (htmlTouchStartTarget === e.target && $targetEl[0] !== $inputEl[0] && $targetEl.closest('.sheet-modal').length === 0) {
|
|
71
|
+
picker.close();
|
|
72
|
+
}
|
|
73
|
+
} else if ($(e.target).closest('.sheet-modal').length === 0) {
|
|
74
|
+
picker.close();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Events
|
|
79
|
+
extend(picker, {
|
|
80
|
+
attachResizeEvent() {
|
|
81
|
+
app.on('resize', onResize);
|
|
82
|
+
},
|
|
83
|
+
detachResizeEvent() {
|
|
84
|
+
app.off('resize', onResize);
|
|
85
|
+
},
|
|
86
|
+
attachInputEvents() {
|
|
87
|
+
picker.$inputEl.on('click', onInputClick);
|
|
88
|
+
if (picker.params.inputReadOnly) {
|
|
89
|
+
picker.$inputEl.on('focus mousedown', onInputFocus);
|
|
90
|
+
if (picker.$inputEl[0]) {
|
|
91
|
+
picker.$inputEl[0].f7ValidateReadonly = true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
detachInputEvents() {
|
|
96
|
+
picker.$inputEl.off('click', onInputClick);
|
|
97
|
+
if (picker.params.inputReadOnly) {
|
|
98
|
+
picker.$inputEl.off('focus mousedown', onInputFocus);
|
|
99
|
+
if (picker.$inputEl[0]) {
|
|
100
|
+
delete picker.$inputEl[0].f7ValidateReadonly;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
attachHtmlEvents() {
|
|
105
|
+
app.on('click', onHtmlClick);
|
|
106
|
+
app.on('touchstart', onHtmlTouchStart);
|
|
107
|
+
},
|
|
108
|
+
detachHtmlEvents() {
|
|
109
|
+
app.off('click', onHtmlClick);
|
|
110
|
+
app.off('touchstart', onHtmlTouchStart);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
picker.init();
|
|
114
|
+
return picker;
|
|
115
|
+
}
|
|
116
|
+
get view() {
|
|
117
|
+
const {
|
|
118
|
+
app,
|
|
119
|
+
params,
|
|
120
|
+
$inputEl
|
|
121
|
+
} = this;
|
|
122
|
+
let view;
|
|
123
|
+
if (params.view) {
|
|
124
|
+
view = params.view;
|
|
125
|
+
} else if ($inputEl) {
|
|
126
|
+
view = $inputEl.parents('.view').length && $inputEl.parents('.view')[0].f7View;
|
|
127
|
+
}
|
|
128
|
+
if (!view) view = app.views.main;
|
|
129
|
+
return view;
|
|
130
|
+
}
|
|
131
|
+
initInput() {
|
|
132
|
+
const picker = this;
|
|
133
|
+
if (!picker.$inputEl) return;
|
|
134
|
+
if (picker.params.inputReadOnly) picker.$inputEl.prop('readOnly', true);
|
|
135
|
+
}
|
|
136
|
+
resizeCols() {
|
|
137
|
+
const picker = this;
|
|
138
|
+
if (!picker.opened) return;
|
|
139
|
+
for (let i = 0; i < picker.cols.length; i += 1) {
|
|
140
|
+
if (!picker.cols[i].divider) {
|
|
141
|
+
picker.cols[i].calcSize();
|
|
142
|
+
picker.cols[i].setValue(picker.cols[i].value, false);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
isPopover() {
|
|
147
|
+
const picker = this;
|
|
148
|
+
const {
|
|
149
|
+
app,
|
|
150
|
+
modal,
|
|
151
|
+
params
|
|
152
|
+
} = picker;
|
|
153
|
+
const device = getDevice();
|
|
154
|
+
if (params.openIn === 'sheet') return false;
|
|
155
|
+
if (modal && modal.type !== 'popover') return false;
|
|
156
|
+
if (!picker.inline && picker.inputEl) {
|
|
157
|
+
if (params.openIn === 'popover') return true;
|
|
158
|
+
if (device.ios) {
|
|
159
|
+
return !!device.ipad;
|
|
160
|
+
}
|
|
161
|
+
if (app.width >= 768) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
formatValue() {
|
|
168
|
+
const picker = this;
|
|
169
|
+
const {
|
|
170
|
+
value,
|
|
171
|
+
displayValue
|
|
172
|
+
} = picker;
|
|
173
|
+
if (picker.params.formatValue) {
|
|
174
|
+
return picker.params.formatValue.call(picker, value, displayValue);
|
|
175
|
+
}
|
|
176
|
+
return value.join(' ');
|
|
177
|
+
}
|
|
178
|
+
setValue(values) {
|
|
179
|
+
const picker = this;
|
|
180
|
+
let valueIndex = 0;
|
|
181
|
+
if (picker.cols.length === 0) {
|
|
182
|
+
picker.value = values;
|
|
183
|
+
picker.updateValue(values);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
for (let i = 0; i < picker.cols.length; i += 1) {
|
|
187
|
+
if (picker.cols[i] && !picker.cols[i].divider) {
|
|
188
|
+
picker.cols[i].setValue(values[valueIndex]);
|
|
189
|
+
valueIndex += 1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
getValue() {
|
|
194
|
+
const picker = this;
|
|
195
|
+
return picker.value;
|
|
196
|
+
}
|
|
197
|
+
updateValue(forceValues) {
|
|
198
|
+
const picker = this;
|
|
199
|
+
const newValue = forceValues || [];
|
|
200
|
+
const newDisplayValue = [];
|
|
201
|
+
let column;
|
|
202
|
+
if (picker.cols.length === 0) {
|
|
203
|
+
const noDividerColumns = picker.params.cols.filter(c => !c.divider);
|
|
204
|
+
for (let i = 0; i < noDividerColumns.length; i += 1) {
|
|
205
|
+
column = noDividerColumns[i];
|
|
206
|
+
if (column.displayValues !== undefined && column.values !== undefined && column.values.indexOf(newValue[i]) !== -1) {
|
|
207
|
+
newDisplayValue.push(column.displayValues[column.values.indexOf(newValue[i])]);
|
|
208
|
+
} else {
|
|
209
|
+
newDisplayValue.push(newValue[i]);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
for (let i = 0; i < picker.cols.length; i += 1) {
|
|
214
|
+
if (!picker.cols[i].divider) {
|
|
215
|
+
newValue.push(picker.cols[i].value);
|
|
216
|
+
newDisplayValue.push(picker.cols[i].displayValue);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (newValue.indexOf(undefined) >= 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
picker.value = newValue;
|
|
224
|
+
picker.displayValue = newDisplayValue;
|
|
225
|
+
picker.emit('local::change pickerChange', picker, picker.value, picker.displayValue);
|
|
226
|
+
if (picker.inputEl) {
|
|
227
|
+
picker.$inputEl.val(picker.formatValue());
|
|
228
|
+
picker.$inputEl.trigger('change');
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
initColumn(colEl, updateItems) {
|
|
232
|
+
const picker = this;
|
|
233
|
+
pickerColumn.call(picker, colEl, updateItems);
|
|
234
|
+
}
|
|
235
|
+
// eslint-disable-next-line
|
|
236
|
+
destroyColumn(colEl) {
|
|
237
|
+
const picker = this;
|
|
238
|
+
const $colEl = $(colEl);
|
|
239
|
+
const index = $colEl.index();
|
|
240
|
+
if (picker.cols[index] && picker.cols[index].destroy) {
|
|
241
|
+
picker.cols[index].destroy();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
renderToolbar() {
|
|
245
|
+
const picker = this;
|
|
246
|
+
if (picker.params.renderToolbar) return picker.params.renderToolbar.call(picker, picker);
|
|
247
|
+
return $jsx("div", {
|
|
248
|
+
class: "toolbar toolbar-top"
|
|
249
|
+
}, $jsx("div", {
|
|
250
|
+
class: "toolbar-inner"
|
|
251
|
+
}, $jsx("div", {
|
|
252
|
+
class: "left"
|
|
253
|
+
}), $jsx("div", {
|
|
254
|
+
class: "right"
|
|
255
|
+
}, $jsx("a", {
|
|
256
|
+
class: "link sheet-close popover-close"
|
|
257
|
+
}, picker.params.toolbarCloseText))));
|
|
258
|
+
}
|
|
259
|
+
// eslint-disable-next-line
|
|
260
|
+
renderColumn(col, onlyItems) {
|
|
261
|
+
const colClasses = `picker-column ${col.textAlign ? `picker-column-${col.textAlign}` : ''} ${col.cssClass || ''}`;
|
|
262
|
+
let columnHtml;
|
|
263
|
+
let columnItemsHtml;
|
|
264
|
+
if (col.divider) {
|
|
265
|
+
// prettier-ignore
|
|
266
|
+
columnHtml = `
|
|
267
|
+
<div class="${colClasses} picker-column-divider">${col.content}</div>
|
|
268
|
+
`;
|
|
269
|
+
} else {
|
|
270
|
+
// prettier-ignore
|
|
271
|
+
columnItemsHtml = col.values.map((value, index) => `
|
|
272
|
+
<div class="picker-item" data-picker-value="${value}">
|
|
273
|
+
<span>${col.displayValues ? col.displayValues[index] : value}</span>
|
|
274
|
+
</div>
|
|
275
|
+
`).join('');
|
|
276
|
+
// prettier-ignore
|
|
277
|
+
columnHtml = `
|
|
278
|
+
<div class="${colClasses}">
|
|
279
|
+
<div class="picker-items">${columnItemsHtml}</div>
|
|
280
|
+
</div>
|
|
281
|
+
`;
|
|
282
|
+
}
|
|
283
|
+
return onlyItems ? columnItemsHtml.trim() : columnHtml.trim();
|
|
284
|
+
}
|
|
285
|
+
renderInline() {
|
|
286
|
+
const picker = this;
|
|
287
|
+
const {
|
|
288
|
+
rotateEffect,
|
|
289
|
+
cssClass,
|
|
290
|
+
toolbar
|
|
291
|
+
} = picker.params;
|
|
292
|
+
const inlineHtml = $jsx("div", {
|
|
293
|
+
class: `picker picker-inline ${rotateEffect ? 'picker-3d' : ''} ${cssClass || ''}`
|
|
294
|
+
}, toolbar && picker.renderToolbar(), $jsx("div", {
|
|
295
|
+
class: "picker-columns"
|
|
296
|
+
}, picker.cols.map(col => picker.renderColumn(col)), $jsx("div", {
|
|
297
|
+
class: "picker-center-highlight"
|
|
298
|
+
})));
|
|
299
|
+
return inlineHtml;
|
|
300
|
+
}
|
|
301
|
+
renderSheet() {
|
|
302
|
+
const picker = this;
|
|
303
|
+
const {
|
|
304
|
+
rotateEffect,
|
|
305
|
+
cssClass,
|
|
306
|
+
toolbar
|
|
307
|
+
} = picker.params;
|
|
308
|
+
const sheetHtml = $jsx("div", {
|
|
309
|
+
class: `sheet-modal picker picker-sheet ${rotateEffect ? 'picker-3d' : ''} ${cssClass || ''}`
|
|
310
|
+
}, toolbar && picker.renderToolbar(), $jsx("div", {
|
|
311
|
+
class: "sheet-modal-inner picker-columns"
|
|
312
|
+
}, picker.cols.map(col => picker.renderColumn(col)), $jsx("div", {
|
|
313
|
+
class: "picker-center-highlight"
|
|
314
|
+
})));
|
|
315
|
+
return sheetHtml;
|
|
316
|
+
}
|
|
317
|
+
renderPopover() {
|
|
318
|
+
const picker = this;
|
|
319
|
+
const {
|
|
320
|
+
rotateEffect,
|
|
321
|
+
cssClass,
|
|
322
|
+
toolbar
|
|
323
|
+
} = picker.params;
|
|
324
|
+
const popoverHtml = $jsx("div", {
|
|
325
|
+
class: "popover picker-popover"
|
|
326
|
+
}, $jsx("div", {
|
|
327
|
+
class: "popover-inner"
|
|
328
|
+
}, $jsx("div", {
|
|
329
|
+
class: `picker ${rotateEffect ? 'picker-3d' : ''} ${cssClass || ''}`
|
|
330
|
+
}, toolbar && picker.renderToolbar(), $jsx("div", {
|
|
331
|
+
class: "picker-columns"
|
|
332
|
+
}, picker.cols.map(col => picker.renderColumn(col)), $jsx("div", {
|
|
333
|
+
class: "picker-center-highlight"
|
|
334
|
+
})))));
|
|
335
|
+
return popoverHtml;
|
|
336
|
+
}
|
|
337
|
+
render() {
|
|
338
|
+
const picker = this;
|
|
339
|
+
if (picker.params.render) return picker.params.render.call(picker);
|
|
340
|
+
if (!picker.inline) {
|
|
341
|
+
if (picker.isPopover()) return picker.renderPopover();
|
|
342
|
+
return picker.renderSheet();
|
|
343
|
+
}
|
|
344
|
+
return picker.renderInline();
|
|
345
|
+
}
|
|
346
|
+
onOpen() {
|
|
347
|
+
const picker = this;
|
|
348
|
+
const {
|
|
349
|
+
initialized,
|
|
350
|
+
$el,
|
|
351
|
+
app,
|
|
352
|
+
$inputEl,
|
|
353
|
+
inline,
|
|
354
|
+
value,
|
|
355
|
+
params
|
|
356
|
+
} = picker;
|
|
357
|
+
picker.opened = true;
|
|
358
|
+
picker.closing = false;
|
|
359
|
+
picker.opening = true;
|
|
360
|
+
|
|
361
|
+
// Init main events
|
|
362
|
+
picker.attachResizeEvent();
|
|
363
|
+
|
|
364
|
+
// Init cols
|
|
365
|
+
$el.find('.picker-column').each(colEl => {
|
|
366
|
+
let updateItems = true;
|
|
367
|
+
if (!initialized && params.value || initialized && value) {
|
|
368
|
+
updateItems = false;
|
|
369
|
+
}
|
|
370
|
+
picker.initColumn(colEl, updateItems);
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// Set value
|
|
374
|
+
if (!initialized) {
|
|
375
|
+
if (value) picker.setValue(value);else if (params.value) {
|
|
376
|
+
picker.setValue(params.value);
|
|
377
|
+
}
|
|
378
|
+
} else if (value) {
|
|
379
|
+
picker.setValue(value);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Extra focus
|
|
383
|
+
if (!inline && $inputEl && $inputEl.length && app.theme === 'md') {
|
|
384
|
+
$inputEl.trigger('focus');
|
|
385
|
+
}
|
|
386
|
+
picker.initialized = true;
|
|
387
|
+
|
|
388
|
+
// Trigger events
|
|
389
|
+
if ($el) {
|
|
390
|
+
$el.trigger('picker:open');
|
|
391
|
+
}
|
|
392
|
+
if ($inputEl) {
|
|
393
|
+
$inputEl.trigger('picker:open');
|
|
394
|
+
}
|
|
395
|
+
picker.emit('local::open pickerOpen', picker);
|
|
396
|
+
}
|
|
397
|
+
onOpened() {
|
|
398
|
+
const picker = this;
|
|
399
|
+
picker.opening = false;
|
|
400
|
+
if (picker.$el) {
|
|
401
|
+
picker.$el.trigger('picker:opened');
|
|
402
|
+
}
|
|
403
|
+
if (picker.$inputEl) {
|
|
404
|
+
picker.$inputEl.trigger('picker:opened');
|
|
405
|
+
}
|
|
406
|
+
picker.emit('local::opened pickerOpened', picker);
|
|
407
|
+
}
|
|
408
|
+
onClose() {
|
|
409
|
+
const picker = this;
|
|
410
|
+
const app = picker.app;
|
|
411
|
+
picker.opening = false;
|
|
412
|
+
picker.closing = true;
|
|
413
|
+
|
|
414
|
+
// Detach events
|
|
415
|
+
picker.detachResizeEvent();
|
|
416
|
+
picker.cols.forEach(col => {
|
|
417
|
+
if (col.destroy) col.destroy();
|
|
418
|
+
});
|
|
419
|
+
if (picker.$inputEl) {
|
|
420
|
+
if (app.theme === 'md') {
|
|
421
|
+
picker.$inputEl.trigger('blur');
|
|
422
|
+
} else {
|
|
423
|
+
const validate = picker.$inputEl.attr('validate');
|
|
424
|
+
const required = picker.$inputEl.attr('required');
|
|
425
|
+
if (validate && required) {
|
|
426
|
+
app.input.validate(picker.$inputEl);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if (picker.$el) {
|
|
431
|
+
picker.$el.trigger('picker:close');
|
|
432
|
+
}
|
|
433
|
+
if (picker.$inputEl) {
|
|
434
|
+
picker.$inputEl.trigger('picker:close');
|
|
435
|
+
}
|
|
436
|
+
picker.emit('local::close pickerClose', picker);
|
|
437
|
+
}
|
|
438
|
+
onClosed() {
|
|
439
|
+
const picker = this;
|
|
440
|
+
picker.opened = false;
|
|
441
|
+
picker.closing = false;
|
|
442
|
+
if (!picker.inline) {
|
|
443
|
+
nextTick(() => {
|
|
444
|
+
if (picker.modal && picker.modal.el && picker.modal.destroy) {
|
|
445
|
+
if (!picker.params.routableModals) {
|
|
446
|
+
picker.modal.destroy();
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
delete picker.modal;
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
if (picker.$el) {
|
|
453
|
+
picker.$el.trigger('picker:closed');
|
|
454
|
+
}
|
|
455
|
+
if (picker.$inputEl) {
|
|
456
|
+
picker.$inputEl.trigger('picker:closed');
|
|
457
|
+
}
|
|
458
|
+
picker.emit('local::closed pickerClosed', picker);
|
|
459
|
+
}
|
|
460
|
+
open() {
|
|
461
|
+
const picker = this;
|
|
462
|
+
const {
|
|
463
|
+
app,
|
|
464
|
+
opened,
|
|
465
|
+
inline,
|
|
466
|
+
$inputEl,
|
|
467
|
+
$scrollToEl,
|
|
468
|
+
params
|
|
469
|
+
} = picker;
|
|
470
|
+
if (opened) return;
|
|
471
|
+
if (picker.cols.length === 0 && params.cols.length) {
|
|
472
|
+
params.cols.forEach(col => {
|
|
473
|
+
picker.cols.push(col);
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
if (inline) {
|
|
477
|
+
picker.$el = $(picker.render());
|
|
478
|
+
picker.$el[0].f7Picker = picker;
|
|
479
|
+
picker.$containerEl.append(picker.$el);
|
|
480
|
+
picker.onOpen();
|
|
481
|
+
picker.onOpened();
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const isPopover = picker.isPopover();
|
|
485
|
+
const modalType = isPopover ? 'popover' : 'sheet';
|
|
486
|
+
const modalParams = {
|
|
487
|
+
targetEl: $inputEl,
|
|
488
|
+
scrollToEl: $scrollToEl,
|
|
489
|
+
content: picker.render(),
|
|
490
|
+
backdrop: typeof params.backdrop !== 'undefined' ? params.backdrop : isPopover,
|
|
491
|
+
on: {
|
|
492
|
+
open() {
|
|
493
|
+
const modal = this;
|
|
494
|
+
picker.modal = modal;
|
|
495
|
+
picker.$el = isPopover ? modal.$el.find('.picker') : modal.$el;
|
|
496
|
+
picker.$el[0].f7Picker = picker;
|
|
497
|
+
picker.onOpen();
|
|
498
|
+
},
|
|
499
|
+
opened() {
|
|
500
|
+
picker.onOpened();
|
|
501
|
+
},
|
|
502
|
+
close() {
|
|
503
|
+
picker.onClose();
|
|
504
|
+
},
|
|
505
|
+
closed() {
|
|
506
|
+
picker.onClosed();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
if (modalType === 'sheet') {
|
|
511
|
+
modalParams.push = params.sheetPush;
|
|
512
|
+
modalParams.swipeToClose = params.sheetSwipeToClose;
|
|
513
|
+
}
|
|
514
|
+
if (params.routableModals && picker.view) {
|
|
515
|
+
picker.view.router.navigate({
|
|
516
|
+
url: picker.url,
|
|
517
|
+
route: {
|
|
518
|
+
path: picker.url,
|
|
519
|
+
[modalType]: modalParams
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
} else {
|
|
523
|
+
picker.modal = app[modalType].create(modalParams);
|
|
524
|
+
picker.modal.open();
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
close() {
|
|
528
|
+
const picker = this;
|
|
529
|
+
const {
|
|
530
|
+
opened,
|
|
531
|
+
inline
|
|
532
|
+
} = picker;
|
|
533
|
+
if (!opened) return;
|
|
534
|
+
if (inline) {
|
|
535
|
+
picker.onClose();
|
|
536
|
+
picker.onClosed();
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
if (picker.params.routableModals && picker.view) {
|
|
540
|
+
picker.view.router.back();
|
|
541
|
+
} else {
|
|
542
|
+
picker.modal.close();
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
init() {
|
|
546
|
+
const picker = this;
|
|
547
|
+
picker.initInput();
|
|
548
|
+
if (picker.inline) {
|
|
549
|
+
picker.open();
|
|
550
|
+
picker.emit('local::init pickerInit', picker);
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
if (!picker.initialized && picker.params.value) {
|
|
554
|
+
picker.setValue(picker.params.value);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// Attach input Events
|
|
558
|
+
if (picker.$inputEl) {
|
|
559
|
+
picker.attachInputEvents();
|
|
560
|
+
}
|
|
561
|
+
if (picker.params.closeByOutsideClick) {
|
|
562
|
+
picker.attachHtmlEvents();
|
|
563
|
+
}
|
|
564
|
+
picker.emit('local::init pickerInit', picker);
|
|
565
|
+
}
|
|
566
|
+
destroy() {
|
|
567
|
+
const picker = this;
|
|
568
|
+
if (picker.destroyed) return;
|
|
569
|
+
const {
|
|
570
|
+
$el
|
|
571
|
+
} = picker;
|
|
572
|
+
picker.emit('local::beforeDestroy pickerBeforeDestroy', picker);
|
|
573
|
+
if ($el) $el.trigger('picker:beforedestroy');
|
|
574
|
+
picker.close();
|
|
575
|
+
|
|
576
|
+
// Detach Events
|
|
577
|
+
if (picker.$inputEl) {
|
|
578
|
+
picker.detachInputEvents();
|
|
579
|
+
}
|
|
580
|
+
if (picker.params.closeByOutsideClick) {
|
|
581
|
+
picker.detachHtmlEvents();
|
|
582
|
+
}
|
|
583
|
+
if ($el && $el.length) delete picker.$el[0].f7Picker;
|
|
584
|
+
deleteProps(picker);
|
|
585
|
+
picker.destroyed = true;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
export default Picker;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import $ from '../../shared/dom7.js';
|
|
2
|
+
export default function pickerColumn(colEl, updateItems) {
|
|
3
|
+
const picker = this;
|
|
4
|
+
// const app = picker.app;
|
|
5
|
+
const $colEl = $(colEl);
|
|
6
|
+
const colIndex = $colEl.index();
|
|
7
|
+
const col = picker.cols[colIndex];
|
|
8
|
+
if (col.divider) return;
|
|
9
|
+
col.$el = $colEl;
|
|
10
|
+
col.el = $colEl[0];
|
|
11
|
+
col.$itemsEl = col.$el.find('.picker-items');
|
|
12
|
+
col.items = col.$itemsEl.find('.picker-item');
|
|
13
|
+
let itemHeight;
|
|
14
|
+
let colHeight;
|
|
15
|
+
col.replaceValues = function replaceColValues(values, displayValues) {
|
|
16
|
+
col.detachEvents();
|
|
17
|
+
col.values = values;
|
|
18
|
+
col.displayValues = displayValues;
|
|
19
|
+
col.$itemsEl.html(picker.renderColumn(col, true));
|
|
20
|
+
col.items = col.$itemsEl.find('.picker-item');
|
|
21
|
+
col.calcSize();
|
|
22
|
+
col.setValue(col.values[0], true);
|
|
23
|
+
col.attachEvents();
|
|
24
|
+
};
|
|
25
|
+
col.calcSize = function calcColSize() {
|
|
26
|
+
colHeight = col.$el[0].offsetHeight;
|
|
27
|
+
itemHeight = col.items[0].offsetHeight;
|
|
28
|
+
const hadPadding = col.el.style.getPropertyValue('--f7-picker-scroll-padding');
|
|
29
|
+
col.el.style.setProperty('--f7-picker-scroll-padding', `${(colHeight - itemHeight) / 2}px`);
|
|
30
|
+
if (!hadPadding) {
|
|
31
|
+
col.$itemsEl[0].scrollTop = 0;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
col.setValue = function setColValue(newValue, valueCallbacks) {
|
|
35
|
+
const newActiveIndex = col.$itemsEl.find(`.picker-item[data-picker-value="${newValue}"]`).index();
|
|
36
|
+
if (typeof newActiveIndex === 'undefined' || newActiveIndex === -1) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const newScrollTop = newActiveIndex * itemHeight;
|
|
40
|
+
col.$itemsEl[0].scrollTop = newScrollTop;
|
|
41
|
+
|
|
42
|
+
// Update items
|
|
43
|
+
col.updateItems(newActiveIndex, newScrollTop, valueCallbacks);
|
|
44
|
+
};
|
|
45
|
+
col.updateItems = function updateColItems(activeIndex, scrollTop, valueCallbacks) {
|
|
46
|
+
if (typeof scrollTop === 'undefined') {
|
|
47
|
+
// eslint-disable-next-line
|
|
48
|
+
scrollTop = col.$itemsEl[0].scrollTop;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* eslint-disable no-param-reassign */
|
|
52
|
+
if (typeof activeIndex === 'undefined') {
|
|
53
|
+
activeIndex = Math.round(scrollTop / itemHeight);
|
|
54
|
+
}
|
|
55
|
+
if (activeIndex < 0) activeIndex = 0;
|
|
56
|
+
if (activeIndex >= col.items.length) activeIndex = col.items.length - 1;
|
|
57
|
+
/* eslint-enable no-param-reassign */
|
|
58
|
+
const previousActiveIndex = col.activeIndex;
|
|
59
|
+
col.activeIndex = activeIndex;
|
|
60
|
+
col.$itemsEl.find('.picker-item-selected').removeClass('picker-item-selected');
|
|
61
|
+
const selectedItem = col.items.eq(activeIndex);
|
|
62
|
+
selectedItem.addClass('picker-item-selected').children().transform('');
|
|
63
|
+
// Set 3D rotate effect
|
|
64
|
+
if (picker.params.rotateEffect) {
|
|
65
|
+
col.items.each(itemEl => {
|
|
66
|
+
const $itemEl = $(itemEl);
|
|
67
|
+
const itemOffset = itemEl.offsetTop - (colHeight - itemHeight) / 2 - scrollTop;
|
|
68
|
+
const percentage = itemOffset / itemHeight;
|
|
69
|
+
const itemsFit = Math.ceil(col.height / itemHeight / 2) + 1;
|
|
70
|
+
let angle = -24 * percentage;
|
|
71
|
+
if (angle > 180) angle = 180;
|
|
72
|
+
if (angle < -180) angle = -180;
|
|
73
|
+
if (Math.abs(percentage) > itemsFit) {
|
|
74
|
+
$itemEl.addClass('picker-item-far');
|
|
75
|
+
} else {
|
|
76
|
+
$itemEl.removeClass('picker-item-far');
|
|
77
|
+
}
|
|
78
|
+
$itemEl.children('span').transform(`translate3d(0, ${-percentage * itemHeight}px, -100px) rotateX(${angle}deg)`);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if (valueCallbacks || typeof valueCallbacks === 'undefined') {
|
|
82
|
+
// Update values
|
|
83
|
+
col.value = selectedItem.attr('data-picker-value');
|
|
84
|
+
col.displayValue = col.displayValues ? col.displayValues[activeIndex] : col.value;
|
|
85
|
+
// On change callback
|
|
86
|
+
if (previousActiveIndex !== activeIndex) {
|
|
87
|
+
if (col.onChange) {
|
|
88
|
+
col.onChange(picker, col.value, col.displayValue);
|
|
89
|
+
}
|
|
90
|
+
picker.updateValue();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
function handleScroll() {
|
|
95
|
+
col.updateItems();
|
|
96
|
+
}
|
|
97
|
+
function handleClick() {
|
|
98
|
+
const value = $(this).attr('data-picker-value');
|
|
99
|
+
col.setValue(value);
|
|
100
|
+
}
|
|
101
|
+
col.attachEvents = function attachColEvents() {
|
|
102
|
+
col.$itemsEl.on('scroll', handleScroll);
|
|
103
|
+
col.items.on('click', handleClick);
|
|
104
|
+
};
|
|
105
|
+
col.detachEvents = function detachColEvents() {
|
|
106
|
+
col.items.off('click', handleClick);
|
|
107
|
+
};
|
|
108
|
+
col.init = function initCol() {
|
|
109
|
+
col.calcSize();
|
|
110
|
+
if (colIndex === 0) col.$el.addClass('picker-column-first');
|
|
111
|
+
if (colIndex === picker.cols.length - 1) col.$el.addClass('picker-column-last');
|
|
112
|
+
if (picker.params.freeMode) col.$el.addClass('picker-column-free-mode');
|
|
113
|
+
// Update items on init
|
|
114
|
+
if (updateItems) col.updateItems(0);
|
|
115
|
+
col.attachEvents();
|
|
116
|
+
};
|
|
117
|
+
col.destroy = function destroyCol() {
|
|
118
|
+
col.detachEvents();
|
|
119
|
+
};
|
|
120
|
+
col.init();
|
|
121
|
+
}
|