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,82 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_lists.styl');
|
|
2
|
+
|
|
3
|
+
import Themeable from '../../mixins/themeable';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'k-list',
|
|
7
|
+
|
|
8
|
+
provide: function provide() {
|
|
9
|
+
return {
|
|
10
|
+
listClick: this.listClick,
|
|
11
|
+
listClose: this.listClose
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
mixins: [Themeable],
|
|
17
|
+
|
|
18
|
+
data: function data() {
|
|
19
|
+
return {
|
|
20
|
+
uid: null,
|
|
21
|
+
groups: []
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
props: {
|
|
27
|
+
dense: Boolean,
|
|
28
|
+
subheader: Boolean,
|
|
29
|
+
threeLine: Boolean,
|
|
30
|
+
twoLine: Boolean
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
computed: {
|
|
34
|
+
classes: function classes() {
|
|
35
|
+
return {
|
|
36
|
+
'list': true,
|
|
37
|
+
'list--two-line': this.twoLine,
|
|
38
|
+
'list--dense': this.dense,
|
|
39
|
+
'list--three-line': this.threeLine,
|
|
40
|
+
'list--subheader': this.subheader,
|
|
41
|
+
'theme--dark dark--bg': this.dark,
|
|
42
|
+
'theme--light light--bg': this.light
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
watch: {
|
|
48
|
+
uid: function uid() {
|
|
49
|
+
var _this = this;
|
|
50
|
+
|
|
51
|
+
this.$children.filter(function (i) {
|
|
52
|
+
return i.$options._componentTag === 'k-list-group';
|
|
53
|
+
}).forEach(function (i) {
|
|
54
|
+
return i.toggle(_this.uid);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
methods: {
|
|
60
|
+
listClick: function listClick(uid, force) {
|
|
61
|
+
if (force) {
|
|
62
|
+
this.uid = uid;
|
|
63
|
+
} else {
|
|
64
|
+
this.uid = this.uid === uid ? null : uid;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
listClose: function listClose(uid) {
|
|
68
|
+
if (this.uid === uid) {
|
|
69
|
+
this.uid = null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
render: function render(h) {
|
|
75
|
+
var data = {
|
|
76
|
+
'class': this.classes,
|
|
77
|
+
attrs: { 'data-uid': this._uid }
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return h('ul', data, [this.$slots.default]);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { KExpandTransition } from '../transitions';
|
|
2
|
+
|
|
3
|
+
import Bootable from '../../mixins/bootable';
|
|
4
|
+
import Toggleable from '../../mixins/toggleable';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
name: 'k-list-group',
|
|
8
|
+
|
|
9
|
+
inject: ['listClick', 'listClose'],
|
|
10
|
+
|
|
11
|
+
mixins: [Bootable, Toggleable],
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
group: String,
|
|
15
|
+
noAction: Boolean
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
computed: {
|
|
19
|
+
classes: function classes() {
|
|
20
|
+
return {
|
|
21
|
+
'list--group__header': true,
|
|
22
|
+
'list--group__header--active': this.isActive,
|
|
23
|
+
'list--group__header--no-action': this.noAction
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
watch: {
|
|
29
|
+
isActive: function isActive() {
|
|
30
|
+
this.isBooted = true;
|
|
31
|
+
|
|
32
|
+
if (!this.isActive) {
|
|
33
|
+
this.listClose(this._uid);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
$route: function $route(to) {
|
|
37
|
+
var isActive = this.matchRoute(to.path);
|
|
38
|
+
|
|
39
|
+
if (this.group) {
|
|
40
|
+
if (isActive && this.isActive !== isActive) {
|
|
41
|
+
this.listClick(this._uid);
|
|
42
|
+
}
|
|
43
|
+
this.isActive = isActive;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
mounted: function mounted() {
|
|
49
|
+
this.isBooted = this.isActive;
|
|
50
|
+
|
|
51
|
+
if (this.group) {
|
|
52
|
+
this.isActive = this.matchRoute(this.$route.path);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (this.isActive) {
|
|
56
|
+
this.listClick(this._uid);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
methods: {
|
|
62
|
+
click: function click() {
|
|
63
|
+
var _this = this;
|
|
64
|
+
|
|
65
|
+
if (!this.$refs.item.querySelector('.list__tile--disabled')) {
|
|
66
|
+
requestAnimationFrame(function () {
|
|
67
|
+
return _this.listClick(_this._uid);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
toggle: function toggle(uid) {
|
|
72
|
+
this.isActive = this._uid === uid;
|
|
73
|
+
},
|
|
74
|
+
matchRoute: function matchRoute(to) {
|
|
75
|
+
if (!this.group) return false;
|
|
76
|
+
return to.match(this.group) !== null;
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
render: function render(h) {
|
|
81
|
+
var group = h('ul', {
|
|
82
|
+
'class': 'list list--group',
|
|
83
|
+
directives: [{
|
|
84
|
+
name: 'show',
|
|
85
|
+
value: this.isActive
|
|
86
|
+
}],
|
|
87
|
+
ref: 'group'
|
|
88
|
+
}, this.showLazyContent(this.$slots.default));
|
|
89
|
+
|
|
90
|
+
var item = h('div', {
|
|
91
|
+
'class': this.classes,
|
|
92
|
+
on: Object.assign({}, { click: this.click }, this.$listeners),
|
|
93
|
+
ref: 'item'
|
|
94
|
+
}, [this.$slots.item]);
|
|
95
|
+
|
|
96
|
+
var transition = h(KExpandTransition, [group]);
|
|
97
|
+
|
|
98
|
+
return h('div', { 'class': 'list--group__container' }, [item, transition]);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
|
+
|
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
|
|
5
|
+
import Routable from '../../mixins/routable';
|
|
6
|
+
import Toggleable from '../../mixins/toggleable';
|
|
7
|
+
import Ripple from '../../directives/ripple';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'k-list-tile',
|
|
11
|
+
|
|
12
|
+
mixins: [Routable, Toggleable],
|
|
13
|
+
|
|
14
|
+
directives: {
|
|
15
|
+
Ripple: Ripple
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
inheritAttrs: false,
|
|
19
|
+
|
|
20
|
+
props: {
|
|
21
|
+
activeClass: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'list__tile--active'
|
|
24
|
+
},
|
|
25
|
+
avatar: Boolean,
|
|
26
|
+
inactive: Boolean,
|
|
27
|
+
tag: String
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
computed: {
|
|
31
|
+
classes: function classes() {
|
|
32
|
+
return _defineProperty({
|
|
33
|
+
'list__tile': true,
|
|
34
|
+
'list__tile--link': this.isLink && !this.inactive,
|
|
35
|
+
'list__tile--avatar': this.avatar,
|
|
36
|
+
'list__tile--disabled': this.disabled
|
|
37
|
+
}, this.activeClass, this.isActive);
|
|
38
|
+
},
|
|
39
|
+
isLink: function isLink() {
|
|
40
|
+
return this.href || this.to || this.$listeners && (this.$listeners.click || this.$listeners['!click']);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
render: function render(h) {
|
|
45
|
+
var isRouteLink = !this.inactive && this.isLink;
|
|
46
|
+
|
|
47
|
+
var _ref2 = isRouteLink ? this.generateRouteLink() : {
|
|
48
|
+
tag: this.tag || 'div',
|
|
49
|
+
data: {
|
|
50
|
+
class: this.classes
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
tag = _ref2.tag,
|
|
54
|
+
data = _ref2.data;
|
|
55
|
+
|
|
56
|
+
data.attrs = Object.assign({}, data.attrs, this.$attrs);
|
|
57
|
+
|
|
58
|
+
return h('li', {
|
|
59
|
+
attrs: {
|
|
60
|
+
disabled: this.disabled
|
|
61
|
+
},
|
|
62
|
+
on: _extends({}, this.$listeners)
|
|
63
|
+
}, [h(tag, data, this.$slots.default)]);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
functional: true,
|
|
3
|
+
|
|
4
|
+
name: 'k-list-tile-action',
|
|
5
|
+
|
|
6
|
+
render: function render(h, _ref) {
|
|
7
|
+
var data = _ref.data,
|
|
8
|
+
children = _ref.children;
|
|
9
|
+
|
|
10
|
+
data.staticClass = data.staticClass ? 'list__tile__action ' + (data.staticClass || '') : 'list__tile__action';
|
|
11
|
+
if ((children || []).length > 1) data.staticClass += ' list__tile__action--stack';
|
|
12
|
+
|
|
13
|
+
return h('div', data, children);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createSimpleFunctional } from '../../util/helpers';
|
|
2
|
+
|
|
3
|
+
import KList from './KList';
|
|
4
|
+
import KListGroup from './KListGroup';
|
|
5
|
+
import KListTile from './KListTile';
|
|
6
|
+
import KListTileAction from './KListTileAction';
|
|
7
|
+
|
|
8
|
+
export { KList, KListGroup, KListTile, KListTileAction };
|
|
9
|
+
export var KListTileActionText = createSimpleFunctional('list__tile__action-text', 'span');
|
|
10
|
+
export var KListTileAvatar = createSimpleFunctional('list__tile__avatar', 'k-avatar');
|
|
11
|
+
export var KListTileContent = createSimpleFunctional('list__tile__content', 'div');
|
|
12
|
+
export var KListTileTitle = createSimpleFunctional('list__tile__title', 'div');
|
|
13
|
+
export var KListTileSubTitle = createSimpleFunctional('list__tile__sub-title', 'div');
|
|
14
|
+
|
|
15
|
+
KList.install = function install(Kdu) {
|
|
16
|
+
Kdu.component(KList.name, KList);
|
|
17
|
+
Kdu.component(KListGroup.name, KListGroup);
|
|
18
|
+
Kdu.component(KListTile.name, KListTile);
|
|
19
|
+
Kdu.component(KListTileAction.name, KListTileAction);
|
|
20
|
+
Kdu.component('k-list-tile-action-text', KListTileActionText);
|
|
21
|
+
Kdu.component('k-list-tile-avatar', KListTileAvatar);
|
|
22
|
+
Kdu.component('k-list-tile-content', KListTileContent);
|
|
23
|
+
Kdu.component('k-list-tile-sub-title', KListTileSubTitle);
|
|
24
|
+
Kdu.component('k-list-tile-title', KListTileTitle);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default KList;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_menus.styl');
|
|
2
|
+
|
|
3
|
+
// Mixins
|
|
4
|
+
import Delayable from '../../mixins/delayable';
|
|
5
|
+
import Dependent from '../../mixins/dependent';
|
|
6
|
+
import Detachable from '../../mixins/detachable';
|
|
7
|
+
import Menuable from '../../mixins/menuable.js';
|
|
8
|
+
import Toggleable from '../../mixins/toggleable';
|
|
9
|
+
|
|
10
|
+
// Component level mixins
|
|
11
|
+
import Activator from './mixins/menu-activator';
|
|
12
|
+
import Generators from './mixins/menu-generators';
|
|
13
|
+
import Keyable from './mixins/menu-keyable';
|
|
14
|
+
import Position from './mixins/menu-position';
|
|
15
|
+
|
|
16
|
+
// Directives
|
|
17
|
+
import ClickOutside from '../../directives/click-outside';
|
|
18
|
+
import Resize from '../../directives/resize';
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'k-menu',
|
|
22
|
+
|
|
23
|
+
mixins: [Activator, Dependent, Delayable, Detachable, Generators, Keyable, Menuable, Position, Toggleable],
|
|
24
|
+
|
|
25
|
+
directives: {
|
|
26
|
+
ClickOutside: ClickOutside,
|
|
27
|
+
Resize: Resize
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
data: function data() {
|
|
31
|
+
return {
|
|
32
|
+
defaultOffset: 8,
|
|
33
|
+
maxHeightAutoDefault: '200px',
|
|
34
|
+
startIndex: 3,
|
|
35
|
+
stopIndex: 0,
|
|
36
|
+
hasJustFocused: false,
|
|
37
|
+
resizeTimeout: null
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
props: {
|
|
43
|
+
auto: Boolean,
|
|
44
|
+
closeOnClick: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
47
|
+
},
|
|
48
|
+
closeOnContentClick: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
disabled: Boolean,
|
|
53
|
+
fullWidth: Boolean,
|
|
54
|
+
maxHeight: { default: 'auto' },
|
|
55
|
+
offsetX: Boolean,
|
|
56
|
+
offsetY: Boolean,
|
|
57
|
+
openOnClick: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true
|
|
60
|
+
},
|
|
61
|
+
openOnHover: Boolean,
|
|
62
|
+
origin: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: 'top left'
|
|
65
|
+
},
|
|
66
|
+
transition: {
|
|
67
|
+
type: [Boolean, String],
|
|
68
|
+
default: 'menu-transition'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
computed: {
|
|
73
|
+
calculatedLeft: function calculatedLeft() {
|
|
74
|
+
var left = this.calcLeft;
|
|
75
|
+
if (this.auto) left = this.calcLeftAuto;
|
|
76
|
+
|
|
77
|
+
return this.calcXOverflow(left()) + 'px';
|
|
78
|
+
},
|
|
79
|
+
calculatedMaxHeight: function calculatedMaxHeight() {
|
|
80
|
+
return this.auto ? '200px' : isNaN(this.maxHeight) ? this.maxHeight : this.maxHeight + 'px';
|
|
81
|
+
},
|
|
82
|
+
calculatedMaxWidth: function calculatedMaxWidth() {
|
|
83
|
+
return isNaN(this.maxWidth) ? this.maxWidth : this.maxWidth + 'px';
|
|
84
|
+
},
|
|
85
|
+
calculatedMinWidth: function calculatedMinWidth() {
|
|
86
|
+
if (this.minWidth) {
|
|
87
|
+
return isNaN(this.minWidth) ? this.minWidth : this.minWidth + 'px';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var minWidth = this.dimensions.activator.width + this.nudgeWidth + (this.auto ? 16 : 0);
|
|
91
|
+
|
|
92
|
+
var calculatedMaxWidth = isNaN(parseInt(this.calculatedMaxWidth)) ? minWidth : parseInt(this.calculatedMaxWidth);
|
|
93
|
+
|
|
94
|
+
return Math.min(calculatedMaxWidth, minWidth) + 'px';
|
|
95
|
+
},
|
|
96
|
+
calculatedTop: function calculatedTop() {
|
|
97
|
+
var top = this.auto ? this.calcTopAuto : this.calcTop;
|
|
98
|
+
|
|
99
|
+
return this.calcYOverflow(top()) + 'px';
|
|
100
|
+
},
|
|
101
|
+
styles: function styles() {
|
|
102
|
+
return {
|
|
103
|
+
maxHeight: this.calculatedMaxHeight,
|
|
104
|
+
minWidth: this.calculatedMinWidth,
|
|
105
|
+
maxWidth: this.calculatedMaxWidth,
|
|
106
|
+
top: this.calculatedTop,
|
|
107
|
+
left: this.calculatedLeft,
|
|
108
|
+
transformOrigin: this.origin,
|
|
109
|
+
zIndex: this.zIndex || this.activeZIndex
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
watch: {
|
|
115
|
+
activator: function activator(newActivator, oldActivator) {
|
|
116
|
+
this.removeActivatorEvents(oldActivator);
|
|
117
|
+
this.addActivatorEvents(newActivator);
|
|
118
|
+
},
|
|
119
|
+
isContentActive: function isContentActive(val) {
|
|
120
|
+
this.hasJustFocused = val;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
methods: {
|
|
125
|
+
activate: function activate() {
|
|
126
|
+
// This exists primarily for k-select
|
|
127
|
+
// helps determine which tiles to activate
|
|
128
|
+
this.getTiles();
|
|
129
|
+
// Update coordinates and dimensions of menu
|
|
130
|
+
// and its activator
|
|
131
|
+
this.updateDimensions();
|
|
132
|
+
// Start the transition
|
|
133
|
+
requestAnimationFrame(this.startTransition);
|
|
134
|
+
// Once transitioning, calculate scroll position
|
|
135
|
+
setTimeout(this.calculateScroll, 50);
|
|
136
|
+
},
|
|
137
|
+
onResize: function onResize() {
|
|
138
|
+
if (!this.isActive) return;
|
|
139
|
+
|
|
140
|
+
// Account for screen resize
|
|
141
|
+
// and orientation change
|
|
142
|
+
this.$refs.content.offsetWidth;
|
|
143
|
+
this.updateDimensions();
|
|
144
|
+
|
|
145
|
+
// When resizing to a smaller width
|
|
146
|
+
// content width is evaluated before
|
|
147
|
+
// the new activator width has been
|
|
148
|
+
// set, causing it to not size properly
|
|
149
|
+
// hacky but will revisit in the future
|
|
150
|
+
clearTimeout(this.resizeTimeout);
|
|
151
|
+
this.resizeTimeout = setTimeout(this.updateDimensions, 100);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
render: function render(h) {
|
|
156
|
+
var data = {
|
|
157
|
+
staticClass: 'menu',
|
|
158
|
+
class: {
|
|
159
|
+
'menu--disabled': this.disabled
|
|
160
|
+
},
|
|
161
|
+
style: {
|
|
162
|
+
display: this.fullWidth ? 'block' : 'inline-block'
|
|
163
|
+
},
|
|
164
|
+
directives: [{
|
|
165
|
+
name: 'resize',
|
|
166
|
+
value: {
|
|
167
|
+
debounce: 500,
|
|
168
|
+
value: this.onResize
|
|
169
|
+
}
|
|
170
|
+
}],
|
|
171
|
+
on: {
|
|
172
|
+
keydown: this.changeListIndex
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return h('div', data, [this.genActivator(), this.genTransition()]);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu activator
|
|
3
|
+
*
|
|
4
|
+
* @mixin
|
|
5
|
+
*
|
|
6
|
+
* Handles the click and hover activation
|
|
7
|
+
* Supports slotted and detached activators
|
|
8
|
+
*/
|
|
9
|
+
export default {
|
|
10
|
+
methods: {
|
|
11
|
+
activatorClickHandler: function activatorClickHandler(e) {
|
|
12
|
+
if (this.disabled) return;
|
|
13
|
+
if (this.openOnClick && !this.isActive) {
|
|
14
|
+
this.getActivator().focus();
|
|
15
|
+
this.isActive = true;
|
|
16
|
+
this.absoluteX = e.clientX;
|
|
17
|
+
this.absoluteY = e.clientY;
|
|
18
|
+
} else if (this.closeOnClick && this.isActive) {
|
|
19
|
+
this.getActivator().blur();
|
|
20
|
+
this.isActive = false;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
mouseEnterHandler: function mouseEnterHandler(e) {
|
|
24
|
+
var _this = this;
|
|
25
|
+
|
|
26
|
+
this.runDelay('open', function () {
|
|
27
|
+
if (_this.hasJustFocused) return;
|
|
28
|
+
|
|
29
|
+
_this.hasJustFocused = true;
|
|
30
|
+
_this.isActive = true;
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
mouseLeaveHandler: function mouseLeaveHandler(e) {
|
|
34
|
+
var _this2 = this;
|
|
35
|
+
|
|
36
|
+
// Prevent accidental re-activation
|
|
37
|
+
this.runDelay('close', function () {
|
|
38
|
+
if (_this2.$refs.content.contains(e.relatedTarget)) return;
|
|
39
|
+
|
|
40
|
+
requestAnimationFrame(function () {
|
|
41
|
+
_this2.isActive = false;
|
|
42
|
+
_this2.callDeactivate();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
addActivatorEvents: function addActivatorEvents() {
|
|
47
|
+
var activator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
48
|
+
|
|
49
|
+
if (!activator) return;
|
|
50
|
+
activator.addEventListener('click', this.activatorClickHandler);
|
|
51
|
+
},
|
|
52
|
+
removeActivatorEvents: function removeActivatorEvents() {
|
|
53
|
+
var activator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
54
|
+
|
|
55
|
+
if (!activator) return;
|
|
56
|
+
activator.removeEventListener('click', this.activatorClickHandler);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Menu generators
|
|
5
|
+
*
|
|
6
|
+
* @mixin
|
|
7
|
+
*
|
|
8
|
+
* Used for creating the DOM elements for KMenu
|
|
9
|
+
*/
|
|
10
|
+
export default {
|
|
11
|
+
methods: {
|
|
12
|
+
genActivator: function genActivator() {
|
|
13
|
+
if (!this.$slots.activator) return null;
|
|
14
|
+
|
|
15
|
+
var options = {
|
|
16
|
+
staticClass: 'menu__activator',
|
|
17
|
+
'class': {
|
|
18
|
+
'menu__activator--active': this.hasJustFocused || this.isActive
|
|
19
|
+
},
|
|
20
|
+
ref: 'activator',
|
|
21
|
+
on: {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (this.openOnHover) {
|
|
25
|
+
options.on['mouseenter'] = this.mouseEnterHandler;
|
|
26
|
+
options.on['mouseleave'] = this.mouseLeaveHandler;
|
|
27
|
+
} else if (this.openOnClick) {
|
|
28
|
+
options.on['click'] = this.activatorClickHandler;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return this.$createElement('div', options, this.$slots.activator);
|
|
32
|
+
},
|
|
33
|
+
genTransition: function genTransition() {
|
|
34
|
+
if (!this.transition) return this.genContent();
|
|
35
|
+
|
|
36
|
+
return this.$createElement('transition', {
|
|
37
|
+
props: {
|
|
38
|
+
name: this.transition
|
|
39
|
+
}
|
|
40
|
+
}, [this.genContent()]);
|
|
41
|
+
},
|
|
42
|
+
genDirectives: function genDirectives() {
|
|
43
|
+
var _this = this;
|
|
44
|
+
|
|
45
|
+
// Do not add click outside for hover menu
|
|
46
|
+
var directives = !this.openOnHover ? [{
|
|
47
|
+
name: 'click-outside',
|
|
48
|
+
value: {
|
|
49
|
+
callback: function callback() {
|
|
50
|
+
return _this.closeOnClick;
|
|
51
|
+
},
|
|
52
|
+
include: function include() {
|
|
53
|
+
return [_this.$el].concat(_toConsumableArray(_this.getOpenDependentElements()));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}] : [];
|
|
57
|
+
|
|
58
|
+
directives.push({
|
|
59
|
+
name: 'show',
|
|
60
|
+
value: this.isContentActive
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return directives;
|
|
64
|
+
},
|
|
65
|
+
genContent: function genContent() {
|
|
66
|
+
var _this2 = this;
|
|
67
|
+
|
|
68
|
+
var options = {
|
|
69
|
+
'class': [('menu__content ' + this.contentClass).trim(), { 'menuable__content__active': this.isActive }],
|
|
70
|
+
style: this.styles,
|
|
71
|
+
directives: this.genDirectives(),
|
|
72
|
+
ref: 'content',
|
|
73
|
+
on: {
|
|
74
|
+
click: function click(e) {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
if (e.target.getAttribute('disabled')) return;
|
|
77
|
+
if (_this2.closeOnContentClick) _this2.isActive = false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
!this.disabled && this.openOnHover && (options.on.mouseenter = this.mouseEnterHandler);
|
|
83
|
+
this.openOnHover && (options.on.mouseleave = this.mouseLeaveHandler);
|
|
84
|
+
|
|
85
|
+
return this.$createElement('div', options, this.showLazyContent(this.$slots.default));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu keyable
|
|
3
|
+
*
|
|
4
|
+
* @mixin
|
|
5
|
+
*
|
|
6
|
+
* Primarily used to support KSelect
|
|
7
|
+
* Handles opening and closing of KMenu from keystrokes
|
|
8
|
+
* Will conditionally highlight KListTiles for KSelect
|
|
9
|
+
*/
|
|
10
|
+
export default {
|
|
11
|
+
data: function data() {
|
|
12
|
+
return {
|
|
13
|
+
listIndex: -1,
|
|
14
|
+
tiles: []
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
watch: {
|
|
19
|
+
isActive: function isActive(val) {
|
|
20
|
+
if (!val) this.listIndex = -1;
|
|
21
|
+
},
|
|
22
|
+
listIndex: function listIndex(next, prev) {
|
|
23
|
+
// For infinite scroll and autocomplete, re-evaluate children
|
|
24
|
+
this.getTiles();
|
|
25
|
+
|
|
26
|
+
if (next in this.tiles) {
|
|
27
|
+
this.tiles[next].classList.add('list__tile--highlighted');
|
|
28
|
+
this.$refs.content.scrollTop = next * 48;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
prev in this.tiles && this.tiles[prev].classList.remove('list__tile--highlighted');
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
methods: {
|
|
36
|
+
changeListIndex: function changeListIndex(e) {
|
|
37
|
+
// Up, Down, Enter, Space
|
|
38
|
+
if ([40, 38, 13].includes(e.keyCode) || e.keyCode === 32 && !this.isActive) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Esc, Tab
|
|
43
|
+
if ([27, 9].includes(e.keyCode)) return this.isActive = false;else if (!this.isActive &&
|
|
44
|
+
// Enter, Space
|
|
45
|
+
[13, 32].includes(e.keyCode) && this.openOnClick) {
|
|
46
|
+
return this.isActive = true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Down
|
|
50
|
+
if (e.keyCode === 40 && this.listIndex < this.tiles.length - 1) {
|
|
51
|
+
this.listIndex++;
|
|
52
|
+
// Up
|
|
53
|
+
} else if (e.keyCode === 38 && this.listIndex > 0) {
|
|
54
|
+
this.listIndex--;
|
|
55
|
+
// Enter
|
|
56
|
+
} else if (e.keyCode === 13 && this.listIndex !== -1) {
|
|
57
|
+
this.tiles[this.listIndex].click();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
getTiles: function getTiles() {
|
|
61
|
+
this.tiles = this.$refs.content.querySelectorAll('.list__tile');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|