From 91da8df4822b877bc55d09af5d91bab616fd9621 Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Wed, 15 Jul 2020 12:31:31 +0400 Subject: [PATCH 1/5] Add ScrollSections components --- .../ScrollSections/SScrollSectionItem.vue | 43 +++++ .../ScrollSections/SScrollSections.vue | 164 ++++++++++++++++++ src/components/ScrollSections/index.ts | 4 + src/components/index.ts | 3 + src/index.ts | 6 + src/types/components.ts | 2 + 6 files changed, 222 insertions(+) create mode 100644 src/components/ScrollSections/SScrollSectionItem.vue create mode 100644 src/components/ScrollSections/SScrollSections.vue create mode 100644 src/components/ScrollSections/index.ts diff --git a/src/components/ScrollSections/SScrollSectionItem.vue b/src/components/ScrollSections/SScrollSectionItem.vue new file mode 100644 index 00000000..00018bb3 --- /dev/null +++ b/src/components/ScrollSections/SScrollSectionItem.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/components/ScrollSections/SScrollSections.vue b/src/components/ScrollSections/SScrollSections.vue new file mode 100644 index 00000000..4d467b83 --- /dev/null +++ b/src/components/ScrollSections/SScrollSections.vue @@ -0,0 +1,164 @@ + + + + + diff --git a/src/components/ScrollSections/index.ts b/src/components/ScrollSections/index.ts new file mode 100644 index 00000000..66f1ecbf --- /dev/null +++ b/src/components/ScrollSections/index.ts @@ -0,0 +1,4 @@ +import SScrollSectionItem from './SScrollSectionItem.vue' +import SScrollSections from './SScrollSections.vue' + +export { SScrollSectionItem, SScrollSections } diff --git a/src/components/index.ts b/src/components/index.ts index 2243316c..0da7b7bc 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -15,6 +15,7 @@ import { SInput, SJsonInput } from './Input' import { SMain } from './Layout/Main' import { SMenu, SMenuItem, SMenuItemGroup, SSubmenu } from './Menu' import { SRow } from './Layout/Row' +import { SScrollSectionItem, SScrollSections } from './ScrollSections' import { STooltip } from './Tooltip' export { @@ -38,6 +39,8 @@ export { SMenuItem, SMenuItemGroup, SRow, + SScrollSectionItem, + SScrollSections, SSubmenu, STooltip } diff --git a/src/index.ts b/src/index.ts index 404b2f53..cfcf50c0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,6 +19,8 @@ import { SMenuItem, SMenuItemGroup, SRow, + SScrollSectionItem, + SScrollSections, SSubmenu, STooltip } from './components' @@ -43,6 +45,8 @@ const elements = [ { component: SMenuItem, name: Components.SMenuItem }, { component: SMenuItemGroup, name: Components.SMenuItemGroup }, { component: SRow, name: Components.SRow }, + { component: SScrollSectionItem, name: Components.SScrollSectionItem }, + { component: SScrollSections, name: Components.SScrollSections }, { component: SSubmenu, name: Components.SSubmenu }, { component: STooltip, name: Components.STooltip } ] @@ -76,6 +80,8 @@ export { SMenuItem, SMenuItemGroup, SRow, + SScrollSectionItem, + SScrollSections, SSubmenu, STooltip } diff --git a/src/types/components.ts b/src/types/components.ts index cb207ddb..659eef9d 100644 --- a/src/types/components.ts +++ b/src/types/components.ts @@ -17,6 +17,8 @@ export enum Components { SMenuItem = 'SMenuItem', SMenuItemGroup = 'SMenuItemGroup', SRow = 'SRow', + SScrollSectionItem = 'SScrollSectionItem', + SScrollSections = 'SScrollSections', SSubmenu = 'SSubmenu', STooltip = 'STooltip' } From e24a92dd1dad0da86b7ceea35d6b6b72605bac69 Mon Sep 17 00:00:00 2001 From: Stefan Popov Date: Wed, 15 Jul 2020 13:03:21 +0400 Subject: [PATCH 2/5] Add disabled state for scroll section item --- .../ScrollSections/SScrollSectionItem.vue | 8 +++++++- .../ScrollSections/SScrollSections.vue | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/ScrollSections/SScrollSectionItem.vue b/src/components/ScrollSections/SScrollSectionItem.vue index 00018bb3..fee3d230 100644 --- a/src/components/ScrollSections/SScrollSectionItem.vue +++ b/src/components/ScrollSections/SScrollSectionItem.vue @@ -19,9 +19,15 @@ export default class SScrollSectionItem extends Vue { */ @Prop({ default: '', type: String, required: true }) readonly section!: string /** - * Title of scroll section item. + * Title of scroll section item. Slot `title` can be used as well */ @Prop({ default: '', type: String }) readonly title!: string + /** + * Disabled state of scroll section item for menu. + * + * `false` by default + */ + @Prop({ default: false, type: Boolean }) readonly disabled!: boolean } diff --git a/src/components/ScrollSections/SScrollSections.vue b/src/components/ScrollSections/SScrollSections.vue index 4d467b83..7a3eb2e4 100644 --- a/src/components/ScrollSections/SScrollSections.vue +++ b/src/components/ScrollSections/SScrollSections.vue @@ -1,13 +1,14 @@