@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
package/less/vars.less
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Framework7, { Framework7Plugin } from '../../components/app/app-class';
|
|
2
|
+
|
|
3
|
+
export namespace Clicks {
|
|
4
|
+
interface AppMethods {}
|
|
5
|
+
interface AppParams {
|
|
6
|
+
/** Object with clicks-module related parameters */
|
|
7
|
+
clicks?:
|
|
8
|
+
| {
|
|
9
|
+
/** CSS selector for links that should be treated as external and shouldn't be handled by Framework7. For example such '.external' value will match to links like <a href="somepage.html" class="external"> (with class "external") (default '.external') */
|
|
10
|
+
externalLinks?: string;
|
|
11
|
+
}
|
|
12
|
+
| undefined;
|
|
13
|
+
}
|
|
14
|
+
interface AppEvents {}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const ClicksModule: Framework7Plugin;
|
|
18
|
+
|
|
19
|
+
export default ClicksModule;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { getWindow } from 'ssr-window';
|
|
2
|
+
import $ from '../../shared/dom7.js';
|
|
3
|
+
import ViewClass from '../../components/view/view-class.js';
|
|
4
|
+
function initClicks(app) {
|
|
5
|
+
function handleClicks(e) {
|
|
6
|
+
const window = getWindow();
|
|
7
|
+
const $clickedEl = $(e.target);
|
|
8
|
+
const $clickedLinkEl = $clickedEl.closest('a');
|
|
9
|
+
const isLink = $clickedLinkEl.length > 0;
|
|
10
|
+
const url = isLink && $clickedLinkEl.attr('href');
|
|
11
|
+
|
|
12
|
+
// Check if link is external
|
|
13
|
+
if (isLink) {
|
|
14
|
+
if ($clickedLinkEl.is(app.params.clicks.externalLinks) ||
|
|
15
|
+
// eslint-disable-next-line
|
|
16
|
+
url && url.indexOf('javascript:') >= 0) {
|
|
17
|
+
const target = $clickedLinkEl.attr('target');
|
|
18
|
+
if (url && window.cordova && window.cordova.InAppBrowser && (target === '_system' || target === '_blank')) {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
window.cordova.InAppBrowser.open(url, target);
|
|
21
|
+
} else if (url && window.Capacitor && window.Capacitor.Plugins && window.Capacitor.Plugins.Browser && (target === '_system' || target === '_blank')) {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
window.Capacitor.Plugins.Browser.open({
|
|
24
|
+
url
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Modules Clicks
|
|
32
|
+
Object.keys(app.modules).forEach(moduleName => {
|
|
33
|
+
const moduleClicks = app.modules[moduleName].clicks;
|
|
34
|
+
if (!moduleClicks) return;
|
|
35
|
+
if (e.preventF7Router) return;
|
|
36
|
+
Object.keys(moduleClicks).forEach(clickSelector => {
|
|
37
|
+
const matchingClickedElement = $clickedEl.closest(clickSelector).eq(0);
|
|
38
|
+
if (matchingClickedElement.length > 0) {
|
|
39
|
+
moduleClicks[clickSelector].call(app, matchingClickedElement, matchingClickedElement.dataset(), e);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Load Page
|
|
45
|
+
let clickedLinkData = {};
|
|
46
|
+
if (isLink) {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
clickedLinkData = $clickedLinkEl.dataset();
|
|
49
|
+
}
|
|
50
|
+
clickedLinkData.clickedEl = $clickedLinkEl[0];
|
|
51
|
+
|
|
52
|
+
// Prevent Router
|
|
53
|
+
if (e.preventF7Router) return;
|
|
54
|
+
if ($clickedLinkEl.hasClass('prevent-router') || $clickedLinkEl.hasClass('router-prevent')) return;
|
|
55
|
+
const validUrl = url && url.length > 0 && url[0] !== '#';
|
|
56
|
+
if (validUrl || $clickedLinkEl.hasClass('back')) {
|
|
57
|
+
let view;
|
|
58
|
+
if (clickedLinkData.view && clickedLinkData.view === 'current') {
|
|
59
|
+
view = app.views.current;
|
|
60
|
+
} else if (clickedLinkData.view) {
|
|
61
|
+
view = $(clickedLinkData.view)[0].f7View;
|
|
62
|
+
} else {
|
|
63
|
+
view = $clickedEl.parents('.view')[0] && $clickedEl.parents('.view')[0].f7View;
|
|
64
|
+
if (view && view.params.linksView && (!$clickedLinkEl.hasClass('back') || $clickedLinkEl.hasClass('back') && view.router.history.length === 1)) {
|
|
65
|
+
if (typeof view.params.linksView === 'string') view = $(view.params.linksView)[0].f7View;else if (view.params.linksView instanceof ViewClass) view = view.params.linksView;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (!view) {
|
|
69
|
+
if (app.views.main) view = app.views.main;
|
|
70
|
+
}
|
|
71
|
+
if (!view || !view.router) return;
|
|
72
|
+
if ($clickedLinkEl[0].f7RouteProps) {
|
|
73
|
+
clickedLinkData.props = $clickedLinkEl[0].f7RouteProps;
|
|
74
|
+
}
|
|
75
|
+
if ($clickedLinkEl.hasClass('back')) view.router.back(url, clickedLinkData);else view.router.navigate(url, clickedLinkData);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
app.on('click', handleClicks);
|
|
79
|
+
}
|
|
80
|
+
export default {
|
|
81
|
+
name: 'clicks',
|
|
82
|
+
params: {
|
|
83
|
+
clicks: {
|
|
84
|
+
// External Links
|
|
85
|
+
externalLinks: '.external'
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
on: {
|
|
89
|
+
init() {
|
|
90
|
+
const app = this;
|
|
91
|
+
initClicks(app);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import htm from 'htm';
|
|
2
|
+
import { flattenArray } from '../../shared/utils.js';
|
|
3
|
+
const ignoreChildren = [false, null, '', undefined];
|
|
4
|
+
const h = function (type, props) {
|
|
5
|
+
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
6
|
+
children[_key - 2] = arguments[_key];
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
type,
|
|
10
|
+
props: props || {},
|
|
11
|
+
children: flattenArray(children.filter(child => ignoreChildren.indexOf(child) < 0))
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const $h = htm.bind(h);
|
|
15
|
+
export default $h;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flattenArray } from '../../shared/utils.js';
|
|
2
|
+
const ignoreChildren = [false, null, '', undefined];
|
|
3
|
+
const $jsx = function (type, props) {
|
|
4
|
+
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
5
|
+
children[_key - 2] = arguments[_key];
|
|
6
|
+
}
|
|
7
|
+
const flatChildren = flattenArray((children || []).filter(child => ignoreChildren.indexOf(child) < 0));
|
|
8
|
+
if (type === 'Fragment') {
|
|
9
|
+
return flatChildren;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
type,
|
|
13
|
+
props: props || {},
|
|
14
|
+
children: flatChildren
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default $jsx;
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/* eslint no-underscore-dangle: "off" */
|
|
2
|
+
import { getWindow, getDocument } from 'ssr-window';
|
|
3
|
+
import $ from '../../shared/dom7.js';
|
|
4
|
+
import $h from './$h.js';
|
|
5
|
+
import { id as generateId, merge, eventNameToColonCase, deleteProps } from '../../shared/utils.js';
|
|
6
|
+
import vdom from './vdom.js';
|
|
7
|
+
import patch from './patch.js';
|
|
8
|
+
import $jsx from './$jsx.js';
|
|
9
|
+
|
|
10
|
+
/* eslint-disable no-shadow */
|
|
11
|
+
/* eslint-disable no-return-assign */
|
|
12
|
+
/* eslint-disable no-plusplus */
|
|
13
|
+
/* eslint-disable no-param-reassign */
|
|
14
|
+
/* eslint-disable no-sequences */
|
|
15
|
+
const types = [{
|
|
16
|
+
name: 'array',
|
|
17
|
+
init: i => i,
|
|
18
|
+
type: i => [i].find(Array.isArray),
|
|
19
|
+
update: (i, o) => [o].filter(Array.isArray).find(() => (i.length = 0, i.push(...o))),
|
|
20
|
+
insert: function (i, x, o) {
|
|
21
|
+
if (o === void 0) {
|
|
22
|
+
o = [];
|
|
23
|
+
}
|
|
24
|
+
return i.splice(Math.max(x, 0), 0, ...[o].flat());
|
|
25
|
+
},
|
|
26
|
+
replace: function (i, x, o) {
|
|
27
|
+
if (o === void 0) {
|
|
28
|
+
o = [];
|
|
29
|
+
}
|
|
30
|
+
return i.splice(Math.max(x, 0), Math.min(++x, 1), ...[o].flat());
|
|
31
|
+
},
|
|
32
|
+
append: function (i, o) {
|
|
33
|
+
if (o === void 0) {
|
|
34
|
+
o = [];
|
|
35
|
+
}
|
|
36
|
+
return i.push(...[o].flat());
|
|
37
|
+
},
|
|
38
|
+
prepend: function (i, o) {
|
|
39
|
+
if (o === void 0) {
|
|
40
|
+
o = [];
|
|
41
|
+
}
|
|
42
|
+
return i.unshift(...[o].flat());
|
|
43
|
+
},
|
|
44
|
+
swap: (i, a, b) => {
|
|
45
|
+
[i[a], i[b]] = [i[b], i[a]];
|
|
46
|
+
},
|
|
47
|
+
fromTo: function (i, a, b) {
|
|
48
|
+
if (b === void 0) {
|
|
49
|
+
b = a;
|
|
50
|
+
}
|
|
51
|
+
return i.splice(Math.max(b, 0), 0, ...i.splice(Math.max(a, 0), 1));
|
|
52
|
+
},
|
|
53
|
+
remove: function (i, o, a) {
|
|
54
|
+
if (a === void 0) {
|
|
55
|
+
a = i.map((_, x) => x);
|
|
56
|
+
}
|
|
57
|
+
return [o].flat().filter(i => a.includes(i)).sort((a, b) => b - a).forEach(x => i.splice(x, 1));
|
|
58
|
+
},
|
|
59
|
+
clear: i => i.length = 0
|
|
60
|
+
}, {
|
|
61
|
+
name: 'object',
|
|
62
|
+
init: i => i,
|
|
63
|
+
type: i => [i].filter(i => [i !== null, i !== undefined].every(i => i)).find(i => Object.getPrototypeOf(i) === Object.prototype),
|
|
64
|
+
update: (i, o) => Object.assign(i, o),
|
|
65
|
+
insert: () => {},
|
|
66
|
+
replace: () => {},
|
|
67
|
+
append: () => {},
|
|
68
|
+
prepend: () => {},
|
|
69
|
+
swap: () => ({}),
|
|
70
|
+
// N/A
|
|
71
|
+
fromTo: () => ({}),
|
|
72
|
+
// N/A
|
|
73
|
+
remove: (i, o) => [o].flat().forEach(k => delete i[k]),
|
|
74
|
+
clear: i => Object.keys(i).forEach(k => delete i[k])
|
|
75
|
+
}, {
|
|
76
|
+
name: 'atoms',
|
|
77
|
+
type: () => true,
|
|
78
|
+
init: function (i, o) {
|
|
79
|
+
if (o === void 0) {
|
|
80
|
+
o = {};
|
|
81
|
+
}
|
|
82
|
+
return Object.defineProperty(o, 'value', {
|
|
83
|
+
get: () => i,
|
|
84
|
+
set: v => {
|
|
85
|
+
// eslint-disable-next-line
|
|
86
|
+
i = v;
|
|
87
|
+
}
|
|
88
|
+
}), o;
|
|
89
|
+
},
|
|
90
|
+
update: function (i, v) {
|
|
91
|
+
if (v === void 0) {
|
|
92
|
+
v = i.value;
|
|
93
|
+
}
|
|
94
|
+
i.value = v;
|
|
95
|
+
},
|
|
96
|
+
insert: () => ({}),
|
|
97
|
+
// N/A
|
|
98
|
+
replace: () => ({}),
|
|
99
|
+
// N/A
|
|
100
|
+
append: () => ({}),
|
|
101
|
+
// N/A
|
|
102
|
+
prepend: () => ({}),
|
|
103
|
+
// N/A
|
|
104
|
+
swap: () => ({}),
|
|
105
|
+
// N/A
|
|
106
|
+
fromTo: () => ({}),
|
|
107
|
+
// N/A
|
|
108
|
+
remove: () => ({}),
|
|
109
|
+
// N/A
|
|
110
|
+
clear: i => {
|
|
111
|
+
i.value = undefined;
|
|
112
|
+
}
|
|
113
|
+
}];
|
|
114
|
+
|
|
115
|
+
/* eslint-enable no-shadow */
|
|
116
|
+
/* eslint-enable no-return-assign */
|
|
117
|
+
/* eslint-enable no-plusplus */
|
|
118
|
+
/* eslint-enable no-param-reassign */
|
|
119
|
+
/* eslint-enable no-sequences */
|
|
120
|
+
|
|
121
|
+
class Component {
|
|
122
|
+
constructor(app, component, props, _temp) {
|
|
123
|
+
if (props === void 0) {
|
|
124
|
+
props = {};
|
|
125
|
+
}
|
|
126
|
+
let {
|
|
127
|
+
el,
|
|
128
|
+
context,
|
|
129
|
+
children
|
|
130
|
+
} = _temp === void 0 ? {} : _temp;
|
|
131
|
+
const document = getDocument();
|
|
132
|
+
merge(this, {
|
|
133
|
+
f7: app,
|
|
134
|
+
props: props || {},
|
|
135
|
+
context: context || {},
|
|
136
|
+
id: component.id || generateId(),
|
|
137
|
+
children: children || [],
|
|
138
|
+
theme: {
|
|
139
|
+
ios: app.theme === 'ios',
|
|
140
|
+
md: app.theme === 'md'
|
|
141
|
+
},
|
|
142
|
+
style: component.style,
|
|
143
|
+
__updateQueue: [],
|
|
144
|
+
__eventHandlers: [],
|
|
145
|
+
__onceEventHandlers: [],
|
|
146
|
+
__onBeforeMount: [],
|
|
147
|
+
__onMounted: [],
|
|
148
|
+
__onBeforeUpdate: [],
|
|
149
|
+
__onUpdated: [],
|
|
150
|
+
__onBeforeUnmount: [],
|
|
151
|
+
__onUnmounted: []
|
|
152
|
+
});
|
|
153
|
+
const createComponent = () => {
|
|
154
|
+
return component(this.props, this.getComponentContext(true));
|
|
155
|
+
};
|
|
156
|
+
const getRenderFuncion = componentResult => new Promise((resolve, reject) => {
|
|
157
|
+
if (typeof componentResult === 'function') {
|
|
158
|
+
resolve(componentResult);
|
|
159
|
+
} else if (componentResult instanceof Promise) {
|
|
160
|
+
componentResult.then(render => {
|
|
161
|
+
resolve(render);
|
|
162
|
+
}).catch(err => {
|
|
163
|
+
reject(err);
|
|
164
|
+
});
|
|
165
|
+
} else {
|
|
166
|
+
reject(new Error('Framework7: Component render function is not a "function" type. Didn\'t you forget to "return $render"?'));
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return new Promise((resolve, reject) => {
|
|
170
|
+
const componentResult = createComponent();
|
|
171
|
+
getRenderFuncion(componentResult).then(render => {
|
|
172
|
+
this.renderFunction = render;
|
|
173
|
+
const tree = this.render();
|
|
174
|
+
if (el) {
|
|
175
|
+
this.vnode = vdom(tree, this, true);
|
|
176
|
+
if (this.style) {
|
|
177
|
+
this.styleEl = document.createElement('style');
|
|
178
|
+
this.styleEl.innerHTML = this.style;
|
|
179
|
+
}
|
|
180
|
+
this.el = el;
|
|
181
|
+
patch(this.el, this.vnode);
|
|
182
|
+
this.el = this.vnode.elm;
|
|
183
|
+
this.$el = $(this.el);
|
|
184
|
+
this.attachEvents();
|
|
185
|
+
this.el.f7Component = this;
|
|
186
|
+
this.mount();
|
|
187
|
+
resolve(this);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
// Make Dom
|
|
191
|
+
if (tree) {
|
|
192
|
+
this.vnode = vdom(tree, this, true);
|
|
193
|
+
this.el = document.createElement(this.vnode.sel || 'div');
|
|
194
|
+
patch(this.el, this.vnode);
|
|
195
|
+
this.$el = $(this.el);
|
|
196
|
+
}
|
|
197
|
+
if (this.style) {
|
|
198
|
+
this.styleEl = document.createElement('style');
|
|
199
|
+
this.styleEl.innerHTML = this.style;
|
|
200
|
+
}
|
|
201
|
+
this.attachEvents();
|
|
202
|
+
if (this.el) {
|
|
203
|
+
this.el.f7Component = this;
|
|
204
|
+
}
|
|
205
|
+
resolve(this);
|
|
206
|
+
}).catch(err => {
|
|
207
|
+
reject(err);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
on(eventName, handler) {
|
|
212
|
+
if (!this.__eventHandlers) return;
|
|
213
|
+
this.__eventHandlers.push({
|
|
214
|
+
eventName,
|
|
215
|
+
handler
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
once(eventName, handler) {
|
|
219
|
+
if (!this.__eventHandlers) return;
|
|
220
|
+
this.__onceEventHandlers.push({
|
|
221
|
+
eventName,
|
|
222
|
+
handler
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
getComponentRef() {
|
|
226
|
+
const self = this;
|
|
227
|
+
return initialValue => {
|
|
228
|
+
let value = initialValue;
|
|
229
|
+
const obj = {};
|
|
230
|
+
Object.defineProperty(obj, 'value', {
|
|
231
|
+
get() {
|
|
232
|
+
return value;
|
|
233
|
+
},
|
|
234
|
+
set(v) {
|
|
235
|
+
value = v;
|
|
236
|
+
self.update();
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return obj;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
getComponentStore() {
|
|
243
|
+
const {
|
|
244
|
+
state,
|
|
245
|
+
_gettersPlain,
|
|
246
|
+
dispatch
|
|
247
|
+
} = this.f7.store;
|
|
248
|
+
const $store = {
|
|
249
|
+
state,
|
|
250
|
+
dispatch
|
|
251
|
+
};
|
|
252
|
+
$store.getters = new Proxy(_gettersPlain, {
|
|
253
|
+
get: (target, prop) => {
|
|
254
|
+
const obj = target[prop];
|
|
255
|
+
const callback = v => {
|
|
256
|
+
obj.value = v;
|
|
257
|
+
this.update();
|
|
258
|
+
};
|
|
259
|
+
obj.onUpdated(callback);
|
|
260
|
+
return obj;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
return $store;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* eslint-disable no-sequences */
|
|
267
|
+
getUseState() {
|
|
268
|
+
var _this = this;
|
|
269
|
+
return o => {
|
|
270
|
+
const obj = [o].reduce(function (t, _i, _x, _a, i) {
|
|
271
|
+
if (i === void 0) {
|
|
272
|
+
i = t.init(_i);
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
state: i,
|
|
276
|
+
update: v => (t.update(i, v), _this.update()),
|
|
277
|
+
remove: v => (t.remove(i, v), _this.update()),
|
|
278
|
+
clear: () => (t.clear(i), _this.update()),
|
|
279
|
+
insert: (x, v) => (t.insert(i, x, v), _this.update()),
|
|
280
|
+
replace: (x, v) => (t.replace(i, x, v), _this.update()),
|
|
281
|
+
append: v => (t.append(i, v), _this.update()),
|
|
282
|
+
prepend: v => (t.prepend(i, v), _this.update()),
|
|
283
|
+
swap: (a, b) => (t.swap(i, a, b), _this.update()),
|
|
284
|
+
fromTo: (a, b) => (t.fromTo(i, a, b), _this.update()),
|
|
285
|
+
method: function (f) {
|
|
286
|
+
if (f === void 0) {
|
|
287
|
+
f = () => ({});
|
|
288
|
+
}
|
|
289
|
+
return f(i), _this.update();
|
|
290
|
+
},
|
|
291
|
+
async: function (f) {
|
|
292
|
+
if (f === void 0) {
|
|
293
|
+
f = () => Promise.reject(i);
|
|
294
|
+
}
|
|
295
|
+
return f(i).then(() => _this.update());
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
}, types.find(i => i.type(o)));
|
|
299
|
+
obj.length = 12;
|
|
300
|
+
obj[Symbol.iterator] = function Iterate() {
|
|
301
|
+
const values = Object.values(this);
|
|
302
|
+
values.splice(values.indexOf(12), 1);
|
|
303
|
+
let index = 0;
|
|
304
|
+
return {
|
|
305
|
+
next() {
|
|
306
|
+
if (index < values.length) {
|
|
307
|
+
const val = values[index];
|
|
308
|
+
index += 1;
|
|
309
|
+
return {
|
|
310
|
+
value: val,
|
|
311
|
+
done: false
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
done: true
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
return obj;
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
/* eslint-enable no-sequences */
|
|
324
|
+
|
|
325
|
+
getComponentContext(includeHooks) {
|
|
326
|
+
const ctx = {
|
|
327
|
+
$f7route: this.context.f7route,
|
|
328
|
+
$f7router: this.context.f7router,
|
|
329
|
+
$h,
|
|
330
|
+
$,
|
|
331
|
+
$id: this.id,
|
|
332
|
+
$f7: this.f7,
|
|
333
|
+
$f7ready: this.f7ready.bind(this),
|
|
334
|
+
$theme: this.theme,
|
|
335
|
+
$tick: this.tick.bind(this),
|
|
336
|
+
$update: this.update.bind(this),
|
|
337
|
+
$emit: this.emit.bind(this),
|
|
338
|
+
$store: this.getComponentStore(),
|
|
339
|
+
$ref: this.getComponentRef(),
|
|
340
|
+
$el: {},
|
|
341
|
+
$useState: this.getUseState()
|
|
342
|
+
};
|
|
343
|
+
Object.defineProperty(ctx.$el, 'value', {
|
|
344
|
+
get: () => {
|
|
345
|
+
return this.$el;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
if (includeHooks) Object.assign(ctx, {
|
|
349
|
+
$on: this.on.bind(this),
|
|
350
|
+
$once: this.once.bind(this),
|
|
351
|
+
$onBeforeMount: handler => this.__onBeforeMount.push(handler),
|
|
352
|
+
$onMounted: handler => this.__onMounted.push(handler),
|
|
353
|
+
$onBeforeUpdate: handler => this.__onBeforeUpdate.push(handler),
|
|
354
|
+
$onUpdated: handler => this.__onUpdated.push(handler),
|
|
355
|
+
$onBeforeUnmount: handler => this.__onBeforeUnmount.push(handler),
|
|
356
|
+
$onUnmounted: handler => this.__onUnmounted.push(handler)
|
|
357
|
+
});
|
|
358
|
+
return ctx;
|
|
359
|
+
}
|
|
360
|
+
render() {
|
|
361
|
+
return this.renderFunction(this.getComponentContext());
|
|
362
|
+
}
|
|
363
|
+
emit(name, data) {
|
|
364
|
+
if (!this.el) return;
|
|
365
|
+
this.$el.trigger(name, data);
|
|
366
|
+
}
|
|
367
|
+
attachEvents() {
|
|
368
|
+
const {
|
|
369
|
+
$el
|
|
370
|
+
} = this;
|
|
371
|
+
if (!this.__eventHandlers) return;
|
|
372
|
+
this.__eventHandlers.forEach(_ref => {
|
|
373
|
+
let {
|
|
374
|
+
eventName,
|
|
375
|
+
handler
|
|
376
|
+
} = _ref;
|
|
377
|
+
$el.on(eventNameToColonCase(eventName), handler);
|
|
378
|
+
});
|
|
379
|
+
this.__onceEventHandlers.forEach(_ref2 => {
|
|
380
|
+
let {
|
|
381
|
+
eventName,
|
|
382
|
+
handler
|
|
383
|
+
} = _ref2;
|
|
384
|
+
$el.once(eventNameToColonCase(eventName), handler);
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
detachEvents() {
|
|
388
|
+
const {
|
|
389
|
+
$el
|
|
390
|
+
} = this;
|
|
391
|
+
if (!this.__eventHandlers) return;
|
|
392
|
+
this.__eventHandlers.forEach(_ref3 => {
|
|
393
|
+
let {
|
|
394
|
+
eventName,
|
|
395
|
+
handler
|
|
396
|
+
} = _ref3;
|
|
397
|
+
$el.on(eventNameToColonCase(eventName), handler);
|
|
398
|
+
});
|
|
399
|
+
this.__onceEventHandlers.forEach(_ref4 => {
|
|
400
|
+
let {
|
|
401
|
+
eventName,
|
|
402
|
+
handler
|
|
403
|
+
} = _ref4;
|
|
404
|
+
$el.once(eventNameToColonCase(eventName), handler);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
startUpdateQueue() {
|
|
408
|
+
const window = getWindow();
|
|
409
|
+
if (this.__requestAnimationFrameId) return;
|
|
410
|
+
const update = () => {
|
|
411
|
+
this.hook('onBeforeUpdate');
|
|
412
|
+
const tree = this.render();
|
|
413
|
+
|
|
414
|
+
// Make Dom
|
|
415
|
+
if (tree) {
|
|
416
|
+
const newVNode = vdom(tree, this, false);
|
|
417
|
+
this.vnode = patch(this.vnode, newVNode);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
this.__requestAnimationFrameId = window.requestAnimationFrame(() => {
|
|
421
|
+
if (this.__updateIsPending) update();
|
|
422
|
+
let resolvers = [...this.__updateQueue];
|
|
423
|
+
this.__updateQueue = [];
|
|
424
|
+
this.__updateIsPending = false;
|
|
425
|
+
window.cancelAnimationFrame(this.__requestAnimationFrameId);
|
|
426
|
+
delete this.__requestAnimationFrameId;
|
|
427
|
+
delete this.__updateIsPending;
|
|
428
|
+
resolvers.forEach(resolver => resolver());
|
|
429
|
+
resolvers = [];
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
tick(callback) {
|
|
433
|
+
return new Promise(resolve => {
|
|
434
|
+
function resolver() {
|
|
435
|
+
resolve();
|
|
436
|
+
if (callback) callback();
|
|
437
|
+
}
|
|
438
|
+
this.__updateQueue.push(resolver);
|
|
439
|
+
this.startUpdateQueue();
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
update(callback) {
|
|
443
|
+
if (this.__destroyed) return new Promise(() => {});
|
|
444
|
+
return new Promise(resolve => {
|
|
445
|
+
const resolver = () => {
|
|
446
|
+
resolve();
|
|
447
|
+
if (callback) callback();
|
|
448
|
+
};
|
|
449
|
+
this.__updateIsPending = true;
|
|
450
|
+
this.__updateQueue.push(resolver);
|
|
451
|
+
this.startUpdateQueue();
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
setState(callback) {
|
|
455
|
+
return this.update(callback);
|
|
456
|
+
}
|
|
457
|
+
f7ready(callback) {
|
|
458
|
+
if (this.f7.initialized) {
|
|
459
|
+
callback(this.f7);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
this.f7.once('init', () => {
|
|
463
|
+
callback(this.f7);
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
mount(mountMethod) {
|
|
467
|
+
this.hook('onBeforeMount', this.$el);
|
|
468
|
+
if (this.styleEl) $('head').append(this.styleEl);
|
|
469
|
+
if (mountMethod) mountMethod(this.el);
|
|
470
|
+
this.hook('onMounted', this.$el);
|
|
471
|
+
}
|
|
472
|
+
destroy() {
|
|
473
|
+
if (this.__destroyed) return;
|
|
474
|
+
const window = getWindow();
|
|
475
|
+
this.hook('onBeforeUnmount');
|
|
476
|
+
if (this.styleEl) $(this.styleEl).remove();
|
|
477
|
+
this.detachEvents();
|
|
478
|
+
this.hook('onUnmounted');
|
|
479
|
+
// Delete component instance
|
|
480
|
+
if (this.el && this.el.f7Component) {
|
|
481
|
+
this.el.f7Component = null;
|
|
482
|
+
delete this.el.f7Component;
|
|
483
|
+
}
|
|
484
|
+
// Patch with empty node
|
|
485
|
+
if (this.vnode) {
|
|
486
|
+
this.vnode = patch(this.vnode, {
|
|
487
|
+
sel: this.vnode.sel,
|
|
488
|
+
data: {}
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
// Clear update queue
|
|
492
|
+
window.cancelAnimationFrame(this.__requestAnimationFrameId);
|
|
493
|
+
this.__updateQueue = [];
|
|
494
|
+
this.__eventHandlers = [];
|
|
495
|
+
this.__onceEventHandlers = [];
|
|
496
|
+
this.__onBeforeMount = [];
|
|
497
|
+
this.__onMounted = [];
|
|
498
|
+
this.__onBeforeUpdate = [];
|
|
499
|
+
this.__onUpdated = [];
|
|
500
|
+
this.__onBeforeUnmount = [];
|
|
501
|
+
this.__onUnmounted = [];
|
|
502
|
+
// Delete all props
|
|
503
|
+
deleteProps(this);
|
|
504
|
+
this.__destroyed = true;
|
|
505
|
+
}
|
|
506
|
+
hook(name) {
|
|
507
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
508
|
+
args[_key - 1] = arguments[_key];
|
|
509
|
+
}
|
|
510
|
+
if (this.__destroyed) return;
|
|
511
|
+
this[`__${name}`].forEach(handler => {
|
|
512
|
+
handler(...args);
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
Component.$jsx = $jsx;
|
|
517
|
+
export default Component;
|