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,21 @@
|
|
|
1
|
+
import Ripple from '../directives/ripple';
|
|
2
|
+
|
|
3
|
+
/** @mixin */
|
|
4
|
+
export default {
|
|
5
|
+
directives: { Ripple: Ripple },
|
|
6
|
+
|
|
7
|
+
methods: {
|
|
8
|
+
genRipple: function genRipple() {
|
|
9
|
+
return this.$createElement('div', {
|
|
10
|
+
'class': this.rippleClasses || 'input-group--selection-controls__ripple',
|
|
11
|
+
on: Object.assign({}, {
|
|
12
|
+
click: this.toggle
|
|
13
|
+
}, this.$listeners),
|
|
14
|
+
directives: [{
|
|
15
|
+
name: 'ripple',
|
|
16
|
+
value: !this.disabled && { center: true }
|
|
17
|
+
}]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
|
+
|
|
3
|
+
import Ripple from '../directives/ripple';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
directives: {
|
|
7
|
+
Ripple: Ripple
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
props: {
|
|
11
|
+
activeClass: String,
|
|
12
|
+
append: Boolean,
|
|
13
|
+
disabled: Boolean,
|
|
14
|
+
exact: Boolean,
|
|
15
|
+
href: [String, Object],
|
|
16
|
+
to: [String, Object],
|
|
17
|
+
nuxt: Boolean,
|
|
18
|
+
replace: Boolean,
|
|
19
|
+
ripple: Boolean,
|
|
20
|
+
tag: String,
|
|
21
|
+
target: String
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
methods: {
|
|
25
|
+
click: function click() {},
|
|
26
|
+
generateRouteLink: function generateRouteLink() {
|
|
27
|
+
var exact = this.exact;
|
|
28
|
+
var tag = void 0;
|
|
29
|
+
|
|
30
|
+
var data = {
|
|
31
|
+
attrs: { disabled: this.disabled },
|
|
32
|
+
class: this.classes,
|
|
33
|
+
props: {},
|
|
34
|
+
directives: [{
|
|
35
|
+
name: 'ripple',
|
|
36
|
+
value: this.ripple || false
|
|
37
|
+
}],
|
|
38
|
+
on: _extends({}, this.$listeners || {}, {
|
|
39
|
+
click: this.click
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
if (typeof this.exact === 'undefined') {
|
|
44
|
+
exact = this.to === '/' || this.to === Object(this.to) && this.to.path === '/';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (this.to) {
|
|
48
|
+
tag = this.nuxt ? 'nuxt-link' : 'router-link';
|
|
49
|
+
data.props.to = this.to;
|
|
50
|
+
data.props.exact = exact;
|
|
51
|
+
data.props.activeClass = this.activeClass;
|
|
52
|
+
data.props.append = this.append;
|
|
53
|
+
data.props.replace = this.replace;
|
|
54
|
+
} else {
|
|
55
|
+
tag = this.href && 'a' || this.tag || 'a';
|
|
56
|
+
|
|
57
|
+
if (tag === 'a') {
|
|
58
|
+
data.attrs.href = this.href || 'javascript:;';
|
|
59
|
+
if (this.target) data.attrs.target = this.target;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { tag: tag, data: data };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import Colorable from './colorable';
|
|
2
|
+
import Input from './input';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
mixins: [Input, Colorable],
|
|
6
|
+
|
|
7
|
+
model: {
|
|
8
|
+
prop: 'inputValue',
|
|
9
|
+
event: 'change'
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
props: {
|
|
13
|
+
id: String,
|
|
14
|
+
inputValue: null,
|
|
15
|
+
falseValue: null,
|
|
16
|
+
trueValue: null
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
computed: {
|
|
20
|
+
isActive: function isActive() {
|
|
21
|
+
if (Array.isArray(this.inputValue)) {
|
|
22
|
+
return this.inputValue.indexOf(this.value) !== -1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!this.trueValue || !this.falseValue) {
|
|
26
|
+
return this.value ? this.value === this.inputValue : Boolean(this.inputValue);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return this.inputValue === this.trueValue;
|
|
30
|
+
},
|
|
31
|
+
isDirty: function isDirty() {
|
|
32
|
+
return this.isActive;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
watch: {
|
|
37
|
+
indeterminate: function indeterminate(val) {
|
|
38
|
+
this.inputIndeterminate = val;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
methods: {
|
|
43
|
+
genLabel: function genLabel() {
|
|
44
|
+
return this.$createElement('label', {
|
|
45
|
+
on: { click: this.toggle },
|
|
46
|
+
attrs: {
|
|
47
|
+
for: this.id
|
|
48
|
+
}
|
|
49
|
+
}, this.$slots.label || this.label);
|
|
50
|
+
},
|
|
51
|
+
toggle: function toggle() {
|
|
52
|
+
if (this.disabled) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var input = this.inputValue;
|
|
57
|
+
if (Array.isArray(input)) {
|
|
58
|
+
input = input.slice();
|
|
59
|
+
var i = input.indexOf(this.value);
|
|
60
|
+
|
|
61
|
+
if (i === -1) {
|
|
62
|
+
input.push(this.value);
|
|
63
|
+
} else {
|
|
64
|
+
input.splice(i, 1);
|
|
65
|
+
}
|
|
66
|
+
} else if (this.trueValue || this.falseValue) {
|
|
67
|
+
input = input === this.trueValue ? this.falseValue : this.trueValue;
|
|
68
|
+
} else if (this.value) {
|
|
69
|
+
input = this.value === this.inputValue ? null : this.value;
|
|
70
|
+
} else {
|
|
71
|
+
input = !input;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
this.validate(true, input);
|
|
75
|
+
|
|
76
|
+
this.$emit('change', input);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
2
|
+
|
|
3
|
+
import { getZIndex } from '../util/helpers';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
data: function data() {
|
|
7
|
+
return {
|
|
8
|
+
stackBase: null,
|
|
9
|
+
stackClass: 'unpecified',
|
|
10
|
+
stackElement: null,
|
|
11
|
+
stackExclude: null,
|
|
12
|
+
stackMinZIndex: 0
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
computed: {
|
|
17
|
+
activeZIndex: function activeZIndex() {
|
|
18
|
+
var content = this.stackElement || this.$refs.content;
|
|
19
|
+
// Return current zindex if not active
|
|
20
|
+
if (!this.isActive) return getZIndex(content);
|
|
21
|
+
|
|
22
|
+
// Return max current z-index (excluding self) + 2
|
|
23
|
+
// (2 to leave room for an overlay below, if needed)
|
|
24
|
+
return this.getMaxZIndex(this.stackExclude || [content]) + 2;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
getMaxZIndex: function getMaxZIndex() {
|
|
29
|
+
var exclude = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
30
|
+
|
|
31
|
+
var base = this.stackBase || this.$el;
|
|
32
|
+
// Start with lowest allowed z-index or z-index of
|
|
33
|
+
// base component's element, whichever is greater
|
|
34
|
+
var zis = [this.stackMinZIndex, getZIndex(base)];
|
|
35
|
+
// Convert the NodeList to an array to
|
|
36
|
+
// prevent an Edge bug with Symbol.iterator
|
|
37
|
+
var activeElements = [].concat(_toConsumableArray(document.getElementsByClassName(this.stackClass)));
|
|
38
|
+
|
|
39
|
+
// Get z-index for all active dialogs
|
|
40
|
+
var _iteratorNormalCompletion = true;
|
|
41
|
+
var _didIteratorError = false;
|
|
42
|
+
var _iteratorError = undefined;
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
for (var _iterator = activeElements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
46
|
+
var activeElement = _step.value;
|
|
47
|
+
|
|
48
|
+
if (!exclude.includes(activeElement)) {
|
|
49
|
+
zis.push(getZIndex(activeElement));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
} catch (err) {
|
|
53
|
+
_didIteratorError = true;
|
|
54
|
+
_iteratorError = err;
|
|
55
|
+
} finally {
|
|
56
|
+
try {
|
|
57
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
58
|
+
_iterator.return();
|
|
59
|
+
}
|
|
60
|
+
} finally {
|
|
61
|
+
if (_didIteratorError) {
|
|
62
|
+
throw _iteratorError;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return Math.max.apply(Math, zis);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
export function factory() {
|
|
4
|
+
var _watch;
|
|
5
|
+
|
|
6
|
+
var prop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'value';
|
|
7
|
+
var event = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'input';
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
model: { prop: prop, event: event },
|
|
11
|
+
|
|
12
|
+
props: _defineProperty({}, prop, { required: false }),
|
|
13
|
+
|
|
14
|
+
data: function data() {
|
|
15
|
+
return {
|
|
16
|
+
isActive: !!this[prop]
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
watch: (_watch = {}, _defineProperty(_watch, prop, function (val) {
|
|
22
|
+
this.isActive = !!val;
|
|
23
|
+
}), _defineProperty(_watch, 'isActive', function isActive(val) {
|
|
24
|
+
!!val !== this[prop] && this.$emit(event, val);
|
|
25
|
+
}), _watch)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var Toggleable = factory();
|
|
30
|
+
|
|
31
|
+
export default Toggleable;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
data: function data() {
|
|
3
|
+
return {
|
|
4
|
+
parallax: null,
|
|
5
|
+
parallaxDist: null,
|
|
6
|
+
percentScrolled: null,
|
|
7
|
+
scrollTop: null,
|
|
8
|
+
windowHeight: null,
|
|
9
|
+
windowBottom: null
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
computed: {
|
|
15
|
+
normalizedHeight: function normalizedHeight() {
|
|
16
|
+
if (this.jumbotron) {
|
|
17
|
+
return isNaN(this.height) ? this.height : this.height + 'px';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return Number(this.height.toString().replace(/(^[0-9]*$)/, '$1'));
|
|
21
|
+
},
|
|
22
|
+
imgHeight: function imgHeight() {
|
|
23
|
+
return this.objHeight();
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
mounted: function mounted() {
|
|
28
|
+
this.$kdutify.load(this.init);
|
|
29
|
+
},
|
|
30
|
+
beforeDestroy: function beforeDestroy() {
|
|
31
|
+
window.removeEventListener('scroll', this.translate, false);
|
|
32
|
+
window.removeEventListener('resize', this.translate, false);
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
methods: {
|
|
37
|
+
listeners: function listeners() {
|
|
38
|
+
window.addEventListener('scroll', this.translate, false);
|
|
39
|
+
window.addEventListener('resize', this.translate, false);
|
|
40
|
+
},
|
|
41
|
+
translate: function translate() {
|
|
42
|
+
this.calcDimensions();
|
|
43
|
+
|
|
44
|
+
this.percentScrolled = (this.windowBottom - this.elOffsetTop) / (this.normalizedHeight + this.windowHeight);
|
|
45
|
+
|
|
46
|
+
this.parallax = Math.round(this.parallaxDist * this.percentScrolled);
|
|
47
|
+
|
|
48
|
+
if (this.translated) {
|
|
49
|
+
this.translated();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
calcDimensions: function calcDimensions() {
|
|
53
|
+
var offset = this.$el.getBoundingClientRect();
|
|
54
|
+
|
|
55
|
+
this.scrollTop = window.pageYOffset;
|
|
56
|
+
this.parallaxDist = this.imgHeight - this.normalizedHeight;
|
|
57
|
+
this.elOffsetTop = offset.top + this.scrollTop;
|
|
58
|
+
this.windowHeight = window.innerHeight;
|
|
59
|
+
this.windowBottom = this.scrollTop + this.windowHeight;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
data: function data() {
|
|
5
|
+
return {
|
|
6
|
+
errorBucket: [],
|
|
7
|
+
hasFocused: false,
|
|
8
|
+
hasInput: false,
|
|
9
|
+
shouldValidate: false,
|
|
10
|
+
valid: false
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
props: {
|
|
16
|
+
error: {
|
|
17
|
+
type: Boolean
|
|
18
|
+
},
|
|
19
|
+
errorMessages: {
|
|
20
|
+
type: [String, Array],
|
|
21
|
+
default: function _default() {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: function _default() {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
validateOnBlur: Boolean
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
computed: {
|
|
35
|
+
validations: function validations() {
|
|
36
|
+
if (!Array.isArray(this.errorMessages)) {
|
|
37
|
+
return [this.errorMessages];
|
|
38
|
+
} else if (this.errorMessages.length > 0) {
|
|
39
|
+
return this.errorMessages;
|
|
40
|
+
} else if (this.shouldValidate) {
|
|
41
|
+
return this.errorBucket;
|
|
42
|
+
} else {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
hasError: function hasError() {
|
|
47
|
+
return this.validations.length > 0 || this.errorMessages.length > 0 || this.error;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
watch: {
|
|
52
|
+
rules: {
|
|
53
|
+
handler: function handler(newVal, oldVal) {
|
|
54
|
+
// TODO: This handler seems to trigger when input changes, even though
|
|
55
|
+
// rules array stays the same? Solved it like this for now
|
|
56
|
+
if (newVal.length === oldVal.length) return;
|
|
57
|
+
|
|
58
|
+
this.validate();
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
deep: true
|
|
62
|
+
},
|
|
63
|
+
inputValue: function inputValue(val) {
|
|
64
|
+
// If it's the first time we're setting input,
|
|
65
|
+
// mark it with hasInput
|
|
66
|
+
if (!!val && !this.hasInput) this.hasInput = true;
|
|
67
|
+
|
|
68
|
+
if (this.hasInput && !this.validateOnBlur) this.shouldValidate = true;
|
|
69
|
+
},
|
|
70
|
+
isFocused: function isFocused(val) {
|
|
71
|
+
// If we're not focused, and it's the first time
|
|
72
|
+
// we're defocusing, set shouldValidate to true
|
|
73
|
+
if (!val && !this.hasFocused) {
|
|
74
|
+
this.hasFocused = true;
|
|
75
|
+
this.shouldValidate = true;
|
|
76
|
+
|
|
77
|
+
this.$emit('update:error', this.errorBucket.length > 0);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
hasError: function hasError(val) {
|
|
81
|
+
if (this.shouldValidate) {
|
|
82
|
+
this.$emit('update:error', val);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
error: function error(val) {
|
|
86
|
+
this.shouldValidate = !!val;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
mounted: function mounted() {
|
|
91
|
+
this.shouldValidate = !!this.error;
|
|
92
|
+
this.validate();
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
methods: {
|
|
97
|
+
reset: function reset() {
|
|
98
|
+
var _this = this;
|
|
99
|
+
|
|
100
|
+
// TODO: Do this another way!
|
|
101
|
+
// This is so that we can reset all types of inputs
|
|
102
|
+
this.$emit('input', this.isMultiple ? [] : null);
|
|
103
|
+
this.$emit('change', null);
|
|
104
|
+
|
|
105
|
+
this.$nextTick(function () {
|
|
106
|
+
_this.shouldValidate = false;
|
|
107
|
+
_this.hasFocused = false;
|
|
108
|
+
_this.validate();
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
validate: function validate() {
|
|
112
|
+
var _this2 = this;
|
|
113
|
+
|
|
114
|
+
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
115
|
+
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.inputValue;
|
|
116
|
+
|
|
117
|
+
if (force) this.shouldValidate = true;
|
|
118
|
+
|
|
119
|
+
this.errorBucket = [];
|
|
120
|
+
|
|
121
|
+
this.rules.forEach(function (rule) {
|
|
122
|
+
var valid = typeof rule === 'function' ? rule(value) : rule;
|
|
123
|
+
|
|
124
|
+
if (valid !== true && !['string', 'boolean'].includes(typeof valid === 'undefined' ? 'undefined' : _typeof(valid))) {
|
|
125
|
+
throw new TypeError('Rules should return a string or boolean, received \'' + (typeof valid === 'undefined' ? 'undefined' : _typeof(valid)) + '\' instead');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (valid !== true) {
|
|
129
|
+
_this2.errorBucket.push(valid);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
this.valid = this.errorBucket.length === 0;
|
|
134
|
+
|
|
135
|
+
return this.valid;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Kdu mixin to get the current width/height and the associated breakpoint.
|
|
3
|
+
*
|
|
4
|
+
* Useful to e.g. adapt the user interface from inside a Kdu component
|
|
5
|
+
* as opposed to using CSS classes. The breakpoint pixel values and
|
|
6
|
+
* range names are taken from Kdutify (https://github.com/kdutifyjs).
|
|
7
|
+
*
|
|
8
|
+
* Use within a component:
|
|
9
|
+
*
|
|
10
|
+
* import breakpoint from './breakpoint.js'
|
|
11
|
+
*
|
|
12
|
+
* export default {
|
|
13
|
+
* name: 'my-component',
|
|
14
|
+
* mixins: [breakpoint],
|
|
15
|
+
* ...
|
|
16
|
+
*
|
|
17
|
+
* Then inside a template:
|
|
18
|
+
*
|
|
19
|
+
* <div k-if="$breakpoint.smAndDown">...</div>
|
|
20
|
+
*/
|
|
21
|
+
var breakpoint = {
|
|
22
|
+
data: function data() {
|
|
23
|
+
return {
|
|
24
|
+
clientWidth: clientDimensions.getWidth(),
|
|
25
|
+
clientHeight: clientDimensions.getHeight()
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
computed: {
|
|
31
|
+
breakpoint: function breakpoint() {
|
|
32
|
+
var xs = this.clientWidth < 600;
|
|
33
|
+
var sm = this.clientWidth < 960 && !xs;
|
|
34
|
+
var md = this.clientWidth < 1280 - 16 && !(sm || xs);
|
|
35
|
+
var lg = this.clientWidth < 1920 - 16 && !(md || sm || xs);
|
|
36
|
+
var xl = this.clientWidth >= 1920 - 16 && !(lg || md || sm || xs);
|
|
37
|
+
|
|
38
|
+
var xsOnly = xs;
|
|
39
|
+
var smOnly = sm;
|
|
40
|
+
var smAndDown = (xs || sm) && !(md || lg || xl);
|
|
41
|
+
var smAndUp = !xs && (sm || md || lg || xl);
|
|
42
|
+
var mdOnly = md;
|
|
43
|
+
var mdAndDown = (xs || sm || md) && !(lg || xl);
|
|
44
|
+
var mdAndUp = !(xs || sm) && (md || lg || xl);
|
|
45
|
+
var lgOnly = lg;
|
|
46
|
+
var lgAndDown = (xs || sm || md || lg) && !xl;
|
|
47
|
+
var lgAndUp = !(xs || sm || md) && (lg || xl);
|
|
48
|
+
var xlOnly = xl;
|
|
49
|
+
|
|
50
|
+
var name = void 0;
|
|
51
|
+
switch (true) {
|
|
52
|
+
case xs:
|
|
53
|
+
name = 'xs';
|
|
54
|
+
break;
|
|
55
|
+
case sm:
|
|
56
|
+
name = 'sm';
|
|
57
|
+
break;
|
|
58
|
+
case md:
|
|
59
|
+
name = 'md';
|
|
60
|
+
break;
|
|
61
|
+
case lg:
|
|
62
|
+
name = 'lg';
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
name = 'xl';
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var result = {
|
|
70
|
+
// Definite breakpoint.
|
|
71
|
+
xs: xs,
|
|
72
|
+
sm: sm,
|
|
73
|
+
md: md,
|
|
74
|
+
lg: lg,
|
|
75
|
+
xl: xl,
|
|
76
|
+
|
|
77
|
+
// Useful e.g. to construct CSS class names dynamically.
|
|
78
|
+
name: name,
|
|
79
|
+
|
|
80
|
+
// Breakpoint ranges.
|
|
81
|
+
xsOnly: xsOnly,
|
|
82
|
+
smOnly: smOnly,
|
|
83
|
+
smAndDown: smAndDown,
|
|
84
|
+
smAndUp: smAndUp,
|
|
85
|
+
mdOnly: mdOnly,
|
|
86
|
+
mdAndDown: mdAndDown,
|
|
87
|
+
mdAndUp: mdAndUp,
|
|
88
|
+
lgOnly: lgOnly,
|
|
89
|
+
lgAndDown: lgAndDown,
|
|
90
|
+
lgAndUp: lgAndUp,
|
|
91
|
+
xlOnly: xlOnly,
|
|
92
|
+
|
|
93
|
+
// For custom breakpoint logic.
|
|
94
|
+
width: this.clientWidth,
|
|
95
|
+
height: this.clientHeight
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
watch: {
|
|
103
|
+
breakpoint: function breakpoint(val) {
|
|
104
|
+
this.$kdutify.breakpoint = val;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
methods: {
|
|
109
|
+
onResize: function onResize() {
|
|
110
|
+
this.clientWidth = clientDimensions.getWidth();
|
|
111
|
+
this.clientHeight = clientDimensions.getHeight();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Cross-browser support as described in:
|
|
116
|
+
// https://stackoverflow.com/questions/1248081
|
|
117
|
+
};var clientDimensions = {
|
|
118
|
+
getWidth: function getWidth() {
|
|
119
|
+
if (typeof document === 'undefined') return 0; // SSR
|
|
120
|
+
return Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
121
|
+
},
|
|
122
|
+
getHeight: function getHeight() {
|
|
123
|
+
if (typeof document === 'undefined') return 0; // SSR
|
|
124
|
+
return Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default breakpoint;
|