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,92 @@
|
|
|
1
|
+
require('../../stylus/components/_input-groups.styl')
|
|
2
|
+
require('../../stylus/components/_selection-controls.styl')
|
|
3
|
+
|
|
4
|
+
import KIcon from '../KIcon'
|
|
5
|
+
import { KFadeTransition } from '../transitions'
|
|
6
|
+
import Rippleable from '../../mixins/rippleable'
|
|
7
|
+
import Selectable from '../../mixins/selectable'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'k-checkbox',
|
|
11
|
+
|
|
12
|
+
components: {
|
|
13
|
+
KFadeTransition,
|
|
14
|
+
KIcon
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
mixins: [Rippleable, Selectable],
|
|
18
|
+
|
|
19
|
+
data () {
|
|
20
|
+
return {
|
|
21
|
+
inputIndeterminate: this.indeterminate
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
props: {
|
|
26
|
+
indeterminate: Boolean
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
computed: {
|
|
30
|
+
classes () {
|
|
31
|
+
const classes = {
|
|
32
|
+
'checkbox': true,
|
|
33
|
+
'input-group--selection-controls': true,
|
|
34
|
+
'input-group--active': this.isActive
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (this.hasError) {
|
|
38
|
+
classes['error--text'] = true
|
|
39
|
+
} else {
|
|
40
|
+
return this.addTextColorClassChecks(classes)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return classes
|
|
44
|
+
},
|
|
45
|
+
icon () {
|
|
46
|
+
if (this.inputIndeterminate) {
|
|
47
|
+
return 'indeterminate_check_box'
|
|
48
|
+
} else if (this.isActive) {
|
|
49
|
+
return 'check_box'
|
|
50
|
+
} else {
|
|
51
|
+
return 'check_box_outline_blank'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
methods: {
|
|
57
|
+
groupFocus (e) {
|
|
58
|
+
this.isFocused = true
|
|
59
|
+
this.$emit('focus', e)
|
|
60
|
+
},
|
|
61
|
+
groupBlur (e) {
|
|
62
|
+
this.isFocused = false
|
|
63
|
+
this.tabFocused = false
|
|
64
|
+
this.$emit('blur', this.inputValue)
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
render (h) {
|
|
69
|
+
const transition = h('k-fade-transition', [
|
|
70
|
+
h('k-icon', {
|
|
71
|
+
staticClass: 'icon--selection-control',
|
|
72
|
+
'class': {
|
|
73
|
+
'icon--checkbox': this.icon === 'check_box'
|
|
74
|
+
},
|
|
75
|
+
key: this.icon
|
|
76
|
+
}, this.icon)
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
const data = {
|
|
80
|
+
attrs: {
|
|
81
|
+
tabindex: this.disabled
|
|
82
|
+
? -1
|
|
83
|
+
: this.internalTabIndex || this.tabindex,
|
|
84
|
+
role: 'checkbox',
|
|
85
|
+
'aria-checked': this.inputIndeterminate && 'mixed' || this.isActive && 'true' || 'false',
|
|
86
|
+
'aria-label': this.label
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return this.genInputGroup([transition, this.genRipple()], data)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
require('../../stylus/components/_chips.styl')
|
|
2
|
+
|
|
3
|
+
import KIcon from '../KIcon'
|
|
4
|
+
import Colorable from '../../mixins/colorable'
|
|
5
|
+
import Themeable from '../../mixins/themeable'
|
|
6
|
+
import Toggleable from '../../mixins/toggleable'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'k-chip',
|
|
10
|
+
|
|
11
|
+
components: {
|
|
12
|
+
KIcon
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
mixins: [Colorable, Themeable, Toggleable],
|
|
16
|
+
|
|
17
|
+
props: {
|
|
18
|
+
close: Boolean,
|
|
19
|
+
disabled: Boolean,
|
|
20
|
+
label: Boolean,
|
|
21
|
+
outline: Boolean,
|
|
22
|
+
// Used for selects/tagging
|
|
23
|
+
selected: Boolean,
|
|
24
|
+
small: Boolean,
|
|
25
|
+
textColor: String,
|
|
26
|
+
value: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
computed: {
|
|
33
|
+
classes () {
|
|
34
|
+
const classes = this.addBackgroundColorClassChecks({
|
|
35
|
+
'chip': true,
|
|
36
|
+
'chip--disabled': this.disabled,
|
|
37
|
+
'chip--selected': this.selected,
|
|
38
|
+
'chip--label': this.label,
|
|
39
|
+
'chip--outline': this.outline,
|
|
40
|
+
'chip--small': this.small,
|
|
41
|
+
'chip--removable': this.close,
|
|
42
|
+
'theme--light': this.light,
|
|
43
|
+
'theme--dark': this.dark
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
return (this.textColor || this.outline)
|
|
47
|
+
? this.addTextColorClassChecks(classes, this.textColor ? 'textColor' : 'color')
|
|
48
|
+
: classes
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
render (h) {
|
|
53
|
+
const children = [this.$slots.default]
|
|
54
|
+
const data = {
|
|
55
|
+
'class': this.classes,
|
|
56
|
+
attrs: { tabindex: this.disabled ? -1 : 0 },
|
|
57
|
+
directives: [{
|
|
58
|
+
name: 'show',
|
|
59
|
+
value: this.isActive
|
|
60
|
+
}],
|
|
61
|
+
on: this.$listeners
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (this.close) {
|
|
65
|
+
const data = {
|
|
66
|
+
staticClass: 'chip__close',
|
|
67
|
+
on: {
|
|
68
|
+
click: e => {
|
|
69
|
+
e.stopPropagation()
|
|
70
|
+
|
|
71
|
+
this.$emit('input', false)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
children.push(h('div', data, [
|
|
77
|
+
h(KIcon, { props: { right: true } }, 'cancel')
|
|
78
|
+
]))
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return h('span', data, children)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
require('../../stylus/components/_tables.styl')
|
|
2
|
+
require('../../stylus/components/_data-table.styl')
|
|
3
|
+
|
|
4
|
+
import KBtn from '../KBtn'
|
|
5
|
+
import KIcon from '../KIcon'
|
|
6
|
+
import KProgressLinear from '../KProgressLinear'
|
|
7
|
+
import KSelect from '../KSelect'
|
|
8
|
+
|
|
9
|
+
import Filterable from '../../mixins/filterable'
|
|
10
|
+
import Themeable from '../../mixins/themeable'
|
|
11
|
+
import Loadable from '../../mixins/loadable'
|
|
12
|
+
import Head from './mixins/head'
|
|
13
|
+
import Body from './mixins/body'
|
|
14
|
+
import Foot from './mixins/foot'
|
|
15
|
+
import Progress from './mixins/progress'
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
createSimpleFunctional,
|
|
19
|
+
getObjectValueByPath
|
|
20
|
+
} from '../../util/helpers'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'k-data-table',
|
|
24
|
+
|
|
25
|
+
components: {
|
|
26
|
+
KBtn,
|
|
27
|
+
KIcon,
|
|
28
|
+
KProgressLinear,
|
|
29
|
+
KSelect,
|
|
30
|
+
// Importing does not work properly
|
|
31
|
+
'k-table-overflow': createSimpleFunctional('table__overflow')
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
data () {
|
|
35
|
+
return {
|
|
36
|
+
all: false,
|
|
37
|
+
searchLength: 0,
|
|
38
|
+
defaultPagination: {
|
|
39
|
+
descending: false,
|
|
40
|
+
page: 1,
|
|
41
|
+
rowsPerPage: 5,
|
|
42
|
+
sortBy: null,
|
|
43
|
+
totalItems: 0
|
|
44
|
+
},
|
|
45
|
+
expanded: {}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
mixins: [Head, Body, Filterable, Foot, Loadable, Progress, Themeable],
|
|
50
|
+
|
|
51
|
+
props: {
|
|
52
|
+
expand: {
|
|
53
|
+
type: Boolean
|
|
54
|
+
},
|
|
55
|
+
headers: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default: () => []
|
|
58
|
+
},
|
|
59
|
+
headerText: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'text'
|
|
62
|
+
},
|
|
63
|
+
hideActions: Boolean,
|
|
64
|
+
hideHeaders: Boolean,
|
|
65
|
+
mustSort: Boolean,
|
|
66
|
+
noResultsText: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: 'No matching records found'
|
|
69
|
+
},
|
|
70
|
+
rowsPerPageItems: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default () {
|
|
73
|
+
return [
|
|
74
|
+
5,
|
|
75
|
+
10,
|
|
76
|
+
25,
|
|
77
|
+
{ text: 'All', value: -1 }
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
rowsPerPageText: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: 'Rows per page:'
|
|
84
|
+
},
|
|
85
|
+
selectAll: [Boolean, String],
|
|
86
|
+
search: {
|
|
87
|
+
required: false
|
|
88
|
+
},
|
|
89
|
+
filter: {
|
|
90
|
+
type: Function,
|
|
91
|
+
default: (val, search) => {
|
|
92
|
+
return val !== null &&
|
|
93
|
+
['undefined', 'boolean'].indexOf(typeof val) === -1 &&
|
|
94
|
+
val.toString().toLowerCase().indexOf(search) !== -1
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
customFilter: {
|
|
98
|
+
type: Function,
|
|
99
|
+
default: (items, search, filter) => {
|
|
100
|
+
search = search.toString().toLowerCase()
|
|
101
|
+
return items.filter(i => (
|
|
102
|
+
Object.keys(i).some(j => filter(i[j], search))
|
|
103
|
+
))
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
customSort: {
|
|
107
|
+
type: Function,
|
|
108
|
+
default: (items, index, isDescending) => {
|
|
109
|
+
if (index === null) return items
|
|
110
|
+
|
|
111
|
+
return items.sort((a, b) => {
|
|
112
|
+
let sortA = getObjectValueByPath(a, index)
|
|
113
|
+
let sortB = getObjectValueByPath(b, index)
|
|
114
|
+
|
|
115
|
+
if (isDescending) {
|
|
116
|
+
[sortA, sortB] = [sortB, sortA]
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Check if both are numbers
|
|
120
|
+
if (!isNaN(sortA) && !isNaN(sortB)) {
|
|
121
|
+
return sortA - sortB
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Check if both cannot be evaluated
|
|
125
|
+
if (sortA === null && sortB === null) {
|
|
126
|
+
return 0
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
[sortA, sortB] = [sortA, sortB]
|
|
130
|
+
.map(s => (
|
|
131
|
+
(s || '').toString().toLocaleLowerCase()
|
|
132
|
+
))
|
|
133
|
+
|
|
134
|
+
if (sortA > sortB) return 1
|
|
135
|
+
if (sortA < sortB) return -1
|
|
136
|
+
|
|
137
|
+
return 0
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
value: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: () => []
|
|
144
|
+
},
|
|
145
|
+
items: {
|
|
146
|
+
type: Array,
|
|
147
|
+
required: true,
|
|
148
|
+
default: () => []
|
|
149
|
+
},
|
|
150
|
+
totalItems: {
|
|
151
|
+
type: Number,
|
|
152
|
+
default: null
|
|
153
|
+
},
|
|
154
|
+
itemKey: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: 'id'
|
|
157
|
+
},
|
|
158
|
+
pagination: {
|
|
159
|
+
type: Object,
|
|
160
|
+
default: () => {}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
computed: {
|
|
165
|
+
classes () {
|
|
166
|
+
return {
|
|
167
|
+
'datatable table': true,
|
|
168
|
+
'datatable--select-all': this.selectAll !== false,
|
|
169
|
+
'theme--dark': this.dark,
|
|
170
|
+
'theme--light': this.light
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
computedPagination () {
|
|
174
|
+
return this.hasPagination
|
|
175
|
+
? this.pagination
|
|
176
|
+
: this.defaultPagination
|
|
177
|
+
},
|
|
178
|
+
hasPagination () {
|
|
179
|
+
const pagination = this.pagination || {}
|
|
180
|
+
|
|
181
|
+
return Object.keys(pagination).length > 0
|
|
182
|
+
},
|
|
183
|
+
hasSelectAll () {
|
|
184
|
+
return this.selectAll !== undefined && this.selectAll !== false
|
|
185
|
+
},
|
|
186
|
+
itemsLength () {
|
|
187
|
+
if (this.search) return this.searchLength
|
|
188
|
+
return this.totalItems || this.items.length
|
|
189
|
+
},
|
|
190
|
+
indeterminate () {
|
|
191
|
+
return this.hasSelectAll && this.someItems && !this.everyItem
|
|
192
|
+
},
|
|
193
|
+
everyItem () {
|
|
194
|
+
return this.filteredItems.length &&
|
|
195
|
+
this.filteredItems.every(i => this.isSelected(i))
|
|
196
|
+
},
|
|
197
|
+
someItems () {
|
|
198
|
+
return this.filteredItems.some(i => this.isSelected(i))
|
|
199
|
+
},
|
|
200
|
+
getPage () {
|
|
201
|
+
const { rowsPerPage } = this.computedPagination
|
|
202
|
+
|
|
203
|
+
return rowsPerPage === Object(rowsPerPage)
|
|
204
|
+
? rowsPerPage.value
|
|
205
|
+
: rowsPerPage
|
|
206
|
+
},
|
|
207
|
+
pageStart () {
|
|
208
|
+
return this.getPage === -1
|
|
209
|
+
? 0
|
|
210
|
+
: (this.computedPagination.page - 1) * this.getPage
|
|
211
|
+
},
|
|
212
|
+
pageStop () {
|
|
213
|
+
return this.getPage === -1
|
|
214
|
+
? this.itemsLength
|
|
215
|
+
: this.computedPagination.page * this.getPage
|
|
216
|
+
},
|
|
217
|
+
filteredItems () {
|
|
218
|
+
if (this.totalItems) return this.items
|
|
219
|
+
|
|
220
|
+
let items = this.items.slice()
|
|
221
|
+
const hasSearch = typeof this.search !== 'undefined' &&
|
|
222
|
+
this.search !== null
|
|
223
|
+
|
|
224
|
+
if (hasSearch) {
|
|
225
|
+
items = this.customFilter(items, this.search, this.filter)
|
|
226
|
+
this.searchLength = items.length
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
items = this.customSort(
|
|
230
|
+
items,
|
|
231
|
+
this.computedPagination.sortBy,
|
|
232
|
+
this.computedPagination.descending
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
return this.hideActions &&
|
|
236
|
+
!this.hasPagination
|
|
237
|
+
? items
|
|
238
|
+
: items.slice(this.pageStart, this.pageStop)
|
|
239
|
+
},
|
|
240
|
+
selected () {
|
|
241
|
+
const selected = {}
|
|
242
|
+
this.value.forEach(i => (selected[i[this.itemKey]] = true))
|
|
243
|
+
return selected
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
watch: {
|
|
248
|
+
indeterminate (val) {
|
|
249
|
+
if (val) this.all = true
|
|
250
|
+
},
|
|
251
|
+
someItems (val) {
|
|
252
|
+
if (!val) this.all = false
|
|
253
|
+
},
|
|
254
|
+
search () {
|
|
255
|
+
this.updatePagination({ page: 1, totalItems: this.itemsLength })
|
|
256
|
+
},
|
|
257
|
+
everyItem (val) {
|
|
258
|
+
if (val) this.all = true
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
methods: {
|
|
263
|
+
updatePagination (val) {
|
|
264
|
+
const pagination = this.hasPagination
|
|
265
|
+
? this.pagination
|
|
266
|
+
: this.defaultPagination
|
|
267
|
+
const updatedPagination = Object.assign({}, pagination, val)
|
|
268
|
+
this.$emit('update:pagination', updatedPagination)
|
|
269
|
+
|
|
270
|
+
if (!this.hasPagination) {
|
|
271
|
+
this.defaultPagination = updatedPagination
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
isSelected (item) {
|
|
275
|
+
return this.selected[item[this.itemKey]]
|
|
276
|
+
},
|
|
277
|
+
isExpanded (item) {
|
|
278
|
+
return this.expanded[item[this.itemKey]]
|
|
279
|
+
},
|
|
280
|
+
sort (index) {
|
|
281
|
+
const { sortBy, descending } = this.computedPagination
|
|
282
|
+
if (sortBy === null) {
|
|
283
|
+
this.updatePagination({ sortBy: index, descending: false })
|
|
284
|
+
} else if (sortBy === index && !descending) {
|
|
285
|
+
this.updatePagination({ descending: true })
|
|
286
|
+
} else if (sortBy !== index) {
|
|
287
|
+
this.updatePagination({ sortBy: index, descending: false })
|
|
288
|
+
} else if (!this.mustSort) {
|
|
289
|
+
this.updatePagination({ sortBy: null, descending: null })
|
|
290
|
+
} else {
|
|
291
|
+
this.updatePagination({ sortBy: index, descending: false })
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
needsTR (row) {
|
|
295
|
+
return row.length && row.find(c => c.tag === 'td')
|
|
296
|
+
},
|
|
297
|
+
genTR (children, data = {}) {
|
|
298
|
+
return this.$createElement('tr', data, children)
|
|
299
|
+
},
|
|
300
|
+
toggle (value) {
|
|
301
|
+
const selected = Object.assign({}, this.selected)
|
|
302
|
+
this.filteredItems.forEach(i => (
|
|
303
|
+
selected[i[this.itemKey]] = value)
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
this.$emit('input', this.items.filter(i => (
|
|
307
|
+
selected[i[this.itemKey]]))
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
created () {
|
|
313
|
+
const firstSortable = this.headers.find(h => (
|
|
314
|
+
!('sortable' in h) || h.sortable)
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
this.defaultPagination.sortBy = firstSortable
|
|
318
|
+
? firstSortable.value
|
|
319
|
+
: null
|
|
320
|
+
|
|
321
|
+
if (!this.rowsPerPageItems.length) {
|
|
322
|
+
console.warn('The prop \'rows-per-page-items\' in k-data-table can not be empty.')
|
|
323
|
+
} else {
|
|
324
|
+
this.defaultPagination.rowsPerPage = this.rowsPerPageItems[0]
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
this.defaultPagination.totalItems = this.itemsLength
|
|
328
|
+
|
|
329
|
+
this.updatePagination(
|
|
330
|
+
Object.assign({}, this.defaultPagination, this.pagination)
|
|
331
|
+
)
|
|
332
|
+
},
|
|
333
|
+
|
|
334
|
+
render (h) {
|
|
335
|
+
return h('k-table-overflow', {}, [
|
|
336
|
+
h('table', {
|
|
337
|
+
'class': this.classes
|
|
338
|
+
}, [
|
|
339
|
+
this.genTHead(),
|
|
340
|
+
this.genTProgress(),
|
|
341
|
+
this.genTBody(),
|
|
342
|
+
this.genTFoot()
|
|
343
|
+
])
|
|
344
|
+
])
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
require('../../stylus/components/_small-dialog.styl')
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: 'k-edit-dialog',
|
|
5
|
+
|
|
6
|
+
data () {
|
|
7
|
+
return {
|
|
8
|
+
isActive: false,
|
|
9
|
+
isSaving: false
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
cancelText: {
|
|
15
|
+
default: 'Cancel'
|
|
16
|
+
},
|
|
17
|
+
large: Boolean,
|
|
18
|
+
lazy: Boolean,
|
|
19
|
+
saveText: {
|
|
20
|
+
default: 'Save'
|
|
21
|
+
},
|
|
22
|
+
transition: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'slide-x-reverse-transition'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
watch: {
|
|
29
|
+
isActive (val) {
|
|
30
|
+
val &&
|
|
31
|
+
this.$emit('open') &&
|
|
32
|
+
setTimeout(this.focus, 50) // Give DOM time to paint
|
|
33
|
+
|
|
34
|
+
if (!val) {
|
|
35
|
+
!this.isSaving && this.$emit('cancel')
|
|
36
|
+
this.isSaving && this.$emit('close')
|
|
37
|
+
this.isSaving = false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
methods: {
|
|
43
|
+
cancel () {
|
|
44
|
+
this.isActive = false
|
|
45
|
+
},
|
|
46
|
+
focus () {
|
|
47
|
+
const input = this.$refs.content.querySelector('input')
|
|
48
|
+
input && input.focus()
|
|
49
|
+
},
|
|
50
|
+
save () {
|
|
51
|
+
this.isSaving = true
|
|
52
|
+
this.isActive = false
|
|
53
|
+
this.$emit('save')
|
|
54
|
+
},
|
|
55
|
+
genButton (fn, text) {
|
|
56
|
+
return this.$createElement('k-btn', {
|
|
57
|
+
props: {
|
|
58
|
+
flat: true,
|
|
59
|
+
color: 'primary',
|
|
60
|
+
light: true
|
|
61
|
+
},
|
|
62
|
+
on: { click: fn }
|
|
63
|
+
}, text)
|
|
64
|
+
},
|
|
65
|
+
genActions () {
|
|
66
|
+
return this.$createElement('div', {
|
|
67
|
+
'class': 'small-dialog__actions'
|
|
68
|
+
}, [
|
|
69
|
+
this.genButton(this.cancel, this.cancelText),
|
|
70
|
+
this.genButton(this.save, this.saveText)
|
|
71
|
+
])
|
|
72
|
+
},
|
|
73
|
+
genContent () {
|
|
74
|
+
return this.$createElement('div', {
|
|
75
|
+
on: {
|
|
76
|
+
keydown: e => {
|
|
77
|
+
e.keyCode === 27 && this.cancel()
|
|
78
|
+
e.keyCode === 13 && this.save()
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
ref: 'content'
|
|
82
|
+
}, [this.$slots.input])
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
render (h) {
|
|
87
|
+
return h('k-menu', {
|
|
88
|
+
'class': 'small-dialog',
|
|
89
|
+
props: {
|
|
90
|
+
contentClass: 'small-dialog__content',
|
|
91
|
+
transition: this.transition,
|
|
92
|
+
origin: 'top right',
|
|
93
|
+
right: true,
|
|
94
|
+
value: this.isActive,
|
|
95
|
+
closeOnContentClick: false,
|
|
96
|
+
lazy: this.lazy
|
|
97
|
+
},
|
|
98
|
+
on: {
|
|
99
|
+
input: val => (this.isActive = val)
|
|
100
|
+
}
|
|
101
|
+
}, [
|
|
102
|
+
h('a', {
|
|
103
|
+
domProps: { href: 'javascript:;' },
|
|
104
|
+
slot: 'activator'
|
|
105
|
+
}, this.$slots.default),
|
|
106
|
+
this.genContent(),
|
|
107
|
+
this.large ? this.genActions() : null
|
|
108
|
+
])
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSimpleFunctional
|
|
3
|
+
} from '../../util/helpers'
|
|
4
|
+
|
|
5
|
+
import KDataTable from './KDataTable'
|
|
6
|
+
import KEditDialog from './KEditDialog'
|
|
7
|
+
|
|
8
|
+
KDataTable.install = function install (Kdu) {
|
|
9
|
+
const KTableOverflow = createSimpleFunctional('table__overflow')
|
|
10
|
+
|
|
11
|
+
Kdu.component(KDataTable.name, KDataTable)
|
|
12
|
+
Kdu.component(KEditDialog.name, KEditDialog)
|
|
13
|
+
Kdu.component('k-table-overflow', KTableOverflow)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default KDataTable
|