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,72 @@
|
|
|
1
|
+
function directive (e, el, binding, v) {
|
|
2
|
+
// The include element callbacks below can be expensive
|
|
3
|
+
// so we should avoid calling them when we're not active.
|
|
4
|
+
// Explicitly check for false to allow fallback compatibility
|
|
5
|
+
// with non-toggleable components
|
|
6
|
+
if (!e || v.context.isActive === false) return
|
|
7
|
+
|
|
8
|
+
// Get value passed to directive
|
|
9
|
+
const val = binding.value || (() => true)
|
|
10
|
+
// Check if callback was passed in object or as the value
|
|
11
|
+
const cb = val.callback || val
|
|
12
|
+
// Check if additional elements were passed to be included in check
|
|
13
|
+
// (click must be outside all included elements, if any)
|
|
14
|
+
const elements = (val.include || (() => []))()
|
|
15
|
+
// Add the root element for the component this directive was defined on
|
|
16
|
+
elements.push(el)
|
|
17
|
+
|
|
18
|
+
// Check if it's a click outside our elements, and then if our callback returns true.
|
|
19
|
+
// Non-toggleable components should take action in their callback and return falsy.
|
|
20
|
+
// Toggleable can return true if it wants to deactivate.
|
|
21
|
+
// Note that, because we're in the capture phase, this callback will occure before
|
|
22
|
+
// the bubbling click event on any outside elements.
|
|
23
|
+
if (!clickedInEls(e, elements) && cb(e)) {
|
|
24
|
+
// Delay setting toggleable inactive to avoid conflicting
|
|
25
|
+
// with an outside click on any activator toggling our state.
|
|
26
|
+
setTimeout(() => (v.context.isActive = false), 0)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function clickedInEls (e, elements) {
|
|
31
|
+
// Get position of click
|
|
32
|
+
const { clientX: x, clientY: y } = e
|
|
33
|
+
// Loop over all included elements to see if click was in any of them
|
|
34
|
+
for (const el of elements) {
|
|
35
|
+
if (clickedInEl(el, x, y)) return true
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return false
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function clickedInEl (el, x, y) {
|
|
42
|
+
// Get bounding rect for element
|
|
43
|
+
// (we're in capturing event and we want to check for multiple elements,
|
|
44
|
+
// so can't use target.)
|
|
45
|
+
const b = el.getBoundingClientRect()
|
|
46
|
+
// Check if the click was in the element's bounding rect
|
|
47
|
+
|
|
48
|
+
return x >= b.left && x <= b.right && y >= b.top && y <= b.bottom
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
name: 'click-outside',
|
|
53
|
+
|
|
54
|
+
bind (el, binding, v) {
|
|
55
|
+
v.context.$kdutify.load(() => {
|
|
56
|
+
const onClick = e => directive(e, el, binding, v)
|
|
57
|
+
// iOS does not recognize click events on document
|
|
58
|
+
// or body, this is the entire purpose of the k-app
|
|
59
|
+
// component and [data-app], stop removing this
|
|
60
|
+
const app = document.querySelector('[data-app]') ||
|
|
61
|
+
document.body // This is only for unit tests
|
|
62
|
+
app.addEventListener('click', onClick, true)
|
|
63
|
+
el._clickOutside = onClick
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
unbind (el) {
|
|
68
|
+
const app = document.querySelector('[data-app]') ||
|
|
69
|
+
document.body // This is only for unit tests
|
|
70
|
+
app && app.removeEventListener('click', el._clickOutside, true)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ClickOutside from './click-outside'
|
|
2
|
+
import Resize from './resize'
|
|
3
|
+
import Ripple from './ripple'
|
|
4
|
+
import Scroll from './scroll'
|
|
5
|
+
import Touch from './touch'
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
ClickOutside,
|
|
9
|
+
Ripple,
|
|
10
|
+
Resize,
|
|
11
|
+
Scroll,
|
|
12
|
+
Touch
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function install (Kdu) {
|
|
16
|
+
Kdu.directive('click-outside', ClickOutside)
|
|
17
|
+
Kdu.directive('ripple', Ripple)
|
|
18
|
+
Kdu.directive('resize', Resize)
|
|
19
|
+
Kdu.directive('scroll', Scroll)
|
|
20
|
+
Kdu.directive('touch', Touch)
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function inserted (el, binding) {
|
|
2
|
+
let cb = binding.value
|
|
3
|
+
let debounce = 200
|
|
4
|
+
|
|
5
|
+
if (typeof binding.value !== 'function') {
|
|
6
|
+
cb = binding.value.value
|
|
7
|
+
debounce = binding.value.debounce
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let debounceTimeout = setTimeout(cb, debounce)
|
|
11
|
+
const onResize = () => {
|
|
12
|
+
clearTimeout(debounceTimeout)
|
|
13
|
+
debounceTimeout = setTimeout(cb, debounce)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
window.addEventListener('resize', onResize, { passive: true })
|
|
17
|
+
el._onResize = onResize
|
|
18
|
+
|
|
19
|
+
onResize()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function unbind (el, binding) {
|
|
23
|
+
window.removeEventListener('resize', el._onResize)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'resize',
|
|
28
|
+
inserted,
|
|
29
|
+
unbind
|
|
30
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
function style (el, value) {
|
|
2
|
+
[
|
|
3
|
+
'transform',
|
|
4
|
+
'webkitTransform'
|
|
5
|
+
].forEach(i => {
|
|
6
|
+
el.style[i] = value
|
|
7
|
+
})
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const RippleDataAttribute = 'data-ripple'
|
|
11
|
+
|
|
12
|
+
const ripple = {
|
|
13
|
+
show: (e, el, { value = {} }) => {
|
|
14
|
+
if (el.getAttribute(RippleDataAttribute) !== 'true') {
|
|
15
|
+
return
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var container = document.createElement('span')
|
|
19
|
+
var animation = document.createElement('span')
|
|
20
|
+
|
|
21
|
+
container.appendChild(animation)
|
|
22
|
+
container.className = 'ripple__container'
|
|
23
|
+
|
|
24
|
+
if (value.class) {
|
|
25
|
+
container.className += ` ${value.class}`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const size = el.clientWidth > el.clientHeight
|
|
29
|
+
? el.clientWidth
|
|
30
|
+
: el.clientHeight
|
|
31
|
+
animation.className = 'ripple__animation'
|
|
32
|
+
animation.style.width = `${size * (value.center ? 1 : 2)}px`
|
|
33
|
+
animation.style.height = animation.style.width
|
|
34
|
+
|
|
35
|
+
el.appendChild(container)
|
|
36
|
+
const computed = window.getComputedStyle(el)
|
|
37
|
+
if (computed.position !== 'absolute' && computed.position !== 'fixed') el.style.position = 'relative'
|
|
38
|
+
|
|
39
|
+
const offset = el.getBoundingClientRect()
|
|
40
|
+
const x = value.center ? '50%' : `${e.clientX - offset.left}px`
|
|
41
|
+
const y = value.center ? '50%' : `${e.clientY - offset.top}px`
|
|
42
|
+
|
|
43
|
+
animation.classList.add('ripple__animation--enter')
|
|
44
|
+
animation.classList.add('ripple__animation--visible')
|
|
45
|
+
style(animation, `translate(-50%, -50%) translate(${x}, ${y}) scale3d(0.01,0.01,0.01)`)
|
|
46
|
+
animation.dataset.activated = Date.now()
|
|
47
|
+
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
animation.classList.remove('ripple__animation--enter')
|
|
50
|
+
style(animation, `translate(-50%, -50%) translate(${x}, ${y}) scale3d(0.99,0.99,0.99)`)
|
|
51
|
+
}, 0)
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
hide: (el) => {
|
|
55
|
+
if (el.getAttribute(RippleDataAttribute) !== 'true') {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const ripples = el.getElementsByClassName('ripple__animation')
|
|
60
|
+
|
|
61
|
+
if (ripples.length === 0) return
|
|
62
|
+
const animation = ripples[ripples.length - 1]
|
|
63
|
+
const diff = Date.now() - Number(animation.dataset.activated)
|
|
64
|
+
let delay = 400 - diff
|
|
65
|
+
|
|
66
|
+
delay = delay < 0 ? 0 : delay
|
|
67
|
+
|
|
68
|
+
setTimeout(() => {
|
|
69
|
+
animation.classList.remove('ripple__animation--visible')
|
|
70
|
+
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
// Need to figure out a new way to do this
|
|
73
|
+
try {
|
|
74
|
+
if (ripples.length < 1) el.style.position = null
|
|
75
|
+
animation.parentNode && el.removeChild(animation.parentNode)
|
|
76
|
+
} catch (e) {}
|
|
77
|
+
}, 300)
|
|
78
|
+
}, delay)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function directive (el, binding) {
|
|
83
|
+
el.setAttribute(RippleDataAttribute, !!binding.value)
|
|
84
|
+
|
|
85
|
+
if ('ontouchstart' in window) {
|
|
86
|
+
el.addEventListener('touchend', () => ripple.hide(el), false)
|
|
87
|
+
el.addEventListener('touchcancel', () => ripple.hide(el), false)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
el.addEventListener('mousedown', e => ripple.show(e, el, binding), false)
|
|
91
|
+
el.addEventListener('mouseup', () => ripple.hide(el), false)
|
|
92
|
+
el.addEventListener('mouseleave', () => ripple.hide(el), false)
|
|
93
|
+
// Anchor tags can be dragged, causes other hides to fail - #1537
|
|
94
|
+
el.addEventListener('dragstart', () => ripple.hide(el), false)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function unbind (el, binding) {
|
|
98
|
+
el.removeEventListener('touchstart', e => ripple.show(e, el, binding), false)
|
|
99
|
+
el.removeEventListener('mousedown', e => ripple.show(e, el, binding), false)
|
|
100
|
+
el.removeEventListener('touchend', () => ripple.hide(el), false)
|
|
101
|
+
el.removeEventListener('touchcancel', () => ripple.hide(el), false)
|
|
102
|
+
el.removeEventListener('mouseup', () => ripple.hide(el), false)
|
|
103
|
+
el.removeEventListener('mouseleave', () => ripple.hide(el), false)
|
|
104
|
+
el.removeEventListener('dragstart', () => ripple.hide(el), false)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function update (el, binding) {
|
|
108
|
+
if (binding.value === binding.oldValue) {
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
el.setAttribute(RippleDataAttribute, !!binding.value)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
name: 'ripple',
|
|
117
|
+
bind: directive,
|
|
118
|
+
unbind: unbind,
|
|
119
|
+
update: update
|
|
120
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function inserted (el, binding) {
|
|
2
|
+
const callback = typeof binding.value === 'function'
|
|
3
|
+
? binding.value
|
|
4
|
+
: binding.value.callback
|
|
5
|
+
const options = binding.value.options || { passive: true }
|
|
6
|
+
let target = binding.value.target || window
|
|
7
|
+
if (target === 'undefined') return
|
|
8
|
+
|
|
9
|
+
if (target !== window) {
|
|
10
|
+
target = document.querySelector(target)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
target.addEventListener('scroll', callback, options)
|
|
14
|
+
|
|
15
|
+
el._onScroll = {
|
|
16
|
+
target,
|
|
17
|
+
options
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function unbind (el, binding) {
|
|
22
|
+
const { target, options } = el._onScroll
|
|
23
|
+
|
|
24
|
+
target.removeEventListener('scroll', binding.callback, options)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
name: 'scroll',
|
|
29
|
+
inserted,
|
|
30
|
+
unbind
|
|
31
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const touchstart = (event, wrapper) => {
|
|
2
|
+
const touch = event.changedTouches[0]
|
|
3
|
+
wrapper.touchstartX = touch.clientX
|
|
4
|
+
wrapper.touchstartY = touch.clientY
|
|
5
|
+
|
|
6
|
+
wrapper.start &&
|
|
7
|
+
wrapper.start(Object.assign(event, wrapper))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const touchend = (event, wrapper) => {
|
|
11
|
+
const touch = event.changedTouches[0]
|
|
12
|
+
wrapper.touchendX = touch.clientX
|
|
13
|
+
wrapper.touchendY = touch.clientY
|
|
14
|
+
|
|
15
|
+
wrapper.end &&
|
|
16
|
+
wrapper.end(Object.assign(event, wrapper))
|
|
17
|
+
|
|
18
|
+
handleGesture(wrapper)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const touchmove = (event, wrapper) => {
|
|
22
|
+
const touch = event.changedTouches[0]
|
|
23
|
+
wrapper.touchmoveX = touch.clientX
|
|
24
|
+
wrapper.touchmoveY = touch.clientY
|
|
25
|
+
|
|
26
|
+
wrapper.move && wrapper.move(Object.assign(event, wrapper))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const handleGesture = (wrapper) => {
|
|
30
|
+
const { touchstartX, touchendX, touchstartY, touchendY } = wrapper
|
|
31
|
+
const dirRatio = 0.5
|
|
32
|
+
const minDistance = 16
|
|
33
|
+
wrapper.offsetX = touchendX - touchstartX
|
|
34
|
+
wrapper.offsetY = touchendY - touchstartY
|
|
35
|
+
|
|
36
|
+
if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {
|
|
37
|
+
wrapper.left && (touchendX < touchstartX - minDistance) && wrapper.left(wrapper)
|
|
38
|
+
wrapper.right && (touchendX > touchstartX + minDistance) && wrapper.right(wrapper)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {
|
|
42
|
+
wrapper.up && (touchendY < touchstartY - minDistance) && wrapper.up(wrapper)
|
|
43
|
+
wrapper.down && (touchendY > touchstartY + minDistance) && wrapper.down(wrapper)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function inserted (el, { value }) {
|
|
48
|
+
const wrapper = {
|
|
49
|
+
touchstartX: 0,
|
|
50
|
+
touchstartY: 0,
|
|
51
|
+
touchendX: 0,
|
|
52
|
+
touchendY: 0,
|
|
53
|
+
touchmoveX: 0,
|
|
54
|
+
touchmoveY: 0,
|
|
55
|
+
offsetX: 0,
|
|
56
|
+
offsetY: 0,
|
|
57
|
+
left: value.left,
|
|
58
|
+
right: value.right,
|
|
59
|
+
up: value.up,
|
|
60
|
+
down: value.down,
|
|
61
|
+
start: value.start,
|
|
62
|
+
move: value.move,
|
|
63
|
+
end: value.end
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const target = value.parent ? el.parentNode : el
|
|
67
|
+
const options = value.options || { passive: true }
|
|
68
|
+
|
|
69
|
+
// Needed to pass unit tests
|
|
70
|
+
if (!target) return
|
|
71
|
+
target.addEventListener('touchstart', e => touchstart(e, wrapper), options)
|
|
72
|
+
target.addEventListener('touchend', e => touchend(e, wrapper), options)
|
|
73
|
+
target.addEventListener('touchmove', e => touchmove(e, wrapper), options)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function unbind (el, { value }) {
|
|
77
|
+
const target = value.parent ? el.parentNode : el
|
|
78
|
+
|
|
79
|
+
if (!target) return
|
|
80
|
+
|
|
81
|
+
target.removeEventListener('touchstart', touchstart)
|
|
82
|
+
target.removeEventListener('touchend', touchend)
|
|
83
|
+
target.removeEventListener('touchmove', touchmove)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default {
|
|
87
|
+
name: 'touch',
|
|
88
|
+
inserted,
|
|
89
|
+
unbind
|
|
90
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require('./stylus/app.styl')
|
|
2
|
+
import Semver from 'semver'
|
|
3
|
+
import { devDependencies, version } from '../package.json'
|
|
4
|
+
import * as components from './components'
|
|
5
|
+
import * as directives from './directives'
|
|
6
|
+
|
|
7
|
+
function Kdutify (Kdu) {
|
|
8
|
+
const Kdutify = components.Kdutify
|
|
9
|
+
|
|
10
|
+
Kdu.use(Kdutify, {
|
|
11
|
+
components,
|
|
12
|
+
directives
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Kdutify.version = version
|
|
17
|
+
|
|
18
|
+
function checkKduVersion () {
|
|
19
|
+
const kduDep = devDependencies.kdu
|
|
20
|
+
if (!Semver.satisfies(window.Kdu.version, kduDep)) {
|
|
21
|
+
console.warn(`Kdutify requires Kdu version ${kduDep}`)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (typeof window !== 'undefined' && window.Kdu) {
|
|
26
|
+
window.Kdu.version && checkKduVersion()
|
|
27
|
+
window.Kdu.use(Kdutify)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default Kdutify
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootable
|
|
3
|
+
* @mixin
|
|
4
|
+
*
|
|
5
|
+
* Used to add lazy content functionality to components
|
|
6
|
+
* Looks for change in "isActive" to automatically boot
|
|
7
|
+
* Otherwise can be set manually
|
|
8
|
+
*/
|
|
9
|
+
export default {
|
|
10
|
+
data: () => ({
|
|
11
|
+
isBooted: false
|
|
12
|
+
}),
|
|
13
|
+
|
|
14
|
+
props: {
|
|
15
|
+
lazy: Boolean
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
watch: {
|
|
19
|
+
isActive () {
|
|
20
|
+
this.isBooted = true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
methods: {
|
|
25
|
+
showLazyContent (content) {
|
|
26
|
+
return (this.isBooted || !this.lazy)
|
|
27
|
+
? content
|
|
28
|
+
: null
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data () {
|
|
3
|
+
return {
|
|
4
|
+
buttons: [],
|
|
5
|
+
listeners: []
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
methods: {
|
|
10
|
+
getValue (i) {
|
|
11
|
+
if (this.buttons[i].value != null) {
|
|
12
|
+
return this.buttons[i].value
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Fix for testing, this should always be false in the browser
|
|
16
|
+
if (this.buttons[i].$el.value != null && this.buttons[i].$el.value !== '') {
|
|
17
|
+
return this.buttons[i].$el.value
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return i
|
|
21
|
+
},
|
|
22
|
+
update () {
|
|
23
|
+
const selected = []
|
|
24
|
+
|
|
25
|
+
this.buttons
|
|
26
|
+
.forEach((button, i) => {
|
|
27
|
+
const elm = button.$el
|
|
28
|
+
|
|
29
|
+
// Fix for testing, dataset does not exist on elm?
|
|
30
|
+
if (!elm.dataset) elm.dataset = {}
|
|
31
|
+
|
|
32
|
+
elm.removeAttribute('data-only-child')
|
|
33
|
+
|
|
34
|
+
if (this.isSelected(i)) {
|
|
35
|
+
elm.setAttribute('data-selected', true)
|
|
36
|
+
|
|
37
|
+
if (!elm.classList.contains('btn--router')) {
|
|
38
|
+
elm.classList.add('btn--active')
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
selected.push(i)
|
|
42
|
+
} else {
|
|
43
|
+
elm.removeAttribute('data-selected')
|
|
44
|
+
|
|
45
|
+
if (!elm.classList.contains('btn--router')) {
|
|
46
|
+
elm.classList.remove('btn--active')
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
elm.dataset.index = i
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
if (selected.length === 1) {
|
|
54
|
+
this.buttons[selected[0]].$el.setAttribute('data-only-child', true)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
mounted () {
|
|
60
|
+
this.$kdutify.load(() => {
|
|
61
|
+
this.buttons = this.$children
|
|
62
|
+
|
|
63
|
+
this.buttons.forEach((button, i) => {
|
|
64
|
+
this.listeners.push(this.updateValue.bind(this, i))
|
|
65
|
+
button.$on('click', this.listeners[i])
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
this.update()
|
|
69
|
+
})
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
beforeDestroy () {
|
|
73
|
+
this.buttons.forEach((button, i) => {
|
|
74
|
+
button.$off('click', this.listeners[i])
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
color: String
|
|
4
|
+
},
|
|
5
|
+
methods: {
|
|
6
|
+
addBackgroundColorClassChecks (classes, prop = 'color') {
|
|
7
|
+
if (this[prop]) {
|
|
8
|
+
classes[this[prop]] = true
|
|
9
|
+
}
|
|
10
|
+
return classes
|
|
11
|
+
},
|
|
12
|
+
addTextColorClassChecks (classes, prop = 'color') {
|
|
13
|
+
const parts = this[prop] ? this[prop].trim().split(' ') : ['']
|
|
14
|
+
let color = parts[0] + '--text'
|
|
15
|
+
if (parts.length > 1) color += ' text--' + parts[1]
|
|
16
|
+
classes[color] = !!this[prop]
|
|
17
|
+
return classes
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delayable
|
|
3
|
+
*
|
|
4
|
+
* @mixin
|
|
5
|
+
*
|
|
6
|
+
* Changes the open or close
|
|
7
|
+
* delay time for elements
|
|
8
|
+
*/
|
|
9
|
+
export default {
|
|
10
|
+
data: () => ({
|
|
11
|
+
openTimeout: null,
|
|
12
|
+
closeTimeout: null
|
|
13
|
+
}),
|
|
14
|
+
|
|
15
|
+
props: {
|
|
16
|
+
openDelay: {
|
|
17
|
+
type: [Number, String],
|
|
18
|
+
default: 0
|
|
19
|
+
},
|
|
20
|
+
closeDelay: {
|
|
21
|
+
type: [Number, String],
|
|
22
|
+
default: 200
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
methods: {
|
|
27
|
+
/**
|
|
28
|
+
* Clear any pending delay
|
|
29
|
+
* timers from executing
|
|
30
|
+
*
|
|
31
|
+
* @return {void}
|
|
32
|
+
*/
|
|
33
|
+
clearDelay () {
|
|
34
|
+
clearTimeout(this.openTimeout)
|
|
35
|
+
clearTimeout(this.closeTimeout)
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Runs callback after
|
|
39
|
+
* a specified delay
|
|
40
|
+
*
|
|
41
|
+
* @param {String} type
|
|
42
|
+
* @param {Function} cb
|
|
43
|
+
*
|
|
44
|
+
* @return {void}
|
|
45
|
+
*/
|
|
46
|
+
runDelay (type, cb) {
|
|
47
|
+
this.clearDelay()
|
|
48
|
+
|
|
49
|
+
const delay = parseInt(this[`${type}Delay`], 10)
|
|
50
|
+
|
|
51
|
+
this[`${type}Timeout`] = setTimeout(cb, delay)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function searchChildren (children) {
|
|
2
|
+
const results = []
|
|
3
|
+
for (const child of children) {
|
|
4
|
+
if (child.isActive && child.isDependent) {
|
|
5
|
+
results.push(child)
|
|
6
|
+
} else {
|
|
7
|
+
results.push(...searchChildren(child.$children))
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return results
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
data () {
|
|
16
|
+
return {
|
|
17
|
+
closeDependents: true,
|
|
18
|
+
isDependent: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
methods: {
|
|
23
|
+
getOpenDependents () {
|
|
24
|
+
if (this.closeDependents) return searchChildren(this.$children)
|
|
25
|
+
|
|
26
|
+
return []
|
|
27
|
+
},
|
|
28
|
+
getOpenDependentElements () {
|
|
29
|
+
const result = []
|
|
30
|
+
|
|
31
|
+
for (const dependent of this.getOpenDependents()) {
|
|
32
|
+
result.push(...dependent.getClickableDependentElements())
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return result
|
|
36
|
+
},
|
|
37
|
+
getClickableDependentElements () {
|
|
38
|
+
const result = [this.$el]
|
|
39
|
+
if (this.$refs.content) result.push(this.$refs.content)
|
|
40
|
+
result.push(...this.getOpenDependentElements())
|
|
41
|
+
|
|
42
|
+
return result
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
watch: {
|
|
47
|
+
isActive (val) {
|
|
48
|
+
if (val) return
|
|
49
|
+
|
|
50
|
+
for (const dependent of this.getOpenDependents()) {
|
|
51
|
+
dependent.isActive = false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|