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,306 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_sliders.styl');
|
|
2
|
+
|
|
3
|
+
import { addOnceEventListener, createRange } from '../../util/helpers';
|
|
4
|
+
|
|
5
|
+
import Input from '../../mixins/input';
|
|
6
|
+
|
|
7
|
+
import ClickOutside from '../../directives/click-outside';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'k-slider',
|
|
11
|
+
|
|
12
|
+
mixins: [Input],
|
|
13
|
+
|
|
14
|
+
directives: { ClickOutside: ClickOutside },
|
|
15
|
+
|
|
16
|
+
data: function data() {
|
|
17
|
+
return {
|
|
18
|
+
app: {},
|
|
19
|
+
isActive: false,
|
|
20
|
+
keyPressed: 0
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
props: {
|
|
26
|
+
color: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
min: {
|
|
31
|
+
type: [Number, String],
|
|
32
|
+
default: 0
|
|
33
|
+
},
|
|
34
|
+
max: {
|
|
35
|
+
type: [Number, String],
|
|
36
|
+
default: 100
|
|
37
|
+
},
|
|
38
|
+
step: {
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
default: null
|
|
41
|
+
},
|
|
42
|
+
thumbColor: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
thumbLabel: Boolean,
|
|
47
|
+
value: [Number, String],
|
|
48
|
+
snap: Boolean,
|
|
49
|
+
trackColor: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
computed: {
|
|
56
|
+
classes: function classes() {
|
|
57
|
+
return {
|
|
58
|
+
'input-group--slider': true,
|
|
59
|
+
'input-group--active': this.isActive,
|
|
60
|
+
'input-group--dirty': this.inputWidth > 0,
|
|
61
|
+
'input-group--disabled': this.disabled,
|
|
62
|
+
'input-group--ticks': !this.disabled && this.step
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
inputValue: {
|
|
67
|
+
get: function get() {
|
|
68
|
+
return this.value;
|
|
69
|
+
},
|
|
70
|
+
set: function set(val) {
|
|
71
|
+
var min = this.min,
|
|
72
|
+
max = this.max,
|
|
73
|
+
step = this.step,
|
|
74
|
+
snap = this.snap;
|
|
75
|
+
|
|
76
|
+
val = val < min && min || val > max && max || val;
|
|
77
|
+
|
|
78
|
+
// Round value to ensure the
|
|
79
|
+
// entire slider range can
|
|
80
|
+
// be selected with step
|
|
81
|
+
var value = snap ? Math.round(val / step) * step : Math.round(val);
|
|
82
|
+
this.lazyValue = value;
|
|
83
|
+
|
|
84
|
+
if (value !== this.value) {
|
|
85
|
+
this.$emit('input', value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
interval: function interval() {
|
|
90
|
+
return 100 / (this.max - this.min) * this.step;
|
|
91
|
+
},
|
|
92
|
+
thumbContainerClasses: function thumbContainerClasses() {
|
|
93
|
+
return {
|
|
94
|
+
'slider__thumb-container': true,
|
|
95
|
+
'slider__thumb-container--label': this.thumbLabel
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
thumbStyles: function thumbStyles() {
|
|
99
|
+
return {
|
|
100
|
+
transition: this.keyPressed >= 2 ? 'none' : '',
|
|
101
|
+
left: this.inputWidth + '%'
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
tickContainerStyles: function tickContainerStyles() {
|
|
105
|
+
return {
|
|
106
|
+
transform: 'translate3d(0, -50%, 0)'
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
trackStyles: function trackStyles() {
|
|
110
|
+
var scaleX = this.calculateScale(1 - this.inputWidth / 100);
|
|
111
|
+
var offsetX = this.thumbLabel ? 0 : !this.isActive ? 8 : 12;
|
|
112
|
+
var translateX = offsetX + 'px';
|
|
113
|
+
return {
|
|
114
|
+
transition: this.keyPressed >= 2 ? 'none' : '',
|
|
115
|
+
transform: 'scaleX(' + scaleX + ') translateX(' + translateX + ')'
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
trackFillStyles: function trackFillStyles() {
|
|
119
|
+
var inputWidth = this.inputWidth;
|
|
120
|
+
var scaleX = this.calculateScale(inputWidth / 100);
|
|
121
|
+
var translateX = inputWidth > 99 && !this.thumbLabel ? -8 + 'px' : 0;
|
|
122
|
+
return {
|
|
123
|
+
transition: this.keyPressed >= 2 ? 'none' : '',
|
|
124
|
+
transform: 'scaleX(' + scaleX + ') translateX(' + translateX + ')'
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
numTicks: function numTicks() {
|
|
128
|
+
return parseInt((this.max - this.min) / this.step);
|
|
129
|
+
},
|
|
130
|
+
inputWidth: function inputWidth() {
|
|
131
|
+
var val = this.inputValue;
|
|
132
|
+
if (this.snap) {
|
|
133
|
+
val = Math.round(val / this.step) * this.step;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
val = (val - this.min) / (this.max - this.min) * 100;
|
|
137
|
+
|
|
138
|
+
return val < 0.15 ? 0 : val;
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
watch: {
|
|
143
|
+
isActive: function isActive(val) {
|
|
144
|
+
this.isFocused = val;
|
|
145
|
+
},
|
|
146
|
+
min: function min(val) {
|
|
147
|
+
val > this.inputValue && this.$emit('input', val);
|
|
148
|
+
},
|
|
149
|
+
max: function max(val) {
|
|
150
|
+
val < this.inputValue && this.$emit('input', val);
|
|
151
|
+
},
|
|
152
|
+
value: function value(val) {
|
|
153
|
+
this.inputValue = val;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
mounted: function mounted() {
|
|
158
|
+
this.inputValue = this.value;
|
|
159
|
+
|
|
160
|
+
// Without a k-app, iOS does not work with body selectors
|
|
161
|
+
this.app = document.querySelector('[data-app]') || console.warn('The k-slider component requires the presence of k-app or a non-body wrapping element with the [data-app] attribute.');
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
methods: {
|
|
166
|
+
calculateScale: function calculateScale(scale) {
|
|
167
|
+
return this.disabled ? scale - 0.015 : scale;
|
|
168
|
+
},
|
|
169
|
+
onMouseDown: function onMouseDown(e) {
|
|
170
|
+
this.keyPressed = 2;
|
|
171
|
+
var options = { passive: true };
|
|
172
|
+
this.isActive = true;
|
|
173
|
+
|
|
174
|
+
if ('touches' in e) {
|
|
175
|
+
this.app.addEventListener('touchmove', this.onMouseMove, options);
|
|
176
|
+
addOnceEventListener(this.app, 'touchend', this.onMouseUp);
|
|
177
|
+
} else {
|
|
178
|
+
this.app.addEventListener('mousemove', this.onMouseMove, options);
|
|
179
|
+
addOnceEventListener(this.app, 'mouseup', this.onMouseUp);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
onMouseUp: function onMouseUp() {
|
|
183
|
+
this.keyPressed = 0;
|
|
184
|
+
var options = { passive: true };
|
|
185
|
+
this.isActive = false;
|
|
186
|
+
this.app.removeEventListener('touchmove', this.onMouseMove, options);
|
|
187
|
+
this.app.removeEventListener('mousemove', this.onMouseMove, options);
|
|
188
|
+
},
|
|
189
|
+
onMouseMove: function onMouseMove(e) {
|
|
190
|
+
var _$refs$track$getBound = this.$refs.track.getBoundingClientRect(),
|
|
191
|
+
offsetLeft = _$refs$track$getBound.left,
|
|
192
|
+
trackWidth = _$refs$track$getBound.width;
|
|
193
|
+
|
|
194
|
+
var clientX = 'touches' in e ? e.touches[0].clientX : e.clientX;
|
|
195
|
+
var left = (clientX - offsetLeft) / trackWidth * 100;
|
|
196
|
+
|
|
197
|
+
if (left >= 0 && left <= 100) {
|
|
198
|
+
this.inputValue = parseInt(this.min, 10) + left / 100 * (this.max - this.min);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
onKeyDown: function onKeyDown(e) {
|
|
202
|
+
if (e.keyCode === 37 || e.keyCode === 39) {
|
|
203
|
+
this.keyPressed += 1;
|
|
204
|
+
|
|
205
|
+
var direction = e.keyCode === 37 && -1 || e.keyCode === 39 && 1 || 0;
|
|
206
|
+
var multiplier = e.shiftKey && 3 || e.ctrlKey && 2 || 1;
|
|
207
|
+
var amount = this.snap && this.step || 1;
|
|
208
|
+
|
|
209
|
+
this.inputValue = this.inputValue + direction * amount * multiplier;
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
onKeyUp: function onKeyUp(e) {
|
|
213
|
+
this.keyPressed = 0;
|
|
214
|
+
},
|
|
215
|
+
sliderMove: function sliderMove(e) {
|
|
216
|
+
if (!this.isActive) {
|
|
217
|
+
this.onMouseMove(e);
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
genThumbLabel: function genThumbLabel(h) {
|
|
221
|
+
return h('k-scale-transition', {
|
|
222
|
+
props: { origin: 'bottom center' }
|
|
223
|
+
}, [h('div', {
|
|
224
|
+
'class': 'slider__thumb--label__container',
|
|
225
|
+
directives: [{
|
|
226
|
+
name: 'show',
|
|
227
|
+
value: this.isActive
|
|
228
|
+
}]
|
|
229
|
+
}, [h('div', { 'class': ['slider__thumb--label', this.thumbColor || this.color] }, [h('span', {}, parseInt(this.inputValue))])])]);
|
|
230
|
+
},
|
|
231
|
+
genThumbContainer: function genThumbContainer(h) {
|
|
232
|
+
var children = [];
|
|
233
|
+
children.push(h('div', { 'class': ['slider__thumb', this.thumbColor || this.color] }));
|
|
234
|
+
|
|
235
|
+
this.thumbLabel && children.push(this.genThumbLabel(h));
|
|
236
|
+
|
|
237
|
+
return h('div', {
|
|
238
|
+
'class': this.thumbContainerClasses,
|
|
239
|
+
style: this.thumbStyles,
|
|
240
|
+
on: {
|
|
241
|
+
touchstart: this.onMouseDown,
|
|
242
|
+
mousedown: this.onMouseDown
|
|
243
|
+
},
|
|
244
|
+
ref: 'thumb'
|
|
245
|
+
}, children);
|
|
246
|
+
},
|
|
247
|
+
genSteps: function genSteps(h) {
|
|
248
|
+
var _this = this;
|
|
249
|
+
|
|
250
|
+
var ticks = createRange(this.numTicks + 1).map(function (i) {
|
|
251
|
+
var span = h('span', {
|
|
252
|
+
class: 'slider__tick',
|
|
253
|
+
style: {
|
|
254
|
+
left: i * (100 / _this.numTicks) + '%'
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
return span;
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
return h('div', {
|
|
262
|
+
'class': 'slider__ticks-container',
|
|
263
|
+
style: this.tickContainerStyles
|
|
264
|
+
}, ticks);
|
|
265
|
+
},
|
|
266
|
+
genTrackContainer: function genTrackContainer(h) {
|
|
267
|
+
var children = [h('div', {
|
|
268
|
+
'class': ['slider__track', this.trackColor],
|
|
269
|
+
style: this.trackStyles
|
|
270
|
+
}), h('div', {
|
|
271
|
+
'class': ['slider__track-fill', this.color],
|
|
272
|
+
style: this.trackFillStyles
|
|
273
|
+
})];
|
|
274
|
+
|
|
275
|
+
return h('div', {
|
|
276
|
+
'class': 'slider__track__container',
|
|
277
|
+
ref: 'track'
|
|
278
|
+
}, children);
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
render: function render(h) {
|
|
283
|
+
var children = [];
|
|
284
|
+
|
|
285
|
+
children.push(this.genTrackContainer(h));
|
|
286
|
+
this.step && children.push(this.genSteps(h));
|
|
287
|
+
children.push(this.genThumbContainer(h));
|
|
288
|
+
|
|
289
|
+
var slider = h('div', { 'class': 'slider' }, children);
|
|
290
|
+
|
|
291
|
+
return this.genInputGroup([slider], {
|
|
292
|
+
attrs: {
|
|
293
|
+
role: 'slider',
|
|
294
|
+
tabindex: this.tabindex
|
|
295
|
+
},
|
|
296
|
+
on: Object.assign({}, {
|
|
297
|
+
mouseup: this.sliderMove,
|
|
298
|
+
keydown: this.onKeyDown,
|
|
299
|
+
keyup: this.onKeyUp
|
|
300
|
+
}, this.$listeners),
|
|
301
|
+
directives: [{
|
|
302
|
+
name: 'click-outside'
|
|
303
|
+
}]
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_snackbars.styl');
|
|
2
|
+
|
|
3
|
+
import { KSlideYTransition, KSlideYReverseTransition } from '../transitions';
|
|
4
|
+
|
|
5
|
+
import Colorable from '../../mixins/colorable';
|
|
6
|
+
import Toggleable from '../../mixins/toggleable';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'k-snackbar',
|
|
10
|
+
|
|
11
|
+
components: {
|
|
12
|
+
KSlideYTransition: KSlideYTransition,
|
|
13
|
+
KSlideYReverseTransition: KSlideYReverseTransition
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
mixins: [Colorable, Toggleable],
|
|
17
|
+
|
|
18
|
+
data: function data() {
|
|
19
|
+
return {
|
|
20
|
+
activeTimeout: {}
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
props: {
|
|
26
|
+
absolute: Boolean,
|
|
27
|
+
bottom: Boolean,
|
|
28
|
+
left: Boolean,
|
|
29
|
+
multiLine: Boolean,
|
|
30
|
+
right: Boolean,
|
|
31
|
+
top: Boolean,
|
|
32
|
+
// TODO: change this to closeDelay to match other API in delayable.js
|
|
33
|
+
timeout: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 6000
|
|
36
|
+
},
|
|
37
|
+
vertical: Boolean
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
computed: {
|
|
41
|
+
classes: function classes() {
|
|
42
|
+
return this.addBackgroundColorClassChecks({
|
|
43
|
+
'snack--active': this.isActive,
|
|
44
|
+
'snack--absolute': this.absolute,
|
|
45
|
+
'snack--bottom': this.bottom || !this.top,
|
|
46
|
+
'snack--left': this.left,
|
|
47
|
+
'snack--multi-line': this.multiLine && !this.vertical,
|
|
48
|
+
'snack--right': this.right,
|
|
49
|
+
'snack--top': this.top,
|
|
50
|
+
'snack--vertical': this.vertical
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
computedTransition: function computedTransition() {
|
|
54
|
+
return this.top ? 'k-slide-y-transition' : 'k-slide-y-reverse-transition';
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
watch: {
|
|
59
|
+
isActive: function isActive() {
|
|
60
|
+
this.setTimeout();
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
methods: {
|
|
65
|
+
setTimeout: function (_setTimeout) {
|
|
66
|
+
function setTimeout() {
|
|
67
|
+
return _setTimeout.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
setTimeout.toString = function () {
|
|
71
|
+
return _setTimeout.toString();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return setTimeout;
|
|
75
|
+
}(function () {
|
|
76
|
+
var _this = this;
|
|
77
|
+
|
|
78
|
+
clearTimeout(this.activeTimeout);
|
|
79
|
+
|
|
80
|
+
if (this.isActive && this.timeout) {
|
|
81
|
+
this.activeTimeout = setTimeout(function () {
|
|
82
|
+
_this.isActive = false;
|
|
83
|
+
}, this.timeout);
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
mounted: function mounted() {
|
|
89
|
+
this.setTimeout();
|
|
90
|
+
},
|
|
91
|
+
render: function render(h) {
|
|
92
|
+
var children = [];
|
|
93
|
+
|
|
94
|
+
if (this.isActive) {
|
|
95
|
+
children.push(h('div', {
|
|
96
|
+
staticClass: 'snack__content'
|
|
97
|
+
}, this.$slots.default));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return h('div', {
|
|
101
|
+
staticClass: 'snack',
|
|
102
|
+
'class': this.classes,
|
|
103
|
+
on: this.$listeners
|
|
104
|
+
}, [h(this.computedTransition, children)]);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
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/_speed-dial.styl');
|
|
4
|
+
|
|
5
|
+
import Toggleable from '../../mixins/toggleable';
|
|
6
|
+
import Positionable from '../../mixins/positionable';
|
|
7
|
+
|
|
8
|
+
import ClickOutside from '../../directives/click-outside';
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'k-speed-dial',
|
|
12
|
+
|
|
13
|
+
mixins: [Positionable, Toggleable],
|
|
14
|
+
|
|
15
|
+
directives: { ClickOutside: ClickOutside },
|
|
16
|
+
|
|
17
|
+
props: {
|
|
18
|
+
direction: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'top',
|
|
21
|
+
validator: function validator(val) {
|
|
22
|
+
return ['top', 'right', 'bottom', 'left'].includes(val);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
hover: Boolean,
|
|
26
|
+
transition: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: 'scale-transition'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
computed: {
|
|
33
|
+
classes: function classes() {
|
|
34
|
+
return _defineProperty({
|
|
35
|
+
'speed-dial': true,
|
|
36
|
+
'speed-dial--top': this.top,
|
|
37
|
+
'speed-dial--right': this.right,
|
|
38
|
+
'speed-dial--bottom': this.bottom,
|
|
39
|
+
'speed-dial--left': this.left,
|
|
40
|
+
'speed-dial--absolute': this.absolute,
|
|
41
|
+
'speed-dial--fixed': this.fixed
|
|
42
|
+
}, 'speed-dial--direction-' + this.direction, true);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
render: function render(h) {
|
|
47
|
+
var _this = this;
|
|
48
|
+
|
|
49
|
+
var children = [];
|
|
50
|
+
var data = {
|
|
51
|
+
'class': this.classes,
|
|
52
|
+
directives: [{
|
|
53
|
+
name: 'click-outside'
|
|
54
|
+
}],
|
|
55
|
+
on: {
|
|
56
|
+
click: function click() {
|
|
57
|
+
return _this.isActive = !_this.isActive;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (this.hover) {
|
|
63
|
+
data.on.mouseenter = function () {
|
|
64
|
+
return _this.isActive = true;
|
|
65
|
+
};
|
|
66
|
+
data.on.mouseleave = function () {
|
|
67
|
+
return _this.isActive = false;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (this.isActive) {
|
|
72
|
+
children = (this.$slots.default || []).map(function (b, i) {
|
|
73
|
+
b.key = i;
|
|
74
|
+
|
|
75
|
+
return b;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var list = h('transition-group', {
|
|
80
|
+
'class': 'speed-dial__list',
|
|
81
|
+
props: {
|
|
82
|
+
name: this.transition,
|
|
83
|
+
tag: 'div'
|
|
84
|
+
}
|
|
85
|
+
}, children);
|
|
86
|
+
|
|
87
|
+
return h('div', data, [this.$slots.activator, list]);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
require('../../../src/stylus/components/_steppers.styl');
|
|
2
|
+
|
|
3
|
+
import Themeable from '../../mixins/themeable';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'k-stepper',
|
|
7
|
+
|
|
8
|
+
mixins: [Themeable],
|
|
9
|
+
|
|
10
|
+
provide: function provide() {
|
|
11
|
+
return {
|
|
12
|
+
stepClick: this.stepClick
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
data: function data() {
|
|
16
|
+
return {
|
|
17
|
+
inputValue: null,
|
|
18
|
+
isBooted: false,
|
|
19
|
+
steps: [],
|
|
20
|
+
content: [],
|
|
21
|
+
isReverse: false
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
props: {
|
|
27
|
+
nonLinear: Boolean,
|
|
28
|
+
altLabels: Boolean,
|
|
29
|
+
vertical: Boolean,
|
|
30
|
+
value: [Number, String]
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
computed: {
|
|
34
|
+
classes: function classes() {
|
|
35
|
+
return {
|
|
36
|
+
'stepper': true,
|
|
37
|
+
'stepper--is-booted': this.isBooted,
|
|
38
|
+
'stepper--vertical': this.vertical,
|
|
39
|
+
'stepper--alt-labels': this.altLabels,
|
|
40
|
+
'stepper--non-linear': this.nonLinear,
|
|
41
|
+
'theme--dark': this.dark,
|
|
42
|
+
'theme--light': this.light
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
watch: {
|
|
48
|
+
inputValue: function inputValue(val, prev) {
|
|
49
|
+
var _this = this;
|
|
50
|
+
|
|
51
|
+
this.isReverse = Number(val) < Number(prev);
|
|
52
|
+
this.steps.forEach(function (i) {
|
|
53
|
+
return i.toggle(_this.inputValue);
|
|
54
|
+
});
|
|
55
|
+
this.content.forEach(function (i) {
|
|
56
|
+
return i.toggle(_this.inputValue, _this.isReverse);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
this.$emit('input', this.inputValue);
|
|
60
|
+
prev && (this.isBooted = true);
|
|
61
|
+
},
|
|
62
|
+
value: function value() {
|
|
63
|
+
var _this2 = this;
|
|
64
|
+
|
|
65
|
+
this.getSteps();
|
|
66
|
+
this.$nextTick(function () {
|
|
67
|
+
return _this2.inputValue = _this2.value;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
mounted: function mounted() {
|
|
73
|
+
this.$kdutify.load(this.init);
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
methods: {
|
|
78
|
+
init: function init() {
|
|
79
|
+
this.getSteps();
|
|
80
|
+
|
|
81
|
+
this.inputValue = this.value || this.steps[0].step || 1;
|
|
82
|
+
},
|
|
83
|
+
getSteps: function getSteps() {
|
|
84
|
+
var _this3 = this;
|
|
85
|
+
|
|
86
|
+
this.steps = [];
|
|
87
|
+
this.content = [];
|
|
88
|
+
this.$children.forEach(function (i) {
|
|
89
|
+
if (i.$options._componentTag === 'k-stepper-step') {
|
|
90
|
+
_this3.steps.push(i);
|
|
91
|
+
} else if (i.$options._componentTag === 'k-stepper-content') {
|
|
92
|
+
i.isVertical = _this3.vertical;
|
|
93
|
+
_this3.content.push(i);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
stepClick: function stepClick(step) {
|
|
98
|
+
var _this4 = this;
|
|
99
|
+
|
|
100
|
+
this.getSteps();
|
|
101
|
+
this.$nextTick(function () {
|
|
102
|
+
return _this4.inputValue = step;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
render: function render(h) {
|
|
108
|
+
return h('div', {
|
|
109
|
+
'class': this.classes
|
|
110
|
+
}, this.$slots.default);
|
|
111
|
+
}
|
|
112
|
+
};
|