Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

show-scrollbar property added in f-table-schema #286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/flow-table/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-table/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,14 @@
flex: 1 1;
overflow: auto;
@include scrollbar();
&[show-scrollbar] {
scrollbar-width: thin;

&::-webkit-scrollbar {
display: block;
width: 6px;
height: 6px;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -466,7 +476,7 @@ export class FTableSchema extends FRoot {
</f-div>`
: nothing}
</slot>
<div class="f-table-schema-wrapper">
<div class="f-table-schema-wrapper" ?show-scrollbar=${this.showScrollbar}>
<f-table
id="f-table-element"
.variant=${this.variant}
Expand Down
29 changes: 29 additions & 0 deletions stories/flow-table/f-table-schema.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const Playground = {
.sortOrder=${args["sort-order"]}
.searchTerm=${args["search-term"]}
.showSearchBar=${args["show-search-bar"]}
.showScrollbar=${args["show-scrollbar"]}
.stickyCellBackground=${args["sticky-cell-background"]}
@next=${handleNext}
@toggle-row-details=${toggleRowDetails}
Expand Down Expand Up @@ -164,6 +165,11 @@ export const Playground = {
control: {
type: "boolean"
}
},
["show-scrollbar"]: {
control: {
type: "boolean"
}
}
},

Expand All @@ -181,6 +187,7 @@ export const Playground = {
["sort-order"]: "asc",
["search-term"]: "",
["show-search-bar"]: true,
["show-scrollbar"]: false,
["sticky-cell-background"]: "default",
["header-cell-template"]: (val: string) => {
return html`<f-div gap="small" align="middle-center">
Expand Down Expand Up @@ -413,6 +420,28 @@ export const ShowSearchBar = {
name: "show-search-bar"
};

export const ShowScrollBar = {
render: () => {
const data = getFakeUsers(20, 5);

return html`
<f-div gap="small" height="100%" overflow="scroll" gap="auto" width="100%">
<f-div direction="column" gap="medium" overflow="hidden">
<f-text> show-scrollbar="true"</f-text>
<f-table-schema show-scrollbar .data=${data}> </f-table-schema>
</f-div>
<f-divider></f-divider>
<f-div direction="column" gap="medium" overflow="hidden">
<f-text> show-scrollbar="false"</f-text>
<f-table-schema .showScrollbar=${false} .data=${data}> </f-table-schema>
</f-div>
</f-div>
`;
},

name: "show-scrollbar"
};

export const ToggleRowDetails = {
render: () => {
const data = getFakeUsers(10, 5);
Expand Down
Loading