kdutify 0.16.9-rc.0
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 +21 -0
- package/README.md +70 -0
- package/dist/kdutify.css +12850 -0
- package/dist/kdutify.css.map +1 -0
- package/dist/kdutify.js +16285 -0
- package/dist/kdutify.js.map +1 -0
- package/dist/kdutify.min.css +7 -0
- package/dist/kdutify.min.css.map +1 -0
- package/dist/kdutify.min.js +6 -0
- package/es5/components/KAlert/KAlert.js +80 -0
- package/es5/components/KAlert/index.js +7 -0
- package/es5/components/KApp/KApp.js +67 -0
- package/es5/components/KApp/index.js +7 -0
- package/es5/components/KAvatar/KAvatar.js +31 -0
- package/es5/components/KAvatar/index.js +7 -0
- package/es5/components/KBadge/KBadge.js +59 -0
- package/es5/components/KBadge/index.js +7 -0
- package/es5/components/KBottomNav/KBottomNav.js +50 -0
- package/es5/components/KBottomNav/index.js +7 -0
- package/es5/components/KBottomSheet/KBottomSheet.js +36 -0
- package/es5/components/KBottomSheet/index.js +7 -0
- package/es5/components/KBreadcrumbs/KBreadcrumbs.js +36 -0
- package/es5/components/KBreadcrumbs/KBreadcrumbsItem.js +38 -0
- package/es5/components/KBreadcrumbs/index.js +11 -0
- package/es5/components/KBtn/KBtn.js +153 -0
- package/es5/components/KBtn/index.js +7 -0
- package/es5/components/KBtnToggle/KBtnToggle.js +92 -0
- package/es5/components/KBtnToggle/index.js +7 -0
- package/es5/components/KCard/KCard.js +63 -0
- package/es5/components/KCard/KCardMedia.js +41 -0
- package/es5/components/KCard/KCardTitle.js +21 -0
- package/es5/components/KCard/index.js +19 -0
- package/es5/components/KCarousel/KCarousel.js +178 -0
- package/es5/components/KCarousel/KCarouselItem.js +63 -0
- package/es5/components/KCarousel/index.js +11 -0
- package/es5/components/KCheckbox/KCheckbox.js +89 -0
- package/es5/components/KCheckbox/index.js +7 -0
- package/es5/components/KChip/KChip.js +81 -0
- package/es5/components/KChip/index.js +7 -0
- package/es5/components/KDataTable/KDataTable.js +347 -0
- package/es5/components/KDataTable/KEditDialog.js +108 -0
- package/es5/components/KDataTable/index.js +14 -0
- package/es5/components/KDataTable/mixins/body.js +103 -0
- package/es5/components/KDataTable/mixins/foot.js +118 -0
- package/es5/components/KDataTable/mixins/head.js +123 -0
- package/es5/components/KDataTable/mixins/progress.js +16 -0
- package/es5/components/KDatePicker/KDatePicker.js +416 -0
- package/es5/components/KDatePicker/index.js +7 -0
- package/es5/components/KDatePicker/mixins/date-header.js +68 -0
- package/es5/components/KDatePicker/mixins/date-table.js +101 -0
- package/es5/components/KDatePicker/mixins/date-title.js +64 -0
- package/es5/components/KDatePicker/mixins/date-years.js +53 -0
- package/es5/components/KDatePicker/mixins/month-table.js +91 -0
- package/es5/components/KDialog/KDialog.js +181 -0
- package/es5/components/KDialog/index.js +7 -0
- package/es5/components/KDivider/KDivider.js +29 -0
- package/es5/components/KDivider/index.js +7 -0
- package/es5/components/KExpansionPanel/KExpansionPanel.js +60 -0
- package/es5/components/KExpansionPanel/KExpansionPanelContent.js +114 -0
- package/es5/components/KExpansionPanel/index.js +9 -0
- package/es5/components/KFooter/KFooter.js +61 -0
- package/es5/components/KFooter/index.js +7 -0
- package/es5/components/KForm/KForm.js +203 -0
- package/es5/components/KForm/index.js +7 -0
- package/es5/components/KGrid/KContainer.js +5 -0
- package/es5/components/KGrid/KContent.js +33 -0
- package/es5/components/KGrid/KFlex.js +5 -0
- package/es5/components/KGrid/KLayout.js +5 -0
- package/es5/components/KGrid/grid.js +43 -0
- package/es5/components/KGrid/index.js +20 -0
- package/es5/components/KIcon/KIcon.js +93 -0
- package/es5/components/KIcon/index.js +7 -0
- package/es5/components/KList/KList.js +82 -0
- package/es5/components/KList/KListGroup.js +100 -0
- package/es5/components/KList/KListTile.js +65 -0
- package/es5/components/KList/KListTileAction.js +15 -0
- package/es5/components/KList/index.js +27 -0
- package/es5/components/KMenu/KMenu.js +178 -0
- package/es5/components/KMenu/index.js +7 -0
- package/es5/components/KMenu/mixins/menu-activator.js +59 -0
- package/es5/components/KMenu/mixins/menu-generators.js +88 -0
- package/es5/components/KMenu/mixins/menu-keyable.js +64 -0
- package/es5/components/KMenu/mixins/menu-position.js +64 -0
- package/es5/components/KNavigationDrawer/KNavigationDrawer.js +238 -0
- package/es5/components/KNavigationDrawer/index.js +7 -0
- package/es5/components/KPagination/KPagination.js +167 -0
- package/es5/components/KPagination/index.js +7 -0
- package/es5/components/KParallax/KParallax.js +98 -0
- package/es5/components/KParallax/index.js +7 -0
- package/es5/components/KProgressCircular/KProgressCircular.js +145 -0
- package/es5/components/KProgressCircular/index.js +7 -0
- package/es5/components/KProgressLinear/KProgressLinear.js +146 -0
- package/es5/components/KProgressLinear/index.js +7 -0
- package/es5/components/KRadioGroup/KRadio.js +148 -0
- package/es5/components/KRadioGroup/KRadioGroup.js +139 -0
- package/es5/components/KRadioGroup/index.js +11 -0
- package/es5/components/KSelect/KSelect.js +635 -0
- package/es5/components/KSelect/index.js +7 -0
- package/es5/components/KSelect/mixins/select-autocomplete.js +125 -0
- package/es5/components/KSelect/mixins/select-generators.js +298 -0
- package/es5/components/KSlider/KSlider.js +306 -0
- package/es5/components/KSlider/index.js +7 -0
- package/es5/components/KSnackbar/KSnackbar.js +106 -0
- package/es5/components/KSnackbar/index.js +7 -0
- package/es5/components/KSpeedDial/KSpeedDial.js +89 -0
- package/es5/components/KSpeedDial/index.js +7 -0
- package/es5/components/KStepper/KStepper.js +112 -0
- package/es5/components/KStepper/KStepperContent.js +134 -0
- package/es5/components/KStepper/KStepperStep.js +105 -0
- package/es5/components/KStepper/index.js +17 -0
- package/es5/components/KSubheader/KSubheader.js +29 -0
- package/es5/components/KSubheader/index.js +7 -0
- package/es5/components/KSwitch/KSwitch.js +55 -0
- package/es5/components/KSwitch/index.js +7 -0
- package/es5/components/KSystemBar/KSystemBar.js +54 -0
- package/es5/components/KSystemBar/index.js +7 -0
- package/es5/components/KTabs/KTabs.js +272 -0
- package/es5/components/KTabs/KTabsBar.js +205 -0
- package/es5/components/KTabs/KTabsContent.js +86 -0
- package/es5/components/KTabs/KTabsItem.js +103 -0
- package/es5/components/KTabs/KTabsItems.js +40 -0
- package/es5/components/KTabs/KTabsSlider.js +14 -0
- package/es5/components/KTabs/index.js +17 -0
- package/es5/components/KTextField/KTextField.js +275 -0
- package/es5/components/KTextField/index.js +7 -0
- package/es5/components/KTimePicker/KTimePicker.js +302 -0
- package/es5/components/KTimePicker/index.js +7 -0
- package/es5/components/KTimePicker/mixins/time-body.js +207 -0
- package/es5/components/KTimePicker/mixins/time-title.js +55 -0
- package/es5/components/KToolbar/KToolbar.js +193 -0
- package/es5/components/KToolbar/KToolbarSideIcon.js +29 -0
- package/es5/components/KToolbar/index.js +17 -0
- package/es5/components/KTooltip/KTooltip.js +156 -0
- package/es5/components/KTooltip/index.js +7 -0
- package/es5/components/Kdutify/index.js +50 -0
- package/es5/components/index.js +45 -0
- package/es5/components/transitions/expand-transition.js +36 -0
- package/es5/components/transitions/index.js +47 -0
- package/es5/components/transitions/row-expand-transition.js +38 -0
- package/es5/directives/click-outside.js +100 -0
- package/es5/directives/index.js +15 -0
- package/es5/directives/resize.js +30 -0
- package/es5/directives/ripple.js +144 -0
- package/es5/directives/scroll.js +32 -0
- package/es5/directives/touch.js +102 -0
- package/es5/index.js +30 -0
- package/es5/mixins/applicationable.js +9 -0
- package/es5/mixins/bootable.js +31 -0
- package/es5/mixins/button-group.js +82 -0
- package/es5/mixins/colorable.js +24 -0
- package/es5/mixins/contextualable.js +10 -0
- package/es5/mixins/delayable.js +57 -0
- package/es5/mixins/dependent.js +121 -0
- package/es5/mixins/detachable.js +41 -0
- package/es5/mixins/filterable.js +8 -0
- package/es5/mixins/input.js +219 -0
- package/es5/mixins/loadable.js +31 -0
- package/es5/mixins/maskable.js +181 -0
- package/es5/mixins/menuable.js +293 -0
- package/es5/mixins/overlayable.js +202 -0
- package/es5/mixins/picker.js +36 -0
- package/es5/mixins/positionable.js +10 -0
- package/es5/mixins/rippleable.js +21 -0
- package/es5/mixins/routable.js +66 -0
- package/es5/mixins/selectable.js +79 -0
- package/es5/mixins/stackable.js +70 -0
- package/es5/mixins/tab-focusable.js +7 -0
- package/es5/mixins/themeable.js +15 -0
- package/es5/mixins/toggleable.js +31 -0
- package/es5/mixins/transitionable.js +7 -0
- package/es5/mixins/translatable.js +62 -0
- package/es5/mixins/validatable.js +138 -0
- package/es5/util/breakpoint.js +128 -0
- package/es5/util/helpers.js +139 -0
- package/es5/util/load.js +15 -0
- package/es5/util/mask.js +159 -0
- package/es5/util/testing.js +160 -0
- package/es5/util/to-have-been-warned.js +117 -0
- package/es5/util/touchSupport.js +14 -0
- package/index.d.ts +8 -0
- package/package.json +134 -0
- package/src/components/KAlert/KAlert.js +77 -0
- package/src/components/KAlert/index.js +7 -0
- package/src/components/KApp/KApp.js +64 -0
- package/src/components/KApp/index.js +7 -0
- package/src/components/KAvatar/KAvatar.js +27 -0
- package/src/components/KAvatar/index.js +7 -0
- package/src/components/KBadge/KBadge.js +62 -0
- package/src/components/KBadge/index.js +7 -0
- package/src/components/KBottomNav/KBottomNav.js +50 -0
- package/src/components/KBottomNav/index.js +7 -0
- package/src/components/KBottomSheet/KBottomSheet.js +41 -0
- package/src/components/KBottomSheet/index.js +7 -0
- package/src/components/KBreadcrumbs/KBreadcrumbs.js +35 -0
- package/src/components/KBreadcrumbs/KBreadcrumbsItem.js +38 -0
- package/src/components/KBreadcrumbs/index.js +11 -0
- package/src/components/KBtn/KBtn.js +163 -0
- package/src/components/KBtn/index.js +7 -0
- package/src/components/KBtnToggle/KBtnToggle.js +92 -0
- package/src/components/KBtnToggle/index.js +7 -0
- package/src/components/KCard/KCard.js +61 -0
- package/src/components/KCard/KCardMedia.js +41 -0
- package/src/components/KCard/KCardTitle.js +17 -0
- package/src/components/KCard/index.js +19 -0
- package/src/components/KCarousel/KCarousel.js +174 -0
- package/src/components/KCarousel/KCarouselItem.js +65 -0
- package/src/components/KCarousel/index.js +11 -0
- package/src/components/KCheckbox/KCheckbox.js +92 -0
- package/src/components/KCheckbox/index.js +7 -0
- package/src/components/KChip/KChip.js +83 -0
- package/src/components/KChip/index.js +7 -0
- package/src/components/KDataTable/KDataTable.js +346 -0
- package/src/components/KDataTable/KEditDialog.js +110 -0
- package/src/components/KDataTable/index.js +16 -0
- package/src/components/KDataTable/mixins/body.js +98 -0
- package/src/components/KDataTable/mixins/foot.js +128 -0
- package/src/components/KDataTable/mixins/head.js +119 -0
- package/src/components/KDataTable/mixins/progress.js +16 -0
- package/src/components/KDatePicker/KDatePicker.js +382 -0
- package/src/components/KDatePicker/index.js +7 -0
- package/src/components/KDatePicker/mixins/date-header.js +74 -0
- package/src/components/KDatePicker/mixins/date-table.js +95 -0
- package/src/components/KDatePicker/mixins/date-title.js +76 -0
- package/src/components/KDatePicker/mixins/date-years.js +42 -0
- package/src/components/KDatePicker/mixins/month-table.js +82 -0
- package/src/components/KDialog/KDialog.js +184 -0
- package/src/components/KDialog/index.js +7 -0
- package/src/components/KDivider/KDivider.js +25 -0
- package/src/components/KDivider/index.js +7 -0
- package/src/components/KExpansionPanel/KExpansionPanel.js +55 -0
- package/src/components/KExpansionPanel/KExpansionPanelContent.js +112 -0
- package/src/components/KExpansionPanel/index.js +9 -0
- package/src/components/KFooter/KFooter.js +67 -0
- package/src/components/KFooter/index.js +7 -0
- package/src/components/KForm/KForm.js +117 -0
- package/src/components/KForm/index.js +7 -0
- package/src/components/KGrid/KContainer.js +5 -0
- package/src/components/KGrid/KContent.js +29 -0
- package/src/components/KGrid/KFlex.js +5 -0
- package/src/components/KGrid/KLayout.js +5 -0
- package/src/components/KGrid/grid.js +40 -0
- package/src/components/KGrid/index.js +27 -0
- package/src/components/KIcon/KIcon.js +87 -0
- package/src/components/KIcon/index.js +7 -0
- package/src/components/KList/KList.js +75 -0
- package/src/components/KList/KListGroup.js +95 -0
- package/src/components/KList/KListTile.js +62 -0
- package/src/components/KList/KListTileAction.js +12 -0
- package/src/components/KList/index.js +27 -0
- package/src/components/KMenu/KMenu.js +207 -0
- package/src/components/KMenu/index.js +7 -0
- package/src/components/KMenu/mixins/menu-activator.js +51 -0
- package/src/components/KMenu/mixins/menu-generators.js +84 -0
- package/src/components/KMenu/mixins/menu-keyable.js +68 -0
- package/src/components/KMenu/mixins/menu-position.js +72 -0
- package/src/components/KNavigationDrawer/KNavigationDrawer.js +267 -0
- package/src/components/KNavigationDrawer/index.js +7 -0
- package/src/components/KPagination/KPagination.js +168 -0
- package/src/components/KPagination/index.js +7 -0
- package/src/components/KParallax/KParallax.js +99 -0
- package/src/components/KParallax/index.js +7 -0
- package/src/components/KProgressCircular/KProgressCircular.js +160 -0
- package/src/components/KProgressCircular/index.js +7 -0
- package/src/components/KProgressLinear/KProgressLinear.js +157 -0
- package/src/components/KProgressLinear/index.js +7 -0
- package/src/components/KRadioGroup/KRadio.js +153 -0
- package/src/components/KRadioGroup/KRadioGroup.js +118 -0
- package/src/components/KRadioGroup/index.js +11 -0
- package/src/components/KSelect/KSelect.js +641 -0
- package/src/components/KSelect/index.js +7 -0
- package/src/components/KSelect/mixins/select-autocomplete.js +125 -0
- package/src/components/KSelect/mixins/select-generators.js +300 -0
- package/src/components/KSlider/KSlider.js +311 -0
- package/src/components/KSlider/index.js +7 -0
- package/src/components/KSnackbar/KSnackbar.js +97 -0
- package/src/components/KSnackbar/index.js +7 -0
- package/src/components/KSpeedDial/KSpeedDial.js +80 -0
- package/src/components/KSpeedDial/index.js +7 -0
- package/src/components/KStepper/KStepper.js +95 -0
- package/src/components/KStepper/KStepperContent.js +138 -0
- package/src/components/KStepper/KStepperStep.js +100 -0
- package/src/components/KStepper/index.js +17 -0
- package/src/components/KSubheader/KSubheader.js +25 -0
- package/src/components/KSubheader/index.js +7 -0
- package/src/components/KSwitch/KSwitch.js +58 -0
- package/src/components/KSwitch/index.js +7 -0
- package/src/components/KSystemBar/KSystemBar.js +54 -0
- package/src/components/KSystemBar/index.js +7 -0
- package/src/components/KTabs/KTabs.js +240 -0
- package/src/components/KTabs/KTabsBar.js +202 -0
- package/src/components/KTabs/KTabsContent.js +90 -0
- package/src/components/KTabs/KTabsItem.js +99 -0
- package/src/components/KTabs/KTabsItems.js +40 -0
- package/src/components/KTabs/KTabsSlider.js +14 -0
- package/src/components/KTabs/index.js +17 -0
- package/src/components/KTextField/KTextField.js +246 -0
- package/src/components/KTextField/index.js +7 -0
- package/src/components/KTimePicker/KTimePicker.js +282 -0
- package/src/components/KTimePicker/index.js +7 -0
- package/src/components/KTimePicker/mixins/time-body.js +208 -0
- package/src/components/KTimePicker/mixins/time-title.js +51 -0
- package/src/components/KToolbar/KToolbar.js +206 -0
- package/src/components/KToolbar/KToolbarSideIcon.js +26 -0
- package/src/components/KToolbar/index.js +19 -0
- package/src/components/KTooltip/KTooltip.js +161 -0
- package/src/components/KTooltip/index.js +7 -0
- package/src/components/Kdutify/index.js +48 -0
- package/src/components/index.js +45 -0
- package/src/components/transitions/expand-transition.js +34 -0
- package/src/components/transitions/index.js +50 -0
- package/src/components/transitions/row-expand-transition.js +38 -0
- package/src/directives/click-outside.js +72 -0
- package/src/directives/index.js +21 -0
- package/src/directives/resize.js +30 -0
- package/src/directives/ripple.js +120 -0
- package/src/directives/scroll.js +31 -0
- package/src/directives/touch.js +90 -0
- package/src/index.js +30 -0
- package/src/mixins/applicationable.js +9 -0
- package/src/mixins/bootable.js +31 -0
- package/src/mixins/button-group.js +77 -0
- package/src/mixins/colorable.js +20 -0
- package/src/mixins/contextualable.js +10 -0
- package/src/mixins/delayable.js +54 -0
- package/src/mixins/dependent.js +55 -0
- package/src/mixins/detachable.js +44 -0
- package/src/mixins/filterable.js +8 -0
- package/src/mixins/input.js +220 -0
- package/src/mixins/loadable.js +33 -0
- package/src/mixins/maskable.js +117 -0
- package/src/mixins/menuable.js +299 -0
- package/src/mixins/overlayable.js +180 -0
- package/src/mixins/picker.js +35 -0
- package/src/mixins/positionable.js +10 -0
- package/src/mixins/rippleable.js +21 -0
- package/src/mixins/routable.js +66 -0
- package/src/mixins/selectable.js +84 -0
- package/src/mixins/stackable.js +44 -0
- package/src/mixins/tab-focusable.js +7 -0
- package/src/mixins/themeable.js +15 -0
- package/src/mixins/toggleable.js +28 -0
- package/src/mixins/transitionable.js +7 -0
- package/src/mixins/translatable.js +67 -0
- package/src/mixins/validatable.js +124 -0
- package/src/stylus/app.styl +6 -0
- package/src/stylus/bootstrap.styl +1 -0
- package/src/stylus/components/_alerts.styl +44 -0
- package/src/stylus/components/_app.styl +21 -0
- package/src/stylus/components/_avatars.styl +22 -0
- package/src/stylus/components/_badges.styl +49 -0
- package/src/stylus/components/_bottom-navs.styl +86 -0
- package/src/stylus/components/_bottom-sheets.styl +18 -0
- package/src/stylus/components/_breadcrumbs.styl +46 -0
- package/src/stylus/components/_button-toggle.styl +55 -0
- package/src/stylus/components/_buttons.styl +339 -0
- package/src/stylus/components/_cards.styl +85 -0
- package/src/stylus/components/_carousel.styl +76 -0
- package/src/stylus/components/_chips.styl +102 -0
- package/src/stylus/components/_content.styl +6 -0
- package/src/stylus/components/_data-table.styl +113 -0
- package/src/stylus/components/_date-picker.styl +214 -0
- package/src/stylus/components/_dialogs.styl +63 -0
- package/src/stylus/components/_dividers.styl +19 -0
- package/src/stylus/components/_expansion-panel.styl +85 -0
- package/src/stylus/components/_footer.styl +40 -0
- package/src/stylus/components/_grid.styl +171 -0
- package/src/stylus/components/_icons.styl +32 -0
- package/src/stylus/components/_input-groups.styl +310 -0
- package/src/stylus/components/_lists.styl +263 -0
- package/src/stylus/components/_menus.styl +87 -0
- package/src/stylus/components/_navigation-drawer.styl +150 -0
- package/src/stylus/components/_overlay.styl +42 -0
- package/src/stylus/components/_pagination.styl +95 -0
- package/src/stylus/components/_parallax.styl +35 -0
- package/src/stylus/components/_pickers.styl +66 -0
- package/src/stylus/components/_progress-circular.styl +58 -0
- package/src/stylus/components/_progress-linear.styl +104 -0
- package/src/stylus/components/_radio-group.styl +23 -0
- package/src/stylus/components/_ripples.styl +31 -0
- package/src/stylus/components/_select.styl +153 -0
- package/src/stylus/components/_selection-controls.styl +122 -0
- package/src/stylus/components/_sliders.styl +234 -0
- package/src/stylus/components/_small-dialog.styl +37 -0
- package/src/stylus/components/_snackbars.styl +110 -0
- package/src/stylus/components/_speed-dial.styl +78 -0
- package/src/stylus/components/_steppers.styl +216 -0
- package/src/stylus/components/_subheaders.styl +18 -0
- package/src/stylus/components/_switch.styl +89 -0
- package/src/stylus/components/_system-bars.styl +49 -0
- package/src/stylus/components/_tables.styl +103 -0
- package/src/stylus/components/_tabs.styl +159 -0
- package/src/stylus/components/_text-fields.styl +243 -0
- package/src/stylus/components/_time-picker.styl +199 -0
- package/src/stylus/components/_toolbar.styl +148 -0
- package/src/stylus/components/_tooltips.styl +25 -0
- package/src/stylus/elements/_blockquote.styl +5 -0
- package/src/stylus/elements/_code.styl +20 -0
- package/src/stylus/elements/_global.styl +31 -0
- package/src/stylus/elements/_headings.styl +17 -0
- package/src/stylus/elements/_lists.styl +2 -0
- package/src/stylus/elements/_typography.styl +54 -0
- package/src/stylus/generic/_bootstrap.styl +49 -0
- package/src/stylus/generic/_reset.styl +332 -0
- package/src/stylus/generic/_transitions.styl +116 -0
- package/src/stylus/main.styl +2 -0
- package/src/stylus/settings/_colors.styl +339 -0
- package/src/stylus/settings/_elevations.styl +111 -0
- package/src/stylus/settings/_theme.styl +201 -0
- package/src/stylus/settings/_variables.styl +396 -0
- package/src/stylus/theme.styl +24 -0
- package/src/stylus/tools/_animations.styl +9 -0
- package/src/stylus/tools/_colors.styl +17 -0
- package/src/stylus/tools/_elevations.styl +7 -0
- package/src/stylus/trumps/_display.styl +14 -0
- package/src/stylus/trumps/_helpers.styl +5 -0
- package/src/stylus/trumps/_spacing.styl +37 -0
- package/src/stylus/trumps/_text.styl +13 -0
- package/src/util/breakpoint.js +134 -0
- package/src/util/helpers.d.ts +21 -0
- package/src/util/helpers.js +125 -0
- package/src/util/load.js +13 -0
- package/src/util/mask.js +138 -0
- package/src/util/testing.js +154 -0
- package/src/util/to-have-been-warned.js +68 -0
- package/src/util/touchSupport.js +12 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maskable
|
|
3
|
+
*
|
|
4
|
+
* @mixin
|
|
5
|
+
*
|
|
6
|
+
* Creates an input mask that is
|
|
7
|
+
* generated from a masked str
|
|
8
|
+
*
|
|
9
|
+
* Example: mask="#### #### #### ####"
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { isMaskDelimiter, maskText as _maskText, unmaskText as _unmaskText } from '../util/mask';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
data: function data() {
|
|
16
|
+
return {
|
|
17
|
+
selection: 0,
|
|
18
|
+
preDefined: {
|
|
19
|
+
'credit-card': '#### - #### - #### - ####',
|
|
20
|
+
'date': '##/##/####',
|
|
21
|
+
'date-with-time': '##/##/#### ##:##',
|
|
22
|
+
'phone': '(###) ### - ####',
|
|
23
|
+
'social': '###-##-####',
|
|
24
|
+
'time': '##:##',
|
|
25
|
+
'time-with-seconds': '##:##:##'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
props: {
|
|
31
|
+
dontFillMaskBlanks: Boolean,
|
|
32
|
+
mask: {
|
|
33
|
+
type: [Object, String],
|
|
34
|
+
default: null
|
|
35
|
+
},
|
|
36
|
+
returnMaskedValue: Boolean
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
computed: {
|
|
40
|
+
masked: function masked() {
|
|
41
|
+
var preDefined = this.preDefined[this.mask];
|
|
42
|
+
var mask = preDefined || this.mask || '';
|
|
43
|
+
|
|
44
|
+
return mask.split('');
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
watch: {
|
|
49
|
+
/**
|
|
50
|
+
* Make sure the cursor is in the correct
|
|
51
|
+
* location when the mask changes
|
|
52
|
+
*/
|
|
53
|
+
mask: function mask() {
|
|
54
|
+
if (!this.$refs.input) return;
|
|
55
|
+
|
|
56
|
+
var oldText = this.$refs.input.value;
|
|
57
|
+
var newText = this.maskText(this.lazyValue);
|
|
58
|
+
var position = 0;
|
|
59
|
+
var selection = this.selection;
|
|
60
|
+
|
|
61
|
+
var _iteratorNormalCompletion = true;
|
|
62
|
+
var _didIteratorError = false;
|
|
63
|
+
var _iteratorError = undefined;
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
for (var _iterator = oldText.substr(0, selection)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
67
|
+
var char = _step.value;
|
|
68
|
+
|
|
69
|
+
isMaskDelimiter(char) || position++;
|
|
70
|
+
}
|
|
71
|
+
} catch (err) {
|
|
72
|
+
_didIteratorError = true;
|
|
73
|
+
_iteratorError = err;
|
|
74
|
+
} finally {
|
|
75
|
+
try {
|
|
76
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
77
|
+
_iterator.return();
|
|
78
|
+
}
|
|
79
|
+
} finally {
|
|
80
|
+
if (_didIteratorError) {
|
|
81
|
+
throw _iteratorError;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
selection = 0;
|
|
87
|
+
var _iteratorNormalCompletion2 = true;
|
|
88
|
+
var _didIteratorError2 = false;
|
|
89
|
+
var _iteratorError2 = undefined;
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
for (var _iterator2 = newText[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
93
|
+
var _char = _step2.value;
|
|
94
|
+
|
|
95
|
+
isMaskDelimiter(_char) || position--;
|
|
96
|
+
selection++;
|
|
97
|
+
if (position <= 0) break;
|
|
98
|
+
}
|
|
99
|
+
} catch (err) {
|
|
100
|
+
_didIteratorError2 = true;
|
|
101
|
+
_iteratorError2 = err;
|
|
102
|
+
} finally {
|
|
103
|
+
try {
|
|
104
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
105
|
+
_iterator2.return();
|
|
106
|
+
}
|
|
107
|
+
} finally {
|
|
108
|
+
if (_didIteratorError2) {
|
|
109
|
+
throw _iteratorError2;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
this.setCaretPosition(selection);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
methods: {
|
|
119
|
+
setCaretPosition: function setCaretPosition(selection) {
|
|
120
|
+
var _this = this;
|
|
121
|
+
|
|
122
|
+
this.selection = selection;
|
|
123
|
+
window.setTimeout(function () {
|
|
124
|
+
_this.$refs.input && _this.$refs.input.setSelectionRange(_this.selection, _this.selection);
|
|
125
|
+
}, 0);
|
|
126
|
+
},
|
|
127
|
+
updateRange: function updateRange() {
|
|
128
|
+
if (!this.$refs.input) return;
|
|
129
|
+
|
|
130
|
+
var newValue = this.maskText(this.lazyValue);
|
|
131
|
+
var selection = 0;
|
|
132
|
+
|
|
133
|
+
this.$refs.input.value = newValue;
|
|
134
|
+
var _iteratorNormalCompletion3 = true;
|
|
135
|
+
var _didIteratorError3 = false;
|
|
136
|
+
var _iteratorError3 = undefined;
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
for (var _iterator3 = newValue[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
140
|
+
var char = _step3.value;
|
|
141
|
+
|
|
142
|
+
if (this.lazySelection <= 0) break;
|
|
143
|
+
isMaskDelimiter(char) || this.lazySelection--;
|
|
144
|
+
selection++;
|
|
145
|
+
}
|
|
146
|
+
} catch (err) {
|
|
147
|
+
_didIteratorError3 = true;
|
|
148
|
+
_iteratorError3 = err;
|
|
149
|
+
} finally {
|
|
150
|
+
try {
|
|
151
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return) {
|
|
152
|
+
_iterator3.return();
|
|
153
|
+
}
|
|
154
|
+
} finally {
|
|
155
|
+
if (_didIteratorError3) {
|
|
156
|
+
throw _iteratorError3;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
this.setCaretPosition(selection);
|
|
162
|
+
},
|
|
163
|
+
maskText: function maskText(text) {
|
|
164
|
+
if (!this.mask) return text;
|
|
165
|
+
|
|
166
|
+
return _maskText(text, this.masked, this.dontFillMaskBlanks);
|
|
167
|
+
},
|
|
168
|
+
unmaskText: function unmaskText(text) {
|
|
169
|
+
if (this.returnMaskedValue || !this.mask) return text;
|
|
170
|
+
|
|
171
|
+
return _unmaskText(text);
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
// When the input changes and is
|
|
175
|
+
// re-created, ensure that the
|
|
176
|
+
// caret location is correct
|
|
177
|
+
setSelectionRange: function setSelectionRange() {
|
|
178
|
+
this.$nextTick(this.updateRange);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2
|
+
|
|
3
|
+
import Positionable from './positionable';
|
|
4
|
+
|
|
5
|
+
import Stackable from './stackable';
|
|
6
|
+
|
|
7
|
+
var dimensions = {
|
|
8
|
+
activator: {
|
|
9
|
+
top: 0, left: 0,
|
|
10
|
+
bottom: 0, right: 0,
|
|
11
|
+
width: 0, height: 0,
|
|
12
|
+
offsetTop: 0, scrollHeight: 0
|
|
13
|
+
},
|
|
14
|
+
content: {
|
|
15
|
+
top: 0, left: 0,
|
|
16
|
+
bottom: 0, right: 0,
|
|
17
|
+
width: 0, height: 0,
|
|
18
|
+
offsetTop: 0, scrollHeight: 0
|
|
19
|
+
},
|
|
20
|
+
hasWindow: false
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Menuable
|
|
24
|
+
*
|
|
25
|
+
* @mixin
|
|
26
|
+
*
|
|
27
|
+
* Used for fixed or absolutely positioning
|
|
28
|
+
* elements within the DOM
|
|
29
|
+
* Can calculate X and Y axis overflows
|
|
30
|
+
* As well as be manually positioned
|
|
31
|
+
*/
|
|
32
|
+
};export default {
|
|
33
|
+
mixins: [Positionable, Stackable],
|
|
34
|
+
|
|
35
|
+
data: function data() {
|
|
36
|
+
return {
|
|
37
|
+
absoluteX: 0,
|
|
38
|
+
absoluteY: 0,
|
|
39
|
+
dimensions: Object.assign({}, dimensions),
|
|
40
|
+
isContentActive: false,
|
|
41
|
+
pageYOffset: 0,
|
|
42
|
+
stackClass: 'menuable__content__active',
|
|
43
|
+
stackMinZIndex: 6
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
props: {
|
|
48
|
+
activator: {
|
|
49
|
+
default: null,
|
|
50
|
+
validate: function validate(val) {
|
|
51
|
+
return ['string', 'object'].includes(typeof val === 'undefined' ? 'undefined' : _typeof(val));
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
allowOverflow: Boolean,
|
|
55
|
+
maxWidth: {
|
|
56
|
+
type: [Number, String],
|
|
57
|
+
default: 'auto'
|
|
58
|
+
},
|
|
59
|
+
minWidth: [Number, String],
|
|
60
|
+
nudgeBottom: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 0
|
|
63
|
+
},
|
|
64
|
+
nudgeLeft: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 0
|
|
67
|
+
},
|
|
68
|
+
nudgeRight: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: 0
|
|
71
|
+
},
|
|
72
|
+
nudgeTop: {
|
|
73
|
+
type: Number,
|
|
74
|
+
default: 0
|
|
75
|
+
},
|
|
76
|
+
nudgeWidth: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: 0
|
|
79
|
+
},
|
|
80
|
+
offsetOverflow: Boolean,
|
|
81
|
+
positionX: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: null
|
|
84
|
+
},
|
|
85
|
+
positionY: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: null
|
|
88
|
+
},
|
|
89
|
+
zIndex: {
|
|
90
|
+
type: [Number, String],
|
|
91
|
+
default: null
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
computed: {
|
|
96
|
+
hasActivator: function hasActivator() {
|
|
97
|
+
return !!this.$slots.activator || this.activator;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
watch: {
|
|
102
|
+
disabled: function disabled(val) {
|
|
103
|
+
val && this.callDeactivate();
|
|
104
|
+
},
|
|
105
|
+
isActive: function isActive(val) {
|
|
106
|
+
if (this.disabled) return;
|
|
107
|
+
|
|
108
|
+
val && this.callActivate() || this.callDeactivate();
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
methods: {
|
|
113
|
+
absolutePosition: function absolutePosition() {
|
|
114
|
+
return {
|
|
115
|
+
offsetTop: 0,
|
|
116
|
+
scrollHeight: 0,
|
|
117
|
+
top: this.positionY || this.absoluteY,
|
|
118
|
+
bottom: this.positionY || this.absoluteY,
|
|
119
|
+
left: this.positionX || this.absoluteX,
|
|
120
|
+
right: this.positionX || this.absoluteX,
|
|
121
|
+
height: 0,
|
|
122
|
+
width: 0
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
activate: function activate() {},
|
|
126
|
+
calcLeft: function calcLeft() {
|
|
127
|
+
var a = this.dimensions.activator;
|
|
128
|
+
var c = this.dimensions.content;
|
|
129
|
+
var left = this.left ? a.right - c.width : a.left;
|
|
130
|
+
|
|
131
|
+
if (this.offsetX) left += this.left ? -a.width : a.width;
|
|
132
|
+
if (this.nudgeLeft) left -= this.nudgeLeft;
|
|
133
|
+
if (this.nudgeRight) left += this.nudgeRight;
|
|
134
|
+
|
|
135
|
+
return left;
|
|
136
|
+
},
|
|
137
|
+
calcTop: function calcTop() {
|
|
138
|
+
this.checkForWindow();
|
|
139
|
+
|
|
140
|
+
var a = this.dimensions.activator;
|
|
141
|
+
var c = this.dimensions.content;
|
|
142
|
+
var top = this.top ? a.bottom - c.height : a.top;
|
|
143
|
+
|
|
144
|
+
if (this.offsetY) top += this.top ? -a.height : a.height;
|
|
145
|
+
if (this.nudgeTop) top -= this.nudgeTop;
|
|
146
|
+
if (this.nudgeBottom) top += this.nudgeBottom;
|
|
147
|
+
|
|
148
|
+
return top + this.pageYOffset;
|
|
149
|
+
},
|
|
150
|
+
calcXOverflow: function calcXOverflow(left) {
|
|
151
|
+
var parsedMaxWidth = isNaN(parseInt(this.maxWidth)) ? 0 : parseInt(this.maxWidth);
|
|
152
|
+
var innerWidth = this.getInnerWidth();
|
|
153
|
+
var maxWidth = Math.max(this.dimensions.content.width, parsedMaxWidth);
|
|
154
|
+
var totalWidth = left + maxWidth;
|
|
155
|
+
var availableWidth = totalWidth - innerWidth;
|
|
156
|
+
|
|
157
|
+
if ((!this.left || this.right) && availableWidth > 0) {
|
|
158
|
+
left = innerWidth - maxWidth - (innerWidth > 600 ? 30 : 12) // Account for scrollbar
|
|
159
|
+
;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (left < 0) left = 12;
|
|
163
|
+
|
|
164
|
+
return left;
|
|
165
|
+
},
|
|
166
|
+
calcYOverflow: function calcYOverflow(top) {
|
|
167
|
+
var documentHeight = this.getInnerHeight();
|
|
168
|
+
var toTop = this.pageYOffset + documentHeight;
|
|
169
|
+
var activator = this.dimensions.activator;
|
|
170
|
+
var contentHeight = this.dimensions.content.height;
|
|
171
|
+
var totalHeight = top + contentHeight;
|
|
172
|
+
var isOverflowing = toTop < totalHeight;
|
|
173
|
+
|
|
174
|
+
// If overflowing bottom and offset
|
|
175
|
+
if (isOverflowing && this.offsetOverflow) {
|
|
176
|
+
top = this.pageYOffset + (activator.top - contentHeight);
|
|
177
|
+
// If overflowing bottom
|
|
178
|
+
} else if (isOverflowing && !this.allowOverflow) {
|
|
179
|
+
top = toTop - contentHeight - 12;
|
|
180
|
+
// If overflowing top
|
|
181
|
+
} else if (top < this.pageYOffset && !this.allowOverflow) {
|
|
182
|
+
top = this.pageYOffset + 12;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return top < 12 ? 12 : top;
|
|
186
|
+
},
|
|
187
|
+
callActivate: function callActivate() {
|
|
188
|
+
this.checkForWindow();
|
|
189
|
+
if (!this.hasWindow) return;
|
|
190
|
+
|
|
191
|
+
this.activate();
|
|
192
|
+
},
|
|
193
|
+
callDeactivate: function callDeactivate() {
|
|
194
|
+
this.isContentActive = false;
|
|
195
|
+
|
|
196
|
+
this.deactivate();
|
|
197
|
+
},
|
|
198
|
+
checkForWindow: function checkForWindow() {
|
|
199
|
+
this.hasWindow = typeof window !== 'undefined';
|
|
200
|
+
|
|
201
|
+
if (this.hasWindow) {
|
|
202
|
+
this.pageYOffset = this.getOffsetTop();
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
deactivate: function deactivate() {},
|
|
206
|
+
getActivator: function getActivator() {
|
|
207
|
+
if (this.activator) {
|
|
208
|
+
return typeof this.activator === 'string' ? document.querySelector(this.activator) : this.activator;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return this.$refs.activator.children ? this.$refs.activator.children[0] : this.$refs.activator;
|
|
212
|
+
},
|
|
213
|
+
getInnerHeight: function getInnerHeight() {
|
|
214
|
+
if (!this.hasWindow) return 0;
|
|
215
|
+
|
|
216
|
+
return window.innerHeight || document.documentElement.clientHeight;
|
|
217
|
+
},
|
|
218
|
+
getInnerWidth: function getInnerWidth() {
|
|
219
|
+
if (!this.hasWindow) return 0;
|
|
220
|
+
|
|
221
|
+
return window.innerWidth;
|
|
222
|
+
},
|
|
223
|
+
getOffsetTop: function getOffsetTop() {
|
|
224
|
+
if (!this.hasWindow) return 0;
|
|
225
|
+
|
|
226
|
+
return window.pageYOffset || document.documentElement.scrollTop;
|
|
227
|
+
},
|
|
228
|
+
measure: function measure(el, selector) {
|
|
229
|
+
el = selector ? el.querySelector(selector) : el;
|
|
230
|
+
|
|
231
|
+
if (!el) return null;
|
|
232
|
+
|
|
233
|
+
var _el$getBoundingClient = el.getBoundingClientRect(),
|
|
234
|
+
top = _el$getBoundingClient.top,
|
|
235
|
+
bottom = _el$getBoundingClient.bottom,
|
|
236
|
+
left = _el$getBoundingClient.left,
|
|
237
|
+
right = _el$getBoundingClient.right,
|
|
238
|
+
height = _el$getBoundingClient.height,
|
|
239
|
+
width = _el$getBoundingClient.width;
|
|
240
|
+
|
|
241
|
+
return {
|
|
242
|
+
offsetTop: el.offsetTop,
|
|
243
|
+
scrollHeight: el.scrollHeight,
|
|
244
|
+
top: top, bottom: bottom, left: left, right: right, height: height, width: width
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
sneakPeek: function sneakPeek(cb) {
|
|
248
|
+
var _this = this;
|
|
249
|
+
|
|
250
|
+
requestAnimationFrame(function () {
|
|
251
|
+
var el = _this.$refs.content;
|
|
252
|
+
|
|
253
|
+
if (_this.isShown(el)) return cb();
|
|
254
|
+
|
|
255
|
+
el.style.display = 'inline-block';
|
|
256
|
+
cb();
|
|
257
|
+
el.style.display = 'none';
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
startTransition: function startTransition() {
|
|
261
|
+
var _this2 = this;
|
|
262
|
+
|
|
263
|
+
requestAnimationFrame(function () {
|
|
264
|
+
return _this2.isContentActive = true;
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
isShown: function isShown(el) {
|
|
268
|
+
return el.style.display !== 'none';
|
|
269
|
+
},
|
|
270
|
+
resetDimensions: function resetDimensions() {
|
|
271
|
+
this.dimensions = Object.assign({}, dimensions);
|
|
272
|
+
},
|
|
273
|
+
updateDimensions: function updateDimensions() {
|
|
274
|
+
var _this3 = this;
|
|
275
|
+
|
|
276
|
+
// Ensure that overflow calculation
|
|
277
|
+
// can work properly every update
|
|
278
|
+
this.resetDimensions();
|
|
279
|
+
|
|
280
|
+
var dimensions = {};
|
|
281
|
+
|
|
282
|
+
// Activate should already be shown
|
|
283
|
+
dimensions.activator = !this.hasActivator || this.absolute ? this.absolutePosition() : this.measure(this.getActivator());
|
|
284
|
+
|
|
285
|
+
// Display and hide to get dimensions
|
|
286
|
+
this.sneakPeek(function () {
|
|
287
|
+
dimensions.content = _this3.measure(_this3.$refs.content);
|
|
288
|
+
|
|
289
|
+
_this3.dimensions = dimensions;
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
require('../../src/stylus/components/_overlay.styl');
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
data: function data() {
|
|
5
|
+
return {
|
|
6
|
+
overlay: null,
|
|
7
|
+
overlayOffset: 0,
|
|
8
|
+
overlayTimeout: null,
|
|
9
|
+
overlayTransitionDuration: 500 + 150 // transition + delay
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
props: {
|
|
15
|
+
hideOverlay: Boolean
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
beforeDestroy: function beforeDestroy() {
|
|
19
|
+
this.removeOverlay();
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
methods: {
|
|
24
|
+
genOverlay: function genOverlay() {
|
|
25
|
+
var _this = this;
|
|
26
|
+
|
|
27
|
+
// If fn is called and timeout is active
|
|
28
|
+
// or overlay already exists
|
|
29
|
+
// cancel removal of overlay and re-add active
|
|
30
|
+
if (!this.isActive || this.hideOverlay || this.isActive && this.overlayTimeout || this.overlay) {
|
|
31
|
+
clearTimeout(this.overlayTimeout);
|
|
32
|
+
|
|
33
|
+
return this.overlay && this.overlay.classList.add('overlay--active');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
this.overlay = document.createElement('div');
|
|
37
|
+
this.overlay.className = 'overlay';
|
|
38
|
+
|
|
39
|
+
if (this.absolute) this.overlay.className += ' overlay--absolute';
|
|
40
|
+
|
|
41
|
+
this.hideScroll();
|
|
42
|
+
|
|
43
|
+
var parent = this.absolute ? this.$el.parentNode : document.querySelector('[data-app]');
|
|
44
|
+
|
|
45
|
+
parent.insertBefore(this.overlay, parent.firstChild);
|
|
46
|
+
|
|
47
|
+
this.overlay.clientHeight; // Force repaint
|
|
48
|
+
requestAnimationFrame(function () {
|
|
49
|
+
_this.overlay.className += ' overlay--active';
|
|
50
|
+
|
|
51
|
+
if (_this.activeZIndex !== undefined) {
|
|
52
|
+
_this.overlay.style.zIndex = _this.activeZIndex - 1;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return true;
|
|
57
|
+
},
|
|
58
|
+
removeOverlay: function removeOverlay() {
|
|
59
|
+
var _this2 = this;
|
|
60
|
+
|
|
61
|
+
if (!this.overlay) {
|
|
62
|
+
return this.showScroll();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
this.overlay.classList.remove('overlay--active');
|
|
66
|
+
|
|
67
|
+
this.overlayTimeout = setTimeout(function () {
|
|
68
|
+
// IE11 Fix
|
|
69
|
+
try {
|
|
70
|
+
_this2.overlay.parentNode.removeChild(_this2.overlay);
|
|
71
|
+
_this2.overlay = null;
|
|
72
|
+
_this2.showScroll();
|
|
73
|
+
} catch (e) {}
|
|
74
|
+
|
|
75
|
+
clearTimeout(_this2.overlayTimeout);
|
|
76
|
+
_this2.overlayTimeout = null;
|
|
77
|
+
}, this.overlayTransitionDuration);
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @param {Event} e
|
|
82
|
+
* @returns void
|
|
83
|
+
*/
|
|
84
|
+
scrollListener: function scrollListener(e) {
|
|
85
|
+
if (e.type === 'keydown') {
|
|
86
|
+
var up = [38, 33];
|
|
87
|
+
var down = [40, 34];
|
|
88
|
+
|
|
89
|
+
if (up.includes(e.keyCode)) {
|
|
90
|
+
e.deltaY = -1;
|
|
91
|
+
} else if (down.includes(e.keyCode)) {
|
|
92
|
+
e.deltaY = 1;
|
|
93
|
+
} else {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (e.target === this.overlay || e.type !== 'keydown' && e.target === document.body || this.checkPath(e)) e.preventDefault();
|
|
99
|
+
},
|
|
100
|
+
hasScrollbar: function hasScrollbar(el) {
|
|
101
|
+
var style = window.getComputedStyle(el);
|
|
102
|
+
return ['auto', 'scroll'].includes(style['overflow-y']) && el.scrollHeight > el.clientHeight;
|
|
103
|
+
},
|
|
104
|
+
shouldScroll: function shouldScroll(el, delta) {
|
|
105
|
+
if (el.scrollTop === 0 && delta < 0) return true;
|
|
106
|
+
return el.scrollTop + el.clientHeight === el.scrollHeight && delta > 0;
|
|
107
|
+
},
|
|
108
|
+
isInside: function isInside(el, parent) {
|
|
109
|
+
if (el === parent) {
|
|
110
|
+
return true;
|
|
111
|
+
} else if (el === null || el === document.body) {
|
|
112
|
+
return false;
|
|
113
|
+
} else {
|
|
114
|
+
return this.isInside(el.parentNode, parent);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @param {Event} e
|
|
120
|
+
* @returns boolean
|
|
121
|
+
*/
|
|
122
|
+
checkPath: function checkPath(e) {
|
|
123
|
+
var path = e.path || this.composedPath(e);
|
|
124
|
+
var delta = e.deltaY || -e.wheelDelta;
|
|
125
|
+
|
|
126
|
+
if (e.type === 'keydown' && path[0] === document.body) {
|
|
127
|
+
var dialog = this.$refs.dialog;
|
|
128
|
+
var selected = window.getSelection().anchorNode;
|
|
129
|
+
if (this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {
|
|
130
|
+
return this.shouldScroll(dialog, delta);
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var _iteratorNormalCompletion = true;
|
|
136
|
+
var _didIteratorError = false;
|
|
137
|
+
var _iteratorError = undefined;
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
for (var _iterator = path[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
141
|
+
var el = _step.value;
|
|
142
|
+
|
|
143
|
+
if ([document, document.documentElement, this.$refs.content].includes(el)) return true;
|
|
144
|
+
if (this.hasScrollbar(el)) return this.shouldScroll(el, delta);
|
|
145
|
+
}
|
|
146
|
+
} catch (err) {
|
|
147
|
+
_didIteratorError = true;
|
|
148
|
+
_iteratorError = err;
|
|
149
|
+
} finally {
|
|
150
|
+
try {
|
|
151
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
152
|
+
_iterator.return();
|
|
153
|
+
}
|
|
154
|
+
} finally {
|
|
155
|
+
if (_didIteratorError) {
|
|
156
|
+
throw _iteratorError;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return true;
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Polyfill for Event.prototype.composedPath
|
|
166
|
+
* @param {Event} e
|
|
167
|
+
* @returns Element[]
|
|
168
|
+
*/
|
|
169
|
+
composedPath: function composedPath(e) {
|
|
170
|
+
if (e.composedPath) return e.composedPath();
|
|
171
|
+
|
|
172
|
+
var path = [];
|
|
173
|
+
var el = e.target;
|
|
174
|
+
|
|
175
|
+
while (el) {
|
|
176
|
+
path.push(el);
|
|
177
|
+
|
|
178
|
+
if (el.tagName === 'HTML') {
|
|
179
|
+
path.push(document);
|
|
180
|
+
path.push(window);
|
|
181
|
+
|
|
182
|
+
return path;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
el = el.parentElement;
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
hideScroll: function hideScroll() {
|
|
189
|
+
if (this.$kdutify.breakpoint.mdAndDown) {
|
|
190
|
+
document.documentElement.classList.add('overflow-y-hidden');
|
|
191
|
+
} else {
|
|
192
|
+
window.addEventListener('wheel', this.scrollListener);
|
|
193
|
+
window.addEventListener('keydown', this.scrollListener);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
showScroll: function showScroll() {
|
|
197
|
+
document.documentElement.classList.remove('overflow-y-hidden');
|
|
198
|
+
window.removeEventListener('wheel', this.scrollListener);
|
|
199
|
+
window.removeEventListener('keydown', this.scrollListener);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Themeable from './themeable';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
mixins: [Themeable],
|
|
5
|
+
|
|
6
|
+
data: function data() {
|
|
7
|
+
return {
|
|
8
|
+
isSaving: false
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
actions: Boolean,
|
|
15
|
+
autosave: Boolean,
|
|
16
|
+
landscape: Boolean,
|
|
17
|
+
noTitle: Boolean,
|
|
18
|
+
scrollable: Boolean,
|
|
19
|
+
value: {
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
light: Boolean,
|
|
23
|
+
dark: Boolean
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
methods: {
|
|
27
|
+
save: function save() {},
|
|
28
|
+
cancel: function cancel() {},
|
|
29
|
+
genSlot: function genSlot() {
|
|
30
|
+
return this.$scopedSlots.default({
|
|
31
|
+
save: this.save,
|
|
32
|
+
cancel: this.cancel
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|