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

Commit ad99809

Browse files
committed
flow-table/show-scroll-bar show-scrollbar property added
1 parent 40b83df commit ad99809

File tree

5 files changed

+56
-2
lines changed

5 files changed

+56
-2
lines changed

packages/flow-table/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
# Change Log
44

5+
## [2.5.0] - 2024-07-08
6+
7+
### Minor Changes
8+
9+
- `show-scrollbar` property added in `f-table-schema`
10+
511
## [2.4.8] - 2024-07-08
612

713
### Patch Changes

packages/flow-table/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ollion/flow-table",
3-
"version": "2.4.8",
3+
"version": "2.5.0",
44
"description": "Table component for flow library",
55
"module": "dist/flow-table.es.js",
66
"main": "dist/flow-table.cjs.js",

packages/flow-table/src/components/f-table-schema/f-table-schema.scss

+9
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,14 @@
99
flex: 1 1;
1010
overflow: auto;
1111
@include scrollbar();
12+
&[show-scrollbar] {
13+
scrollbar-width: thin;
14+
15+
&::-webkit-scrollbar {
16+
display: block;
17+
width: 6px;
18+
height: 6px;
19+
}
20+
}
1221
}
1322
}

packages/flow-table/src/components/f-table-schema/f-table-schema.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ export class FTableSchema extends FRoot {
182182
this.headerCellTemplate = val;
183183
}
184184

185+
/**
186+
* to show scrollbar
187+
*/
188+
@property({ type: Boolean, reflect: true, attribute: "show-scrollbar" })
189+
showScrollbar = false;
190+
191+
set ["show-scrollbar"](val: boolean) {
192+
this.showScrollbar = val;
193+
}
194+
185195
@state()
186196
offset = 0;
187197

@@ -466,7 +476,7 @@ export class FTableSchema extends FRoot {
466476
</f-div>`
467477
: nothing}
468478
</slot>
469-
<div class="f-table-schema-wrapper">
479+
<div class="f-table-schema-wrapper" ?show-scrollbar=${this.showScrollbar}>
470480
<f-table
471481
id="f-table-element"
472482
.variant=${this.variant}

stories/flow-table/f-table-schema.stories.ts

+29
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const Playground = {
7575
.sortOrder=${args["sort-order"]}
7676
.searchTerm=${args["search-term"]}
7777
.showSearchBar=${args["show-search-bar"]}
78+
.showScrollbar=${args["show-scrollbar"]}
7879
.stickyCellBackground=${args["sticky-cell-background"]}
7980
@next=${handleNext}
8081
@toggle-row-details=${toggleRowDetails}
@@ -164,6 +165,11 @@ export const Playground = {
164165
control: {
165166
type: "boolean"
166167
}
168+
},
169+
["show-scrollbar"]: {
170+
control: {
171+
type: "boolean"
172+
}
167173
}
168174
},
169175

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

423+
export const ShowScrollBar = {
424+
render: () => {
425+
const data = getFakeUsers(20, 5);
426+
427+
return html`
428+
<f-div gap="small" height="100%" overflow="scroll" gap="auto" width="100%">
429+
<f-div direction="column" gap="medium" overflow="hidden">
430+
<f-text> show-scrollbar="true"</f-text>
431+
<f-table-schema show-scrollbar .data=${data}> </f-table-schema>
432+
</f-div>
433+
<f-divider></f-divider>
434+
<f-div direction="column" gap="medium" overflow="hidden">
435+
<f-text> show-scrollbar="false"</f-text>
436+
<f-table-schema .showScrollbar=${false} .data=${data}> </f-table-schema>
437+
</f-div>
438+
</f-div>
439+
`;
440+
},
441+
442+
name: "show-scrollbar"
443+
};
444+
416445
export const ToggleRowDetails = {
417446
render: () => {
418447
const data = getFakeUsers(10, 5);

0 commit comments

Comments
 (0)