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,134 @@
|
|
|
1
|
+
import { KTabTransition, KTabReverseTransition } from '../transitions';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'k-stepper-content',
|
|
5
|
+
|
|
6
|
+
components: {
|
|
7
|
+
KTabTransition: KTabTransition,
|
|
8
|
+
KTabReverseTransition: KTabReverseTransition
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
data: function data() {
|
|
12
|
+
return {
|
|
13
|
+
height: 0,
|
|
14
|
+
isActive: false,
|
|
15
|
+
isReverse: false,
|
|
16
|
+
isVertical: false
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
step: {
|
|
23
|
+
type: [Number, String],
|
|
24
|
+
required: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
computed: {
|
|
29
|
+
classes: function classes() {
|
|
30
|
+
return {
|
|
31
|
+
'stepper__content': true
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
computedTransition: function computedTransition() {
|
|
35
|
+
return this.isReverse ? 'k-tab-reverse-transition' : 'k-tab-transition';
|
|
36
|
+
},
|
|
37
|
+
styles: function styles() {
|
|
38
|
+
if (!this.isVertical) return {};
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
height: !isNaN(this.height) ? this.height + 'px' : this.height
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
wrapperClasses: function wrapperClasses() {
|
|
45
|
+
return {
|
|
46
|
+
'stepper__wrapper': true
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
watch: {
|
|
52
|
+
isActive: function isActive() {
|
|
53
|
+
if (!this.isVertical) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (this.isActive) {
|
|
58
|
+
this.enter();
|
|
59
|
+
} else {
|
|
60
|
+
this.leave();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
mounted: function mounted() {
|
|
66
|
+
this.$refs.wrapper.addEventListener('transitionend', this.onTransition, false);
|
|
67
|
+
},
|
|
68
|
+
beforeDestroy: function beforeDestroy() {
|
|
69
|
+
this.$refs.wrapper.removeEventListener('transitionend', this.onTransition, false);
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
methods: {
|
|
74
|
+
onTransition: function onTransition() {
|
|
75
|
+
if (!this.isActive) return;
|
|
76
|
+
|
|
77
|
+
this.height = 'auto';
|
|
78
|
+
},
|
|
79
|
+
enter: function enter() {
|
|
80
|
+
var _this = this;
|
|
81
|
+
|
|
82
|
+
var scrollHeight = 0;
|
|
83
|
+
|
|
84
|
+
// Render bug with height
|
|
85
|
+
setTimeout(function () {
|
|
86
|
+
scrollHeight = _this.$refs.wrapper.scrollHeight;
|
|
87
|
+
}, 0);
|
|
88
|
+
|
|
89
|
+
this.height = 0;
|
|
90
|
+
|
|
91
|
+
// Give the collapsing element time to collapse
|
|
92
|
+
setTimeout(function () {
|
|
93
|
+
return _this.height = scrollHeight || 'auto';
|
|
94
|
+
}, 450);
|
|
95
|
+
},
|
|
96
|
+
leave: function leave() {
|
|
97
|
+
var _this2 = this;
|
|
98
|
+
|
|
99
|
+
this.height = this.$refs.wrapper.clientHeight;
|
|
100
|
+
setTimeout(function () {
|
|
101
|
+
return _this2.height = 0;
|
|
102
|
+
}, 0);
|
|
103
|
+
},
|
|
104
|
+
toggle: function toggle(step, reverse) {
|
|
105
|
+
this.isActive = step.toString() === this.step.toString();
|
|
106
|
+
this.isReverse = reverse;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
render: function render(h) {
|
|
111
|
+
var contentData = {
|
|
112
|
+
'class': this.classes
|
|
113
|
+
};
|
|
114
|
+
var wrapperData = {
|
|
115
|
+
'class': this.wrapperClasses,
|
|
116
|
+
style: this.styles,
|
|
117
|
+
ref: 'wrapper'
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
if (!this.isVertical) {
|
|
121
|
+
contentData.directives = [{
|
|
122
|
+
name: 'show',
|
|
123
|
+
value: this.isActive
|
|
124
|
+
}];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var wrapper = h('div', wrapperData, [this.$slots.default]);
|
|
128
|
+
var content = h('div', contentData, [wrapper]);
|
|
129
|
+
|
|
130
|
+
return h(this.computedTransition, {
|
|
131
|
+
on: this.$listeners
|
|
132
|
+
}, [content]);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import KIcon from '../KIcon';
|
|
2
|
+
import Ripple from '../../directives/ripple';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'k-stepper-step',
|
|
6
|
+
|
|
7
|
+
components: { KIcon: KIcon },
|
|
8
|
+
|
|
9
|
+
directives: { Ripple: Ripple },
|
|
10
|
+
|
|
11
|
+
inject: ['stepClick'],
|
|
12
|
+
|
|
13
|
+
data: function data() {
|
|
14
|
+
return {
|
|
15
|
+
isActive: false,
|
|
16
|
+
isInactive: true
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
complete: Boolean,
|
|
23
|
+
completeIcon: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'check'
|
|
26
|
+
},
|
|
27
|
+
editIcon: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'edit'
|
|
30
|
+
},
|
|
31
|
+
errorIcon: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'warning'
|
|
34
|
+
},
|
|
35
|
+
editable: Boolean,
|
|
36
|
+
rules: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default: function _default() {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
step: [Number, String]
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
computed: {
|
|
46
|
+
classes: function classes() {
|
|
47
|
+
return {
|
|
48
|
+
'stepper__step': true,
|
|
49
|
+
'stepper__step--active': this.isActive,
|
|
50
|
+
'stepper__step--editable': this.editable,
|
|
51
|
+
'stepper__step--inactive': this.isInactive,
|
|
52
|
+
'stepper__step--error': this.hasError,
|
|
53
|
+
'stepper__step--complete': this.complete
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
hasError: function hasError() {
|
|
57
|
+
return this.rules.some(function (i) {
|
|
58
|
+
return i() !== true;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
methods: {
|
|
64
|
+
click: function click(e) {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
|
|
67
|
+
if (this.editable) {
|
|
68
|
+
this.stepClick(this.step);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
toggle: function toggle(step) {
|
|
72
|
+
this.isActive = step.toString() === this.step.toString();
|
|
73
|
+
this.isInactive = Number(step) < Number(this.step);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
render: function render(h) {
|
|
78
|
+
var data = {
|
|
79
|
+
'class': this.classes,
|
|
80
|
+
directives: [{
|
|
81
|
+
name: 'ripple',
|
|
82
|
+
value: this.editable
|
|
83
|
+
}],
|
|
84
|
+
on: { click: this.click }
|
|
85
|
+
};
|
|
86
|
+
var stepContent = void 0;
|
|
87
|
+
|
|
88
|
+
if (this.hasError) {
|
|
89
|
+
stepContent = [h('k-icon', {}, this.errorIcon)];
|
|
90
|
+
} else if (this.complete) {
|
|
91
|
+
if (this.editable) {
|
|
92
|
+
stepContent = [h('k-icon', {}, this.editIcon)];
|
|
93
|
+
} else {
|
|
94
|
+
stepContent = [h('k-icon', {}, this.completeIcon)];
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
stepContent = this.step;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var step = h('span', { 'class': 'stepper__step__step' }, stepContent);
|
|
101
|
+
var label = h('div', { 'class': 'stepper__label' }, this.$slots.default);
|
|
102
|
+
|
|
103
|
+
return h('div', data, [step, label]);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createSimpleFunctional } from '../../util/helpers';
|
|
2
|
+
import KStepper from './KStepper';
|
|
3
|
+
import KStepperStep from './KStepperStep';
|
|
4
|
+
import KStepperContent from './KStepperContent';
|
|
5
|
+
|
|
6
|
+
KStepper.install = function install(Kdu) {
|
|
7
|
+
var KStepperHeader = createSimpleFunctional('stepper__header');
|
|
8
|
+
var KStepperItems = createSimpleFunctional('stepper__items');
|
|
9
|
+
|
|
10
|
+
Kdu.component(KStepper.name, KStepper);
|
|
11
|
+
Kdu.component(KStepperContent.name, KStepperContent);
|
|
12
|
+
Kdu.component(KStepperStep.name, KStepperStep);
|
|
13
|
+
Kdu.component(KStepperHeader.name, KStepperHeader);
|
|
14
|
+
Kdu.component(KStepperItems.name, KStepperItems);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default KStepper;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_subheaders.styl');
|
|
2
|
+
|
|
3
|
+
import Themeable from '../../mixins/themeable';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'k-subheader',
|
|
7
|
+
|
|
8
|
+
functional: true,
|
|
9
|
+
|
|
10
|
+
mixins: [Themeable],
|
|
11
|
+
|
|
12
|
+
props: {
|
|
13
|
+
inset: Boolean
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
render: function render(h, _ref) {
|
|
17
|
+
var data = _ref.data,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
props = _ref.props;
|
|
20
|
+
|
|
21
|
+
data.staticClass = ('subheader ' + (data.staticClass || '')).trim();
|
|
22
|
+
|
|
23
|
+
if (props.inset) data.staticClass += ' subheader--inset';
|
|
24
|
+
if (props.light) data.staticClass += ' theme--light';
|
|
25
|
+
if (props.dark) data.staticClass += ' theme--dark';
|
|
26
|
+
|
|
27
|
+
return h('li', data, children);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_input-groups.styl');
|
|
2
|
+
require('../../../src/stylus/components/_selection-controls.styl');
|
|
3
|
+
require('../../../src/stylus/components/_switch.styl');
|
|
4
|
+
|
|
5
|
+
import Rippleable from '../../mixins/rippleable';
|
|
6
|
+
import Selectable from '../../mixins/selectable';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'k-switch',
|
|
10
|
+
|
|
11
|
+
mixins: [Rippleable, Selectable],
|
|
12
|
+
|
|
13
|
+
computed: {
|
|
14
|
+
classes: function classes() {
|
|
15
|
+
var classes = {
|
|
16
|
+
'input-group--selection-controls switch': true
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
if (this.hasError) {
|
|
20
|
+
classes['error--text'] = true;
|
|
21
|
+
} else {
|
|
22
|
+
return this.addTextColorClassChecks(classes);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return classes;
|
|
26
|
+
},
|
|
27
|
+
rippleClasses: function rippleClasses() {
|
|
28
|
+
return {
|
|
29
|
+
'input-group--selection-controls__ripple': true,
|
|
30
|
+
'input-group--selection-controls__ripple--active': this.isActive
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
containerClasses: function containerClasses() {
|
|
34
|
+
return {
|
|
35
|
+
'input-group--selection-controls__container': true,
|
|
36
|
+
'input-group--selection-controls__container--light': this.light,
|
|
37
|
+
'input-group--selection-controls__container--disabled': this.disabled
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
toggleClasses: function toggleClasses() {
|
|
41
|
+
return {
|
|
42
|
+
'input-group--selection-controls__toggle': true,
|
|
43
|
+
'input-group--selection-controls__toggle--active': this.isActive
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
render: function render(h) {
|
|
49
|
+
var container = h('div', {
|
|
50
|
+
'class': this.containerClasses
|
|
51
|
+
}, [h('div', { 'class': this.toggleClasses }), this.genRipple()]);
|
|
52
|
+
|
|
53
|
+
return this.genInputGroup([container]);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_system-bars.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-system-bar',
|
|
9
|
+
|
|
10
|
+
mixins: [Applicationable, Colorable, Themeable],
|
|
11
|
+
|
|
12
|
+
props: {
|
|
13
|
+
lightsOut: Boolean,
|
|
14
|
+
status: Boolean,
|
|
15
|
+
window: Boolean
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
computed: {
|
|
19
|
+
classes: function classes() {
|
|
20
|
+
return this.addBackgroundColorClassChecks({
|
|
21
|
+
'system-bar': true,
|
|
22
|
+
'system-bar--lights-out': this.lightsOut,
|
|
23
|
+
'system-bar--status': this.status,
|
|
24
|
+
'system-bar--window': this.window,
|
|
25
|
+
'theme--dark': this.dark,
|
|
26
|
+
'theme--light': this.light
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
computedHeight: function computedHeight() {
|
|
30
|
+
if (this.window) return 32;
|
|
31
|
+
|
|
32
|
+
return 24;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
methods: {
|
|
37
|
+
updateApplication: function updateApplication() {
|
|
38
|
+
if (!this.app) return;
|
|
39
|
+
|
|
40
|
+
this.$kdutify.application.bar = this.computedHeight;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
render: function render(h) {
|
|
45
|
+
var data = {
|
|
46
|
+
'class': this.classes,
|
|
47
|
+
style: {
|
|
48
|
+
height: this.computedHeight + 'px'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return h('div', data, this.$slots.default);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_tabs.styl');
|
|
2
|
+
|
|
3
|
+
import Themeable from '../../mixins/themeable';
|
|
4
|
+
import Resize from '../../directives/resize';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
name: 'k-tabs',
|
|
8
|
+
|
|
9
|
+
directives: {
|
|
10
|
+
Resize: Resize
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
mixins: [Themeable],
|
|
14
|
+
|
|
15
|
+
provide: function provide() {
|
|
16
|
+
var _this = this;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
registerContent: this.registerContent,
|
|
20
|
+
unregisterContent: this.unregisterContent,
|
|
21
|
+
registerTabItem: this.registerTabItem,
|
|
22
|
+
unregisterTabItem: this.unregisterTabItem,
|
|
23
|
+
next: this.next,
|
|
24
|
+
prev: this.prev,
|
|
25
|
+
slider: this.slider,
|
|
26
|
+
tabClick: this.tabClick,
|
|
27
|
+
isScrollable: function isScrollable() {
|
|
28
|
+
return _this.scrollable;
|
|
29
|
+
},
|
|
30
|
+
isMobile: function isMobile() {
|
|
31
|
+
return _this.isMobile;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
data: function data() {
|
|
36
|
+
return {
|
|
37
|
+
content: [],
|
|
38
|
+
tabItems: [],
|
|
39
|
+
activeIndex: null,
|
|
40
|
+
isBooted: false,
|
|
41
|
+
isMobile: false,
|
|
42
|
+
resizeTimeout: null,
|
|
43
|
+
reverse: false,
|
|
44
|
+
target: null,
|
|
45
|
+
tabsSlider: null,
|
|
46
|
+
targetEl: null,
|
|
47
|
+
tabsContainer: null,
|
|
48
|
+
transitionTime: 300
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
props: {
|
|
54
|
+
centered: Boolean,
|
|
55
|
+
fixed: Boolean,
|
|
56
|
+
grow: Boolean,
|
|
57
|
+
icons: Boolean,
|
|
58
|
+
mobileBreakPoint: {
|
|
59
|
+
type: [Number, String],
|
|
60
|
+
default: 1280
|
|
61
|
+
},
|
|
62
|
+
value: String,
|
|
63
|
+
scrollable: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
computed: {
|
|
70
|
+
classes: function classes() {
|
|
71
|
+
return {
|
|
72
|
+
'tabs': true,
|
|
73
|
+
'tabs--centered': this.centered,
|
|
74
|
+
'tabs--fixed': this.fixed,
|
|
75
|
+
'tabs--grow': this.grow,
|
|
76
|
+
'tabs--icons': this.icons,
|
|
77
|
+
'tabs--mobile': this.isMobile,
|
|
78
|
+
'tabs--scroll-bars': this.scrollable,
|
|
79
|
+
'theme--dark': this.dark,
|
|
80
|
+
'theme--light': this.light
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
watch: {
|
|
86
|
+
value: function value() {
|
|
87
|
+
this.tabClick(this.value);
|
|
88
|
+
},
|
|
89
|
+
activeIndex: function activeIndex() {
|
|
90
|
+
var _this2 = this;
|
|
91
|
+
|
|
92
|
+
this.updateTabs();
|
|
93
|
+
this.$nextTick(function () {
|
|
94
|
+
return _this2.isBooted = true;
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
tabItems: function tabItems(newItems, oldItems) {
|
|
98
|
+
var _this3 = this;
|
|
99
|
+
|
|
100
|
+
// Tab item got removed
|
|
101
|
+
if (oldItems.length > newItems.length) {
|
|
102
|
+
if (!newItems.find(function (o) {
|
|
103
|
+
return o.id === _this3.target;
|
|
104
|
+
})) {
|
|
105
|
+
var i = oldItems.findIndex(function (o) {
|
|
106
|
+
return o.id === _this3.target;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
this.$nextTick(function () {
|
|
110
|
+
_this3.activeIndex = _this3.tabItems[i > 0 ? i - 1 : 0].id;
|
|
111
|
+
_this3.target = _this3.activeIndex;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
this.slider();
|
|
116
|
+
},
|
|
117
|
+
'$kdutify.application.left': function $kdutifyApplicationLeft() {
|
|
118
|
+
this.onContainerResize();
|
|
119
|
+
},
|
|
120
|
+
'$kdutify.application.right': function $kdutifyApplicationRight() {
|
|
121
|
+
this.onContainerResize();
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
mounted: function mounted() {
|
|
126
|
+
var _this4 = this;
|
|
127
|
+
|
|
128
|
+
this.$kdutify.load(function () {
|
|
129
|
+
// // This is a workaround to detect if link is active
|
|
130
|
+
// // when being used as a router or nuxt link
|
|
131
|
+
var i = _this4.tabItems.findIndex(function (_ref) {
|
|
132
|
+
var el = _ref.el;
|
|
133
|
+
|
|
134
|
+
return el.firstChild.classList.contains('tabs__item--active');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
var tab = _this4.value || (_this4.tabItems[i !== -1 ? i : 0] || {}).id;
|
|
138
|
+
|
|
139
|
+
tab && _this4.tabClick(tab) && _this4.onResize();
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
methods: {
|
|
145
|
+
registerContent: function registerContent(id, toggle) {
|
|
146
|
+
this.content.push({ id: id, toggle: toggle });
|
|
147
|
+
},
|
|
148
|
+
registerTabItem: function registerTabItem(id, toggle, el) {
|
|
149
|
+
this.tabItems.push({ id: id, toggle: toggle, el: el });
|
|
150
|
+
},
|
|
151
|
+
unregisterContent: function unregisterContent(id) {
|
|
152
|
+
this.content = this.content.filter(function (o) {
|
|
153
|
+
return o.id !== id;
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
unregisterTabItem: function unregisterTabItem(id) {
|
|
157
|
+
this.tabItems = this.tabItems.filter(function (o) {
|
|
158
|
+
return o.id !== id;
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
next: function next(cycle) {
|
|
162
|
+
var nextIndex = this.activeIndex + 1;
|
|
163
|
+
|
|
164
|
+
if (!this.content[nextIndex]) {
|
|
165
|
+
if (!cycle) return;
|
|
166
|
+
nextIndex = 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
this.tabClick(this.tabItems[nextIndex].id);
|
|
170
|
+
},
|
|
171
|
+
prev: function prev(cycle) {
|
|
172
|
+
var prevIndex = this.activeIndex - 1;
|
|
173
|
+
|
|
174
|
+
if (!this.content[prevIndex]) {
|
|
175
|
+
if (!cycle) return;
|
|
176
|
+
prevIndex = this.content.length - 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this.tabClick(this.tabItems[prevIndex].id);
|
|
180
|
+
},
|
|
181
|
+
onResize: function onResize() {
|
|
182
|
+
this.isMobile = window.innerWidth < this.mobileBreakPoint;
|
|
183
|
+
this.slider();
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* When k-navigation-drawer changes the
|
|
188
|
+
* width of the container, call resize
|
|
189
|
+
* after the transition is complete
|
|
190
|
+
*
|
|
191
|
+
* @return {Void}
|
|
192
|
+
*/
|
|
193
|
+
onContainerResize: function onContainerResize() {
|
|
194
|
+
clearTimeout(this.resizeTimeout);
|
|
195
|
+
this.resizeTimeout = setTimeout(this.onResize, this.transitionTime);
|
|
196
|
+
},
|
|
197
|
+
slider: function slider(el) {
|
|
198
|
+
var _this5 = this;
|
|
199
|
+
|
|
200
|
+
this.tabsSlider = this.tabsSlider || this.$el.querySelector('.tabs__slider');
|
|
201
|
+
|
|
202
|
+
this.tabsContainer = this.tabsContainer || this.$el.querySelector('.tabs__container');
|
|
203
|
+
|
|
204
|
+
if (!this.tabsSlider || !this.tabsContainer) return;
|
|
205
|
+
|
|
206
|
+
this.targetEl = el || this.targetEl;
|
|
207
|
+
|
|
208
|
+
if (!this.targetEl) return;
|
|
209
|
+
|
|
210
|
+
// Gives DOM time to paint when
|
|
211
|
+
// processing slider for
|
|
212
|
+
// dynamic tabs
|
|
213
|
+
this.$nextTick(function () {
|
|
214
|
+
// #684 Calculate width as %
|
|
215
|
+
var width = _this5.targetEl.scrollWidth / _this5.tabsContainer.clientWidth * 100;
|
|
216
|
+
|
|
217
|
+
_this5.tabsSlider.style.width = width + '%';
|
|
218
|
+
_this5.tabsSlider.style.left = _this5.targetEl.offsetLeft + 'px';
|
|
219
|
+
});
|
|
220
|
+
},
|
|
221
|
+
tabClick: function tabClick(target) {
|
|
222
|
+
var _this6 = this;
|
|
223
|
+
|
|
224
|
+
var setActiveIndex = function setActiveIndex(index) {
|
|
225
|
+
if (_this6.activeIndex === index) {
|
|
226
|
+
// #762 update tabs display
|
|
227
|
+
// In case tabs count got changed but activeIndex didn't
|
|
228
|
+
_this6.updateTabs();
|
|
229
|
+
} else {
|
|
230
|
+
_this6.activeIndex = index;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
this.target = target;
|
|
235
|
+
|
|
236
|
+
this.$nextTick(function () {
|
|
237
|
+
var nextIndex = _this6.content.findIndex(function (o) {
|
|
238
|
+
return o.id === target;
|
|
239
|
+
});
|
|
240
|
+
_this6.reverse = nextIndex < _this6.activeIndex;
|
|
241
|
+
setActiveIndex(nextIndex);
|
|
242
|
+
|
|
243
|
+
_this6.$emit('input', _this6.target);
|
|
244
|
+
});
|
|
245
|
+
},
|
|
246
|
+
updateTabs: function updateTabs() {
|
|
247
|
+
var _this7 = this;
|
|
248
|
+
|
|
249
|
+
this.content.forEach(function (_ref2) {
|
|
250
|
+
var toggle = _ref2.toggle;
|
|
251
|
+
|
|
252
|
+
toggle(_this7.target, _this7.reverse, _this7.isBooted);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
this.tabItems.forEach(function (_ref3) {
|
|
256
|
+
var toggle = _ref3.toggle;
|
|
257
|
+
|
|
258
|
+
toggle(_this7.target);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
render: function render(h) {
|
|
264
|
+
return h('div', {
|
|
265
|
+
'class': this.classes,
|
|
266
|
+
directives: [{
|
|
267
|
+
name: 'resize',
|
|
268
|
+
value: this.onResize
|
|
269
|
+
}]
|
|
270
|
+
}, this.$slots.default);
|
|
271
|
+
}
|
|
272
|
+
};
|