SevenOutman on DateRangePicker-fsm
refactor(DateRangePicker): orga… (compare)
SevenOutman on main
build(docs): bump rsuite 5.16.5 (compare)
simonguo on react-18
docs(extensions): add @rsuite/f… build: bump 5.16.5 Merge branch 'main' into feat/r… (compare)
simonguo on virtualized
test: update DropdownMenuSpec.js (compare)
The example shows import { Table } from 'rsuite';
const { Column, HeaderCell, Cell, Pagination } = Table;
<Column width={200} resizable sortable >
<HeaderCell>Pilot</HeaderCell>
<Cell dataKey='PilotName' />
</Column>
if (columnChildren.length !== 2) {....
anyone who has managed to setup rsuite to work with react@17.0.2?
i have 17.0.1 and it works well. I have build project with CRA and followed install guide from off docs. Very simple.
.fade {
opacity: 0;
-webkit-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
pointer-events: none;
}
.fade.in {
opacity: 1;
pointer-events: unset;
}
Affects coreui react admin . Basically, the fade hides the content and opacity very harsh in blocking action @rsuite
Need to make the notification widget and another window inward;
Requirements notification window:
· Filtering
· Ordering
· Grouping
· Pagination
· "Types" (success, danger, warning, information, muted)
· Expansion (additional information)
· Ability to add a link
· Mark as read (possibility to mark as read).
maybe I found some bug with the component MultiCascader.
to reproduce, use the create-react-app
demo project ,and replace your src/App.js
like the code below:
import "./App.css";
import "rsuite/dist/styles/rsuite-default.css";
import { MultiCascader } from "rsuite";
function App() {
const data = [
{
value: "1",
label: "四川",
children: [
{
label: "成都市",
value: "1-1",
children: [
{
value: "1-1-1",
label: "锦江区",
},
{
value: "1-1-2",
label: "青羊区",
},
],
},
{
value: "1-2",
label: "自贡市",
children: [
{
value: "1-2-1",
label: "自流井区",
},
{
value: "1-2-2",
label: "贡井区",
},
],
},
],
},
{
label: "贵州",
value: "2",
children: [
{
value: "2-1",
label: "贵阳市",
children: [
{
value: "2-1-1",
label: "南明区",
},
{
value: "2-1-2",
label: "云岩区",
},
],
},
{
value: "2-2",
label: "六盘水市",
children: [
{
value: "2-2-1",
label: "钟山区",
},
{
value: "2-2-2",
label: "六枝特区",
},
],
},
],
},
];
const value = ["1-1-1", "1-1-2", "1-2-1", "1-2-2"];
return (
<div className="App">
<MultiCascader data={data} value={value} />
</div>
);
}
export default App;
the problem is , with the default value ,the top level is shown as partial checked.
the expected is, shown as all checked.
const RTable = ({ tableData }: RTableInterface) => {
const { Column, HeaderCell } = Table;
const [limit, setLimit] = useState(10);
const [page, setPage] = useState(1);
//const [data, setData] = useState(filterData(tableData));
const [sortColumn, setSortColumn] = useState("");
const [sortType, setSortType] = useState<SortType | undefined>();
const [loading, setLoading] = useState(false);
const handleChangeLimit = (dataKey) => {
setPage(1);
setLimit(dataKey);
};
const getData = () => {
if (sortColumn && sortType) {
return fakeData.sort((a, b) => {
let x = a[sortColumn];
let y = b[sortColumn];
if (typeof x === "string") {
x = x.charCodeAt(0);
}
if (typeof y === "string") {
y = y.charCodeAt(0);
}
if (sortType === "asc") {
return x - y;
} else {
return y - x;
}
});
}
return tableData;
};
const filterData = fakeData.filter((v, i) => {
const start = limit * (page - 1);
const end = start + limit;
return i >= start && i < end;
});
const handleSortColumn = (sortColumn, sortType) => {
setLoading(true);
setTimeout(() => {
setLoading(false);
setSortColumn(sortColumn);
setSortType(sortType);
}, 500);
};
return (
<div>
<Table
height={420}
data={filterData}
sortColumn={sortColumn}
sortType={sortType}
onSortColumn={handleSortColumn}
loading={loading}
onRowClick={(data) => {
console.log(data);
}}
>
<Column width={70} align="center" fixed>
<HeaderCell>Id</HeaderCell>
<Cell dataKey="id" />
</Column>
<Column width={200} fixed sortable>
<HeaderCell>First Name</HeaderCell>
<Cell dataKey="firstName" />
</Column>
<Column width={200} sortable>
<HeaderCell>Last Name</HeaderCell>
<Cell dataKey="lastName" />
</Column>
<Column width={200} sortable>
<HeaderCell>City</HeaderCell>
<Cell dataKey="city" />
</Column>
<Column width={200} sortable>
<HeaderCell>Street</HeaderCell>
<Cell dataKey="street" />
</Column>
<Column width={300} sortable>
<HeaderCell>Company Name</HeaderCell>
<Cell dataKey="companyName" />
</Column>
<Column width={300} sortable>
<HeaderCell>Email</HeaderCell>
<Cell dataKey="email" />
</Column>
<Column width={120} fixed="right">
<HeaderCell>Action</HeaderCell>
<Cell>
{(rowData) => {
function handleAction() {
alert(`id:${rowData.id}`);
}
return (
<span>
<a onClick={handleAction}> Edit </a> |{" "}
<a onClick={handleAction}> Remove </a>
</span>
);
}}
</Cell>
</Column>
</Table>
<div style={{ padding: 20 }}>
<Pagination
prev
next
first
last
ellipsis
boundaryLinks
maxButtons={5}
size="xs"
layout={["total", "-", "limit", "|", "pager", "skip"]}
total={tableData.length}
limitOptions={[10, 20]}
limit={limit}
activePage={page}
onChangePage={setPage}
onChangeLimit={handleChangeLimit}
/>
</div>
</div>
);
};
anyone who has managed to setup rsuite to work with react@17.0.2?
Using npm, adding the --legacy-peer-deps to my npm install command resovled the peer dependency issues I was having.
npm i --save --legacy-peer-deps rsuite
store.subscribe(() => {
const theme = store.getState().theme;
if (theme.name === 'dark') {
require('rsuite/dist/styles/rsuite-dark.min.css');
} else {
require('rsuite/dist/styles/rsuite-default.min.css');
}
});
navigator.onLine
to get a boolean when the page was just rendered
offline