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

Commit 901dc63

Browse files
committed
Demo app global table filter case
1 parent ed8d450 commit 901dc63

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

demo/App.tsx

+15-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import Logger from 'core/Logger';
88
import AppState, { AppMode, AppFlavor } from './AppMode';
99

1010
import './style.less';
11+
import FilterCaseButton from 'dash-table/components/Filter/FilterCaseButton';
12+
import { Case } from 'dash-table/components/Table/props';
1113

1214
class App extends Component<any, any> {
1315
constructor(props: any) {
@@ -25,7 +27,7 @@ class App extends Component<any, any> {
2527
const flavors = flavorParam ? flavorParam.split(';') : [];
2628

2729
if (flavors.indexOf(AppFlavor.FilterNative) !== -1) {
28-
return (<div>
30+
return (<div className='demo-app-root'>
2931
<button
3032
className='clear-filters'
3133
onClick={() => {
@@ -35,6 +37,17 @@ class App extends Component<any, any> {
3537
this.setState({ tableProps });
3638
}}
3739
>Clear Filter</button>
40+
<FilterCaseButton
41+
filterCase={this.state.tableProps.filter_case === Case.Insensitive
42+
? Case.Insensitive : Case.Sensitive}
43+
setColumnCase={() => {
44+
const tableProps = R.clone(this.state.tableProps);
45+
tableProps.filter_case = tableProps.filter_case === Case.Insensitive
46+
? Case.Sensitive : Case.Insensitive;
47+
48+
this.setState({ tableProps });
49+
}}
50+
/>
3851
<input
3952
style={{ width: '500px' }}
4053
value={this.state.temp_filtering}
@@ -47,6 +60,7 @@ class App extends Component<any, any> {
4760

4861
this.setState({ tableProps });
4962
}} />
63+
5064
</div>);
5165
} else if (mode === AppMode.TaleOfTwoTables) {
5266
if (!this.state.tableProps2) {

demo/style.less

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
html {
22
font-size: 13px;
3-
}
3+
4+
.demo-app-root {
5+
input.dash-filter--case {
6+
outline: none;
7+
}
8+
9+
input.dash-filter--case--sensitive {
10+
background-color: hotpink;
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)