@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,64 @@
|
|
|
1
|
+
import Framework7, {
|
|
2
|
+
CSSSelector,
|
|
3
|
+
Framework7EventsClass,
|
|
4
|
+
Framework7Plugin,
|
|
5
|
+
} from '../app/app-class.js';
|
|
6
|
+
|
|
7
|
+
export namespace Form {
|
|
8
|
+
interface DomEvents {
|
|
9
|
+
/** Event will be triggered on form when calling app.form.convertToData */
|
|
10
|
+
'form:todata': () => void;
|
|
11
|
+
/** Event will be triggered on form when calling app.form.fillFromData */
|
|
12
|
+
'form:fromdata': () => void;
|
|
13
|
+
|
|
14
|
+
/** Event will be triggered right after for data saved */
|
|
15
|
+
'form:storedata': () => void;
|
|
16
|
+
|
|
17
|
+
/** Event will be triggered after successful Ajax request */
|
|
18
|
+
'formajax:success': () => void;
|
|
19
|
+
/** Event will be triggered after Ajax request completed */
|
|
20
|
+
'formajax:complete': () => void;
|
|
21
|
+
/** Event will be triggered right before Ajax request */
|
|
22
|
+
'formajax:beforesend': () => void;
|
|
23
|
+
/** Event will be triggered on Ajax request error */
|
|
24
|
+
'formajax:error': () => void;
|
|
25
|
+
}
|
|
26
|
+
interface AppMethods {
|
|
27
|
+
form: {
|
|
28
|
+
/** convert form fields values to data object */
|
|
29
|
+
convertToData(form: HTMLElement | CSSSelector): object;
|
|
30
|
+
|
|
31
|
+
/** fill up form according to data object */
|
|
32
|
+
fillFromData(form: HTMLElement | CSSSelector, data: object): void;
|
|
33
|
+
|
|
34
|
+
/** get form data for the form with specified id attribute */
|
|
35
|
+
getFormData(formId: string): object;
|
|
36
|
+
/** store form data for the form with specified id attribute */
|
|
37
|
+
storeFormData(formId: string, data: object): void;
|
|
38
|
+
/** remove form data for the form with specified id attribute */
|
|
39
|
+
removeFormData(formId: string): void;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface AppParams {}
|
|
43
|
+
interface AppEvents {
|
|
44
|
+
/** Event will be triggered on form when calling app.form.convertToData */
|
|
45
|
+
formToData: (form: HTMLElement, data: object) => void;
|
|
46
|
+
/** Event will be triggered on form when calling app.form.fillFromData */
|
|
47
|
+
formFromData: (form: HTMLElement, data: object) => void;
|
|
48
|
+
|
|
49
|
+
/** Event will be triggered right after for data saved */
|
|
50
|
+
formStoreData: (form: HTMLElement, data: object) => void;
|
|
51
|
+
|
|
52
|
+
/** Event will be triggered right after for data saved */
|
|
53
|
+
formAjaxSuccess: (form: HTMLElement, data: object, response: Response) => void;
|
|
54
|
+
/** Event will be triggered right after for data saved */
|
|
55
|
+
formAjaxComplete: (form: HTMLElement, data: object, response: Response) => void;
|
|
56
|
+
/** Event will be triggered right after for data saved */
|
|
57
|
+
formAjaxBeforeSend: (form: HTMLElement, data: object) => void;
|
|
58
|
+
/** Event will be triggered right after for data saved */
|
|
59
|
+
formAjaxError: (form: HTMLElement, data: object, error: any) => void;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
declare const FormComponent: Framework7Plugin;
|
|
63
|
+
|
|
64
|
+
export default FormComponent;
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { getWindow, getDocument } from 'ssr-window';
|
|
2
|
+
import $ from '../../shared/dom7.js';
|
|
3
|
+
import { extend, serializeObject } from '../../shared/utils.js';
|
|
4
|
+
|
|
5
|
+
// Form Data
|
|
6
|
+
const FormData = {
|
|
7
|
+
store(form, data) {
|
|
8
|
+
const app = this;
|
|
9
|
+
const window = getWindow();
|
|
10
|
+
let formId = form;
|
|
11
|
+
const $formEl = $(form);
|
|
12
|
+
if ($formEl.length && $formEl.is('form') && $formEl.attr('id')) {
|
|
13
|
+
formId = $formEl.attr('id');
|
|
14
|
+
}
|
|
15
|
+
// Store form data in app.formsData
|
|
16
|
+
app.form.data[`form-${formId}`] = data;
|
|
17
|
+
|
|
18
|
+
// Store form data in local storage also
|
|
19
|
+
window.localStorage[`f7form-${formId}`] = JSON.stringify(data);
|
|
20
|
+
},
|
|
21
|
+
get(form) {
|
|
22
|
+
const app = this;
|
|
23
|
+
const window = getWindow();
|
|
24
|
+
let formId = form;
|
|
25
|
+
const $formEl = $(form);
|
|
26
|
+
if ($formEl.length && $formEl.is('form') && $formEl.attr('id')) {
|
|
27
|
+
formId = $formEl.attr('id');
|
|
28
|
+
}
|
|
29
|
+
if (window.localStorage[`f7form-${formId}`]) {
|
|
30
|
+
return JSON.parse(window.localStorage[`f7form-${formId}`]);
|
|
31
|
+
}
|
|
32
|
+
if (app.form.data[`form-${formId}`]) {
|
|
33
|
+
return app.form.data[`form-${formId}`];
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
},
|
|
37
|
+
remove(form) {
|
|
38
|
+
const app = this;
|
|
39
|
+
const window = getWindow();
|
|
40
|
+
let formId = form;
|
|
41
|
+
const $formEl = $(form);
|
|
42
|
+
if ($formEl.length && $formEl.is('form') && $formEl.attr('id')) {
|
|
43
|
+
formId = $formEl.attr('id');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Delete form data from app.formsData
|
|
47
|
+
if (app.form.data[`form-${formId}`]) {
|
|
48
|
+
app.form.data[`form-${formId}`] = '';
|
|
49
|
+
delete app.form.data[`form-${formId}`];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Delete form data from local storage also
|
|
53
|
+
if (window.localStorage[`f7form-${formId}`]) {
|
|
54
|
+
window.localStorage[`f7form-${formId}`] = '';
|
|
55
|
+
window.localStorage.removeItem(`f7form-${formId}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Form Storage
|
|
61
|
+
const FormStorage = {
|
|
62
|
+
init(formEl) {
|
|
63
|
+
const app = this;
|
|
64
|
+
const $formEl = $(formEl);
|
|
65
|
+
const formId = $formEl.attr('id');
|
|
66
|
+
if (!formId) return;
|
|
67
|
+
const initialData = app.form.getFormData(formId);
|
|
68
|
+
if (initialData) {
|
|
69
|
+
app.form.fillFromData($formEl, initialData);
|
|
70
|
+
}
|
|
71
|
+
function store() {
|
|
72
|
+
const data = app.form.convertToData($formEl);
|
|
73
|
+
if (!data) return;
|
|
74
|
+
app.form.storeFormData(formId, data);
|
|
75
|
+
$formEl.trigger('form:storedata', data);
|
|
76
|
+
app.emit('formStoreData', $formEl[0], data);
|
|
77
|
+
}
|
|
78
|
+
$formEl.on('change submit', store);
|
|
79
|
+
},
|
|
80
|
+
destroy(formEl) {
|
|
81
|
+
const $formEl = $(formEl);
|
|
82
|
+
$formEl.off('change submit');
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// Form To/From Data
|
|
87
|
+
function formToData(formEl) {
|
|
88
|
+
const app = this;
|
|
89
|
+
const $formEl = $(formEl).eq(0);
|
|
90
|
+
if ($formEl.length === 0) return undefined;
|
|
91
|
+
|
|
92
|
+
// Form data
|
|
93
|
+
const data = {};
|
|
94
|
+
|
|
95
|
+
// Skip input types
|
|
96
|
+
const skipTypes = ['submit', 'image', 'button', 'file'];
|
|
97
|
+
const skipNames = [];
|
|
98
|
+
$formEl.find('input, select, textarea').each(inputEl => {
|
|
99
|
+
const $inputEl = $(inputEl);
|
|
100
|
+
if ($inputEl.hasClass('ignore-store-data') || $inputEl.hasClass('no-store-data')) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const name = $inputEl.attr('name');
|
|
104
|
+
const type = $inputEl.attr('type');
|
|
105
|
+
const tag = inputEl.nodeName.toLowerCase();
|
|
106
|
+
if (skipTypes.indexOf(type) >= 0) return;
|
|
107
|
+
if (skipNames.indexOf(name) >= 0 || !name) return;
|
|
108
|
+
if (tag === 'select' && $inputEl.prop('multiple')) {
|
|
109
|
+
skipNames.push(name);
|
|
110
|
+
data[name] = [];
|
|
111
|
+
$formEl.find(`select[name="${name}"] option`).each(el => {
|
|
112
|
+
if (el.selected) data[name].push(el.value);
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
switch (type) {
|
|
116
|
+
case 'checkbox':
|
|
117
|
+
skipNames.push(name);
|
|
118
|
+
data[name] = [];
|
|
119
|
+
$formEl.find(`input[name="${name}"]`).each(el => {
|
|
120
|
+
if (el.checked) data[name].push(el.value);
|
|
121
|
+
});
|
|
122
|
+
break;
|
|
123
|
+
case 'radio':
|
|
124
|
+
skipNames.push(name);
|
|
125
|
+
$formEl.find(`input[name="${name}"]`).each(el => {
|
|
126
|
+
if (el.checked) data[name] = el.value;
|
|
127
|
+
});
|
|
128
|
+
break;
|
|
129
|
+
default:
|
|
130
|
+
data[name] = $inputEl.val();
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
$formEl.trigger('form:todata', data);
|
|
136
|
+
app.emit('formToData', $formEl[0], data);
|
|
137
|
+
return data;
|
|
138
|
+
}
|
|
139
|
+
function formFromData(formEl, formData) {
|
|
140
|
+
const app = this;
|
|
141
|
+
const $formEl = $(formEl).eq(0);
|
|
142
|
+
if (!$formEl.length) return;
|
|
143
|
+
let data = formData;
|
|
144
|
+
const formId = $formEl.attr('id');
|
|
145
|
+
if (!data && formId) {
|
|
146
|
+
data = app.form.getFormData(formId);
|
|
147
|
+
}
|
|
148
|
+
if (!data) return;
|
|
149
|
+
|
|
150
|
+
// Skip input types
|
|
151
|
+
const skipTypes = ['submit', 'image', 'button', 'file'];
|
|
152
|
+
const skipNames = [];
|
|
153
|
+
$formEl.find('input, select, textarea').each(inputEl => {
|
|
154
|
+
const $inputEl = $(inputEl);
|
|
155
|
+
if ($inputEl.hasClass('ignore-store-data') || $inputEl.hasClass('no-store-data')) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const name = $inputEl.attr('name');
|
|
159
|
+
const type = $inputEl.attr('type');
|
|
160
|
+
const tag = inputEl.nodeName.toLowerCase();
|
|
161
|
+
if (typeof data[name] === 'undefined' || data[name] === null) return;
|
|
162
|
+
if (skipTypes.indexOf(type) >= 0) return;
|
|
163
|
+
if (skipNames.indexOf(name) >= 0 || !name) return;
|
|
164
|
+
if (tag === 'select' && $inputEl.prop('multiple')) {
|
|
165
|
+
skipNames.push(name);
|
|
166
|
+
$formEl.find(`select[name="${name}"] option`).each(el => {
|
|
167
|
+
const selectEl = el;
|
|
168
|
+
if (data[name].indexOf(el.value) >= 0) selectEl.selected = true;else selectEl.selected = false;
|
|
169
|
+
});
|
|
170
|
+
} else {
|
|
171
|
+
switch (type) {
|
|
172
|
+
case 'checkbox':
|
|
173
|
+
skipNames.push(name);
|
|
174
|
+
$formEl.find(`input[name="${name}"]`).each(el => {
|
|
175
|
+
const checkboxEl = el;
|
|
176
|
+
if (data[name].indexOf(el.value) >= 0) checkboxEl.checked = true;else checkboxEl.checked = false;
|
|
177
|
+
});
|
|
178
|
+
break;
|
|
179
|
+
case 'radio':
|
|
180
|
+
skipNames.push(name);
|
|
181
|
+
$formEl.find(`input[name="${name}"]`).each(el => {
|
|
182
|
+
const radioEl = el;
|
|
183
|
+
if (data[name] === el.value) radioEl.checked = true;else radioEl.checked = false;
|
|
184
|
+
});
|
|
185
|
+
break;
|
|
186
|
+
default:
|
|
187
|
+
$inputEl.val(data[name]);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (tag === 'select' || tag === 'input' || tag === 'textarea') {
|
|
192
|
+
$inputEl.trigger('change', 'fromdata');
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
$formEl.trigger('form:fromdata', data);
|
|
196
|
+
app.emit('formFromData', $formEl[0], data);
|
|
197
|
+
}
|
|
198
|
+
function initAjaxForm() {
|
|
199
|
+
const app = this;
|
|
200
|
+
const window = getWindow();
|
|
201
|
+
const document = getDocument();
|
|
202
|
+
function onSubmitChange(e, fromData) {
|
|
203
|
+
const $formEl = $(this);
|
|
204
|
+
if (e.type === 'change' && !$formEl.hasClass('form-ajax-submit-onchange')) return;
|
|
205
|
+
if (e.type === 'submit') e.preventDefault();
|
|
206
|
+
if (e.type === 'change' && fromData === 'fromdata') return;
|
|
207
|
+
const method = ($formEl.attr('method') || 'GET').toUpperCase();
|
|
208
|
+
const contentType = $formEl.attr('enctype') || $formEl.prop('enctype');
|
|
209
|
+
let url = $formEl.attr('action');
|
|
210
|
+
if (!url) return;
|
|
211
|
+
let data;
|
|
212
|
+
if (method === 'POST') {
|
|
213
|
+
if (contentType === 'application/x-www-form-urlencoded' || contentType === 'application/json') {
|
|
214
|
+
data = app.form.convertToData($formEl[0]);
|
|
215
|
+
if (contentType === 'application/json') {
|
|
216
|
+
data = JSON.stringify(data);
|
|
217
|
+
}
|
|
218
|
+
} else {
|
|
219
|
+
data = new window.FormData($formEl[0]);
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
data = serializeObject(app.form.convertToData($formEl[0]));
|
|
223
|
+
if (url.includes('?')) {
|
|
224
|
+
url += `&${data}`;
|
|
225
|
+
} else {
|
|
226
|
+
url += `?${data}`;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
$formEl.trigger('formajax:beforesend', {
|
|
230
|
+
data
|
|
231
|
+
});
|
|
232
|
+
app.emit('formAjaxBeforeSend', $formEl[0], data);
|
|
233
|
+
fetch(url, {
|
|
234
|
+
method,
|
|
235
|
+
headers: {
|
|
236
|
+
'Content-Type': contentType || 'application/x-www-form-urlencoded'
|
|
237
|
+
},
|
|
238
|
+
...(method === 'POST' || method === 'PUT' ? {
|
|
239
|
+
body: data
|
|
240
|
+
} : {})
|
|
241
|
+
}).then(response => {
|
|
242
|
+
$formEl.trigger('formajax:complete', {
|
|
243
|
+
data,
|
|
244
|
+
response
|
|
245
|
+
});
|
|
246
|
+
app.emit('formAjaxComplete', $formEl[0], data, response);
|
|
247
|
+
$formEl.trigger('formajax:success', {
|
|
248
|
+
data,
|
|
249
|
+
response
|
|
250
|
+
});
|
|
251
|
+
app.emit('formAjaxSuccess', $formEl[0], data, response);
|
|
252
|
+
}).catch(error => {
|
|
253
|
+
$formEl.trigger('formajax:error', {
|
|
254
|
+
data,
|
|
255
|
+
error
|
|
256
|
+
});
|
|
257
|
+
app.emit('formAjaxError', $formEl[0], data, error);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
$(document).on('submit change', 'form.form-ajax-submit, form.form-ajax-submit-onchange', onSubmitChange);
|
|
261
|
+
}
|
|
262
|
+
export default {
|
|
263
|
+
name: 'form',
|
|
264
|
+
create() {
|
|
265
|
+
const app = this;
|
|
266
|
+
extend(app, {
|
|
267
|
+
form: {
|
|
268
|
+
data: {},
|
|
269
|
+
storeFormData: FormData.store.bind(app),
|
|
270
|
+
getFormData: FormData.get.bind(app),
|
|
271
|
+
removeFormData: FormData.remove.bind(app),
|
|
272
|
+
convertToData: formToData.bind(app),
|
|
273
|
+
fillFromData: formFromData.bind(app),
|
|
274
|
+
storage: {
|
|
275
|
+
init: FormStorage.init.bind(app),
|
|
276
|
+
destroy: FormStorage.destroy.bind(app)
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
},
|
|
281
|
+
on: {
|
|
282
|
+
init() {
|
|
283
|
+
const app = this;
|
|
284
|
+
initAjaxForm.call(app);
|
|
285
|
+
},
|
|
286
|
+
tabBeforeRemove(tabEl) {
|
|
287
|
+
const app = this;
|
|
288
|
+
$(tabEl).find('.form-store-data').each(formEl => {
|
|
289
|
+
app.form.storage.destroy(formEl);
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
tabMounted(tabEl) {
|
|
293
|
+
const app = this;
|
|
294
|
+
$(tabEl).find('.form-store-data').each(formEl => {
|
|
295
|
+
app.form.storage.init(formEl);
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
pageBeforeRemove(page) {
|
|
299
|
+
const app = this;
|
|
300
|
+
page.$el.find('.form-store-data').each(formEl => {
|
|
301
|
+
app.form.storage.destroy(formEl);
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
pageInit(page) {
|
|
305
|
+
const app = this;
|
|
306
|
+
page.$el.find('.form-store-data').each(formEl => {
|
|
307
|
+
app.form.storage.init(formEl);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
};
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/* eslint no-nested-ternary: off */
|
|
2
|
+
import { getDocument } from 'ssr-window';
|
|
3
|
+
import $ from '../../shared/dom7.js';
|
|
4
|
+
import { extend, deleteProps } from '../../shared/utils.js';
|
|
5
|
+
import Framework7Class from '../../shared/class.js';
|
|
6
|
+
/** @jsx $jsx */
|
|
7
|
+
import $jsx from '../../shared/$jsx.js';
|
|
8
|
+
class Gauge extends Framework7Class {
|
|
9
|
+
constructor(app, params) {
|
|
10
|
+
if (params === void 0) {
|
|
11
|
+
params = {};
|
|
12
|
+
}
|
|
13
|
+
super(params, [app]);
|
|
14
|
+
const self = this;
|
|
15
|
+
const defaults = extend({}, app.params.gauge);
|
|
16
|
+
|
|
17
|
+
// Extend defaults with modules params
|
|
18
|
+
self.useModulesParams(defaults);
|
|
19
|
+
self.params = extend(defaults, params);
|
|
20
|
+
const {
|
|
21
|
+
el
|
|
22
|
+
} = self.params;
|
|
23
|
+
if (!el) return self;
|
|
24
|
+
const $el = $(el);
|
|
25
|
+
if ($el.length === 0) return self;
|
|
26
|
+
if ($el[0].f7Gauge) return $el[0].f7Gauge;
|
|
27
|
+
extend(self, {
|
|
28
|
+
app,
|
|
29
|
+
$el,
|
|
30
|
+
el: $el && $el[0]
|
|
31
|
+
});
|
|
32
|
+
$el[0].f7Gauge = self;
|
|
33
|
+
|
|
34
|
+
// Install Modules
|
|
35
|
+
self.useModules();
|
|
36
|
+
self.init();
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
calcRadius() {
|
|
40
|
+
const self = this;
|
|
41
|
+
const {
|
|
42
|
+
size,
|
|
43
|
+
borderWidth
|
|
44
|
+
} = self.params;
|
|
45
|
+
return size / 2 - borderWidth / 2;
|
|
46
|
+
}
|
|
47
|
+
calcBorderLength() {
|
|
48
|
+
const self = this;
|
|
49
|
+
const radius = self.calcRadius();
|
|
50
|
+
return 2 * Math.PI * radius;
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const self = this;
|
|
54
|
+
if (self.params.render) return self.params.render.call(self, self);
|
|
55
|
+
const {
|
|
56
|
+
type,
|
|
57
|
+
value,
|
|
58
|
+
size,
|
|
59
|
+
bgColor,
|
|
60
|
+
borderBgColor,
|
|
61
|
+
borderColor,
|
|
62
|
+
borderWidth,
|
|
63
|
+
valueText,
|
|
64
|
+
valueTextColor,
|
|
65
|
+
valueFontSize,
|
|
66
|
+
valueFontWeight,
|
|
67
|
+
labelText,
|
|
68
|
+
labelTextColor,
|
|
69
|
+
labelFontSize,
|
|
70
|
+
labelFontWeight
|
|
71
|
+
} = self.params;
|
|
72
|
+
const semiCircle = type === 'semicircle';
|
|
73
|
+
const radius = self.calcRadius();
|
|
74
|
+
const length = self.calcBorderLength();
|
|
75
|
+
const progress = Math.max(Math.min(value, 1), 0);
|
|
76
|
+
return $jsx("svg", {
|
|
77
|
+
class: "gauge-svg",
|
|
78
|
+
width: `${size}px`,
|
|
79
|
+
height: `${semiCircle ? size / 2 : size}px`,
|
|
80
|
+
viewBox: `0 0 ${size} ${semiCircle ? size / 2 : size}`
|
|
81
|
+
}, semiCircle && $jsx("path", {
|
|
82
|
+
class: "gauge-back-semi",
|
|
83
|
+
d: `M${size - borderWidth / 2},${size / 2} a1,1 0 0,0 -${size - borderWidth},0`,
|
|
84
|
+
stroke: borderBgColor,
|
|
85
|
+
"stroke-width": borderWidth,
|
|
86
|
+
fill: bgColor || 'none'
|
|
87
|
+
}), semiCircle && $jsx("path", {
|
|
88
|
+
class: "gauge-front-semi",
|
|
89
|
+
d: `M${size - borderWidth / 2},${size / 2} a1,1 0 0,0 -${size - borderWidth},0`,
|
|
90
|
+
stroke: borderColor,
|
|
91
|
+
"stroke-width": borderWidth,
|
|
92
|
+
"stroke-dasharray": length / 2,
|
|
93
|
+
"stroke-dashoffset": length / 2 * (1 + progress),
|
|
94
|
+
fill: borderBgColor ? 'none' : bgColor || 'none'
|
|
95
|
+
}), !semiCircle && borderBgColor && $jsx("circle", {
|
|
96
|
+
class: "gauge-back-circle",
|
|
97
|
+
stroke: borderBgColor,
|
|
98
|
+
"stroke-width": borderWidth,
|
|
99
|
+
fill: bgColor || 'none',
|
|
100
|
+
cx: size / 2,
|
|
101
|
+
cy: size / 2,
|
|
102
|
+
r: radius
|
|
103
|
+
}), !semiCircle && $jsx("circle", {
|
|
104
|
+
class: "gauge-front-circle",
|
|
105
|
+
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
106
|
+
stroke: borderColor,
|
|
107
|
+
"stroke-width": borderWidth,
|
|
108
|
+
"stroke-dasharray": length,
|
|
109
|
+
"stroke-dashoffset": length * (1 - progress),
|
|
110
|
+
fill: borderBgColor ? 'none' : bgColor || 'none',
|
|
111
|
+
cx: size / 2,
|
|
112
|
+
cy: size / 2,
|
|
113
|
+
r: radius
|
|
114
|
+
}), valueText && $jsx("text", {
|
|
115
|
+
class: "gauge-value-text",
|
|
116
|
+
x: "50%",
|
|
117
|
+
y: semiCircle ? '100%' : '50%',
|
|
118
|
+
"font-weight": valueFontWeight,
|
|
119
|
+
"font-size": valueFontSize,
|
|
120
|
+
fill: valueTextColor,
|
|
121
|
+
dy: semiCircle ? labelText ? -labelFontSize - 15 : -5 : 0,
|
|
122
|
+
"text-anchor": "middle",
|
|
123
|
+
"dominant-baseline": !semiCircle && 'middle'
|
|
124
|
+
}, valueText), labelText && $jsx("text", {
|
|
125
|
+
class: "gauge-label-text",
|
|
126
|
+
x: "50%",
|
|
127
|
+
y: semiCircle ? '100%' : '50%',
|
|
128
|
+
"font-weight": labelFontWeight,
|
|
129
|
+
"font-size": labelFontSize,
|
|
130
|
+
fill: labelTextColor,
|
|
131
|
+
dy: semiCircle ? -5 : valueText ? valueFontSize / 2 + 10 : 0,
|
|
132
|
+
"text-anchor": "middle",
|
|
133
|
+
"dominant-baseline": !semiCircle && 'middle'
|
|
134
|
+
}, labelText));
|
|
135
|
+
}
|
|
136
|
+
update(newParams) {
|
|
137
|
+
if (newParams === void 0) {
|
|
138
|
+
newParams = {};
|
|
139
|
+
}
|
|
140
|
+
const self = this;
|
|
141
|
+
const document = getDocument();
|
|
142
|
+
const {
|
|
143
|
+
params,
|
|
144
|
+
$svgEl
|
|
145
|
+
} = self;
|
|
146
|
+
Object.keys(newParams).forEach(param => {
|
|
147
|
+
if (typeof newParams[param] !== 'undefined') {
|
|
148
|
+
params[param] = newParams[param];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
if ($svgEl.length === 0) return self;
|
|
152
|
+
const {
|
|
153
|
+
value,
|
|
154
|
+
size,
|
|
155
|
+
bgColor,
|
|
156
|
+
borderBgColor,
|
|
157
|
+
borderColor,
|
|
158
|
+
borderWidth,
|
|
159
|
+
valueText,
|
|
160
|
+
valueTextColor,
|
|
161
|
+
valueFontSize,
|
|
162
|
+
valueFontWeight,
|
|
163
|
+
labelText,
|
|
164
|
+
labelTextColor,
|
|
165
|
+
labelFontSize,
|
|
166
|
+
labelFontWeight
|
|
167
|
+
} = params;
|
|
168
|
+
const length = self.calcBorderLength();
|
|
169
|
+
const progress = Math.max(Math.min(value, 1), 0);
|
|
170
|
+
const radius = self.calcRadius();
|
|
171
|
+
const semiCircle = params.type === 'semicircle';
|
|
172
|
+
const svgAttrs = {
|
|
173
|
+
width: `${size}px`,
|
|
174
|
+
height: `${semiCircle ? size / 2 : size}px`,
|
|
175
|
+
viewBox: `0 0 ${size} ${semiCircle ? size / 2 : size}`
|
|
176
|
+
};
|
|
177
|
+
Object.keys(svgAttrs).forEach(attr => {
|
|
178
|
+
$svgEl.attr(attr, svgAttrs[attr]);
|
|
179
|
+
});
|
|
180
|
+
if (semiCircle) {
|
|
181
|
+
const backAttrs = {
|
|
182
|
+
d: `M${size - borderWidth / 2},${size / 2} a1,1 0 0,0 -${size - borderWidth},0`,
|
|
183
|
+
stroke: borderBgColor,
|
|
184
|
+
'stroke-width': borderWidth,
|
|
185
|
+
fill: bgColor || 'none'
|
|
186
|
+
};
|
|
187
|
+
const frontAttrs = {
|
|
188
|
+
d: `M${size - borderWidth / 2},${size / 2} a1,1 0 0,0 -${size - borderWidth},0`,
|
|
189
|
+
stroke: borderColor,
|
|
190
|
+
'stroke-width': borderWidth,
|
|
191
|
+
'stroke-dasharray': length / 2,
|
|
192
|
+
'stroke-dashoffset': length / 2 * (1 + progress),
|
|
193
|
+
fill: borderBgColor ? 'none' : bgColor || 'none'
|
|
194
|
+
};
|
|
195
|
+
Object.keys(backAttrs).forEach(attr => {
|
|
196
|
+
$svgEl.find('.gauge-back-semi').attr(attr, backAttrs[attr]);
|
|
197
|
+
});
|
|
198
|
+
Object.keys(frontAttrs).forEach(attr => {
|
|
199
|
+
$svgEl.find('.gauge-front-semi').attr(attr, frontAttrs[attr]);
|
|
200
|
+
});
|
|
201
|
+
} else {
|
|
202
|
+
const backAttrs = {
|
|
203
|
+
stroke: borderBgColor,
|
|
204
|
+
'stroke-width': borderWidth,
|
|
205
|
+
fill: bgColor || 'none',
|
|
206
|
+
cx: size / 2,
|
|
207
|
+
cy: size / 2,
|
|
208
|
+
r: radius
|
|
209
|
+
};
|
|
210
|
+
const frontAttrs = {
|
|
211
|
+
transform: `rotate(-90 ${size / 2} ${size / 2})`,
|
|
212
|
+
stroke: borderColor,
|
|
213
|
+
'stroke-width': borderWidth,
|
|
214
|
+
'stroke-dasharray': length,
|
|
215
|
+
'stroke-dashoffset': length * (1 - progress),
|
|
216
|
+
fill: borderBgColor ? 'none' : bgColor || 'none',
|
|
217
|
+
cx: size / 2,
|
|
218
|
+
cy: size / 2,
|
|
219
|
+
r: radius
|
|
220
|
+
};
|
|
221
|
+
Object.keys(backAttrs).forEach(attr => {
|
|
222
|
+
$svgEl.find('.gauge-back-circle').attr(attr, backAttrs[attr]);
|
|
223
|
+
});
|
|
224
|
+
Object.keys(frontAttrs).forEach(attr => {
|
|
225
|
+
$svgEl.find('.gauge-front-circle').attr(attr, frontAttrs[attr]);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (valueText) {
|
|
229
|
+
if (!$svgEl.find('.gauge-value-text').length) {
|
|
230
|
+
const textEl = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
231
|
+
textEl.classList.add('gauge-value-text');
|
|
232
|
+
$svgEl.append(textEl);
|
|
233
|
+
}
|
|
234
|
+
const textAttrs = {
|
|
235
|
+
x: '50%',
|
|
236
|
+
y: semiCircle ? '100%' : '50%',
|
|
237
|
+
'font-weight': valueFontWeight,
|
|
238
|
+
'font-size': valueFontSize,
|
|
239
|
+
fill: valueTextColor,
|
|
240
|
+
dy: semiCircle ? labelText ? -labelFontSize - 15 : -5 : 0,
|
|
241
|
+
'text-anchor': 'middle',
|
|
242
|
+
'dominant-baseline': !semiCircle && 'middle'
|
|
243
|
+
};
|
|
244
|
+
Object.keys(textAttrs).forEach(attr => {
|
|
245
|
+
$svgEl.find('.gauge-value-text').attr(attr, textAttrs[attr]);
|
|
246
|
+
});
|
|
247
|
+
$svgEl.find('.gauge-value-text').text(valueText);
|
|
248
|
+
} else {
|
|
249
|
+
$svgEl.find('.gauge-value-text').remove();
|
|
250
|
+
}
|
|
251
|
+
if (labelText) {
|
|
252
|
+
if (!$svgEl.find('.gauge-label-text').length) {
|
|
253
|
+
const textEl = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
254
|
+
textEl.classList.add('gauge-label-text');
|
|
255
|
+
$svgEl.append(textEl);
|
|
256
|
+
}
|
|
257
|
+
const labelAttrs = {
|
|
258
|
+
x: '50%',
|
|
259
|
+
y: semiCircle ? '100%' : '50%',
|
|
260
|
+
'font-weight': labelFontWeight,
|
|
261
|
+
'font-size': labelFontSize,
|
|
262
|
+
fill: labelTextColor,
|
|
263
|
+
dy: semiCircle ? -5 : valueText ? valueFontSize / 2 + 10 : 0,
|
|
264
|
+
'text-anchor': 'middle',
|
|
265
|
+
'dominant-baseline': !semiCircle && 'middle'
|
|
266
|
+
};
|
|
267
|
+
Object.keys(labelAttrs).forEach(attr => {
|
|
268
|
+
$svgEl.find('.gauge-label-text').attr(attr, labelAttrs[attr]);
|
|
269
|
+
});
|
|
270
|
+
$svgEl.find('.gauge-label-text').text(labelText);
|
|
271
|
+
} else {
|
|
272
|
+
$svgEl.find('.gauge-label-text').remove();
|
|
273
|
+
}
|
|
274
|
+
return self;
|
|
275
|
+
}
|
|
276
|
+
init() {
|
|
277
|
+
const self = this;
|
|
278
|
+
const $svgEl = $(self.render()).eq(0);
|
|
279
|
+
$svgEl.f7Gauge = self;
|
|
280
|
+
extend(self, {
|
|
281
|
+
$svgEl,
|
|
282
|
+
svgEl: $svgEl && $svgEl[0]
|
|
283
|
+
});
|
|
284
|
+
self.$el.append($svgEl);
|
|
285
|
+
return self;
|
|
286
|
+
}
|
|
287
|
+
destroy() {
|
|
288
|
+
const self = this;
|
|
289
|
+
if (!self.$el || self.destroyed) return;
|
|
290
|
+
self.$el.trigger('gauge:beforedestroy');
|
|
291
|
+
self.emit('local::beforeDestroy gaugeBeforeDestroy', self);
|
|
292
|
+
self.$svgEl.remove();
|
|
293
|
+
delete self.$el[0].f7Gauge;
|
|
294
|
+
deleteProps(self);
|
|
295
|
+
self.destroyed = true;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export default Gauge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gauge{position:relative;text-align:center;margin-left:auto;margin-right:auto;display:inline-block}.gauge svg,.gauge-svg{max-width:100%;height:auto}.gauge svg circle,.gauge svg path,.gauge-svg circle,.gauge-svg path{transition-duration:.4s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.gauge{position:relative;text-align:center;margin-left:auto;margin-right:auto;display:inline-block}.gauge svg,.gauge-svg{max-width:100%;height:auto}.gauge svg circle,.gauge svg path,.gauge-svg circle,.gauge-svg path{transition-duration:.4s}
|