@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,871 @@
|
|
|
1
|
+
import { extend, colorRgbToHex, colorRgbToHsl, colorHslToHsb, colorHslToRgb, colorHsbToHsl, colorHexToRgb, nextTick, deleteProps } from '../../shared/utils.js';
|
|
2
|
+
import Framework7Class from '../../shared/class.js';
|
|
3
|
+
import $ from '../../shared/dom7.js';
|
|
4
|
+
import { getDevice } from '../../shared/get-device.js';
|
|
5
|
+
import moduleAlphaSlider from './modules/alpha-slider.js';
|
|
6
|
+
import moduleCurrentColor from './modules/current-color.js';
|
|
7
|
+
import moduleHex from './modules/hex.js';
|
|
8
|
+
import moduleHsbSliders from './modules/hsb-sliders.js';
|
|
9
|
+
import moduleHueSlider from './modules/hue-slider.js';
|
|
10
|
+
import moduleBrightnessSlider from './modules/brightness-slider.js';
|
|
11
|
+
import modulePalette from './modules/palette.js';
|
|
12
|
+
import moduleInitialCurrentColors from './modules/initial-current-colors.js';
|
|
13
|
+
import moduleRgbBars from './modules/rgb-bars.js';
|
|
14
|
+
import moduleRgbSliders from './modules/rgb-sliders.js';
|
|
15
|
+
import moduleSbSpectrum from './modules/sb-spectrum.js';
|
|
16
|
+
import moduleHsSpectrum from './modules/hs-spectrum.js';
|
|
17
|
+
import moduleWheel from './modules/wheel.js';
|
|
18
|
+
|
|
19
|
+
/** @jsx $jsx */
|
|
20
|
+
import $jsx from '../../shared/$jsx.js';
|
|
21
|
+
class ColorPicker extends Framework7Class {
|
|
22
|
+
constructor(app, params) {
|
|
23
|
+
if (params === void 0) {
|
|
24
|
+
params = {};
|
|
25
|
+
}
|
|
26
|
+
super(params, [app]);
|
|
27
|
+
const self = this;
|
|
28
|
+
self.params = extend({}, app.params.colorPicker, params);
|
|
29
|
+
let $containerEl;
|
|
30
|
+
if (self.params.containerEl) {
|
|
31
|
+
$containerEl = $(self.params.containerEl);
|
|
32
|
+
if ($containerEl.length === 0) return self;
|
|
33
|
+
}
|
|
34
|
+
let $inputEl;
|
|
35
|
+
if (self.params.inputEl) {
|
|
36
|
+
$inputEl = $(self.params.inputEl);
|
|
37
|
+
}
|
|
38
|
+
let $targetEl;
|
|
39
|
+
if (self.params.targetEl) {
|
|
40
|
+
$targetEl = $(self.params.targetEl);
|
|
41
|
+
}
|
|
42
|
+
extend(self, {
|
|
43
|
+
app,
|
|
44
|
+
$containerEl,
|
|
45
|
+
containerEl: $containerEl && $containerEl[0],
|
|
46
|
+
inline: $containerEl && $containerEl.length > 0,
|
|
47
|
+
$inputEl,
|
|
48
|
+
inputEl: $inputEl && $inputEl[0],
|
|
49
|
+
$targetEl,
|
|
50
|
+
targetEl: $targetEl && $targetEl[0],
|
|
51
|
+
initialized: false,
|
|
52
|
+
opened: false,
|
|
53
|
+
url: self.params.url,
|
|
54
|
+
modules: {
|
|
55
|
+
'alpha-slider': moduleAlphaSlider,
|
|
56
|
+
'current-color': moduleCurrentColor,
|
|
57
|
+
hex: moduleHex,
|
|
58
|
+
// eslint-disable-line
|
|
59
|
+
'hsb-sliders': moduleHsbSliders,
|
|
60
|
+
'hue-slider': moduleHueSlider,
|
|
61
|
+
'brightness-slider': moduleBrightnessSlider,
|
|
62
|
+
palette: modulePalette,
|
|
63
|
+
// eslint-disable-line
|
|
64
|
+
'initial-current-colors': moduleInitialCurrentColors,
|
|
65
|
+
'rgb-bars': moduleRgbBars,
|
|
66
|
+
'rgb-sliders': moduleRgbSliders,
|
|
67
|
+
'sb-spectrum': moduleSbSpectrum,
|
|
68
|
+
'hs-spectrum': moduleHsSpectrum,
|
|
69
|
+
wheel: moduleWheel // eslint-disable-line
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
function onInputClick() {
|
|
74
|
+
self.open();
|
|
75
|
+
}
|
|
76
|
+
function onInputFocus(e) {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
}
|
|
79
|
+
function onTargetClick() {
|
|
80
|
+
self.open();
|
|
81
|
+
}
|
|
82
|
+
function onHtmlClick(e) {
|
|
83
|
+
if (self.destroyed || !self.params) return;
|
|
84
|
+
if (self.params.openIn === 'page') return;
|
|
85
|
+
const $clickTargetEl = $(e.target);
|
|
86
|
+
if (!self.opened || self.closing) return;
|
|
87
|
+
if ($clickTargetEl.closest('[class*="backdrop"]').length) return;
|
|
88
|
+
if ($clickTargetEl.closest('.color-picker-popup, .color-picker-popover').length) return;
|
|
89
|
+
if ($inputEl && $inputEl.length > 0) {
|
|
90
|
+
if ($clickTargetEl[0] !== $inputEl[0] && $clickTargetEl.closest('.sheet-modal').length === 0) {
|
|
91
|
+
self.close();
|
|
92
|
+
}
|
|
93
|
+
} else if ($(e.target).closest('.sheet-modal').length === 0) {
|
|
94
|
+
self.close();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Events
|
|
99
|
+
extend(self, {
|
|
100
|
+
attachInputEvents() {
|
|
101
|
+
self.$inputEl.on('click', onInputClick);
|
|
102
|
+
if (self.params.inputReadOnly) {
|
|
103
|
+
self.$inputEl.on('focus mousedown', onInputFocus);
|
|
104
|
+
if (self.$inputEl[0]) {
|
|
105
|
+
self.$inputEl[0].f7ValidateReadonly = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
detachInputEvents() {
|
|
110
|
+
self.$inputEl.off('click', onInputClick);
|
|
111
|
+
if (self.params.inputReadOnly) {
|
|
112
|
+
self.$inputEl.off('focus mousedown', onInputFocus);
|
|
113
|
+
if (self.$inputEl[0]) {
|
|
114
|
+
delete self.$inputEl[0].f7ValidateReadonly;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
attachTargetEvents() {
|
|
119
|
+
self.$targetEl.on('click', onTargetClick);
|
|
120
|
+
},
|
|
121
|
+
detachTargetEvents() {
|
|
122
|
+
self.$targetEl.off('click', onTargetClick);
|
|
123
|
+
},
|
|
124
|
+
attachHtmlEvents() {
|
|
125
|
+
app.on('click', onHtmlClick);
|
|
126
|
+
},
|
|
127
|
+
detachHtmlEvents() {
|
|
128
|
+
app.off('click', onHtmlClick);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
self.init();
|
|
132
|
+
return self;
|
|
133
|
+
}
|
|
134
|
+
get view() {
|
|
135
|
+
const {
|
|
136
|
+
$inputEl,
|
|
137
|
+
$targetEl,
|
|
138
|
+
app,
|
|
139
|
+
params
|
|
140
|
+
} = this;
|
|
141
|
+
let view;
|
|
142
|
+
if (params.view) {
|
|
143
|
+
view = params.view;
|
|
144
|
+
} else {
|
|
145
|
+
if ($inputEl) {
|
|
146
|
+
view = $inputEl.parents('.view').length && $inputEl.parents('.view')[0].f7View;
|
|
147
|
+
}
|
|
148
|
+
if (!view && $targetEl) {
|
|
149
|
+
view = $targetEl.parents('.view').length && $targetEl.parents('.view')[0].f7View;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (!view) view = app.views.main;
|
|
153
|
+
return view;
|
|
154
|
+
}
|
|
155
|
+
attachEvents() {
|
|
156
|
+
const self = this;
|
|
157
|
+
self.centerModules = self.centerModules.bind(self);
|
|
158
|
+
if (self.params.centerModules) {
|
|
159
|
+
self.app.on('resize', self.centerModules);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
detachEvents() {
|
|
163
|
+
const self = this;
|
|
164
|
+
if (self.params.centerModules) {
|
|
165
|
+
self.app.off('resize', self.centerModules);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
centerModules() {
|
|
169
|
+
const self = this;
|
|
170
|
+
if (!self.opened || !self.$el || self.inline) return;
|
|
171
|
+
const $pageContentEl = self.$el.find('.page-content');
|
|
172
|
+
if (!$pageContentEl.length) return;
|
|
173
|
+
const {
|
|
174
|
+
scrollHeight,
|
|
175
|
+
offsetHeight
|
|
176
|
+
} = $pageContentEl[0];
|
|
177
|
+
if (scrollHeight <= offsetHeight) {
|
|
178
|
+
$pageContentEl.addClass('justify-content-center');
|
|
179
|
+
} else {
|
|
180
|
+
$pageContentEl.removeClass('justify-content-center');
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
initInput() {
|
|
184
|
+
const self = this;
|
|
185
|
+
if (!self.$inputEl) return;
|
|
186
|
+
if (self.params.inputReadOnly) self.$inputEl.prop('readOnly', true);
|
|
187
|
+
}
|
|
188
|
+
getModalType() {
|
|
189
|
+
const self = this;
|
|
190
|
+
const {
|
|
191
|
+
app,
|
|
192
|
+
modal,
|
|
193
|
+
params
|
|
194
|
+
} = self;
|
|
195
|
+
const {
|
|
196
|
+
openIn,
|
|
197
|
+
openInPhone
|
|
198
|
+
} = params;
|
|
199
|
+
const device = getDevice();
|
|
200
|
+
if (modal && modal.type) return modal.type;
|
|
201
|
+
if (openIn !== 'auto') return openIn;
|
|
202
|
+
if (self.inline) return null;
|
|
203
|
+
if (device.ios) {
|
|
204
|
+
return device.ipad ? 'popover' : openInPhone;
|
|
205
|
+
}
|
|
206
|
+
if (app.width >= 768) {
|
|
207
|
+
return 'popover';
|
|
208
|
+
}
|
|
209
|
+
return openInPhone;
|
|
210
|
+
}
|
|
211
|
+
formatValue() {
|
|
212
|
+
const self = this;
|
|
213
|
+
const {
|
|
214
|
+
value
|
|
215
|
+
} = self;
|
|
216
|
+
if (self.params.formatValue) {
|
|
217
|
+
return self.params.formatValue.call(self, value);
|
|
218
|
+
}
|
|
219
|
+
return value.hex;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// eslint-disable-next-line
|
|
223
|
+
normalizeHsValues(arr) {
|
|
224
|
+
return [Math.floor(arr[0] * 10) / 10, Math.floor(arr[1] * 1000) / 1000, Math.floor(arr[2] * 1000) / 1000];
|
|
225
|
+
}
|
|
226
|
+
setValue(value, updateModules) {
|
|
227
|
+
if (value === void 0) {
|
|
228
|
+
value = {};
|
|
229
|
+
}
|
|
230
|
+
if (updateModules === void 0) {
|
|
231
|
+
updateModules = true;
|
|
232
|
+
}
|
|
233
|
+
const self = this;
|
|
234
|
+
if (typeof value === 'undefined') return;
|
|
235
|
+
let {
|
|
236
|
+
hex,
|
|
237
|
+
rgb,
|
|
238
|
+
hsl,
|
|
239
|
+
hsb,
|
|
240
|
+
alpha = 1,
|
|
241
|
+
hue,
|
|
242
|
+
rgba,
|
|
243
|
+
hsla
|
|
244
|
+
} = self.value || {};
|
|
245
|
+
const needChangeEvent = self.value || !self.value && !self.params.value;
|
|
246
|
+
let valueChanged;
|
|
247
|
+
Object.keys(value).forEach(k => {
|
|
248
|
+
if (!self.value || typeof self.value[k] === 'undefined') {
|
|
249
|
+
valueChanged = true;
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const v = value[k];
|
|
253
|
+
if (Array.isArray(v)) {
|
|
254
|
+
v.forEach((subV, subIndex) => {
|
|
255
|
+
if (subV !== self.value[k][subIndex]) {
|
|
256
|
+
valueChanged = true;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
} else if (v !== self.value[k]) {
|
|
260
|
+
valueChanged = true;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
if (!valueChanged) return;
|
|
264
|
+
if (value.rgb || value.rgba) {
|
|
265
|
+
const [r, g, b, a = alpha] = value.rgb || value.rgba;
|
|
266
|
+
rgb = [r, g, b];
|
|
267
|
+
hex = colorRgbToHex(...rgb);
|
|
268
|
+
hsl = colorRgbToHsl(...rgb);
|
|
269
|
+
hsb = colorHslToHsb(...hsl);
|
|
270
|
+
hsl = self.normalizeHsValues(hsl);
|
|
271
|
+
hsb = self.normalizeHsValues(hsb);
|
|
272
|
+
hue = hsb[0];
|
|
273
|
+
alpha = a;
|
|
274
|
+
rgba = [rgb[0], rgb[1], rgb[2], a];
|
|
275
|
+
hsla = [hsl[0], hsl[1], hsl[2], a];
|
|
276
|
+
}
|
|
277
|
+
if (value.hsl || value.hsla) {
|
|
278
|
+
const [h, s, l, a = alpha] = value.hsl || value.hsla;
|
|
279
|
+
hsl = [h, s, l];
|
|
280
|
+
rgb = colorHslToRgb(...hsl);
|
|
281
|
+
hex = colorRgbToHex(...rgb);
|
|
282
|
+
hsb = colorHslToHsb(...hsl);
|
|
283
|
+
hsl = self.normalizeHsValues(hsl);
|
|
284
|
+
hsb = self.normalizeHsValues(hsb);
|
|
285
|
+
hue = hsb[0];
|
|
286
|
+
alpha = a;
|
|
287
|
+
rgba = [rgb[0], rgb[1], rgb[2], a];
|
|
288
|
+
hsla = [hsl[0], hsl[1], hsl[2], a];
|
|
289
|
+
}
|
|
290
|
+
if (value.hsb) {
|
|
291
|
+
const [h, s, b, a = alpha] = value.hsb;
|
|
292
|
+
hsb = [h, s, b];
|
|
293
|
+
hsl = colorHsbToHsl(...hsb);
|
|
294
|
+
rgb = colorHslToRgb(...hsl);
|
|
295
|
+
hex = colorRgbToHex(...rgb);
|
|
296
|
+
hsl = self.normalizeHsValues(hsl);
|
|
297
|
+
hsb = self.normalizeHsValues(hsb);
|
|
298
|
+
hue = hsb[0];
|
|
299
|
+
alpha = a;
|
|
300
|
+
rgba = [rgb[0], rgb[1], rgb[2], a];
|
|
301
|
+
hsla = [hsl[0], hsl[1], hsl[2], a];
|
|
302
|
+
}
|
|
303
|
+
if (value.hex) {
|
|
304
|
+
rgb = colorHexToRgb(value.hex);
|
|
305
|
+
hex = colorRgbToHex(...rgb);
|
|
306
|
+
hsl = colorRgbToHsl(...rgb);
|
|
307
|
+
hsb = colorHslToHsb(...hsl);
|
|
308
|
+
hsl = self.normalizeHsValues(hsl);
|
|
309
|
+
hsb = self.normalizeHsValues(hsb);
|
|
310
|
+
hue = hsb[0];
|
|
311
|
+
rgba = [rgb[0], rgb[1], rgb[2], alpha];
|
|
312
|
+
hsla = [hsl[0], hsl[1], hsl[2], alpha];
|
|
313
|
+
}
|
|
314
|
+
if (typeof value.alpha !== 'undefined') {
|
|
315
|
+
alpha = value.alpha;
|
|
316
|
+
if (typeof rgb !== 'undefined') {
|
|
317
|
+
rgba = [rgb[0], rgb[1], rgb[2], alpha];
|
|
318
|
+
}
|
|
319
|
+
if (typeof hsl !== 'undefined') {
|
|
320
|
+
hsla = [hsl[0], hsl[1], hsl[2], alpha];
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (typeof value.hue !== 'undefined') {
|
|
324
|
+
const [h, s, l] = hsl; // eslint-disable-line
|
|
325
|
+
hsl = [value.hue, s, l];
|
|
326
|
+
hsb = colorHslToHsb(...hsl);
|
|
327
|
+
rgb = colorHslToRgb(...hsl);
|
|
328
|
+
hex = colorRgbToHex(...rgb);
|
|
329
|
+
hsl = self.normalizeHsValues(hsl);
|
|
330
|
+
hsb = self.normalizeHsValues(hsb);
|
|
331
|
+
hue = hsb[0];
|
|
332
|
+
rgba = [rgb[0], rgb[1], rgb[2], alpha];
|
|
333
|
+
hsla = [hsl[0], hsl[1], hsl[2], alpha];
|
|
334
|
+
}
|
|
335
|
+
self.value = {
|
|
336
|
+
hex,
|
|
337
|
+
alpha,
|
|
338
|
+
hue,
|
|
339
|
+
rgb,
|
|
340
|
+
hsl,
|
|
341
|
+
hsb,
|
|
342
|
+
rgba,
|
|
343
|
+
hsla
|
|
344
|
+
};
|
|
345
|
+
if (!self.initialValue) self.initialValue = extend({}, self.value);
|
|
346
|
+
self.updateValue(needChangeEvent);
|
|
347
|
+
if (self.opened && updateModules) {
|
|
348
|
+
self.updateModules();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
getValue() {
|
|
352
|
+
const self = this;
|
|
353
|
+
return self.value;
|
|
354
|
+
}
|
|
355
|
+
updateValue(fireEvents) {
|
|
356
|
+
if (fireEvents === void 0) {
|
|
357
|
+
fireEvents = true;
|
|
358
|
+
}
|
|
359
|
+
const self = this;
|
|
360
|
+
const {
|
|
361
|
+
$inputEl,
|
|
362
|
+
value,
|
|
363
|
+
$targetEl
|
|
364
|
+
} = self;
|
|
365
|
+
if ($targetEl && self.params.targetElSetBackgroundColor) {
|
|
366
|
+
const {
|
|
367
|
+
rgba
|
|
368
|
+
} = value;
|
|
369
|
+
$targetEl.css('background-color', `rgba(${rgba.join(', ')})`);
|
|
370
|
+
}
|
|
371
|
+
if (fireEvents) {
|
|
372
|
+
self.emit('local::change colorPickerChange', self, value);
|
|
373
|
+
}
|
|
374
|
+
if ($inputEl && $inputEl.length) {
|
|
375
|
+
const inputValue = self.formatValue(value);
|
|
376
|
+
if ($inputEl && $inputEl.length) {
|
|
377
|
+
$inputEl.val(inputValue);
|
|
378
|
+
if (fireEvents) {
|
|
379
|
+
$inputEl.trigger('change');
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
updateModules() {
|
|
385
|
+
const self = this;
|
|
386
|
+
const {
|
|
387
|
+
modules
|
|
388
|
+
} = self;
|
|
389
|
+
self.params.modules.forEach(m => {
|
|
390
|
+
if (typeof m === 'string' && modules[m] && modules[m].update) {
|
|
391
|
+
modules[m].update(self);
|
|
392
|
+
} else if (m && m.update) {
|
|
393
|
+
m.update(self);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
update() {
|
|
398
|
+
const self = this;
|
|
399
|
+
self.updateModules();
|
|
400
|
+
}
|
|
401
|
+
renderPicker() {
|
|
402
|
+
const self = this;
|
|
403
|
+
const {
|
|
404
|
+
params,
|
|
405
|
+
modules
|
|
406
|
+
} = self;
|
|
407
|
+
let html = '';
|
|
408
|
+
params.modules.forEach(m => {
|
|
409
|
+
if (typeof m === 'string' && modules[m] && modules[m].render) {
|
|
410
|
+
html += modules[m].render(self);
|
|
411
|
+
} else if (m && m.render) {
|
|
412
|
+
html += m.render(self);
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
return html;
|
|
416
|
+
}
|
|
417
|
+
renderNavbar() {
|
|
418
|
+
const self = this;
|
|
419
|
+
if (self.params.renderNavbar) {
|
|
420
|
+
return self.params.renderNavbar.call(self, self);
|
|
421
|
+
}
|
|
422
|
+
const {
|
|
423
|
+
openIn,
|
|
424
|
+
navbarTitleText,
|
|
425
|
+
navbarBackLinkText,
|
|
426
|
+
navbarCloseText
|
|
427
|
+
} = self.params;
|
|
428
|
+
return $jsx("div", {
|
|
429
|
+
class: "navbar"
|
|
430
|
+
}, $jsx("div", {
|
|
431
|
+
class: "navbar-bg"
|
|
432
|
+
}), $jsx("div", {
|
|
433
|
+
class: "navbar-inner sliding"
|
|
434
|
+
}, openIn === 'page' && $jsx("div", {
|
|
435
|
+
class: "left"
|
|
436
|
+
}, $jsx("a", {
|
|
437
|
+
class: "link back"
|
|
438
|
+
}, $jsx("i", {
|
|
439
|
+
class: "icon icon-back"
|
|
440
|
+
}), $jsx("span", {
|
|
441
|
+
class: "if-not-md"
|
|
442
|
+
}, navbarBackLinkText))), $jsx("div", {
|
|
443
|
+
class: "title"
|
|
444
|
+
}, navbarTitleText), openIn !== 'page' && $jsx("div", {
|
|
445
|
+
class: "right"
|
|
446
|
+
}, $jsx("a", {
|
|
447
|
+
class: "link popup-close",
|
|
448
|
+
"data-popup": ".color-picker-popup"
|
|
449
|
+
}, navbarCloseText))));
|
|
450
|
+
}
|
|
451
|
+
renderToolbar() {
|
|
452
|
+
const self = this;
|
|
453
|
+
if (self.params.renderToolbar) {
|
|
454
|
+
return self.params.renderToolbar.call(self, self);
|
|
455
|
+
}
|
|
456
|
+
return $jsx("div", {
|
|
457
|
+
class: "toolbar toolbar-top"
|
|
458
|
+
}, $jsx("div", {
|
|
459
|
+
class: "toolbar-inner"
|
|
460
|
+
}, $jsx("div", {
|
|
461
|
+
class: "left"
|
|
462
|
+
}), $jsx("div", {
|
|
463
|
+
class: "right"
|
|
464
|
+
}, $jsx("a", {
|
|
465
|
+
class: "link sheet-close popover-close",
|
|
466
|
+
"data-sheet": ".color-picker-sheet-modal",
|
|
467
|
+
"data-popover": ".color-picker-popover"
|
|
468
|
+
}, self.params.toolbarCloseText))));
|
|
469
|
+
}
|
|
470
|
+
renderInline() {
|
|
471
|
+
const self = this;
|
|
472
|
+
const {
|
|
473
|
+
cssClass,
|
|
474
|
+
groupedModules
|
|
475
|
+
} = self.params;
|
|
476
|
+
return $jsx("div", {
|
|
477
|
+
class: `color-picker color-picker-inline ${groupedModules ? 'color-picker-grouped-modules' : ''} ${cssClass || ''}`
|
|
478
|
+
}, self.renderPicker());
|
|
479
|
+
}
|
|
480
|
+
renderSheet() {
|
|
481
|
+
const self = this;
|
|
482
|
+
const {
|
|
483
|
+
cssClass,
|
|
484
|
+
toolbarSheet,
|
|
485
|
+
groupedModules
|
|
486
|
+
} = self.params;
|
|
487
|
+
return $jsx("div", {
|
|
488
|
+
class: `sheet-modal color-picker color-picker-sheet-modal ${groupedModules ? 'color-picker-grouped-modules' : ''} ${cssClass || ''}`
|
|
489
|
+
}, toolbarSheet && self.renderToolbar(), $jsx("div", {
|
|
490
|
+
class: "sheet-modal-inner"
|
|
491
|
+
}, $jsx("div", {
|
|
492
|
+
class: "page-content"
|
|
493
|
+
}, self.renderPicker())));
|
|
494
|
+
}
|
|
495
|
+
renderPopover() {
|
|
496
|
+
const self = this;
|
|
497
|
+
const {
|
|
498
|
+
cssClass,
|
|
499
|
+
toolbarPopover,
|
|
500
|
+
groupedModules
|
|
501
|
+
} = self.params;
|
|
502
|
+
return $jsx("div", {
|
|
503
|
+
class: `popover color-picker-popover ${cssClass || ''}`
|
|
504
|
+
}, $jsx("div", {
|
|
505
|
+
class: "popover-inner"
|
|
506
|
+
}, $jsx("div", {
|
|
507
|
+
class: `color-picker ${groupedModules ? 'color-picker-grouped-modules' : ''}`
|
|
508
|
+
}, toolbarPopover && self.renderToolbar(), $jsx("div", {
|
|
509
|
+
class: "page-content"
|
|
510
|
+
}, self.renderPicker()))));
|
|
511
|
+
}
|
|
512
|
+
renderPopup() {
|
|
513
|
+
const self = this;
|
|
514
|
+
const {
|
|
515
|
+
cssClass,
|
|
516
|
+
navbarPopup,
|
|
517
|
+
groupedModules
|
|
518
|
+
} = self.params;
|
|
519
|
+
return $jsx("div", {
|
|
520
|
+
class: `popup color-picker-popup ${cssClass || ''}`
|
|
521
|
+
}, $jsx("div", {
|
|
522
|
+
class: "page"
|
|
523
|
+
}, navbarPopup && self.renderNavbar(), $jsx("div", {
|
|
524
|
+
class: `color-picker ${groupedModules ? 'color-picker-grouped-modules' : ''}`
|
|
525
|
+
}, $jsx("div", {
|
|
526
|
+
class: "page-content"
|
|
527
|
+
}, self.renderPicker()))));
|
|
528
|
+
}
|
|
529
|
+
renderPage() {
|
|
530
|
+
const self = this;
|
|
531
|
+
const {
|
|
532
|
+
cssClass,
|
|
533
|
+
groupedModules
|
|
534
|
+
} = self.params;
|
|
535
|
+
return $jsx("div", {
|
|
536
|
+
class: `page color-picker-page ${cssClass || ''}`,
|
|
537
|
+
"data-name": "color-picker-page"
|
|
538
|
+
}, self.renderNavbar(), $jsx("div", {
|
|
539
|
+
class: `color-picker ${groupedModules ? 'color-picker-grouped-modules' : ''}`
|
|
540
|
+
}, $jsx("div", {
|
|
541
|
+
class: "page-content"
|
|
542
|
+
}, self.renderPicker())));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// eslint-disable-next-line
|
|
546
|
+
render() {
|
|
547
|
+
const self = this;
|
|
548
|
+
const {
|
|
549
|
+
params
|
|
550
|
+
} = self;
|
|
551
|
+
if (params.render) return params.render.call(self);
|
|
552
|
+
if (self.inline) return self.renderInline();
|
|
553
|
+
if (params.openIn === 'page') {
|
|
554
|
+
return self.renderPage();
|
|
555
|
+
}
|
|
556
|
+
const modalType = self.getModalType();
|
|
557
|
+
if (modalType === 'popover') return self.renderPopover();
|
|
558
|
+
if (modalType === 'sheet') return self.renderSheet();
|
|
559
|
+
if (modalType === 'popup') return self.renderPopup();
|
|
560
|
+
}
|
|
561
|
+
onOpen() {
|
|
562
|
+
const self = this;
|
|
563
|
+
const {
|
|
564
|
+
initialized,
|
|
565
|
+
$el,
|
|
566
|
+
app,
|
|
567
|
+
$inputEl,
|
|
568
|
+
inline,
|
|
569
|
+
value,
|
|
570
|
+
params,
|
|
571
|
+
modules
|
|
572
|
+
} = self;
|
|
573
|
+
self.closing = false;
|
|
574
|
+
self.opened = true;
|
|
575
|
+
self.opening = true;
|
|
576
|
+
|
|
577
|
+
// Init main events
|
|
578
|
+
self.attachEvents();
|
|
579
|
+
params.modules.forEach(m => {
|
|
580
|
+
if (typeof m === 'string' && modules[m] && modules[m].init) {
|
|
581
|
+
modules[m].init(self);
|
|
582
|
+
} else if (m && m.init) {
|
|
583
|
+
m.init(self);
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
const updateValue = !value && params.value;
|
|
587
|
+
|
|
588
|
+
// Set value
|
|
589
|
+
if (!initialized) {
|
|
590
|
+
if (value) self.setValue(value);else if (params.value) {
|
|
591
|
+
self.setValue(params.value, false);
|
|
592
|
+
} else if (!params.value) {
|
|
593
|
+
self.setValue({
|
|
594
|
+
hex: '#ff0000'
|
|
595
|
+
}, false);
|
|
596
|
+
}
|
|
597
|
+
} else if (value) {
|
|
598
|
+
self.initialValue = extend({}, value);
|
|
599
|
+
self.setValue(value, false);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// Update input value
|
|
603
|
+
if (updateValue) self.updateValue();
|
|
604
|
+
self.updateModules();
|
|
605
|
+
|
|
606
|
+
// Center modules
|
|
607
|
+
if (params.centerModules) {
|
|
608
|
+
self.centerModules();
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// Extra focus
|
|
612
|
+
if (!inline && $inputEl && $inputEl.length && app.theme === 'md') {
|
|
613
|
+
$inputEl.trigger('focus');
|
|
614
|
+
}
|
|
615
|
+
self.initialized = true;
|
|
616
|
+
|
|
617
|
+
// Trigger events
|
|
618
|
+
if ($el) {
|
|
619
|
+
$el.trigger('colorpicker:open');
|
|
620
|
+
}
|
|
621
|
+
if ($inputEl) {
|
|
622
|
+
$inputEl.trigger('colorpicker:open');
|
|
623
|
+
}
|
|
624
|
+
self.emit('local::open colorPickerOpen', self);
|
|
625
|
+
}
|
|
626
|
+
onOpened() {
|
|
627
|
+
const self = this;
|
|
628
|
+
self.opening = false;
|
|
629
|
+
if (self.$el) {
|
|
630
|
+
self.$el.trigger('colorpicker:opened');
|
|
631
|
+
}
|
|
632
|
+
if (self.$inputEl) {
|
|
633
|
+
self.$inputEl.trigger('colorpicker:opened');
|
|
634
|
+
}
|
|
635
|
+
self.emit('local::opened colorPickerOpened', self);
|
|
636
|
+
}
|
|
637
|
+
onClose() {
|
|
638
|
+
const self = this;
|
|
639
|
+
const {
|
|
640
|
+
app,
|
|
641
|
+
params,
|
|
642
|
+
modules
|
|
643
|
+
} = self;
|
|
644
|
+
self.opening = false;
|
|
645
|
+
self.closing = true;
|
|
646
|
+
|
|
647
|
+
// Detach events
|
|
648
|
+
self.detachEvents();
|
|
649
|
+
if (self.$inputEl) {
|
|
650
|
+
if (app.theme === 'md') {
|
|
651
|
+
self.$inputEl.trigger('blur');
|
|
652
|
+
} else {
|
|
653
|
+
const validate = self.$inputEl.attr('validate');
|
|
654
|
+
const required = self.$inputEl.attr('required');
|
|
655
|
+
if (validate && required) {
|
|
656
|
+
app.input.validate(self.$inputEl);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
params.modules.forEach(m => {
|
|
661
|
+
if (typeof m === 'string' && modules[m] && modules[m].destroy) {
|
|
662
|
+
modules[m].destroy(self);
|
|
663
|
+
} else if (m && m.destroy) {
|
|
664
|
+
m.destroy(self);
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
if (self.$el) {
|
|
668
|
+
self.$el.trigger('colorpicker:close');
|
|
669
|
+
}
|
|
670
|
+
if (self.$inputEl) {
|
|
671
|
+
self.$inputEl.trigger('colorpicker:close');
|
|
672
|
+
}
|
|
673
|
+
self.emit('local::close colorPickerClose', self);
|
|
674
|
+
}
|
|
675
|
+
onClosed() {
|
|
676
|
+
const self = this;
|
|
677
|
+
self.opened = false;
|
|
678
|
+
self.closing = false;
|
|
679
|
+
if (!self.inline) {
|
|
680
|
+
nextTick(() => {
|
|
681
|
+
if (self.modal && self.modal.el && self.modal.destroy) {
|
|
682
|
+
if (!self.params.routableModals) {
|
|
683
|
+
self.modal.destroy();
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
delete self.modal;
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
if (self.$el) {
|
|
690
|
+
self.$el.trigger('colorpicker:closed');
|
|
691
|
+
}
|
|
692
|
+
if (self.$inputEl) {
|
|
693
|
+
self.$inputEl.trigger('colorpicker:closed');
|
|
694
|
+
}
|
|
695
|
+
self.emit('local::closed colorPickerClosed', self);
|
|
696
|
+
}
|
|
697
|
+
open() {
|
|
698
|
+
const self = this;
|
|
699
|
+
const {
|
|
700
|
+
app,
|
|
701
|
+
opened,
|
|
702
|
+
inline,
|
|
703
|
+
$inputEl,
|
|
704
|
+
$targetEl,
|
|
705
|
+
params
|
|
706
|
+
} = self;
|
|
707
|
+
if (opened) return;
|
|
708
|
+
if (inline) {
|
|
709
|
+
self.$el = $(self.render());
|
|
710
|
+
self.$el[0].f7ColorPicker = self;
|
|
711
|
+
self.$containerEl.append(self.$el);
|
|
712
|
+
self.onOpen();
|
|
713
|
+
self.onOpened();
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const colorPickerContent = self.render();
|
|
717
|
+
if (params.openIn === 'page') {
|
|
718
|
+
self.view.router.navigate({
|
|
719
|
+
url: self.url,
|
|
720
|
+
route: {
|
|
721
|
+
content: colorPickerContent,
|
|
722
|
+
path: self.url,
|
|
723
|
+
on: {
|
|
724
|
+
pageBeforeIn(e, page) {
|
|
725
|
+
self.$el = page.$el.find('.color-picker');
|
|
726
|
+
self.$el[0].f7ColorPicker = self;
|
|
727
|
+
self.onOpen();
|
|
728
|
+
},
|
|
729
|
+
pageAfterIn() {
|
|
730
|
+
self.onOpened();
|
|
731
|
+
},
|
|
732
|
+
pageBeforeOut() {
|
|
733
|
+
self.onClose();
|
|
734
|
+
},
|
|
735
|
+
pageAfterOut() {
|
|
736
|
+
self.onClosed();
|
|
737
|
+
if (self.$el && self.$el[0]) {
|
|
738
|
+
self.$el[0].f7ColorPicker = null;
|
|
739
|
+
delete self.$el[0].f7ColorPicker;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
} else {
|
|
746
|
+
const modalType = self.getModalType();
|
|
747
|
+
let backdrop = params.backdrop;
|
|
748
|
+
if (backdrop === null || typeof backdrop === 'undefined') {
|
|
749
|
+
if (modalType === 'popover' && app.params.popover.backdrop !== false) backdrop = true;
|
|
750
|
+
if (modalType === 'popup') backdrop = true;
|
|
751
|
+
}
|
|
752
|
+
const modalParams = {
|
|
753
|
+
targetEl: $targetEl || $inputEl,
|
|
754
|
+
scrollToEl: params.scrollToInput ? $targetEl || $inputEl : undefined,
|
|
755
|
+
content: colorPickerContent,
|
|
756
|
+
backdrop,
|
|
757
|
+
closeByBackdropClick: params.closeByBackdropClick,
|
|
758
|
+
on: {
|
|
759
|
+
open() {
|
|
760
|
+
const modal = this;
|
|
761
|
+
self.modal = modal;
|
|
762
|
+
self.$el = modalType === 'popover' || modalType === 'popup' ? modal.$el.find('.color-picker') : modal.$el;
|
|
763
|
+
self.$el[0].f7ColorPicker = self;
|
|
764
|
+
self.onOpen();
|
|
765
|
+
},
|
|
766
|
+
opened() {
|
|
767
|
+
self.onOpened();
|
|
768
|
+
},
|
|
769
|
+
close() {
|
|
770
|
+
self.onClose();
|
|
771
|
+
},
|
|
772
|
+
closed() {
|
|
773
|
+
self.onClosed();
|
|
774
|
+
if (self.$el && self.$el[0]) {
|
|
775
|
+
self.$el[0].f7ColorPicker = null;
|
|
776
|
+
delete self.$el[0].f7ColorPicker;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
if (modalType === 'popup') {
|
|
782
|
+
modalParams.push = params.popupPush;
|
|
783
|
+
modalParams.swipeToClose = params.popupSwipeToClose;
|
|
784
|
+
}
|
|
785
|
+
if (modalType === 'sheet') {
|
|
786
|
+
modalParams.push = params.sheetPush;
|
|
787
|
+
modalParams.swipeToClose = params.sheetSwipeToClose;
|
|
788
|
+
}
|
|
789
|
+
if (params.routableModals && self.view) {
|
|
790
|
+
self.view.router.navigate({
|
|
791
|
+
url: self.url,
|
|
792
|
+
route: {
|
|
793
|
+
path: self.url,
|
|
794
|
+
[modalType]: modalParams
|
|
795
|
+
}
|
|
796
|
+
});
|
|
797
|
+
} else {
|
|
798
|
+
self.modal = app[modalType].create(modalParams);
|
|
799
|
+
self.modal.open();
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
close() {
|
|
804
|
+
const self = this;
|
|
805
|
+
const {
|
|
806
|
+
opened,
|
|
807
|
+
inline
|
|
808
|
+
} = self;
|
|
809
|
+
if (!opened) return;
|
|
810
|
+
if (inline) {
|
|
811
|
+
self.onClose();
|
|
812
|
+
self.onClosed();
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (self.params.routableModals && self.view || self.params.openIn === 'page') {
|
|
816
|
+
self.view.router.back();
|
|
817
|
+
} else {
|
|
818
|
+
self.modal.close();
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
init() {
|
|
822
|
+
const self = this;
|
|
823
|
+
self.initInput();
|
|
824
|
+
if (self.inline) {
|
|
825
|
+
self.open();
|
|
826
|
+
self.emit('local::init colorPickerInit', self);
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
if (!self.initialized && self.params.value) {
|
|
830
|
+
self.setValue(self.params.value);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
// Attach input Events
|
|
834
|
+
if (self.$inputEl) {
|
|
835
|
+
self.attachInputEvents();
|
|
836
|
+
}
|
|
837
|
+
if (self.$targetEl) {
|
|
838
|
+
self.attachTargetEvents();
|
|
839
|
+
}
|
|
840
|
+
if (self.params.closeByOutsideClick) {
|
|
841
|
+
self.attachHtmlEvents();
|
|
842
|
+
}
|
|
843
|
+
self.emit('local::init colorPickerInit', self);
|
|
844
|
+
}
|
|
845
|
+
destroy() {
|
|
846
|
+
const self = this;
|
|
847
|
+
if (self.destroyed) return;
|
|
848
|
+
const {
|
|
849
|
+
$el
|
|
850
|
+
} = self;
|
|
851
|
+
self.emit('local::beforeDestroy colorPickerBeforeDestroy', self);
|
|
852
|
+
if ($el) $el.trigger('colorpicker:beforedestroy');
|
|
853
|
+
self.close();
|
|
854
|
+
|
|
855
|
+
// Detach Events
|
|
856
|
+
self.detachEvents();
|
|
857
|
+
if (self.$inputEl) {
|
|
858
|
+
self.detachInputEvents();
|
|
859
|
+
}
|
|
860
|
+
if (self.$targetEl) {
|
|
861
|
+
self.detachTargetEvents();
|
|
862
|
+
}
|
|
863
|
+
if (self.params.closeByOutsideClick) {
|
|
864
|
+
self.detachHtmlEvents();
|
|
865
|
+
}
|
|
866
|
+
if ($el && $el.length) delete self.$el[0].f7ColorPicker;
|
|
867
|
+
deleteProps(self);
|
|
868
|
+
self.destroyed = true;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
export default ColorPicker;
|