From ad99809458ddd7ea3310b8e7e0d6397acdd9b062 Mon Sep 17 00:00:00 2001 From: Vikas Awaghade Date: Thu, 18 Jul 2024 18:12:04 +0530 Subject: [PATCH] flow-table/show-scroll-bar show-scrollbar property added --- packages/flow-table/CHANGELOG.md | 6 ++++ packages/flow-table/package.json | 2 +- .../f-table-schema/f-table-schema.scss | 9 ++++++ .../f-table-schema/f-table-schema.ts | 12 +++++++- stories/flow-table/f-table-schema.stories.ts | 29 +++++++++++++++++++ 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/packages/flow-table/CHANGELOG.md b/packages/flow-table/CHANGELOG.md index 071c68eaf..2ce2001e2 100644 --- a/packages/flow-table/CHANGELOG.md +++ b/packages/flow-table/CHANGELOG.md @@ -2,6 +2,12 @@ # Change Log +## [2.5.0] - 2024-07-08 + +### Minor Changes + +- `show-scrollbar` property added in `f-table-schema` + ## [2.4.8] - 2024-07-08 ### Patch Changes diff --git a/packages/flow-table/package.json b/packages/flow-table/package.json index a392727dd..2e045be9f 100644 --- a/packages/flow-table/package.json +++ b/packages/flow-table/package.json @@ -1,6 +1,6 @@ { "name": "@ollion/flow-table", - "version": "2.4.8", + "version": "2.5.0", "description": "Table component for flow library", "module": "dist/flow-table.es.js", "main": "dist/flow-table.cjs.js", diff --git a/packages/flow-table/src/components/f-table-schema/f-table-schema.scss b/packages/flow-table/src/components/f-table-schema/f-table-schema.scss index 34d1894d7..60818b6f7 100644 --- a/packages/flow-table/src/components/f-table-schema/f-table-schema.scss +++ b/packages/flow-table/src/components/f-table-schema/f-table-schema.scss @@ -9,5 +9,14 @@ flex: 1 1; overflow: auto; @include scrollbar(); + &[show-scrollbar] { + scrollbar-width: thin; + + &::-webkit-scrollbar { + display: block; + width: 6px; + height: 6px; + } + } } } diff --git a/packages/flow-table/src/components/f-table-schema/f-table-schema.ts b/packages/flow-table/src/components/f-table-schema/f-table-schema.ts index e3c041afb..b3a698a9f 100644 --- a/packages/flow-table/src/components/f-table-schema/f-table-schema.ts +++ b/packages/flow-table/src/components/f-table-schema/f-table-schema.ts @@ -182,6 +182,16 @@ export class FTableSchema extends FRoot { this.headerCellTemplate = val; } + /** + * to show scrollbar + */ + @property({ type: Boolean, reflect: true, attribute: "show-scrollbar" }) + showScrollbar = false; + + set ["show-scrollbar"](val: boolean) { + this.showScrollbar = val; + } + @state() offset = 0; @@ -466,7 +476,7 @@ export class FTableSchema extends FRoot { ` : nothing} -
+
{ return html` @@ -413,6 +420,28 @@ export const ShowSearchBar = { name: "show-search-bar" }; +export const ShowScrollBar = { + render: () => { + const data = getFakeUsers(20, 5); + + return html` + + + show-scrollbar="true" + + + + + show-scrollbar="false" + + + + `; + }, + + name: "show-scrollbar" +}; + export const ToggleRowDetails = { render: () => { const data = getFakeUsers(10, 5);