framework7 7.0.9 → 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
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
var raf = typeof window !== 'undefined' && window.requestAnimationFrame || setTimeout;
|
|
2
|
-
|
|
3
2
|
var nextFrame = function (fn) {
|
|
4
3
|
raf(function () {
|
|
5
4
|
raf(fn);
|
|
6
5
|
});
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
function setNextFrame(obj, prop, val) {
|
|
10
8
|
nextFrame(function () {
|
|
11
9
|
obj[prop] = val;
|
|
12
10
|
});
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
function getTextNodeRect(textNode) {
|
|
16
13
|
var rect;
|
|
17
|
-
|
|
18
14
|
if (document.createRange) {
|
|
19
15
|
var range = document.createRange();
|
|
20
16
|
range.selectNodeContents(textNode);
|
|
21
|
-
|
|
22
17
|
if (range.getBoundingClientRect) {
|
|
23
18
|
rect = range.getBoundingClientRect();
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
return rect;
|
|
28
22
|
}
|
|
29
|
-
|
|
30
23
|
function calcTransformOrigin(isTextNode, textRect, boundingRect) {
|
|
31
24
|
if (isTextNode) {
|
|
32
25
|
if (textRect) {
|
|
@@ -36,7 +29,6 @@ function calcTransformOrigin(isTextNode, textRect, boundingRect) {
|
|
|
36
29
|
return relativeCenterX + 'px ' + relativeCenterY + 'px';
|
|
37
30
|
}
|
|
38
31
|
}
|
|
39
|
-
|
|
40
32
|
return '0 0'; //top left
|
|
41
33
|
}
|
|
42
34
|
|
|
@@ -44,78 +36,57 @@ function getTextDx(oldTextRect, newTextRect) {
|
|
|
44
36
|
if (oldTextRect && newTextRect) {
|
|
45
37
|
return oldTextRect.left + oldTextRect.width / 2 - (newTextRect.left + newTextRect.width / 2);
|
|
46
38
|
}
|
|
47
|
-
|
|
48
39
|
return 0;
|
|
49
40
|
}
|
|
50
|
-
|
|
51
41
|
function getTextDy(oldTextRect, newTextRect) {
|
|
52
42
|
if (oldTextRect && newTextRect) {
|
|
53
43
|
return oldTextRect.top + oldTextRect.height / 2 - (newTextRect.top + newTextRect.height / 2);
|
|
54
44
|
}
|
|
55
|
-
|
|
56
45
|
return 0;
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
function isTextElement(elm) {
|
|
60
48
|
return elm.childNodes.length === 1 && elm.childNodes[0].nodeType === 3;
|
|
61
49
|
}
|
|
62
|
-
|
|
63
50
|
var removed, created;
|
|
64
|
-
|
|
65
51
|
function pre() {
|
|
66
52
|
removed = {};
|
|
67
53
|
created = [];
|
|
68
54
|
}
|
|
69
|
-
|
|
70
55
|
function create(oldVnode, vnode) {
|
|
71
56
|
var hero = vnode.data.hero;
|
|
72
|
-
|
|
73
57
|
if (hero && hero.id) {
|
|
74
58
|
created.push(hero.id);
|
|
75
59
|
created.push(vnode);
|
|
76
60
|
}
|
|
77
61
|
}
|
|
78
|
-
|
|
79
62
|
function destroy(vnode) {
|
|
80
63
|
var hero = vnode.data.hero;
|
|
81
|
-
|
|
82
64
|
if (hero && hero.id) {
|
|
83
65
|
var elm = vnode.elm;
|
|
84
66
|
vnode.isTextNode = isTextElement(elm); //is this a text node?
|
|
85
|
-
|
|
86
67
|
vnode.boundingRect = elm.getBoundingClientRect(); //save the bounding rectangle to a new property on the vnode
|
|
87
|
-
|
|
88
68
|
vnode.textRect = vnode.isTextNode ? getTextNodeRect(elm.childNodes[0]) : null; //save bounding rect of inner text node
|
|
89
|
-
|
|
90
69
|
var computedStyle = window.getComputedStyle(elm, void 0); //get current styles (includes inherited properties)
|
|
91
|
-
|
|
92
70
|
vnode.savedStyle = JSON.parse(JSON.stringify(computedStyle)); //save a copy of computed style values
|
|
93
|
-
|
|
94
71
|
removed[hero.id] = vnode;
|
|
95
72
|
}
|
|
96
73
|
}
|
|
97
|
-
|
|
98
74
|
function post() {
|
|
99
75
|
var i, id, newElm, oldVnode, oldElm, hRatio, wRatio, oldRect, newRect, dx, dy, origTransform, origTransition, newStyle, oldStyle, newComputedStyle, isTextNode, newTextRect, oldTextRect;
|
|
100
|
-
|
|
101
76
|
for (i = 0; i < created.length; i += 2) {
|
|
102
77
|
id = created[i];
|
|
103
78
|
newElm = created[i + 1].elm;
|
|
104
79
|
oldVnode = removed[id];
|
|
105
|
-
|
|
106
80
|
if (oldVnode) {
|
|
107
81
|
isTextNode = oldVnode.isTextNode && isTextElement(newElm); //Are old & new both text?
|
|
108
|
-
|
|
109
82
|
newStyle = newElm.style;
|
|
110
83
|
newComputedStyle = window.getComputedStyle(newElm, void 0); //get full computed style for new element
|
|
111
|
-
|
|
112
84
|
oldElm = oldVnode.elm;
|
|
113
|
-
oldStyle = oldElm.style;
|
|
114
|
-
|
|
85
|
+
oldStyle = oldElm.style;
|
|
86
|
+
//Overall element bounding boxes
|
|
115
87
|
newRect = newElm.getBoundingClientRect();
|
|
116
88
|
oldRect = oldVnode.boundingRect; //previously saved bounding rect
|
|
117
89
|
//Text node bounding boxes & distances
|
|
118
|
-
|
|
119
90
|
if (isTextNode) {
|
|
120
91
|
newTextRect = getTextNodeRect(newElm.childNodes[0]);
|
|
121
92
|
oldTextRect = oldVnode.textRect;
|
|
@@ -126,23 +97,20 @@ function post() {
|
|
|
126
97
|
dx = oldRect.left - newRect.left;
|
|
127
98
|
dy = oldRect.top - newRect.top;
|
|
128
99
|
}
|
|
129
|
-
|
|
130
100
|
hRatio = newRect.height / Math.max(oldRect.height, 1);
|
|
131
101
|
wRatio = isTextNode ? hRatio : newRect.width / Math.max(oldRect.width, 1); //text scales based on hRatio
|
|
132
102
|
// Animate new element
|
|
133
|
-
|
|
134
103
|
origTransform = newStyle.transform;
|
|
135
104
|
origTransition = newStyle.transition;
|
|
136
105
|
if (newComputedStyle.display === 'inline') newStyle.display = 'inline-block'; //this does not appear to have any negative side effects
|
|
137
|
-
|
|
138
106
|
newStyle.transition = origTransition + 'transform 0s';
|
|
139
107
|
newStyle.transformOrigin = calcTransformOrigin(isTextNode, newTextRect, newRect);
|
|
140
108
|
newStyle.opacity = '0';
|
|
141
109
|
newStyle.transform = origTransform + 'translate(' + dx + 'px, ' + dy + 'px) ' + 'scale(' + 1 / wRatio + ', ' + 1 / hRatio + ')';
|
|
142
110
|
setNextFrame(newStyle, 'transition', origTransition);
|
|
143
111
|
setNextFrame(newStyle, 'transform', origTransform);
|
|
144
|
-
setNextFrame(newStyle, 'opacity', '1');
|
|
145
|
-
|
|
112
|
+
setNextFrame(newStyle, 'opacity', '1');
|
|
113
|
+
// Animate old element
|
|
146
114
|
for (var key in oldVnode.savedStyle) {
|
|
147
115
|
if (parseInt(key) != key) {
|
|
148
116
|
var ms = key.substring(0, 2) === 'ms';
|
|
@@ -151,33 +119,25 @@ function post() {
|
|
|
151
119
|
if (!ms && !moz && !webkit) oldStyle[key] = oldVnode.savedStyle[key];
|
|
152
120
|
}
|
|
153
121
|
}
|
|
154
|
-
|
|
155
122
|
oldStyle.position = 'absolute';
|
|
156
123
|
oldStyle.top = oldRect.top + 'px'; //start at existing position
|
|
157
|
-
|
|
158
124
|
oldStyle.left = oldRect.left + 'px';
|
|
159
125
|
oldStyle.width = oldRect.width + 'px'; //Needed for elements who were sized relative to their parents
|
|
160
|
-
|
|
161
126
|
oldStyle.height = oldRect.height + 'px'; //Needed for elements who were sized relative to their parents
|
|
162
|
-
|
|
163
127
|
oldStyle.margin = '0'; //Margin on hero element leads to incorrect positioning
|
|
164
|
-
|
|
165
128
|
oldStyle.transformOrigin = calcTransformOrigin(isTextNode, oldTextRect, oldRect);
|
|
166
129
|
oldStyle.transform = '';
|
|
167
130
|
oldStyle.opacity = '1';
|
|
168
131
|
document.body.appendChild(oldElm);
|
|
169
132
|
setNextFrame(oldStyle, 'transform', 'translate(' + -dx + 'px, ' + -dy + 'px) scale(' + wRatio + ', ' + hRatio + ')'); //scale must be on far right for translate to be correct
|
|
170
|
-
|
|
171
133
|
setNextFrame(oldStyle, 'opacity', '0');
|
|
172
134
|
oldElm.addEventListener('transitionend', function (ev) {
|
|
173
135
|
if (ev.propertyName === 'transform') document.body.removeChild(ev.target);
|
|
174
136
|
});
|
|
175
137
|
}
|
|
176
138
|
}
|
|
177
|
-
|
|
178
139
|
removed = created = undefined;
|
|
179
140
|
}
|
|
180
|
-
|
|
181
141
|
export var heroModule = {
|
|
182
142
|
pre: pre,
|
|
183
143
|
create: create,
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
function updateProps(oldVnode, vnode) {
|
|
2
2
|
var key,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
cur,
|
|
4
|
+
old,
|
|
5
|
+
elm = vnode.elm,
|
|
6
|
+
oldProps = oldVnode.data.props,
|
|
7
|
+
props = vnode.data.props;
|
|
8
8
|
if (!oldProps && !props) return;
|
|
9
9
|
if (oldProps === props) return;
|
|
10
10
|
oldProps = oldProps || {};
|
|
11
11
|
props = props || {};
|
|
12
|
-
|
|
13
12
|
for (key in oldProps) {
|
|
14
13
|
if (!props[key]) {
|
|
15
14
|
delete elm[key];
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
for (key in props) {
|
|
20
18
|
cur = props[key];
|
|
21
19
|
old = oldProps[key];
|
|
22
|
-
|
|
23
20
|
if (old !== cur && (key !== 'value' || elm[key] !== cur)) {
|
|
24
21
|
elm[key] = cur;
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
export var propsModule = {
|
|
30
26
|
create: updateProps,
|
|
31
27
|
update: updateProps
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
var raf = typeof window !== 'undefined' && window.requestAnimationFrame || setTimeout;
|
|
2
|
-
|
|
3
2
|
var nextFrame = function (fn) {
|
|
4
3
|
raf(function () {
|
|
5
4
|
raf(fn);
|
|
6
5
|
});
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
function setNextFrame(obj, prop, val) {
|
|
10
8
|
nextFrame(function () {
|
|
11
9
|
obj[prop] = val;
|
|
12
10
|
});
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
function updateStyle(oldVnode, vnode) {
|
|
16
13
|
var cur,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
name,
|
|
15
|
+
elm = vnode.elm,
|
|
16
|
+
oldStyle = oldVnode.data.style,
|
|
17
|
+
style = vnode.data.style;
|
|
21
18
|
if (!oldStyle && !style) return;
|
|
22
19
|
if (oldStyle === style) return;
|
|
23
20
|
oldStyle = oldStyle || {};
|
|
24
21
|
style = style || {};
|
|
25
22
|
var oldHasDel = ('delayed' in oldStyle);
|
|
26
|
-
|
|
27
23
|
for (name in oldStyle) {
|
|
28
24
|
if (!style[name]) {
|
|
29
25
|
if (name[0] === '-' && name[1] === '-') {
|
|
@@ -33,14 +29,11 @@ function updateStyle(oldVnode, vnode) {
|
|
|
33
29
|
}
|
|
34
30
|
}
|
|
35
31
|
}
|
|
36
|
-
|
|
37
32
|
for (name in style) {
|
|
38
33
|
cur = style[name];
|
|
39
|
-
|
|
40
34
|
if (name === 'delayed' && style.delayed) {
|
|
41
35
|
for (var name2 in style.delayed) {
|
|
42
36
|
cur = style.delayed[name2];
|
|
43
|
-
|
|
44
37
|
if (!oldHasDel || cur !== oldStyle.delayed[name2]) {
|
|
45
38
|
setNextFrame(elm.style, name2, cur);
|
|
46
39
|
}
|
|
@@ -54,53 +47,43 @@ function updateStyle(oldVnode, vnode) {
|
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
49
|
}
|
|
57
|
-
|
|
58
50
|
function applyDestroyStyle(vnode) {
|
|
59
51
|
var style,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
name,
|
|
53
|
+
elm = vnode.elm,
|
|
54
|
+
s = vnode.data.style;
|
|
63
55
|
if (!s || !(style = s.destroy)) return;
|
|
64
|
-
|
|
65
56
|
for (name in style) {
|
|
66
57
|
elm.style[name] = style[name];
|
|
67
58
|
}
|
|
68
59
|
}
|
|
69
|
-
|
|
70
60
|
function applyRemoveStyle(vnode, rm) {
|
|
71
61
|
var s = vnode.data.style;
|
|
72
|
-
|
|
73
62
|
if (!s || !s.remove) {
|
|
74
63
|
rm();
|
|
75
64
|
return;
|
|
76
65
|
}
|
|
77
|
-
|
|
78
66
|
var name,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
elm = vnode.elm,
|
|
68
|
+
i = 0,
|
|
69
|
+
compStyle,
|
|
70
|
+
style = s.remove,
|
|
71
|
+
amount = 0,
|
|
72
|
+
applied = [];
|
|
86
73
|
for (name in style) {
|
|
87
74
|
applied.push(name);
|
|
88
75
|
elm.style[name] = style[name];
|
|
89
76
|
}
|
|
90
|
-
|
|
91
77
|
compStyle = getComputedStyle(elm);
|
|
92
78
|
var props = compStyle['transition-property'].split(', ');
|
|
93
|
-
|
|
94
79
|
for (; i < props.length; ++i) {
|
|
95
80
|
if (applied.indexOf(props[i]) !== -1) amount++;
|
|
96
81
|
}
|
|
97
|
-
|
|
98
82
|
elm.addEventListener('transitionend', function (ev) {
|
|
99
83
|
if (ev.target === elm) --amount;
|
|
100
84
|
if (amount === 0) rm();
|
|
101
85
|
});
|
|
102
86
|
}
|
|
103
|
-
|
|
104
87
|
export var styleModule = {
|
|
105
88
|
create: updateStyle,
|
|
106
89
|
update: updateStyle,
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { init } from './snabbdom.js';
|
|
2
2
|
import { attributesModule } from './modules/attributes.js'; // for setting attributes on DOM elements
|
|
3
|
-
|
|
4
3
|
import { classModule } from './modules/class.js'; // makes it easy to toggle classes
|
|
5
|
-
|
|
6
4
|
import { propsModule } from './modules/props.js'; // for setting properties on DOM elements
|
|
7
|
-
|
|
8
5
|
import { styleModule } from './modules/style.js'; // handles styling on elements with support for animations
|
|
9
|
-
|
|
10
6
|
import { eventListenersModule } from './modules/eventlisteners.js'; // attaches event listeners
|
|
11
|
-
|
|
12
7
|
import { h } from './h.js'; // helper function for creating vnodes
|
|
13
|
-
|
|
14
8
|
var patch = init([attributesModule, classModule, propsModule, styleModule, eventListenersModule]);
|
|
15
9
|
export var snabbdomBundle = {
|
|
16
10
|
patch: patch,
|
|
@@ -1,70 +1,55 @@
|
|
|
1
1
|
import vnode from './vnode.js';
|
|
2
2
|
import * as is from './is.js';
|
|
3
3
|
import htmlDomApi from './htmldomapi.js';
|
|
4
|
-
|
|
5
4
|
function isUndef(s) {
|
|
6
5
|
return s === undefined;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
function isDef(s) {
|
|
10
8
|
return s !== undefined;
|
|
11
9
|
}
|
|
12
|
-
|
|
13
10
|
var emptyNode = vnode('', {}, [], undefined, undefined);
|
|
14
|
-
|
|
15
11
|
function sameVnode(vnode1, vnode2) {
|
|
16
12
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
function isVnode(vnode) {
|
|
20
15
|
return vnode.sel !== undefined;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
function createKeyToOldIdx(children, beginIdx, endIdx) {
|
|
24
18
|
var i,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
map = {},
|
|
20
|
+
key,
|
|
21
|
+
ch;
|
|
29
22
|
for (i = beginIdx; i <= endIdx; ++i) {
|
|
30
23
|
ch = children[i];
|
|
31
|
-
|
|
32
24
|
if (ch != null) {
|
|
33
25
|
key = ch.key;
|
|
34
26
|
if (key !== undefined) map[key] = i;
|
|
35
27
|
}
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
return map;
|
|
39
30
|
}
|
|
40
|
-
|
|
41
31
|
var hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post'];
|
|
42
32
|
export { h } from './h.js';
|
|
43
33
|
export { thunk } from './thunk.js';
|
|
44
34
|
export function init(modules, domApi) {
|
|
45
35
|
var i,
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
j,
|
|
37
|
+
cbs = {};
|
|
48
38
|
var api = domApi !== undefined ? domApi : htmlDomApi;
|
|
49
|
-
|
|
50
39
|
for (i = 0; i < hooks.length; ++i) {
|
|
51
40
|
cbs[hooks[i]] = [];
|
|
52
|
-
|
|
53
41
|
for (j = 0; j < modules.length; ++j) {
|
|
54
42
|
var hook = modules[j][hooks[i]];
|
|
55
|
-
|
|
56
43
|
if (hook !== undefined) {
|
|
57
44
|
cbs[hooks[i]].push(hook);
|
|
58
45
|
}
|
|
59
46
|
}
|
|
60
47
|
}
|
|
61
|
-
|
|
62
48
|
function emptyNodeAt(elm) {
|
|
63
49
|
var id = elm.id ? '#' + elm.id : '';
|
|
64
50
|
var c = elm.className ? '.' + elm.className.split(' ').join('.') : '';
|
|
65
51
|
return vnode(api.tagName(elm).toLowerCase() + id + c, {}, [], undefined, elm);
|
|
66
52
|
}
|
|
67
|
-
|
|
68
53
|
function createRmCb(childElm, listeners) {
|
|
69
54
|
return function rmCb() {
|
|
70
55
|
if (--listeners === 0) {
|
|
@@ -73,26 +58,21 @@ export function init(modules, domApi) {
|
|
|
73
58
|
}
|
|
74
59
|
};
|
|
75
60
|
}
|
|
76
|
-
|
|
77
61
|
function createElm(vnode, insertedVnodeQueue) {
|
|
78
62
|
var i,
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
data = vnode.data;
|
|
81
64
|
if (data !== undefined) {
|
|
82
65
|
if (isDef(i = data.hook) && isDef(i = i.init)) {
|
|
83
66
|
i(vnode);
|
|
84
67
|
data = vnode.data;
|
|
85
68
|
}
|
|
86
69
|
}
|
|
87
|
-
|
|
88
70
|
var children = vnode.children,
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
sel = vnode.sel;
|
|
91
72
|
if (sel === '!') {
|
|
92
73
|
if (isUndef(vnode.text)) {
|
|
93
74
|
vnode.text = '';
|
|
94
75
|
}
|
|
95
|
-
|
|
96
76
|
vnode.elm = api.createComment(vnode.text);
|
|
97
77
|
} else if (sel !== undefined) {
|
|
98
78
|
// Parse selector
|
|
@@ -104,13 +84,10 @@ export function init(modules, domApi) {
|
|
|
104
84
|
var elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? api.createElementNS(i, tag) : api.createElement(tag);
|
|
105
85
|
if (hash < dot) elm.setAttribute('id', sel.slice(hash + 1, dot));
|
|
106
86
|
if (dotIdx > 0) elm.setAttribute('class', sel.slice(dot + 1).replace(/\./g, ' '));
|
|
107
|
-
|
|
108
87
|
for (i = 0; i < cbs.create.length; ++i) cbs.create[i](emptyNode, vnode);
|
|
109
|
-
|
|
110
88
|
if (is.array(children)) {
|
|
111
89
|
for (i = 0; i < children.length; ++i) {
|
|
112
90
|
var ch = children[i];
|
|
113
|
-
|
|
114
91
|
if (ch != null) {
|
|
115
92
|
api.appendChild(elm, createElm(ch, insertedVnodeQueue));
|
|
116
93
|
}
|
|
@@ -118,9 +95,7 @@ export function init(modules, domApi) {
|
|
|
118
95
|
} else if (is.primitive(vnode.text)) {
|
|
119
96
|
api.appendChild(elm, api.createTextNode(vnode.text));
|
|
120
97
|
}
|
|
121
|
-
|
|
122
98
|
i = vnode.data.hook; // Reuse variable
|
|
123
|
-
|
|
124
99
|
if (isDef(i)) {
|
|
125
100
|
if (i.create) i.create(emptyNode, vnode);
|
|
126
101
|
if (i.insert) insertedVnodeQueue.push(vnode);
|
|
@@ -128,34 +103,26 @@ export function init(modules, domApi) {
|
|
|
128
103
|
} else {
|
|
129
104
|
vnode.elm = api.createTextNode(vnode.text);
|
|
130
105
|
}
|
|
131
|
-
|
|
132
106
|
return vnode.elm;
|
|
133
107
|
}
|
|
134
|
-
|
|
135
108
|
function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
|
|
136
109
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
137
110
|
var ch = vnodes[startIdx];
|
|
138
|
-
|
|
139
111
|
if (ch != null) {
|
|
140
112
|
api.insertBefore(parentElm, createElm(ch, insertedVnodeQueue), before);
|
|
141
113
|
}
|
|
142
114
|
}
|
|
143
115
|
}
|
|
144
|
-
|
|
145
116
|
function invokeDestroyHook(vnode) {
|
|
146
117
|
var i,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
118
|
+
j,
|
|
119
|
+
data = vnode.data;
|
|
150
120
|
if (data !== undefined) {
|
|
151
121
|
if (isDef(i = data.hook) && isDef(i = i.destroy)) i(vnode);
|
|
152
|
-
|
|
153
122
|
for (i = 0; i < cbs.destroy.length; ++i) cbs.destroy[i](vnode);
|
|
154
|
-
|
|
155
123
|
if (vnode.children !== undefined) {
|
|
156
124
|
for (j = 0; j < vnode.children.length; ++j) {
|
|
157
125
|
i = vnode.children[j];
|
|
158
|
-
|
|
159
126
|
if (i != null && typeof i !== "string") {
|
|
160
127
|
invokeDestroyHook(i);
|
|
161
128
|
}
|
|
@@ -163,22 +130,18 @@ export function init(modules, domApi) {
|
|
|
163
130
|
}
|
|
164
131
|
}
|
|
165
132
|
}
|
|
166
|
-
|
|
167
133
|
function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
|
|
168
134
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
169
135
|
var i_1 = void 0,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
136
|
+
listeners = void 0,
|
|
137
|
+
rm = void 0,
|
|
138
|
+
ch = vnodes[startIdx];
|
|
174
139
|
if (ch != null) {
|
|
175
140
|
if (isDef(ch.sel)) {
|
|
176
141
|
invokeDestroyHook(ch);
|
|
177
142
|
listeners = cbs.remove.length + 1;
|
|
178
143
|
rm = createRmCb(ch.elm, listeners);
|
|
179
|
-
|
|
180
144
|
for (i_1 = 0; i_1 < cbs.remove.length; ++i_1) cbs.remove[i_1](ch, rm);
|
|
181
|
-
|
|
182
145
|
if (isDef(i_1 = ch.data) && isDef(i_1 = i_1.hook) && isDef(i_1 = i_1.remove)) {
|
|
183
146
|
i_1(ch, rm);
|
|
184
147
|
} else {
|
|
@@ -190,10 +153,9 @@ export function init(modules, domApi) {
|
|
|
190
153
|
}
|
|
191
154
|
}
|
|
192
155
|
}
|
|
193
|
-
|
|
194
156
|
function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) {
|
|
195
157
|
var oldStartIdx = 0,
|
|
196
|
-
|
|
158
|
+
newStartIdx = 0;
|
|
197
159
|
var oldEndIdx = oldCh.length - 1;
|
|
198
160
|
var oldStartVnode = oldCh[0];
|
|
199
161
|
var oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -204,7 +166,6 @@ export function init(modules, domApi) {
|
|
|
204
166
|
var idxInOld;
|
|
205
167
|
var elmToMove;
|
|
206
168
|
var before;
|
|
207
|
-
|
|
208
169
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
209
170
|
if (oldStartVnode == null) {
|
|
210
171
|
oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left
|
|
@@ -236,15 +197,12 @@ export function init(modules, domApi) {
|
|
|
236
197
|
if (oldKeyToIdx === undefined) {
|
|
237
198
|
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
|
|
238
199
|
}
|
|
239
|
-
|
|
240
200
|
idxInOld = oldKeyToIdx[newStartVnode.key];
|
|
241
|
-
|
|
242
201
|
if (isUndef(idxInOld)) {
|
|
243
202
|
api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
|
|
244
203
|
newStartVnode = newCh[++newStartIdx];
|
|
245
204
|
} else {
|
|
246
205
|
elmToMove = oldCh[idxInOld];
|
|
247
|
-
|
|
248
206
|
if (elmToMove.sel !== newStartVnode.sel) {
|
|
249
207
|
api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
|
|
250
208
|
} else {
|
|
@@ -252,12 +210,10 @@ export function init(modules, domApi) {
|
|
|
252
210
|
oldCh[idxInOld] = undefined;
|
|
253
211
|
api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);
|
|
254
212
|
}
|
|
255
|
-
|
|
256
213
|
newStartVnode = newCh[++newStartIdx];
|
|
257
214
|
}
|
|
258
215
|
}
|
|
259
216
|
}
|
|
260
|
-
|
|
261
217
|
if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {
|
|
262
218
|
if (oldStartIdx > oldEndIdx) {
|
|
263
219
|
before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;
|
|
@@ -267,26 +223,20 @@ export function init(modules, domApi) {
|
|
|
267
223
|
}
|
|
268
224
|
}
|
|
269
225
|
}
|
|
270
|
-
|
|
271
226
|
function patchVnode(oldVnode, vnode, insertedVnodeQueue) {
|
|
272
227
|
var i, hook;
|
|
273
|
-
|
|
274
228
|
if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) {
|
|
275
229
|
i(oldVnode, vnode);
|
|
276
230
|
}
|
|
277
|
-
|
|
278
231
|
var elm = vnode.elm = oldVnode.elm;
|
|
279
232
|
var oldCh = oldVnode.children;
|
|
280
233
|
var ch = vnode.children;
|
|
281
234
|
if (oldVnode === vnode) return;
|
|
282
|
-
|
|
283
235
|
if (vnode.data !== undefined) {
|
|
284
236
|
for (i = 0; i < cbs.update.length; ++i) cbs.update[i](oldVnode, vnode);
|
|
285
|
-
|
|
286
237
|
i = vnode.data.hook;
|
|
287
238
|
if (isDef(i) && isDef(i = i.update)) i(oldVnode, vnode);
|
|
288
239
|
}
|
|
289
|
-
|
|
290
240
|
if (isUndef(vnode.text)) {
|
|
291
241
|
if (isDef(oldCh) && isDef(ch)) {
|
|
292
242
|
if (oldCh !== ch) updateChildren(elm, oldCh, ch, insertedVnodeQueue);
|
|
@@ -301,41 +251,32 @@ export function init(modules, domApi) {
|
|
|
301
251
|
} else if (oldVnode.text !== vnode.text) {
|
|
302
252
|
api.setTextContent(elm, vnode.text);
|
|
303
253
|
}
|
|
304
|
-
|
|
305
254
|
if (isDef(hook) && isDef(i = hook.postpatch)) {
|
|
306
255
|
i(oldVnode, vnode);
|
|
307
256
|
}
|
|
308
257
|
}
|
|
309
|
-
|
|
310
258
|
return function patch(oldVnode, vnode) {
|
|
311
259
|
var i, elm, parent;
|
|
312
260
|
var insertedVnodeQueue = [];
|
|
313
|
-
|
|
314
261
|
for (i = 0; i < cbs.pre.length; ++i) cbs.pre[i]();
|
|
315
|
-
|
|
316
262
|
if (!isVnode(oldVnode)) {
|
|
317
263
|
oldVnode = emptyNodeAt(oldVnode);
|
|
318
264
|
}
|
|
319
|
-
|
|
320
265
|
if (sameVnode(oldVnode, vnode)) {
|
|
321
266
|
patchVnode(oldVnode, vnode, insertedVnodeQueue);
|
|
322
267
|
} else {
|
|
323
268
|
elm = oldVnode.elm;
|
|
324
269
|
parent = api.parentNode(elm);
|
|
325
270
|
createElm(vnode, insertedVnodeQueue);
|
|
326
|
-
|
|
327
271
|
if (parent !== null) {
|
|
328
272
|
api.insertBefore(parent, vnode.elm, api.nextSibling(elm));
|
|
329
273
|
removeVnodes(parent, [oldVnode], 0, 0);
|
|
330
274
|
}
|
|
331
275
|
}
|
|
332
|
-
|
|
333
276
|
for (i = 0; i < insertedVnodeQueue.length; ++i) {
|
|
334
277
|
insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]);
|
|
335
278
|
}
|
|
336
|
-
|
|
337
279
|
for (i = 0; i < cbs.post.length; ++i) cbs.post[i]();
|
|
338
|
-
|
|
339
280
|
return vnode;
|
|
340
281
|
};
|
|
341
282
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { h } from './h.js';
|
|
2
|
-
|
|
3
2
|
function copyToThunk(vnode, thunk) {
|
|
4
3
|
thunk.elm = vnode.elm;
|
|
5
4
|
vnode.data.fn = thunk.data.fn;
|
|
@@ -9,42 +8,35 @@ function copyToThunk(vnode, thunk) {
|
|
|
9
8
|
thunk.text = vnode.text;
|
|
10
9
|
thunk.elm = vnode.elm;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
function init(thunk) {
|
|
14
12
|
var cur = thunk.data;
|
|
15
13
|
var vnode = cur.fn.apply(undefined, cur.args);
|
|
16
14
|
copyToThunk(vnode, thunk);
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
function prepatch(oldVnode, thunk) {
|
|
20
17
|
var i,
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
old = oldVnode.data,
|
|
19
|
+
cur = thunk.data;
|
|
23
20
|
var oldArgs = old.args,
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
args = cur.args;
|
|
26
22
|
if (old.fn !== cur.fn || oldArgs.length !== args.length) {
|
|
27
23
|
copyToThunk(cur.fn.apply(undefined, args), thunk);
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
for (i = 0; i < args.length; ++i) {
|
|
32
27
|
if (oldArgs[i] !== args[i]) {
|
|
33
28
|
copyToThunk(cur.fn.apply(undefined, args), thunk);
|
|
34
29
|
return;
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
copyToThunk(oldVnode, thunk);
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
export var thunk = function thunk(sel, key, fn, args) {
|
|
42
35
|
if (args === undefined) {
|
|
43
36
|
args = fn;
|
|
44
37
|
fn = key;
|
|
45
38
|
key = undefined;
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
return h(sel, {
|
|
49
41
|
key: key,
|
|
50
42
|
hook: {
|