framework7 7.0.8 → 8.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/accordion.js +2 -16
- package/components/accordion/accordion.less +0 -3
- package/components/actions/actions-class.js +13 -58
- package/components/actions/actions-ios.less +42 -0
- package/components/actions/actions-md.less +12 -0
- package/components/actions/actions-rtl.css +1 -1
- package/components/actions/actions-vars.less +17 -42
- package/components/actions/actions.css +1 -1
- package/components/actions/actions.d.ts +2 -2
- package/components/actions/actions.js +0 -4
- package/components/actions/actions.lazy.js +1 -1
- package/components/actions/actions.less +5 -35
- package/components/app/app-class.d.ts +14 -12
- package/components/app/app-class.js +93 -75
- package/components/app/app-ios.less +0 -2
- package/components/app/app-md.less +0 -2
- package/components/app/app-vars.less +13 -96
- package/components/app/app.less +1 -4
- package/components/app/load-module.js +17 -36
- package/components/area-chart/area-chart-class.js +8 -64
- package/components/area-chart/area-chart.js +0 -3
- package/components/area-chart/area-chart.less +0 -3
- package/components/autocomplete/autocomplete-class.js +30 -175
- package/components/autocomplete/autocomplete-ios.less +0 -8
- package/components/autocomplete/autocomplete-rtl.css +1 -1
- package/components/autocomplete/autocomplete-vars.less +8 -22
- package/components/autocomplete/autocomplete.css +1 -1
- package/components/autocomplete/autocomplete.d.ts +1 -3
- package/components/autocomplete/autocomplete.js +1 -6
- package/components/autocomplete/autocomplete.lazy.js +1 -1
- package/components/autocomplete/autocomplete.less +6 -18
- package/components/badge/badge-vars.less +3 -6
- package/components/badge/badge.less +1 -3
- package/components/block/block-vars.less +25 -52
- package/components/block/block.less +37 -12
- package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
- package/components/breadcrumbs/breadcrumbs-vars.less +31 -15
- package/components/breadcrumbs/breadcrumbs.css +1 -1
- package/components/breadcrumbs/breadcrumbs.js +0 -2
- package/components/breadcrumbs/breadcrumbs.less +4 -10
- package/components/button/button-vars.less +42 -43
- package/components/button/button.less +24 -26
- package/components/calendar/calendar-class.js +81 -401
- package/components/calendar/calendar-rtl.css +1 -1
- package/components/calendar/calendar-vars.less +32 -46
- package/components/calendar/calendar.css +1 -1
- package/components/calendar/calendar.js +6 -4
- package/components/calendar/calendar.lazy.js +1 -1
- package/components/calendar/calendar.less +10 -21
- package/components/card/card-rtl.css +1 -1
- package/components/card/card-vars.less +41 -44
- package/components/card/card.css +1 -1
- package/components/card/card.js +0 -108
- package/components/card/card.less +18 -24
- package/components/checkbox/checkbox-rtl.css +1 -1
- package/components/checkbox/checkbox-vars.less +0 -8
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.less +10 -3
- package/components/chip/chip-ios.less +3 -0
- package/components/chip/chip-md.less +4 -3
- package/components/chip/chip-rtl.css +1 -1
- package/components/chip/chip-vars.less +17 -20
- package/components/chip/chip.css +1 -1
- package/components/chip/chip.less +16 -21
- package/components/color-picker/color-picker-class.js +27 -158
- package/components/color-picker/color-picker-rtl.css +1 -1
- package/components/color-picker/color-picker.css +1 -1
- package/components/color-picker/color-picker.js +0 -4
- package/components/color-picker/color-picker.lazy.js +1 -1
- package/components/color-picker/color-picker.less +18 -8
- package/components/color-picker/modules/alpha-slider.js +0 -12
- package/components/color-picker/modules/brightness-slider.js +0 -8
- package/components/color-picker/modules/current-color.js +0 -2
- package/components/color-picker/modules/hex.js +0 -12
- package/components/color-picker/modules/hs-spectrum.js +0 -20
- package/components/color-picker/modules/hsb-sliders.js +0 -18
- package/components/color-picker/modules/hue-slider.js +0 -7
- package/components/color-picker/modules/initial-current-colors.js +0 -7
- package/components/color-picker/modules/palette.js +2 -10
- package/components/color-picker/modules/rgb-bars.js +0 -17
- package/components/color-picker/modules/rgb-sliders.js +0 -17
- package/components/color-picker/modules/sb-spectrum.js +0 -20
- package/components/color-picker/modules/wheel.js +0 -28
- package/components/contacts-list/contacts-list-md.less +4 -3
- package/components/contacts-list/contacts-list-rtl.css +1 -1
- package/components/contacts-list/contacts-list-vars.less +3 -15
- package/components/contacts-list/contacts-list.css +1 -1
- package/components/contacts-list/contacts-list.less +0 -3
- package/components/data-table/data-table-class.js +10 -32
- package/components/data-table/data-table-rtl.css +1 -1
- package/components/data-table/data-table-vars.less +6 -39
- package/components/data-table/data-table.css +1 -1
- package/components/data-table/data-table.js +0 -8
- package/components/data-table/data-table.less +0 -3
- package/components/dialog/dialog-class.js +7 -41
- package/components/dialog/dialog-ios.less +0 -3
- package/components/dialog/dialog-md.less +9 -9
- package/components/dialog/dialog-rtl.css +1 -1
- package/components/dialog/dialog-vars.less +25 -70
- package/components/dialog/dialog.css +1 -1
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +12 -48
- package/components/dialog/dialog.lazy.js +1 -1
- package/components/dialog/dialog.less +8 -4
- package/components/fab/fab-rtl.css +1 -1
- package/components/fab/fab-vars.less +20 -14
- package/components/fab/fab.css +1 -1
- package/components/fab/fab.js +0 -21
- package/components/fab/fab.less +50 -53
- package/components/form/form.d.ts +4 -4
- package/components/form/form.js +58 -94
- package/components/form/form.lazy.js +1 -1
- package/components/form/form.less +0 -3
- package/components/gauge/gauge-class.js +4 -20
- package/components/gauge/gauge.js +0 -9
- package/components/gauge/gauge.less +0 -3
- package/components/grid/grid-rtl.css +1 -1
- package/components/grid/grid-vars.less +0 -7
- package/components/grid/grid.css +1 -1
- package/components/grid/grid.d.ts +2 -8
- package/components/grid/grid.js +1 -225
- package/components/grid/grid.lazy.js +1 -1
- package/components/grid/grid.less +54 -184
- package/components/icon/icon.less +0 -3
- package/components/infinite-scroll/infinite-scroll-rtl.css +1 -1
- package/components/infinite-scroll/infinite-scroll.css +1 -1
- package/components/infinite-scroll/infinite-scroll.js +0 -16
- package/components/infinite-scroll/infinite-scroll.less +0 -3
- package/components/input/input-ios.less +49 -41
- package/components/input/input-md.less +87 -19
- package/components/input/input-rtl.css +1 -1
- package/components/input/input-vars.less +26 -60
- package/components/input/input.css +1 -1
- package/components/input/input.js +8 -67
- package/components/input/input.less +67 -153
- package/components/link/link-vars.less +0 -5
- package/components/link/link.less +3 -3
- package/components/list/list-md.less +0 -7
- package/components/list/list-vars.less +59 -108
- package/components/list/list.less +122 -90
- package/components/list-index/list-index-class.js +12 -69
- package/components/list-index/list-index-rtl.css +1 -1
- package/components/list-index/list-index-vars.less +0 -7
- package/components/list-index/list-index.css +1 -1
- package/components/list-index/list-index.d.ts +1 -3
- package/components/list-index/list-index.js +0 -8
- package/components/list-index/list-index.lazy.js +1 -1
- package/components/list-index/list-index.less +4 -7
- package/components/login-screen/login-screen-class.js +4 -9
- package/components/login-screen/login-screen-rtl.css +1 -1
- package/components/login-screen/login-screen-vars.less +13 -12
- package/components/login-screen/login-screen.css +1 -1
- package/components/login-screen/login-screen.js +0 -4
- package/components/login-screen/login-screen.less +2 -8
- package/components/messagebar/messagebar-class.js +18 -79
- package/components/messagebar/messagebar-ios.less +36 -0
- package/components/messagebar/messagebar-md.less +96 -16
- package/components/messagebar/messagebar-rtl.css +1 -1
- package/components/messagebar/messagebar-vars.less +27 -50
- package/components/messagebar/messagebar.css +1 -1
- package/components/messagebar/messagebar.js +0 -8
- package/components/messagebar/messagebar.less +11 -42
- package/components/messages/messages-class.js +17 -110
- package/components/messages/messages-ios.less +9 -0
- package/components/messages/messages-md.less +63 -28
- package/components/messages/messages-rtl.css +1 -1
- package/components/messages/messages-vars.less +43 -50
- package/components/messages/messages.css +1 -1
- package/components/messages/messages.js +0 -8
- package/components/messages/messages.lazy.js +1 -1
- package/components/messages/messages.less +0 -11
- package/components/modal/custom-modal-class.js +4 -14
- package/components/modal/modal-class.js +19 -55
- package/components/modal/modal.js +0 -3
- package/components/navbar/navbar-ios.less +3 -39
- package/components/navbar/navbar-md.less +12 -0
- package/components/navbar/navbar-vars.less +20 -49
- package/components/navbar/navbar.d.ts +0 -2
- package/components/navbar/navbar.js +37 -166
- package/components/navbar/navbar.less +4 -26
- package/components/notification/notification-class.js +4 -39
- package/components/notification/notification-md.less +18 -8
- package/components/notification/notification-rtl.css +1 -1
- package/components/notification/notification-vars.less +15 -54
- package/components/notification/notification.css +1 -1
- package/components/notification/notification.js +0 -2
- package/components/notification/notification.lazy.js +1 -1
- package/components/notification/notification.less +0 -3
- package/components/page/page-md.less +40 -10
- package/components/page/page-transitions/circle.less +15 -9
- package/components/page/page-transitions/fade.less +17 -11
- package/components/page/page-transitions/flip.less +9 -4
- package/components/page/page-vars.less +3 -19
- package/components/page/page.less +2 -10
- package/components/panel/panel-class.js +23 -127
- package/components/panel/panel-md.less +9 -0
- package/components/panel/panel-rtl.css +1 -1
- package/components/panel/panel-vars.less +7 -21
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +2 -2
- package/components/panel/panel.js +0 -34
- package/components/panel/panel.lazy.js +1 -1
- package/components/panel/panel.less +56 -48
- package/components/panel/resizable-panel.js +2 -32
- package/components/panel/swipe-panel.js +16 -71
- package/components/photo-browser/photo-browser-class.js +41 -171
- package/components/photo-browser/photo-browser-rtl.css +1 -1
- package/components/photo-browser/photo-browser-vars.less +0 -3
- package/components/photo-browser/photo-browser.css +1 -1
- package/components/photo-browser/photo-browser.d.ts +2 -4
- package/components/photo-browser/photo-browser.js +1 -6
- package/components/photo-browser/photo-browser.lazy.js +1 -1
- package/components/photo-browser/photo-browser.less +0 -4
- package/components/picker/picker-class.js +26 -133
- package/components/picker/picker-column.js +11 -31
- package/components/picker/picker-ios.less +10 -0
- package/components/picker/picker-md.less +6 -0
- package/components/picker/picker-rtl.css +1 -1
- package/components/picker/picker-vars.less +9 -25
- package/components/picker/picker.css +1 -1
- package/components/picker/picker.js +0 -4
- package/components/picker/picker.lazy.js +1 -1
- package/components/picker/picker.less +0 -11
- package/components/pie-chart/pie-chart-class.js +8 -31
- package/components/pie-chart/pie-chart.js +0 -3
- package/components/pie-chart/pie-chart.less +0 -3
- package/components/popover/popover-class.js +72 -126
- package/components/popover/popover-ios.less +0 -50
- package/components/popover/popover-rtl.css +1 -1
- package/components/popover/popover-vars.less +6 -23
- package/components/popover/popover.css +1 -1
- package/components/popover/popover.d.ts +2 -0
- package/components/popover/popover.js +1 -12
- package/components/popover/popover.lazy.js +1 -1
- package/components/popover/popover.less +62 -5
- package/components/popup/popup-class.js +12 -78
- package/components/popup/popup-rtl.css +1 -1
- package/components/popup/popup-vars.less +7 -9
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.js +0 -4
- package/components/popup/popup.lazy.js +1 -1
- package/components/popup/popup.less +4 -4
- package/components/preloader/preloader-ios.less +3 -1
- package/components/preloader/preloader-md.less +5 -1
- package/components/preloader/preloader-rtl.css +1 -1
- package/components/preloader/preloader-vars.less +0 -6
- package/components/preloader/preloader.css +1 -1
- package/components/preloader/preloader.js +8 -25
- package/components/preloader/preloader.lazy.js +1 -1
- package/components/preloader/preloader.less +6 -3
- package/components/progressbar/progressbar-rtl.css +1 -1
- package/components/progressbar/progressbar-vars.less +2 -12
- package/components/progressbar/progressbar.css +1 -1
- package/components/progressbar/progressbar.js +2 -31
- package/components/progressbar/progressbar.less +0 -3
- package/components/pull-to-refresh/pull-to-refresh-class.js +15 -107
- package/components/pull-to-refresh/pull-to-refresh-md.less +2 -1
- package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh-vars.less +0 -4
- package/components/pull-to-refresh/pull-to-refresh.css +1 -1
- package/components/pull-to-refresh/pull-to-refresh.js +0 -8
- package/components/pull-to-refresh/pull-to-refresh.lazy.js +1 -1
- package/components/pull-to-refresh/pull-to-refresh.less +0 -3
- package/components/radio/radio-rtl.css +1 -1
- package/components/radio/radio-vars.less +0 -7
- package/components/radio/radio.css +1 -1
- package/components/radio/radio.less +12 -5
- package/components/range/range-class.js +27 -112
- package/components/range/range-rtl.css +1 -1
- package/components/range/range-vars.less +10 -32
- package/components/range/range.css +1 -1
- package/components/range/range.js +0 -12
- package/components/range/range.less +0 -3
- package/components/searchbar/remove-diacritics.js +0 -4
- package/components/searchbar/searchbar-class.js +17 -138
- package/components/searchbar/searchbar-md.less +41 -16
- package/components/searchbar/searchbar-rtl.css +1 -1
- package/components/searchbar/searchbar-vars.less +25 -76
- package/components/searchbar/searchbar.css +1 -1
- package/components/searchbar/searchbar.d.ts +2 -2
- package/components/searchbar/searchbar.js +0 -15
- package/components/searchbar/searchbar.lazy.js +1 -1
- package/components/searchbar/searchbar.less +14 -28
- package/components/sheet/sheet-class.js +15 -110
- package/components/sheet/sheet-rtl.css +1 -1
- package/components/sheet/sheet-vars.less +17 -6
- package/components/sheet/sheet.css +1 -1
- package/components/sheet/sheet.js +0 -9
- package/components/sheet/sheet.lazy.js +1 -1
- package/components/sheet/sheet.less +10 -3
- package/components/skeleton/skeleton.less +1 -4
- package/components/smart-select/smart-select-class.js +36 -173
- package/components/smart-select/smart-select.d.ts +1 -3
- package/components/smart-select/smart-select.js +1 -14
- package/components/smart-select/smart-select.lazy.js +1 -1
- package/components/smart-select/smart-select.less +0 -3
- package/components/sortable/sortable-rtl.css +1 -1
- package/components/sortable/sortable-vars.less +8 -8
- package/components/sortable/sortable.css +1 -1
- package/components/sortable/sortable.js +0 -44
- package/components/sortable/sortable.less +0 -3
- package/components/statusbar/statusbar.js +0 -36
- package/components/statusbar/statusbar.less +0 -3
- package/components/stepper/stepper-class.js +10 -83
- package/components/stepper/stepper-rtl.css +1 -1
- package/components/stepper/stepper-vars.less +12 -24
- package/components/stepper/stepper.css +1 -1
- package/components/stepper/stepper.js +0 -12
- package/components/stepper/stepper.less +12 -23
- package/components/subnavbar/subnavbar-vars.less +3 -18
- package/components/subnavbar/subnavbar.js +0 -3
- package/components/subnavbar/subnavbar.less +1 -11
- package/components/swipeout/swipeout-rtl.css +1 -1
- package/components/swipeout/swipeout-vars.less +7 -6
- package/components/swipeout/swipeout.css +1 -1
- package/components/swipeout/swipeout.js +2 -99
- package/components/swipeout/swipeout.less +2 -7
- package/components/swiper/swiper-rtl.css +1 -1
- package/components/swiper/swiper.css +1 -1
- package/components/swiper/swiper.js +9 -30
- package/components/swiper/swiper.lazy.js +1 -1
- package/components/swiper/swiper.less +1 -16
- package/components/tabs/tabs-rtl.css +1 -1
- package/components/tabs/tabs.css +1 -1
- package/components/tabs/tabs.js +23 -60
- package/components/tabs/tabs.lazy.js +1 -1
- package/components/tabs/tabs.less +1 -3
- package/components/text-editor/text-editor-class.js +16 -102
- package/components/text-editor/text-editor-rtl.css +1 -1
- package/components/text-editor/text-editor-vars.less +12 -16
- package/components/text-editor/text-editor.css +1 -1
- package/components/text-editor/text-editor.js +0 -8
- package/components/text-editor/text-editor.lazy.js +1 -1
- package/components/text-editor/text-editor.less +0 -6
- package/components/timeline/timeline-rtl.css +1 -1
- package/components/timeline/timeline-vars.less +13 -47
- package/components/timeline/timeline.css +1 -1
- package/components/timeline/timeline.less +2 -9
- package/components/toast/toast-class.js +2 -16
- package/components/toast/toast-rtl.css +1 -1
- package/components/toast/toast-vars.less +5 -9
- package/components/toast/toast.css +1 -1
- package/components/toast/toast.js +0 -3
- package/components/toast/toast.less +0 -3
- package/components/toggle/toggle-class.js +6 -30
- package/components/toggle/toggle-ios.less +5 -1
- package/components/toggle/toggle-md.less +27 -11
- package/components/toggle/toggle-rtl.css +1 -1
- package/components/toggle/toggle-vars.less +19 -21
- package/components/toggle/toggle.css +1 -1
- package/components/toggle/toggle.js +0 -8
- package/components/toggle/toggle.less +0 -4
- package/components/toolbar/toolbar-ios.less +2 -2
- package/components/toolbar/toolbar-md.less +28 -4
- package/components/toolbar/toolbar-vars.less +17 -52
- package/components/toolbar/toolbar.js +5 -43
- package/components/toolbar/toolbar.less +27 -45
- package/components/tooltip/tooltip-class.js +10 -64
- package/components/tooltip/tooltip-rtl.css +1 -1
- package/components/tooltip/tooltip-vars.less +12 -3
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.js +0 -15
- package/components/tooltip/tooltip.less +0 -3
- package/components/touch-ripple/touch-ripple-class.js +0 -13
- package/components/touch-ripple/touch-ripple.js +0 -4
- package/components/touch-ripple/touch-ripple.less +1 -5
- package/components/treeview/treeview-rtl.css +1 -1
- package/components/treeview/treeview-vars.less +0 -3
- package/components/treeview/treeview.css +1 -1
- package/components/treeview/treeview.js +2 -11
- package/components/treeview/treeview.lazy.js +1 -1
- package/components/treeview/treeview.less +0 -3
- package/components/typography/typography-rtl.css +1 -1
- package/components/typography/typography.css +1 -1
- package/components/typography/typography.less +25 -3
- package/components/view/resizable-view.js +2 -24
- package/components/view/view-class.js +28 -53
- package/components/view/view.d.ts +0 -14
- package/components/view/view.js +8 -32
- package/components/view/view.less +1 -4
- package/components/virtual-list/virtual-list-class.js +58 -146
- package/components/virtual-list/virtual-list.d.ts +1 -1
- package/components/virtual-list/virtual-list.js +0 -2
- package/components/virtual-list/virtual-list.lazy.js +1 -1
- package/components/virtual-list/virtual-list.less +0 -3
- package/framework7-bundle-rtl.css +3593 -5977
- package/framework7-bundle-rtl.min.css +3 -3
- package/framework7-bundle.css +3591 -5978
- package/framework7-bundle.esm.js +4 -10
- package/framework7-bundle.js +6063 -12044
- package/framework7-bundle.js.map +1 -1
- package/framework7-bundle.less +2 -27
- package/framework7-bundle.min.css +3 -3
- package/framework7-bundle.min.js +3 -3
- package/framework7-bundle.min.js.map +1 -1
- package/framework7-lite-bundle.esm.js +4 -10
- package/framework7-lite.esm.js +4 -6
- package/framework7-lite.js +31 -0
- package/framework7-rtl.css +803 -1591
- package/framework7-rtl.min.css +3 -3
- package/framework7-types.d.ts +1 -32
- package/framework7.css +803 -1594
- package/framework7.d.ts +1 -32
- package/framework7.esm.js +4 -6
- package/framework7.js +1770 -3407
- package/framework7.js.map +1 -1
- package/framework7.less +2 -23
- package/framework7.min.css +3 -3
- package/framework7.min.js +3 -3
- package/framework7.min.js.map +1 -1
- package/less/mixins.less +7 -88
- package/less/plugin.js +15 -0
- package/modules/clicks/clicks.js +10 -22
- package/modules/component/$h.js +0 -3
- package/modules/component/$jsx.js +0 -5
- package/modules/component/component-class.js +13 -66
- package/modules/component/component.d.ts +1 -2
- package/modules/component/component.js +0 -8
- package/modules/component/eventslisteners.js +12 -20
- package/modules/component/parse-component.js +18 -20
- package/modules/component/snabbdom/h.js +3 -12
- package/modules/component/snabbdom/helpers/attachto.js +9 -14
- package/modules/component/snabbdom/htmldomapi.js +0 -16
- package/modules/component/snabbdom/modules/attributes.js +7 -11
- package/modules/component/snabbdom/modules/class.js +4 -8
- package/modules/component/snabbdom/modules/dataset.js +3 -7
- package/modules/component/snabbdom/modules/eventlisteners.js +16 -22
- package/modules/component/snabbdom/modules/hero.js +4 -44
- package/modules/component/snabbdom/modules/props.js +5 -9
- package/modules/component/snabbdom/modules/style.js +13 -30
- package/modules/component/snabbdom/snabbdom.bundle.js +0 -6
- package/modules/component/snabbdom/snabbdom.js +13 -72
- package/modules/component/snabbdom/thunk.js +3 -11
- package/modules/component/snabbdom/tovnode.js +1 -6
- package/modules/component/vdom.js +4 -62
- package/modules/demo-module.js +0 -8
- package/modules/device/device.js +6 -11
- package/modules/history/history.js +0 -1
- package/modules/resize/resize.js +8 -11
- package/modules/router/async-component.js +0 -3
- package/modules/router/back.js +86 -275
- package/modules/router/clear-previous-history.js +5 -18
- package/modules/router/component-loader.js +4 -25
- package/modules/router/modal.js +16 -43
- package/modules/router/navigate.js +80 -249
- package/modules/router/process-route-queue.js +0 -12
- package/modules/router/redirect.js +0 -8
- package/modules/router/router-class.js +92 -315
- package/modules/router/router.d.ts +3 -5
- package/modules/router/router.js +0 -3
- package/modules/router/swipe-back.js +35 -139
- package/modules/router/tab.js +14 -43
- package/modules/service-worker/service-worker.js +0 -11
- package/modules/store/create-store.js +10 -29
- package/modules/touch/touch.d.ts +2 -4
- package/modules/touch/touch.js +13 -108
- package/package.json +4 -18
- package/shared/$jsx.js +0 -6
- package/shared/class.js +18 -43
- package/shared/constructor-methods.js +0 -11
- package/shared/events-class.js +0 -17
- package/shared/get-device.js +18 -34
- package/shared/get-support.js +2 -8
- package/shared/history.js +2 -30
- package/shared/material-color-utils.js +728 -0
- package/shared/material-colors.js +75 -0
- package/shared/modal-methods.js +0 -18
- package/shared/utils.d.ts +0 -4
- package/shared/utils.js +191 -71
- package/components/accordion/accordion-aurora.less +0 -2
- package/components/actions/actions-aurora.less +0 -9
- package/components/app/app-aurora.less +0 -10
- package/components/appbar/appbar-aurora.less +0 -2
- package/components/appbar/appbar-ios.less +0 -2
- package/components/appbar/appbar-md.less +0 -2
- package/components/appbar/appbar-rtl.css +0 -1
- package/components/appbar/appbar-vars.less +0 -28
- package/components/appbar/appbar.css +0 -1
- package/components/appbar/appbar.d.ts +0 -14
- package/components/appbar/appbar.js +0 -3
- package/components/appbar/appbar.lazy.js +0 -1
- package/components/appbar/appbar.less +0 -106
- package/components/area-chart/area-chart-aurora.less +0 -2
- package/components/autocomplete/autocomplete-aurora.less +0 -17
- package/components/badge/badge-aurora.less +0 -2
- package/components/block/block-aurora.less +0 -2
- package/components/breadcrumbs/breadcrumbs-aurora.less +0 -2
- package/components/button/button-aurora.less +0 -25
- package/components/calendar/calendar-aurora.less +0 -2
- package/components/card/card-aurora.less +0 -2
- package/components/checkbox/checkbox-aurora.less +0 -39
- package/components/chip/chip-aurora.less +0 -14
- package/components/color-picker/color-picker-aurora.less +0 -2
- package/components/contacts-list/contacts-list-aurora.less +0 -2
- package/components/data-table/data-table-aurora.less +0 -64
- package/components/dialog/dialog-aurora.less +0 -112
- package/components/elevation/elevation-aurora.less +0 -2
- package/components/elevation/elevation-ios.less +0 -2
- package/components/elevation/elevation-md.less +0 -2
- package/components/elevation/elevation-rtl.css +0 -1
- package/components/elevation/elevation-vars.less +0 -51
- package/components/elevation/elevation.css +0 -1
- package/components/elevation/elevation.d.ts +0 -14
- package/components/elevation/elevation.js +0 -3
- package/components/elevation/elevation.lazy.js +0 -1
- package/components/elevation/elevation.less +0 -54
- package/components/fab/fab-aurora.less +0 -2
- package/components/form/form-aurora.less +0 -0
- package/components/gauge/gauge-aurora.less +0 -2
- package/components/grid/grid-aurora.less +0 -2
- package/components/icon/icon-aurora.less +0 -49
- package/components/infinite-scroll/infinite-scroll-aurora.less +0 -6
- package/components/input/input-aurora.less +0 -120
- package/components/lazy/lazy-aurora.less +0 -2
- package/components/lazy/lazy-ios.less +0 -2
- package/components/lazy/lazy-md.less +0 -2
- package/components/lazy/lazy-rtl.css +0 -1
- package/components/lazy/lazy.css +0 -1
- package/components/lazy/lazy.d.ts +0 -57
- package/components/lazy/lazy.js +0 -283
- package/components/lazy/lazy.lazy.js +0 -1
- package/components/lazy/lazy.less +0 -23
- package/components/link/link-aurora.less +0 -15
- package/components/list/list-aurora.less +0 -25
- package/components/list-index/list-index-aurora.less +0 -21
- package/components/login-screen/login-screen-aurora.less +0 -2
- package/components/menu/menu-aurora.less +0 -8
- package/components/menu/menu-ios.less +0 -2
- package/components/menu/menu-md.less +0 -2
- package/components/menu/menu-rtl.css +0 -1
- package/components/menu/menu-vars.less +0 -27
- package/components/menu/menu.css +0 -1
- package/components/menu/menu.d.ts +0 -32
- package/components/menu/menu.js +0 -87
- package/components/menu/menu.lazy.js +0 -1
- package/components/menu/menu.less +0 -232
- package/components/messagebar/messagebar-aurora.less +0 -53
- package/components/messages/messages-aurora.less +0 -137
- package/components/navbar/navbar-aurora.less +0 -70
- package/components/notification/notification-aurora.less +0 -59
- package/components/page/page-aurora.less +0 -49
- package/components/panel/panel-aurora.less +0 -2
- package/components/photo-browser/photo-browser-aurora.less +0 -2
- package/components/picker/picker-aurora.less +0 -2
- package/components/pie-chart/pie-chart-aurora.less +0 -2
- package/components/popover/popover-aurora.less +0 -56
- package/components/popup/popup-aurora.less +0 -2
- package/components/preloader/preloader-aurora.less +0 -53
- package/components/progressbar/progressbar-aurora.less +0 -72
- package/components/pull-to-refresh/pull-to-refresh-aurora.less +0 -122
- package/components/radio/radio-aurora.less +0 -86
- package/components/range/range-aurora.less +0 -9
- package/components/searchbar/searchbar-aurora.less +0 -86
- package/components/sheet/sheet-aurora.less +0 -2
- package/components/skeleton/skeleton-aurora.less +0 -2
- package/components/smart-select/smart-select-aurora.less +0 -2
- package/components/sortable/sortable-aurora.less +0 -7
- package/components/statusbar/statusbar-aurora.less +0 -2
- package/components/stepper/stepper-aurora.less +0 -32
- package/components/subnavbar/subnavbar-aurora.less +0 -51
- package/components/swipeout/swipeout-aurora.less +0 -2
- package/components/swiper/swiper-aurora.less +0 -2
- package/components/tabs/tabs-aurora.less +0 -2
- package/components/text-editor/text-editor-aurora.less +0 -9
- package/components/timeline/timeline-aurora.less +0 -7
- package/components/toast/toast-aurora.less +0 -64
- package/components/toggle/toggle-aurora.less +0 -26
- package/components/toolbar/toolbar-aurora.less +0 -43
- package/components/tooltip/tooltip-aurora.less +0 -2
- package/components/touch-ripple/touch-ripple-aurora.less +0 -2
- package/components/treeview/treeview-aurora.less +0 -31
- package/components/typography/typography-aurora.less +0 -2
- package/components/view/view-aurora.less +0 -2
- package/components/virtual-list/virtual-list-aurora.less +0 -2
- package/modules/request/request.d.ts +0 -15
- package/modules/request/request.js +0 -11
- package/postinstall.js +0 -3
- package/shared/request.d.ts +0 -115
- package/shared/request.js +0 -512
|
@@ -15,38 +15,30 @@ import moduleRgbSliders from './modules/rgb-sliders.js';
|
|
|
15
15
|
import moduleSbSpectrum from './modules/sb-spectrum.js';
|
|
16
16
|
import moduleHsSpectrum from './modules/hs-spectrum.js';
|
|
17
17
|
import moduleWheel from './modules/wheel.js';
|
|
18
|
-
/** @jsx $jsx */
|
|
19
18
|
|
|
19
|
+
/** @jsx $jsx */
|
|
20
20
|
import $jsx from '../../shared/$jsx.js';
|
|
21
|
-
|
|
22
21
|
class ColorPicker extends Framework7Class {
|
|
23
22
|
constructor(app, params) {
|
|
24
23
|
if (params === void 0) {
|
|
25
24
|
params = {};
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
super(params, [app]);
|
|
29
27
|
const self = this;
|
|
30
28
|
self.params = extend({}, app.params.colorPicker, params);
|
|
31
29
|
let $containerEl;
|
|
32
|
-
|
|
33
30
|
if (self.params.containerEl) {
|
|
34
31
|
$containerEl = $(self.params.containerEl);
|
|
35
32
|
if ($containerEl.length === 0) return self;
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
let $inputEl;
|
|
39
|
-
|
|
40
35
|
if (self.params.inputEl) {
|
|
41
36
|
$inputEl = $(self.params.inputEl);
|
|
42
37
|
}
|
|
43
|
-
|
|
44
38
|
let $targetEl;
|
|
45
|
-
|
|
46
39
|
if (self.params.targetEl) {
|
|
47
40
|
$targetEl = $(self.params.targetEl);
|
|
48
41
|
}
|
|
49
|
-
|
|
50
42
|
extend(self, {
|
|
51
43
|
app,
|
|
52
44
|
$containerEl,
|
|
@@ -75,22 +67,18 @@ class ColorPicker extends Framework7Class {
|
|
|
75
67
|
'sb-spectrum': moduleSbSpectrum,
|
|
76
68
|
'hs-spectrum': moduleHsSpectrum,
|
|
77
69
|
wheel: moduleWheel // eslint-disable-line
|
|
78
|
-
|
|
79
70
|
}
|
|
80
71
|
});
|
|
81
72
|
|
|
82
73
|
function onInputClick() {
|
|
83
74
|
self.open();
|
|
84
75
|
}
|
|
85
|
-
|
|
86
76
|
function onInputFocus(e) {
|
|
87
77
|
e.preventDefault();
|
|
88
78
|
}
|
|
89
|
-
|
|
90
79
|
function onTargetClick() {
|
|
91
80
|
self.open();
|
|
92
81
|
}
|
|
93
|
-
|
|
94
82
|
function onHtmlClick(e) {
|
|
95
83
|
if (self.destroyed || !self.params) return;
|
|
96
84
|
if (self.params.openIn === 'page') return;
|
|
@@ -98,7 +86,6 @@ class ColorPicker extends Framework7Class {
|
|
|
98
86
|
if (!self.opened || self.closing) return;
|
|
99
87
|
if ($clickTargetEl.closest('[class*="backdrop"]').length) return;
|
|
100
88
|
if ($clickTargetEl.closest('.color-picker-popup, .color-picker-popover').length) return;
|
|
101
|
-
|
|
102
89
|
if ($inputEl && $inputEl.length > 0) {
|
|
103
90
|
if ($clickTargetEl[0] !== $inputEl[0] && $clickTargetEl.closest('.sheet-modal').length === 0) {
|
|
104
91
|
self.close();
|
|
@@ -106,55 +93,44 @@ class ColorPicker extends Framework7Class {
|
|
|
106
93
|
} else if ($(e.target).closest('.sheet-modal').length === 0) {
|
|
107
94
|
self.close();
|
|
108
95
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
96
|
+
}
|
|
111
97
|
|
|
98
|
+
// Events
|
|
112
99
|
extend(self, {
|
|
113
100
|
attachInputEvents() {
|
|
114
101
|
self.$inputEl.on('click', onInputClick);
|
|
115
|
-
|
|
116
102
|
if (self.params.inputReadOnly) {
|
|
117
103
|
self.$inputEl.on('focus mousedown', onInputFocus);
|
|
118
|
-
|
|
119
104
|
if (self.$inputEl[0]) {
|
|
120
105
|
self.$inputEl[0].f7ValidateReadonly = true;
|
|
121
106
|
}
|
|
122
107
|
}
|
|
123
108
|
},
|
|
124
|
-
|
|
125
109
|
detachInputEvents() {
|
|
126
110
|
self.$inputEl.off('click', onInputClick);
|
|
127
|
-
|
|
128
111
|
if (self.params.inputReadOnly) {
|
|
129
112
|
self.$inputEl.off('focus mousedown', onInputFocus);
|
|
130
|
-
|
|
131
113
|
if (self.$inputEl[0]) {
|
|
132
114
|
delete self.$inputEl[0].f7ValidateReadonly;
|
|
133
115
|
}
|
|
134
116
|
}
|
|
135
117
|
},
|
|
136
|
-
|
|
137
118
|
attachTargetEvents() {
|
|
138
119
|
self.$targetEl.on('click', onTargetClick);
|
|
139
120
|
},
|
|
140
|
-
|
|
141
121
|
detachTargetEvents() {
|
|
142
122
|
self.$targetEl.off('click', onTargetClick);
|
|
143
123
|
},
|
|
144
|
-
|
|
145
124
|
attachHtmlEvents() {
|
|
146
125
|
app.on('click', onHtmlClick);
|
|
147
126
|
},
|
|
148
|
-
|
|
149
127
|
detachHtmlEvents() {
|
|
150
128
|
app.off('click', onHtmlClick);
|
|
151
129
|
}
|
|
152
|
-
|
|
153
130
|
});
|
|
154
131
|
self.init();
|
|
155
132
|
return self;
|
|
156
133
|
}
|
|
157
|
-
|
|
158
134
|
get view() {
|
|
159
135
|
const {
|
|
160
136
|
$inputEl,
|
|
@@ -163,40 +139,32 @@ class ColorPicker extends Framework7Class {
|
|
|
163
139
|
params
|
|
164
140
|
} = this;
|
|
165
141
|
let view;
|
|
166
|
-
|
|
167
142
|
if (params.view) {
|
|
168
143
|
view = params.view;
|
|
169
144
|
} else {
|
|
170
145
|
if ($inputEl) {
|
|
171
146
|
view = $inputEl.parents('.view').length && $inputEl.parents('.view')[0].f7View;
|
|
172
147
|
}
|
|
173
|
-
|
|
174
148
|
if (!view && $targetEl) {
|
|
175
149
|
view = $targetEl.parents('.view').length && $targetEl.parents('.view')[0].f7View;
|
|
176
150
|
}
|
|
177
151
|
}
|
|
178
|
-
|
|
179
152
|
if (!view) view = app.views.main;
|
|
180
153
|
return view;
|
|
181
154
|
}
|
|
182
|
-
|
|
183
155
|
attachEvents() {
|
|
184
156
|
const self = this;
|
|
185
157
|
self.centerModules = self.centerModules.bind(self);
|
|
186
|
-
|
|
187
158
|
if (self.params.centerModules) {
|
|
188
159
|
self.app.on('resize', self.centerModules);
|
|
189
160
|
}
|
|
190
161
|
}
|
|
191
|
-
|
|
192
162
|
detachEvents() {
|
|
193
163
|
const self = this;
|
|
194
|
-
|
|
195
164
|
if (self.params.centerModules) {
|
|
196
165
|
self.app.off('resize', self.centerModules);
|
|
197
166
|
}
|
|
198
167
|
}
|
|
199
|
-
|
|
200
168
|
centerModules() {
|
|
201
169
|
const self = this;
|
|
202
170
|
if (!self.opened || !self.$el || self.inline) return;
|
|
@@ -206,20 +174,17 @@ class ColorPicker extends Framework7Class {
|
|
|
206
174
|
scrollHeight,
|
|
207
175
|
offsetHeight
|
|
208
176
|
} = $pageContentEl[0];
|
|
209
|
-
|
|
210
177
|
if (scrollHeight <= offsetHeight) {
|
|
211
178
|
$pageContentEl.addClass('justify-content-center');
|
|
212
179
|
} else {
|
|
213
180
|
$pageContentEl.removeClass('justify-content-center');
|
|
214
181
|
}
|
|
215
182
|
}
|
|
216
|
-
|
|
217
183
|
initInput() {
|
|
218
184
|
const self = this;
|
|
219
185
|
if (!self.$inputEl) return;
|
|
220
186
|
if (self.params.inputReadOnly) self.$inputEl.prop('readOnly', true);
|
|
221
187
|
}
|
|
222
|
-
|
|
223
188
|
getModalType() {
|
|
224
189
|
const self = this;
|
|
225
190
|
const {
|
|
@@ -235,45 +200,36 @@ class ColorPicker extends Framework7Class {
|
|
|
235
200
|
if (modal && modal.type) return modal.type;
|
|
236
201
|
if (openIn !== 'auto') return openIn;
|
|
237
202
|
if (self.inline) return null;
|
|
238
|
-
|
|
239
203
|
if (device.ios) {
|
|
240
204
|
return device.ipad ? 'popover' : openInPhone;
|
|
241
205
|
}
|
|
242
|
-
|
|
243
|
-
if (app.width >= 768 || device.desktop && app.theme === 'aurora') {
|
|
206
|
+
if (app.width >= 768) {
|
|
244
207
|
return 'popover';
|
|
245
208
|
}
|
|
246
|
-
|
|
247
209
|
return openInPhone;
|
|
248
210
|
}
|
|
249
|
-
|
|
250
211
|
formatValue() {
|
|
251
212
|
const self = this;
|
|
252
213
|
const {
|
|
253
214
|
value
|
|
254
215
|
} = self;
|
|
255
|
-
|
|
256
216
|
if (self.params.formatValue) {
|
|
257
217
|
return self.params.formatValue.call(self, value);
|
|
258
218
|
}
|
|
259
|
-
|
|
260
219
|
return value.hex;
|
|
261
|
-
}
|
|
262
|
-
|
|
220
|
+
}
|
|
263
221
|
|
|
222
|
+
// eslint-disable-next-line
|
|
264
223
|
normalizeHsValues(arr) {
|
|
265
224
|
return [Math.floor(arr[0] * 10) / 10, Math.floor(arr[1] * 1000) / 1000, Math.floor(arr[2] * 1000) / 1000];
|
|
266
225
|
}
|
|
267
|
-
|
|
268
226
|
setValue(value, updateModules) {
|
|
269
227
|
if (value === void 0) {
|
|
270
228
|
value = {};
|
|
271
229
|
}
|
|
272
|
-
|
|
273
230
|
if (updateModules === void 0) {
|
|
274
231
|
updateModules = true;
|
|
275
232
|
}
|
|
276
|
-
|
|
277
233
|
const self = this;
|
|
278
234
|
if (typeof value === 'undefined') return;
|
|
279
235
|
let {
|
|
@@ -293,9 +249,7 @@ class ColorPicker extends Framework7Class {
|
|
|
293
249
|
valueChanged = true;
|
|
294
250
|
return;
|
|
295
251
|
}
|
|
296
|
-
|
|
297
252
|
const v = value[k];
|
|
298
|
-
|
|
299
253
|
if (Array.isArray(v)) {
|
|
300
254
|
v.forEach((subV, subIndex) => {
|
|
301
255
|
if (subV !== self.value[k][subIndex]) {
|
|
@@ -307,7 +261,6 @@ class ColorPicker extends Framework7Class {
|
|
|
307
261
|
}
|
|
308
262
|
});
|
|
309
263
|
if (!valueChanged) return;
|
|
310
|
-
|
|
311
264
|
if (value.rgb || value.rgba) {
|
|
312
265
|
const [r, g, b, a = alpha] = value.rgb || value.rgba;
|
|
313
266
|
rgb = [r, g, b];
|
|
@@ -321,7 +274,6 @@ class ColorPicker extends Framework7Class {
|
|
|
321
274
|
rgba = [rgb[0], rgb[1], rgb[2], a];
|
|
322
275
|
hsla = [hsl[0], hsl[1], hsl[2], a];
|
|
323
276
|
}
|
|
324
|
-
|
|
325
277
|
if (value.hsl || value.hsla) {
|
|
326
278
|
const [h, s, l, a = alpha] = value.hsl || value.hsla;
|
|
327
279
|
hsl = [h, s, l];
|
|
@@ -335,7 +287,6 @@ class ColorPicker extends Framework7Class {
|
|
|
335
287
|
rgba = [rgb[0], rgb[1], rgb[2], a];
|
|
336
288
|
hsla = [hsl[0], hsl[1], hsl[2], a];
|
|
337
289
|
}
|
|
338
|
-
|
|
339
290
|
if (value.hsb) {
|
|
340
291
|
const [h, s, b, a = alpha] = value.hsb;
|
|
341
292
|
hsb = [h, s, b];
|
|
@@ -349,7 +300,6 @@ class ColorPicker extends Framework7Class {
|
|
|
349
300
|
rgba = [rgb[0], rgb[1], rgb[2], a];
|
|
350
301
|
hsla = [hsl[0], hsl[1], hsl[2], a];
|
|
351
302
|
}
|
|
352
|
-
|
|
353
303
|
if (value.hex) {
|
|
354
304
|
rgb = colorHexToRgb(value.hex);
|
|
355
305
|
hex = colorRgbToHex(...rgb);
|
|
@@ -361,22 +311,17 @@ class ColorPicker extends Framework7Class {
|
|
|
361
311
|
rgba = [rgb[0], rgb[1], rgb[2], alpha];
|
|
362
312
|
hsla = [hsl[0], hsl[1], hsl[2], alpha];
|
|
363
313
|
}
|
|
364
|
-
|
|
365
314
|
if (typeof value.alpha !== 'undefined') {
|
|
366
315
|
alpha = value.alpha;
|
|
367
|
-
|
|
368
316
|
if (typeof rgb !== 'undefined') {
|
|
369
317
|
rgba = [rgb[0], rgb[1], rgb[2], alpha];
|
|
370
318
|
}
|
|
371
|
-
|
|
372
319
|
if (typeof hsl !== 'undefined') {
|
|
373
320
|
hsla = [hsl[0], hsl[1], hsl[2], alpha];
|
|
374
321
|
}
|
|
375
322
|
}
|
|
376
|
-
|
|
377
323
|
if (typeof value.hue !== 'undefined') {
|
|
378
324
|
const [h, s, l] = hsl; // eslint-disable-line
|
|
379
|
-
|
|
380
325
|
hsl = [value.hue, s, l];
|
|
381
326
|
hsb = colorHslToHsb(...hsl);
|
|
382
327
|
rgb = colorHslToRgb(...hsl);
|
|
@@ -387,7 +332,6 @@ class ColorPicker extends Framework7Class {
|
|
|
387
332
|
rgba = [rgb[0], rgb[1], rgb[2], alpha];
|
|
388
333
|
hsla = [hsl[0], hsl[1], hsl[2], alpha];
|
|
389
334
|
}
|
|
390
|
-
|
|
391
335
|
self.value = {
|
|
392
336
|
hex,
|
|
393
337
|
alpha,
|
|
@@ -400,53 +344,43 @@ class ColorPicker extends Framework7Class {
|
|
|
400
344
|
};
|
|
401
345
|
if (!self.initialValue) self.initialValue = extend({}, self.value);
|
|
402
346
|
self.updateValue(needChangeEvent);
|
|
403
|
-
|
|
404
347
|
if (self.opened && updateModules) {
|
|
405
348
|
self.updateModules();
|
|
406
349
|
}
|
|
407
350
|
}
|
|
408
|
-
|
|
409
351
|
getValue() {
|
|
410
352
|
const self = this;
|
|
411
353
|
return self.value;
|
|
412
354
|
}
|
|
413
|
-
|
|
414
355
|
updateValue(fireEvents) {
|
|
415
356
|
if (fireEvents === void 0) {
|
|
416
357
|
fireEvents = true;
|
|
417
358
|
}
|
|
418
|
-
|
|
419
359
|
const self = this;
|
|
420
360
|
const {
|
|
421
361
|
$inputEl,
|
|
422
362
|
value,
|
|
423
363
|
$targetEl
|
|
424
364
|
} = self;
|
|
425
|
-
|
|
426
365
|
if ($targetEl && self.params.targetElSetBackgroundColor) {
|
|
427
366
|
const {
|
|
428
367
|
rgba
|
|
429
368
|
} = value;
|
|
430
369
|
$targetEl.css('background-color', `rgba(${rgba.join(', ')})`);
|
|
431
370
|
}
|
|
432
|
-
|
|
433
371
|
if (fireEvents) {
|
|
434
372
|
self.emit('local::change colorPickerChange', self, value);
|
|
435
373
|
}
|
|
436
|
-
|
|
437
374
|
if ($inputEl && $inputEl.length) {
|
|
438
375
|
const inputValue = self.formatValue(value);
|
|
439
|
-
|
|
440
376
|
if ($inputEl && $inputEl.length) {
|
|
441
377
|
$inputEl.val(inputValue);
|
|
442
|
-
|
|
443
378
|
if (fireEvents) {
|
|
444
379
|
$inputEl.trigger('change');
|
|
445
380
|
}
|
|
446
381
|
}
|
|
447
382
|
}
|
|
448
383
|
}
|
|
449
|
-
|
|
450
384
|
updateModules() {
|
|
451
385
|
const self = this;
|
|
452
386
|
const {
|
|
@@ -460,12 +394,10 @@ class ColorPicker extends Framework7Class {
|
|
|
460
394
|
}
|
|
461
395
|
});
|
|
462
396
|
}
|
|
463
|
-
|
|
464
397
|
update() {
|
|
465
398
|
const self = this;
|
|
466
399
|
self.updateModules();
|
|
467
400
|
}
|
|
468
|
-
|
|
469
401
|
renderPicker() {
|
|
470
402
|
const self = this;
|
|
471
403
|
const {
|
|
@@ -482,14 +414,11 @@ class ColorPicker extends Framework7Class {
|
|
|
482
414
|
});
|
|
483
415
|
return html;
|
|
484
416
|
}
|
|
485
|
-
|
|
486
417
|
renderNavbar() {
|
|
487
418
|
const self = this;
|
|
488
|
-
|
|
489
419
|
if (self.params.renderNavbar) {
|
|
490
420
|
return self.params.renderNavbar.call(self, self);
|
|
491
421
|
}
|
|
492
|
-
|
|
493
422
|
const {
|
|
494
423
|
openIn,
|
|
495
424
|
navbarTitleText,
|
|
@@ -519,16 +448,13 @@ class ColorPicker extends Framework7Class {
|
|
|
519
448
|
"data-popup": ".color-picker-popup"
|
|
520
449
|
}, navbarCloseText))));
|
|
521
450
|
}
|
|
522
|
-
|
|
523
451
|
renderToolbar() {
|
|
524
452
|
const self = this;
|
|
525
|
-
|
|
526
453
|
if (self.params.renderToolbar) {
|
|
527
454
|
return self.params.renderToolbar.call(self, self);
|
|
528
455
|
}
|
|
529
|
-
|
|
530
456
|
return $jsx("div", {
|
|
531
|
-
class: "toolbar toolbar-top
|
|
457
|
+
class: "toolbar toolbar-top"
|
|
532
458
|
}, $jsx("div", {
|
|
533
459
|
class: "toolbar-inner"
|
|
534
460
|
}, $jsx("div", {
|
|
@@ -541,7 +467,6 @@ class ColorPicker extends Framework7Class {
|
|
|
541
467
|
"data-popover": ".color-picker-popover"
|
|
542
468
|
}, self.params.toolbarCloseText))));
|
|
543
469
|
}
|
|
544
|
-
|
|
545
470
|
renderInline() {
|
|
546
471
|
const self = this;
|
|
547
472
|
const {
|
|
@@ -552,7 +477,6 @@ class ColorPicker extends Framework7Class {
|
|
|
552
477
|
class: `color-picker color-picker-inline ${groupedModules ? 'color-picker-grouped-modules' : ''} ${cssClass || ''}`
|
|
553
478
|
}, self.renderPicker());
|
|
554
479
|
}
|
|
555
|
-
|
|
556
480
|
renderSheet() {
|
|
557
481
|
const self = this;
|
|
558
482
|
const {
|
|
@@ -568,7 +492,6 @@ class ColorPicker extends Framework7Class {
|
|
|
568
492
|
class: "page-content"
|
|
569
493
|
}, self.renderPicker())));
|
|
570
494
|
}
|
|
571
|
-
|
|
572
495
|
renderPopover() {
|
|
573
496
|
const self = this;
|
|
574
497
|
const {
|
|
@@ -586,7 +509,6 @@ class ColorPicker extends Framework7Class {
|
|
|
586
509
|
class: "page-content"
|
|
587
510
|
}, self.renderPicker()))));
|
|
588
511
|
}
|
|
589
|
-
|
|
590
512
|
renderPopup() {
|
|
591
513
|
const self = this;
|
|
592
514
|
const {
|
|
@@ -604,7 +526,6 @@ class ColorPicker extends Framework7Class {
|
|
|
604
526
|
class: "page-content"
|
|
605
527
|
}, self.renderPicker()))));
|
|
606
528
|
}
|
|
607
|
-
|
|
608
529
|
renderPage() {
|
|
609
530
|
const self = this;
|
|
610
531
|
const {
|
|
@@ -619,9 +540,9 @@ class ColorPicker extends Framework7Class {
|
|
|
619
540
|
}, $jsx("div", {
|
|
620
541
|
class: "page-content"
|
|
621
542
|
}, self.renderPicker())));
|
|
622
|
-
}
|
|
623
|
-
|
|
543
|
+
}
|
|
624
544
|
|
|
545
|
+
// eslint-disable-next-line
|
|
625
546
|
render() {
|
|
626
547
|
const self = this;
|
|
627
548
|
const {
|
|
@@ -629,17 +550,14 @@ class ColorPicker extends Framework7Class {
|
|
|
629
550
|
} = self;
|
|
630
551
|
if (params.render) return params.render.call(self);
|
|
631
552
|
if (self.inline) return self.renderInline();
|
|
632
|
-
|
|
633
553
|
if (params.openIn === 'page') {
|
|
634
554
|
return self.renderPage();
|
|
635
555
|
}
|
|
636
|
-
|
|
637
556
|
const modalType = self.getModalType();
|
|
638
557
|
if (modalType === 'popover') return self.renderPopover();
|
|
639
558
|
if (modalType === 'sheet') return self.renderSheet();
|
|
640
559
|
if (modalType === 'popup') return self.renderPopup();
|
|
641
560
|
}
|
|
642
|
-
|
|
643
561
|
onOpen() {
|
|
644
562
|
const self = this;
|
|
645
563
|
const {
|
|
@@ -654,8 +572,9 @@ class ColorPicker extends Framework7Class {
|
|
|
654
572
|
} = self;
|
|
655
573
|
self.closing = false;
|
|
656
574
|
self.opened = true;
|
|
657
|
-
self.opening = true;
|
|
575
|
+
self.opening = true;
|
|
658
576
|
|
|
577
|
+
// Init main events
|
|
659
578
|
self.attachEvents();
|
|
660
579
|
params.modules.forEach(m => {
|
|
661
580
|
if (typeof m === 'string' && modules[m] && modules[m].init) {
|
|
@@ -664,8 +583,9 @@ class ColorPicker extends Framework7Class {
|
|
|
664
583
|
m.init(self);
|
|
665
584
|
}
|
|
666
585
|
});
|
|
667
|
-
const updateValue = !value && params.value;
|
|
586
|
+
const updateValue = !value && params.value;
|
|
668
587
|
|
|
588
|
+
// Set value
|
|
669
589
|
if (!initialized) {
|
|
670
590
|
if (value) self.setValue(value);else if (params.value) {
|
|
671
591
|
self.setValue(params.value, false);
|
|
@@ -677,49 +597,43 @@ class ColorPicker extends Framework7Class {
|
|
|
677
597
|
} else if (value) {
|
|
678
598
|
self.initialValue = extend({}, value);
|
|
679
599
|
self.setValue(value, false);
|
|
680
|
-
}
|
|
681
|
-
|
|
600
|
+
}
|
|
682
601
|
|
|
602
|
+
// Update input value
|
|
683
603
|
if (updateValue) self.updateValue();
|
|
684
|
-
self.updateModules();
|
|
604
|
+
self.updateModules();
|
|
685
605
|
|
|
606
|
+
// Center modules
|
|
686
607
|
if (params.centerModules) {
|
|
687
608
|
self.centerModules();
|
|
688
|
-
}
|
|
689
|
-
|
|
609
|
+
}
|
|
690
610
|
|
|
611
|
+
// Extra focus
|
|
691
612
|
if (!inline && $inputEl && $inputEl.length && app.theme === 'md') {
|
|
692
613
|
$inputEl.trigger('focus');
|
|
693
614
|
}
|
|
615
|
+
self.initialized = true;
|
|
694
616
|
|
|
695
|
-
|
|
696
|
-
|
|
617
|
+
// Trigger events
|
|
697
618
|
if ($el) {
|
|
698
619
|
$el.trigger('colorpicker:open');
|
|
699
620
|
}
|
|
700
|
-
|
|
701
621
|
if ($inputEl) {
|
|
702
622
|
$inputEl.trigger('colorpicker:open');
|
|
703
623
|
}
|
|
704
|
-
|
|
705
624
|
self.emit('local::open colorPickerOpen', self);
|
|
706
625
|
}
|
|
707
|
-
|
|
708
626
|
onOpened() {
|
|
709
627
|
const self = this;
|
|
710
628
|
self.opening = false;
|
|
711
|
-
|
|
712
629
|
if (self.$el) {
|
|
713
630
|
self.$el.trigger('colorpicker:opened');
|
|
714
631
|
}
|
|
715
|
-
|
|
716
632
|
if (self.$inputEl) {
|
|
717
633
|
self.$inputEl.trigger('colorpicker:opened');
|
|
718
634
|
}
|
|
719
|
-
|
|
720
635
|
self.emit('local::opened colorPickerOpened', self);
|
|
721
636
|
}
|
|
722
|
-
|
|
723
637
|
onClose() {
|
|
724
638
|
const self = this;
|
|
725
639
|
const {
|
|
@@ -728,23 +642,21 @@ class ColorPicker extends Framework7Class {
|
|
|
728
642
|
modules
|
|
729
643
|
} = self;
|
|
730
644
|
self.opening = false;
|
|
731
|
-
self.closing = true;
|
|
645
|
+
self.closing = true;
|
|
732
646
|
|
|
647
|
+
// Detach events
|
|
733
648
|
self.detachEvents();
|
|
734
|
-
|
|
735
649
|
if (self.$inputEl) {
|
|
736
650
|
if (app.theme === 'md') {
|
|
737
651
|
self.$inputEl.trigger('blur');
|
|
738
652
|
} else {
|
|
739
653
|
const validate = self.$inputEl.attr('validate');
|
|
740
654
|
const required = self.$inputEl.attr('required');
|
|
741
|
-
|
|
742
655
|
if (validate && required) {
|
|
743
656
|
app.input.validate(self.$inputEl);
|
|
744
657
|
}
|
|
745
658
|
}
|
|
746
659
|
}
|
|
747
|
-
|
|
748
660
|
params.modules.forEach(m => {
|
|
749
661
|
if (typeof m === 'string' && modules[m] && modules[m].destroy) {
|
|
750
662
|
modules[m].destroy(self);
|
|
@@ -752,23 +664,18 @@ class ColorPicker extends Framework7Class {
|
|
|
752
664
|
m.destroy(self);
|
|
753
665
|
}
|
|
754
666
|
});
|
|
755
|
-
|
|
756
667
|
if (self.$el) {
|
|
757
668
|
self.$el.trigger('colorpicker:close');
|
|
758
669
|
}
|
|
759
|
-
|
|
760
670
|
if (self.$inputEl) {
|
|
761
671
|
self.$inputEl.trigger('colorpicker:close');
|
|
762
672
|
}
|
|
763
|
-
|
|
764
673
|
self.emit('local::close colorPickerClose', self);
|
|
765
674
|
}
|
|
766
|
-
|
|
767
675
|
onClosed() {
|
|
768
676
|
const self = this;
|
|
769
677
|
self.opened = false;
|
|
770
678
|
self.closing = false;
|
|
771
|
-
|
|
772
679
|
if (!self.inline) {
|
|
773
680
|
nextTick(() => {
|
|
774
681
|
if (self.modal && self.modal.el && self.modal.destroy) {
|
|
@@ -776,22 +683,17 @@ class ColorPicker extends Framework7Class {
|
|
|
776
683
|
self.modal.destroy();
|
|
777
684
|
}
|
|
778
685
|
}
|
|
779
|
-
|
|
780
686
|
delete self.modal;
|
|
781
687
|
});
|
|
782
688
|
}
|
|
783
|
-
|
|
784
689
|
if (self.$el) {
|
|
785
690
|
self.$el.trigger('colorpicker:closed');
|
|
786
691
|
}
|
|
787
|
-
|
|
788
692
|
if (self.$inputEl) {
|
|
789
693
|
self.$inputEl.trigger('colorpicker:closed');
|
|
790
694
|
}
|
|
791
|
-
|
|
792
695
|
self.emit('local::closed colorPickerClosed', self);
|
|
793
696
|
}
|
|
794
|
-
|
|
795
697
|
open() {
|
|
796
698
|
const self = this;
|
|
797
699
|
const {
|
|
@@ -803,7 +705,6 @@ class ColorPicker extends Framework7Class {
|
|
|
803
705
|
params
|
|
804
706
|
} = self;
|
|
805
707
|
if (opened) return;
|
|
806
|
-
|
|
807
708
|
if (inline) {
|
|
808
709
|
self.$el = $(self.render());
|
|
809
710
|
self.$el[0].f7ColorPicker = self;
|
|
@@ -812,9 +713,7 @@ class ColorPicker extends Framework7Class {
|
|
|
812
713
|
self.onOpened();
|
|
813
714
|
return;
|
|
814
715
|
}
|
|
815
|
-
|
|
816
716
|
const colorPickerContent = self.render();
|
|
817
|
-
|
|
818
717
|
if (params.openIn === 'page') {
|
|
819
718
|
self.view.router.navigate({
|
|
820
719
|
url: self.url,
|
|
@@ -827,36 +726,29 @@ class ColorPicker extends Framework7Class {
|
|
|
827
726
|
self.$el[0].f7ColorPicker = self;
|
|
828
727
|
self.onOpen();
|
|
829
728
|
},
|
|
830
|
-
|
|
831
729
|
pageAfterIn() {
|
|
832
730
|
self.onOpened();
|
|
833
731
|
},
|
|
834
|
-
|
|
835
732
|
pageBeforeOut() {
|
|
836
733
|
self.onClose();
|
|
837
734
|
},
|
|
838
|
-
|
|
839
735
|
pageAfterOut() {
|
|
840
736
|
self.onClosed();
|
|
841
|
-
|
|
842
737
|
if (self.$el && self.$el[0]) {
|
|
843
738
|
self.$el[0].f7ColorPicker = null;
|
|
844
739
|
delete self.$el[0].f7ColorPicker;
|
|
845
740
|
}
|
|
846
741
|
}
|
|
847
|
-
|
|
848
742
|
}
|
|
849
743
|
}
|
|
850
744
|
});
|
|
851
745
|
} else {
|
|
852
746
|
const modalType = self.getModalType();
|
|
853
747
|
let backdrop = params.backdrop;
|
|
854
|
-
|
|
855
748
|
if (backdrop === null || typeof backdrop === 'undefined') {
|
|
856
749
|
if (modalType === 'popover' && app.params.popover.backdrop !== false) backdrop = true;
|
|
857
750
|
if (modalType === 'popup') backdrop = true;
|
|
858
751
|
}
|
|
859
|
-
|
|
860
752
|
const modalParams = {
|
|
861
753
|
targetEl: $targetEl || $inputEl,
|
|
862
754
|
scrollToEl: params.scrollToInput ? $targetEl || $inputEl : undefined,
|
|
@@ -871,37 +763,29 @@ class ColorPicker extends Framework7Class {
|
|
|
871
763
|
self.$el[0].f7ColorPicker = self;
|
|
872
764
|
self.onOpen();
|
|
873
765
|
},
|
|
874
|
-
|
|
875
766
|
opened() {
|
|
876
767
|
self.onOpened();
|
|
877
768
|
},
|
|
878
|
-
|
|
879
769
|
close() {
|
|
880
770
|
self.onClose();
|
|
881
771
|
},
|
|
882
|
-
|
|
883
772
|
closed() {
|
|
884
773
|
self.onClosed();
|
|
885
|
-
|
|
886
774
|
if (self.$el && self.$el[0]) {
|
|
887
775
|
self.$el[0].f7ColorPicker = null;
|
|
888
776
|
delete self.$el[0].f7ColorPicker;
|
|
889
777
|
}
|
|
890
778
|
}
|
|
891
|
-
|
|
892
779
|
}
|
|
893
780
|
};
|
|
894
|
-
|
|
895
781
|
if (modalType === 'popup') {
|
|
896
782
|
modalParams.push = params.popupPush;
|
|
897
783
|
modalParams.swipeToClose = params.popupSwipeToClose;
|
|
898
784
|
}
|
|
899
|
-
|
|
900
785
|
if (modalType === 'sheet') {
|
|
901
786
|
modalParams.push = params.sheetPush;
|
|
902
787
|
modalParams.swipeToClose = params.sheetSwipeToClose;
|
|
903
788
|
}
|
|
904
|
-
|
|
905
789
|
if (params.routableModals && self.view) {
|
|
906
790
|
self.view.router.navigate({
|
|
907
791
|
url: self.url,
|
|
@@ -916,7 +800,6 @@ class ColorPicker extends Framework7Class {
|
|
|
916
800
|
}
|
|
917
801
|
}
|
|
918
802
|
}
|
|
919
|
-
|
|
920
803
|
close() {
|
|
921
804
|
const self = this;
|
|
922
805
|
const {
|
|
@@ -924,50 +807,41 @@ class ColorPicker extends Framework7Class {
|
|
|
924
807
|
inline
|
|
925
808
|
} = self;
|
|
926
809
|
if (!opened) return;
|
|
927
|
-
|
|
928
810
|
if (inline) {
|
|
929
811
|
self.onClose();
|
|
930
812
|
self.onClosed();
|
|
931
813
|
return;
|
|
932
814
|
}
|
|
933
|
-
|
|
934
815
|
if (self.params.routableModals && self.view || self.params.openIn === 'page') {
|
|
935
816
|
self.view.router.back();
|
|
936
817
|
} else {
|
|
937
818
|
self.modal.close();
|
|
938
819
|
}
|
|
939
820
|
}
|
|
940
|
-
|
|
941
821
|
init() {
|
|
942
822
|
const self = this;
|
|
943
823
|
self.initInput();
|
|
944
|
-
|
|
945
824
|
if (self.inline) {
|
|
946
825
|
self.open();
|
|
947
826
|
self.emit('local::init colorPickerInit', self);
|
|
948
827
|
return;
|
|
949
828
|
}
|
|
950
|
-
|
|
951
829
|
if (!self.initialized && self.params.value) {
|
|
952
830
|
self.setValue(self.params.value);
|
|
953
|
-
}
|
|
954
|
-
|
|
831
|
+
}
|
|
955
832
|
|
|
833
|
+
// Attach input Events
|
|
956
834
|
if (self.$inputEl) {
|
|
957
835
|
self.attachInputEvents();
|
|
958
836
|
}
|
|
959
|
-
|
|
960
837
|
if (self.$targetEl) {
|
|
961
838
|
self.attachTargetEvents();
|
|
962
839
|
}
|
|
963
|
-
|
|
964
840
|
if (self.params.closeByOutsideClick) {
|
|
965
841
|
self.attachHtmlEvents();
|
|
966
842
|
}
|
|
967
|
-
|
|
968
843
|
self.emit('local::init colorPickerInit', self);
|
|
969
844
|
}
|
|
970
|
-
|
|
971
845
|
destroy() {
|
|
972
846
|
const self = this;
|
|
973
847
|
if (self.destroyed) return;
|
|
@@ -976,27 +850,22 @@ class ColorPicker extends Framework7Class {
|
|
|
976
850
|
} = self;
|
|
977
851
|
self.emit('local::beforeDestroy colorPickerBeforeDestroy', self);
|
|
978
852
|
if ($el) $el.trigger('colorpicker:beforedestroy');
|
|
979
|
-
self.close();
|
|
853
|
+
self.close();
|
|
980
854
|
|
|
855
|
+
// Detach Events
|
|
981
856
|
self.detachEvents();
|
|
982
|
-
|
|
983
857
|
if (self.$inputEl) {
|
|
984
858
|
self.detachInputEvents();
|
|
985
859
|
}
|
|
986
|
-
|
|
987
860
|
if (self.$targetEl) {
|
|
988
861
|
self.detachTargetEvents();
|
|
989
862
|
}
|
|
990
|
-
|
|
991
863
|
if (self.params.closeByOutsideClick) {
|
|
992
864
|
self.detachHtmlEvents();
|
|
993
865
|
}
|
|
994
|
-
|
|
995
866
|
if ($el && $el.length) delete self.$el[0].f7ColorPicker;
|
|
996
867
|
deleteProps(self);
|
|
997
868
|
self.destroyed = true;
|
|
998
869
|
}
|
|
999
|
-
|
|
1000
870
|
}
|
|
1001
|
-
|
|
1002
871
|
export default ColorPicker;
|