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,207 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data: function data() {
|
|
3
|
+
return {
|
|
4
|
+
hasChanged: false
|
|
5
|
+
};
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
methods: {
|
|
9
|
+
genBody: function genBody() {
|
|
10
|
+
var _this = this;
|
|
11
|
+
|
|
12
|
+
var children = [this.genHand(this.selectingHour ? 'hour' : 'minute')];
|
|
13
|
+
var data = {
|
|
14
|
+
'class': 'picker--time__clock',
|
|
15
|
+
on: {
|
|
16
|
+
mousedown: this.onMouseDown,
|
|
17
|
+
mouseup: this.onMouseUp,
|
|
18
|
+
mouseleave: function mouseleave() {
|
|
19
|
+
_this.isDragging && _this.onMouseUp();
|
|
20
|
+
},
|
|
21
|
+
touchstart: this.onMouseDown,
|
|
22
|
+
touchend: this.onMouseUp,
|
|
23
|
+
mousemove: this.onDragMove,
|
|
24
|
+
touchmove: this.onDragMove
|
|
25
|
+
},
|
|
26
|
+
key: this.selectingHour ? 'hour' : 'minute',
|
|
27
|
+
ref: 'clock'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
this.selectingHour && children.push(this.genHours()) || children.push(this.genMinutes());
|
|
31
|
+
|
|
32
|
+
if (this.scrollable) {
|
|
33
|
+
data.on.wheel = function (e) {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
|
|
36
|
+
var diff = e.wheelDelta > 0 ? 1 : -1;
|
|
37
|
+
var changing = _this.selectingHour ? 'changeHour' : 'changeMinute';
|
|
38
|
+
|
|
39
|
+
_this[changing](diff);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return this.$createElement('div', {
|
|
44
|
+
'class': 'picker__body'
|
|
45
|
+
}, [this.$createElement('transition', {
|
|
46
|
+
props: {
|
|
47
|
+
name: 'fade-transition',
|
|
48
|
+
mode: 'out-in'
|
|
49
|
+
}
|
|
50
|
+
}, [this.$createElement('div', data, children)])]);
|
|
51
|
+
},
|
|
52
|
+
genHand: function genHand(type) {
|
|
53
|
+
var scale = this.is24hrAfter12 ? 'scaleY(0.6)' : '';
|
|
54
|
+
return [this.$createElement('div', {
|
|
55
|
+
'class': 'picker--time__clock-hand ' + type,
|
|
56
|
+
style: {
|
|
57
|
+
transform: 'rotate(' + this.clockHand + 'deg) ' + scale
|
|
58
|
+
}
|
|
59
|
+
})];
|
|
60
|
+
},
|
|
61
|
+
genHours: function genHours() {
|
|
62
|
+
var hours = this.is24hr ? 24 : 12;
|
|
63
|
+
var children = [];
|
|
64
|
+
var start = 0;
|
|
65
|
+
|
|
66
|
+
if (hours === 12) {
|
|
67
|
+
hours++;
|
|
68
|
+
start = 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
for (var i = start; i < hours; i++) {
|
|
72
|
+
children.push(this.$createElement('span', {
|
|
73
|
+
'class': {
|
|
74
|
+
'active': i === this.hour,
|
|
75
|
+
'disabled': !this.isAllowed('hour', i)
|
|
76
|
+
},
|
|
77
|
+
style: this.getTransform(i),
|
|
78
|
+
domProps: { innerHTML: '<span>' + i + '</span>' }
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return children;
|
|
83
|
+
},
|
|
84
|
+
genMinutes: function genMinutes() {
|
|
85
|
+
var children = [];
|
|
86
|
+
|
|
87
|
+
for (var i = 0; i < 60; i = i + 5) {
|
|
88
|
+
var num = i;
|
|
89
|
+
|
|
90
|
+
if (num < 10) num = '0' + num;
|
|
91
|
+
if (num === 60) num = '00';
|
|
92
|
+
|
|
93
|
+
children.push(this.$createElement('span', {
|
|
94
|
+
'class': {
|
|
95
|
+
'active': num.toString() === this.minute.toString(),
|
|
96
|
+
'disabled': !this.isAllowed('minute', i)
|
|
97
|
+
},
|
|
98
|
+
style: this.getTransform(i),
|
|
99
|
+
domProps: { innerHTML: '<span>' + num + '</span>' }
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return children;
|
|
104
|
+
},
|
|
105
|
+
getTransform: function getTransform(i) {
|
|
106
|
+
var _getPosition = this.getPosition(i),
|
|
107
|
+
x = _getPosition.x,
|
|
108
|
+
y = _getPosition.y;
|
|
109
|
+
|
|
110
|
+
return { transform: 'translate(' + x + 'px, ' + y + 'px)' };
|
|
111
|
+
},
|
|
112
|
+
getPosition: function getPosition(i) {
|
|
113
|
+
var radiusPercentage = this.selectingHour && this.is24hr && i >= 12 ? 0.5 : 0.8;
|
|
114
|
+
var r = this.radius * radiusPercentage;
|
|
115
|
+
i = this.selectingHour && this.is24hr ? i % 12 : i;
|
|
116
|
+
return {
|
|
117
|
+
x: Math.round(Math.sin(i * this.degrees) * r),
|
|
118
|
+
y: Math.round(-Math.cos(i * this.degrees) * r)
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
changeHour: function changeHour(time) {
|
|
122
|
+
var _this2 = this;
|
|
123
|
+
|
|
124
|
+
var range = this.generateRange('hour', this.hour);
|
|
125
|
+
|
|
126
|
+
time < 0 && (range = range.reverse().slice(1));
|
|
127
|
+
this.hour = range.find(function (h) {
|
|
128
|
+
return _this2.allowedHours ? _this2.isAllowed('hour', h) : true;
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return true;
|
|
132
|
+
},
|
|
133
|
+
changeMinute: function changeMinute(time) {
|
|
134
|
+
var _this3 = this;
|
|
135
|
+
|
|
136
|
+
var current = Number(this.minute);
|
|
137
|
+
var range = this.generateRange('minute', current);
|
|
138
|
+
|
|
139
|
+
time < 0 && (range = range.reverse().slice(1));
|
|
140
|
+
var minute = range.find(function (m) {
|
|
141
|
+
return _this3.allowedMinutes ? _this3.isAllowed('minute', m) : true;
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
this.minute = minute < 10 ? '0' + minute : minute;
|
|
145
|
+
|
|
146
|
+
return true;
|
|
147
|
+
},
|
|
148
|
+
onMouseDown: function onMouseDown(e) {
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
|
|
151
|
+
this.isDragging = true;
|
|
152
|
+
this.onDragMove(e);
|
|
153
|
+
},
|
|
154
|
+
onMouseUp: function onMouseUp() {
|
|
155
|
+
this.isDragging = false;
|
|
156
|
+
!this.selectingHour && this.autosave && this.save();
|
|
157
|
+
if (this.hasChanged) {
|
|
158
|
+
this.selectingHour = false;
|
|
159
|
+
this.hasChanged = false;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
onDragMove: function onDragMove(e) {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
if (!this.isDragging && e.type !== 'click') return;
|
|
165
|
+
|
|
166
|
+
var rect = this.$refs.clock.getBoundingClientRect();
|
|
167
|
+
var center = { x: rect.width / 2, y: 0 - rect.width / 2 };
|
|
168
|
+
var clientY = 'touches' in e ? e.touches[0].clientY : e.clientY;
|
|
169
|
+
var clientX = 'touches' in e ? e.touches[0].clientX : e.clientX;
|
|
170
|
+
var coords = {
|
|
171
|
+
y: rect.top - clientY,
|
|
172
|
+
x: clientX - rect.left
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
var selecting = this.selectingHour ? 'hour' : 'minute';
|
|
176
|
+
var value = Math.round(this.angle(center, coords) / this.degreesPerUnit);
|
|
177
|
+
|
|
178
|
+
if (this.selectingHour && this.is24hr) {
|
|
179
|
+
var insideClick = this.euclidean(center, coords) / this.radius < 0.65;
|
|
180
|
+
value = insideClick ? value + 12 : value;
|
|
181
|
+
|
|
182
|
+
// Necessary to fix edge case when selecting left part of 0 and 12
|
|
183
|
+
value = this.angle(center, coords) >= 345 ? (value + 12) % 24 : value;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (this.isAllowed(selecting, value)) {
|
|
187
|
+
this[selecting] = value;
|
|
188
|
+
this.hasChanged = true;
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
euclidean: function euclidean(p0, p1) {
|
|
192
|
+
var dx = Math.abs(p1.x - p0.x);
|
|
193
|
+
var dy = Math.abs(p1.y - p0.y);
|
|
194
|
+
|
|
195
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
196
|
+
},
|
|
197
|
+
angle: function angle(center, p1) {
|
|
198
|
+
var p0 = {
|
|
199
|
+
x: center.x,
|
|
200
|
+
y: center.y + Math.sqrt(Math.abs(p1.x - center.x) * Math.abs(p1.x - center.x) + Math.abs(p1.y - center.y) * Math.abs(p1.y - center.y))
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
var value = 2 * Math.atan2(p1.y - p0.y, p1.x - p0.x);
|
|
204
|
+
return Math.abs(value * 180 / Math.PI);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
methods: {
|
|
3
|
+
genTitle: function genTitle() {
|
|
4
|
+
var children = [this.genTime()];
|
|
5
|
+
|
|
6
|
+
if (this.format === 'ampm') {
|
|
7
|
+
children.push(this.genAMPM());
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return this.$createElement('div', {
|
|
11
|
+
'class': 'picker__title'
|
|
12
|
+
}, children);
|
|
13
|
+
},
|
|
14
|
+
genTime: function genTime() {
|
|
15
|
+
var _this = this;
|
|
16
|
+
|
|
17
|
+
var hour = this.hour;
|
|
18
|
+
|
|
19
|
+
if (this.is24hr && hour < 10) {
|
|
20
|
+
hour = '0' + hour;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return this.$createElement('div', {
|
|
24
|
+
'class': 'picker--time__title'
|
|
25
|
+
}, [this.$createElement('span', {
|
|
26
|
+
'class': { active: this.selectingHour },
|
|
27
|
+
on: {
|
|
28
|
+
click: function click() {
|
|
29
|
+
return _this.selectingHour = true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}, hour), this.$createElement('span', {
|
|
33
|
+
'class': { active: !this.selectingHour },
|
|
34
|
+
on: {
|
|
35
|
+
click: function click() {
|
|
36
|
+
return _this.selectingHour = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, ':' + this.minute)]);
|
|
40
|
+
},
|
|
41
|
+
genAMPM: function genAMPM() {
|
|
42
|
+
return this.$createElement('div', [this.genPeriod('am'), this.genPeriod('pm')]);
|
|
43
|
+
},
|
|
44
|
+
genPeriod: function genPeriod(period) {
|
|
45
|
+
var _this2 = this;
|
|
46
|
+
|
|
47
|
+
return this.$createElement('span', {
|
|
48
|
+
'class': { active: this.period === period },
|
|
49
|
+
on: { click: function click() {
|
|
50
|
+
return _this2.period = period;
|
|
51
|
+
} }
|
|
52
|
+
}, period.toUpperCase());
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_toolbar.styl');
|
|
2
|
+
|
|
3
|
+
import Applicationable from '../../mixins/applicationable';
|
|
4
|
+
import Colorable from '../../mixins/colorable';
|
|
5
|
+
import Themeable from '../../mixins/themeable';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'k-toolbar',
|
|
9
|
+
|
|
10
|
+
mixins: [Applicationable, Colorable, Themeable],
|
|
11
|
+
|
|
12
|
+
data: function data() {
|
|
13
|
+
return {
|
|
14
|
+
heights: {
|
|
15
|
+
mobileLandscape: 48,
|
|
16
|
+
mobile: 56,
|
|
17
|
+
desktop: 64,
|
|
18
|
+
dense: 48
|
|
19
|
+
},
|
|
20
|
+
denseHeight: 48,
|
|
21
|
+
defaultHeight: 56,
|
|
22
|
+
prominentHeight: 64,
|
|
23
|
+
isExtended: false,
|
|
24
|
+
isScrollingProxy: false,
|
|
25
|
+
marginTop: 0,
|
|
26
|
+
previousScroll: null,
|
|
27
|
+
target: null
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
props: {
|
|
32
|
+
absolute: Boolean,
|
|
33
|
+
card: Boolean,
|
|
34
|
+
clippedLeft: Boolean,
|
|
35
|
+
clippedRight: Boolean,
|
|
36
|
+
dense: Boolean,
|
|
37
|
+
extended: Boolean,
|
|
38
|
+
fixed: Boolean,
|
|
39
|
+
flat: Boolean,
|
|
40
|
+
floating: Boolean,
|
|
41
|
+
height: [Number, String],
|
|
42
|
+
manualScroll: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
prominent: Boolean,
|
|
47
|
+
scrollOffScreen: Boolean,
|
|
48
|
+
scrollTarget: String,
|
|
49
|
+
scrollThreshold: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 100
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
computed: {
|
|
56
|
+
computedHeight: function computedHeight() {
|
|
57
|
+
if (this.height) return parseInt(this.height);
|
|
58
|
+
if (this.dense) return this.heights.dense;
|
|
59
|
+
if (this.prominent || this.$kdutify.breakpoint.mdAndUp) return this.heights.desktop;
|
|
60
|
+
if (this.$kdutify.breakpoint.width > this.$kdutify.breakpoint.height) return this.mobileLandscape;
|
|
61
|
+
|
|
62
|
+
return this.heights.mobile;
|
|
63
|
+
},
|
|
64
|
+
computedMarginTop: function computedMarginTop() {
|
|
65
|
+
return this.marginTop + this.$kdutify.application.bar;
|
|
66
|
+
},
|
|
67
|
+
classes: function classes() {
|
|
68
|
+
return this.addBackgroundColorClassChecks({
|
|
69
|
+
'toolbar': true,
|
|
70
|
+
'elevation-0': this.flat,
|
|
71
|
+
'toolbar--absolute': this.absolute,
|
|
72
|
+
'toolbar--card': this.card,
|
|
73
|
+
'toolbar--clipped': this.clippedLeft || this.clippedRight,
|
|
74
|
+
'toolbar--dense': this.dense,
|
|
75
|
+
'toolbar--fixed': this.fixed,
|
|
76
|
+
'toolbar--floating': this.floating,
|
|
77
|
+
'toolbar--prominent': this.prominent,
|
|
78
|
+
'toolbar--extended': this.isExtended,
|
|
79
|
+
'theme--dark': this.dark,
|
|
80
|
+
'theme--light': this.light
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
isScrolling: {
|
|
85
|
+
get: function get() {
|
|
86
|
+
return this.manualScroll != null ? this.manualScroll : this.isScrollingProxy;
|
|
87
|
+
},
|
|
88
|
+
set: function set(val) {
|
|
89
|
+
this.isScrollingProxy = val;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
paddingLeft: function paddingLeft() {
|
|
93
|
+
if (!this.app || this.clippedLeft) return 0;
|
|
94
|
+
|
|
95
|
+
return this.$kdutify.application.left;
|
|
96
|
+
},
|
|
97
|
+
paddingRight: function paddingRight() {
|
|
98
|
+
if (!this.app || this.clippedRight) return 0;
|
|
99
|
+
|
|
100
|
+
return this.$kdutify.application.right;
|
|
101
|
+
},
|
|
102
|
+
styles: function styles() {
|
|
103
|
+
return this.app && {
|
|
104
|
+
marginTop: this.computedMarginTop + 'px',
|
|
105
|
+
paddingLeft: this.paddingLeft + 'px',
|
|
106
|
+
paddingRight: this.paddingRight + 'px'
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
watch: {
|
|
112
|
+
isScrolling: function isScrolling(val) {
|
|
113
|
+
this.whenScrolled(val);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
mounted: function mounted() {
|
|
118
|
+
this.whenScrolled(this.isScrolling);
|
|
119
|
+
},
|
|
120
|
+
destroyed: function destroyed() {
|
|
121
|
+
if (this.app) this.$kdutify.application.top = 0;
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
methods: {
|
|
126
|
+
onScroll: function onScroll() {
|
|
127
|
+
if (typeof window === 'undefined') return;
|
|
128
|
+
|
|
129
|
+
if (!this.target) {
|
|
130
|
+
this.target = this.scrollTarget ? document.querySelector(this.scrollTarget) : window;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var currentScroll = this.scrollTarget ? this.target.scrollTop : this.target.pageYOffset || document.documentElement.scrollTop;
|
|
134
|
+
|
|
135
|
+
if (currentScroll < this.scrollThreshold) return;
|
|
136
|
+
|
|
137
|
+
if (this.previousScroll === null) {
|
|
138
|
+
this.previousScroll = currentScroll;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
this.isScrollingProxy = this.previousScroll < currentScroll;
|
|
142
|
+
|
|
143
|
+
this.previousScroll = currentScroll;
|
|
144
|
+
},
|
|
145
|
+
updateApplication: function updateApplication() {
|
|
146
|
+
if (!this.app) return;
|
|
147
|
+
|
|
148
|
+
this.$kdutify.application.top = !this.fixed && !this.absolute ? 0 : this.isExtended && !this.isScrolling ? this.computedHeight * 2 : this.computedHeight;
|
|
149
|
+
},
|
|
150
|
+
whenScrolled: function whenScrolled(val) {
|
|
151
|
+
this.marginTop = val ? -this.$refs.content.clientHeight - 6 : 0;
|
|
152
|
+
|
|
153
|
+
this.updateApplication();
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
render: function render(h) {
|
|
158
|
+
this.isExtended = this.extended || !!this.$slots.extension;
|
|
159
|
+
this.updateApplication();
|
|
160
|
+
|
|
161
|
+
var children = [];
|
|
162
|
+
var data = {
|
|
163
|
+
'class': this.classes,
|
|
164
|
+
style: this.styles,
|
|
165
|
+
on: this.$listeners
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
if (this.scrollOffScreen) {
|
|
169
|
+
data.directives = [{
|
|
170
|
+
name: 'scroll',
|
|
171
|
+
value: {
|
|
172
|
+
callback: this.onScroll,
|
|
173
|
+
target: this.scrollTarget
|
|
174
|
+
}
|
|
175
|
+
}];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
children.push(h('div', {
|
|
179
|
+
staticClass: 'toolbar__content',
|
|
180
|
+
style: { height: this.computedHeight + 'px' },
|
|
181
|
+
ref: 'content'
|
|
182
|
+
}, this.$slots.default));
|
|
183
|
+
|
|
184
|
+
if (this.isExtended) {
|
|
185
|
+
children.push(h('div', {
|
|
186
|
+
staticClass: 'toolbar__extension',
|
|
187
|
+
style: { height: this.computedHeight + 'px' }
|
|
188
|
+
}, this.$slots.extension));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return h('nav', data, children);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import KBtn from '../../components/KBtn';
|
|
2
|
+
import KIcon from '../../components/KIcon';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'k-toolbar-side-icon',
|
|
6
|
+
|
|
7
|
+
functional: true,
|
|
8
|
+
|
|
9
|
+
render: function render(h, _ref) {
|
|
10
|
+
var slots = _ref.slots,
|
|
11
|
+
listeners = _ref.listeners,
|
|
12
|
+
props = _ref.props,
|
|
13
|
+
data = _ref.data;
|
|
14
|
+
|
|
15
|
+
var classes = data.staticClass ? data.staticClass + ' toolbar__side-icon' : 'toolbar__side-icon';
|
|
16
|
+
|
|
17
|
+
var d = Object.assign(data, {
|
|
18
|
+
staticClass: classes,
|
|
19
|
+
props: Object.assign(props, {
|
|
20
|
+
icon: true
|
|
21
|
+
}),
|
|
22
|
+
on: listeners
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var defaultSlot = slots().default;
|
|
26
|
+
|
|
27
|
+
return h(KBtn, d, defaultSlot || [h(KIcon, 'menu')]);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createSimpleFunctional } from '../../util/helpers';
|
|
2
|
+
|
|
3
|
+
import KToolbar from './KToolbar';
|
|
4
|
+
import KToolbarSideIcon from './KToolbarSideIcon';
|
|
5
|
+
|
|
6
|
+
export { KToolbar, KToolbarSideIcon };
|
|
7
|
+
export var KToolbarTitle = createSimpleFunctional('toolbar__title');
|
|
8
|
+
export var KToolbarItems = createSimpleFunctional('toolbar__items');
|
|
9
|
+
|
|
10
|
+
KToolbar.install = function install(Kdu) {
|
|
11
|
+
Kdu.component('k-toolbar', KToolbar);
|
|
12
|
+
Kdu.component('k-toolbar-items', KToolbarItems);
|
|
13
|
+
Kdu.component('k-toolbar-title', KToolbarTitle);
|
|
14
|
+
Kdu.component('k-toolbar-side-icon', KToolbarSideIcon);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default KToolbar;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
require('../../../src/stylus/components/_tooltips.styl');
|
|
4
|
+
|
|
5
|
+
// Mixins
|
|
6
|
+
import Colorable from '../../mixins/colorable';
|
|
7
|
+
import Delayable from '../../mixins/delayable';
|
|
8
|
+
import Dependent from '../../mixins/dependent';
|
|
9
|
+
import Detachable from '../../mixins/detachable';
|
|
10
|
+
import Menuable from '../../mixins/menuable';
|
|
11
|
+
import Toggleable from '../../mixins/toggleable';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'k-tooltip',
|
|
15
|
+
|
|
16
|
+
mixins: [Colorable, Delayable, Dependent, Detachable, Menuable, Toggleable],
|
|
17
|
+
|
|
18
|
+
data: function data() {
|
|
19
|
+
return {
|
|
20
|
+
calculatedMinWidth: 0,
|
|
21
|
+
closeDependents: false
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
props: {
|
|
26
|
+
debounce: {
|
|
27
|
+
type: [Number, String],
|
|
28
|
+
default: 0
|
|
29
|
+
},
|
|
30
|
+
fixed: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
tag: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'span'
|
|
37
|
+
},
|
|
38
|
+
transition: String,
|
|
39
|
+
zIndex: {
|
|
40
|
+
default: null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
computed: {
|
|
45
|
+
calculatedLeft: function calculatedLeft() {
|
|
46
|
+
var _dimensions = this.dimensions,
|
|
47
|
+
activator = _dimensions.activator,
|
|
48
|
+
content = _dimensions.content;
|
|
49
|
+
|
|
50
|
+
var left = 0;
|
|
51
|
+
|
|
52
|
+
if (this.top || this.bottom) {
|
|
53
|
+
left = activator.left + activator.width / 2 - content.width / 2;
|
|
54
|
+
} else if (this.left || this.right) {
|
|
55
|
+
left = activator.left + (this.right ? activator.width : -content.width) + (this.right ? 10 : -10);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return this.calcXOverflow(left) + 'px';
|
|
59
|
+
},
|
|
60
|
+
calculatedTop: function calculatedTop() {
|
|
61
|
+
var _dimensions2 = this.dimensions,
|
|
62
|
+
activator = _dimensions2.activator,
|
|
63
|
+
content = _dimensions2.content;
|
|
64
|
+
|
|
65
|
+
var top = 0;
|
|
66
|
+
|
|
67
|
+
if (this.top || this.bottom) {
|
|
68
|
+
top = activator.top - (this.top ? activator.height : -activator.height) - (this.top ? 0 : -10);
|
|
69
|
+
} else if (this.left || this.right) {
|
|
70
|
+
top = activator.top + activator.height / 2 - content.height / 2;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return this.calcYOverflow(top + this.pageYOffset) + 'px';
|
|
74
|
+
},
|
|
75
|
+
classes: function classes() {
|
|
76
|
+
return {
|
|
77
|
+
'tooltip--top': this.top,
|
|
78
|
+
'tooltip--right': this.right,
|
|
79
|
+
'tooltip--bottom': this.bottom,
|
|
80
|
+
'tooltip--left': this.left
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
computedTransition: function computedTransition() {
|
|
84
|
+
if (this.transition) return this.transition;
|
|
85
|
+
if (this.top) return 'slide-y-reverse-transition';
|
|
86
|
+
if (this.right) return 'slide-x-transition';
|
|
87
|
+
if (this.bottom) return 'slide-y-transition';
|
|
88
|
+
if (this.left) return 'slide-x-reverse-transition';
|
|
89
|
+
},
|
|
90
|
+
offsetY: function offsetY() {
|
|
91
|
+
return this.top || this.bottom;
|
|
92
|
+
},
|
|
93
|
+
offsetX: function offsetX() {
|
|
94
|
+
return this.left || this.right;
|
|
95
|
+
},
|
|
96
|
+
styles: function styles() {
|
|
97
|
+
return {
|
|
98
|
+
left: this.calculatedLeft,
|
|
99
|
+
maxWidth: isNaN(this.maxWidth) ? this.maxWidth : this.maxWidth + 'px',
|
|
100
|
+
opacity: this.isActive ? 0.9 : 0,
|
|
101
|
+
top: this.calculatedTop,
|
|
102
|
+
zIndex: this.zIndex || this.activeZIndex
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
methods: {
|
|
108
|
+
activate: function activate() {
|
|
109
|
+
// Update coordinates and dimensions of menu
|
|
110
|
+
// and its activator
|
|
111
|
+
this.updateDimensions();
|
|
112
|
+
// Start the transition
|
|
113
|
+
requestAnimationFrame(this.startTransition);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
render: function render(h) {
|
|
118
|
+
var _addBackgroundColorCl,
|
|
119
|
+
_this = this;
|
|
120
|
+
|
|
121
|
+
var tooltip = h('div', {
|
|
122
|
+
staticClass: 'tooltip__content',
|
|
123
|
+
'class': this.addBackgroundColorClassChecks((_addBackgroundColorCl = {}, _defineProperty(_addBackgroundColorCl, this.contentClass, true), _defineProperty(_addBackgroundColorCl, 'menuable__content__active', this.isActive), _addBackgroundColorCl)),
|
|
124
|
+
style: this.styles,
|
|
125
|
+
attrs: this.attrs,
|
|
126
|
+
directives: [{
|
|
127
|
+
name: 'show',
|
|
128
|
+
value: this.isContentActive
|
|
129
|
+
}],
|
|
130
|
+
ref: 'content'
|
|
131
|
+
}, this.$slots.default);
|
|
132
|
+
|
|
133
|
+
return h(this.tag, {
|
|
134
|
+
staticClass: 'tooltip',
|
|
135
|
+
'class': this.classes
|
|
136
|
+
}, [h('transition', {
|
|
137
|
+
props: {
|
|
138
|
+
name: this.computedTransition
|
|
139
|
+
}
|
|
140
|
+
}, [tooltip]), h('span', {
|
|
141
|
+
on: {
|
|
142
|
+
mouseenter: function mouseenter() {
|
|
143
|
+
_this.runDelay('open', function () {
|
|
144
|
+
return _this.isActive = true;
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
mouseleave: function mouseleave() {
|
|
148
|
+
_this.runDelay('close', function () {
|
|
149
|
+
return _this.isActive = false;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
ref: 'activator'
|
|
154
|
+
}, this.$slots.activator)]);
|
|
155
|
+
}
|
|
156
|
+
};
|