Skip to content

Commit 8eeedd0

Browse files
committed
fixed svg example
1 parent 541c409 commit 8eeedd0

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

examples/custom_renderers_svg/src/renderers.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub fn SvgRowRenderer<Row>(
3333
on_select: EventHandler<web_sys::MouseEvent>,
3434
on_change: EventHandler<ChangeEvent<Row>>,
3535
) -> impl IntoView
36-
where
37-
Row: TableRow + Clone + 'static,
36+
where
37+
Row: TableRow + Clone + 'static,
3838
{
3939
let transform = y_transform_from_index(index);
4040

@@ -114,8 +114,8 @@ pub fn SvgHeadCellRenderer<F>(
114114
on_click: F,
115115
children: Children,
116116
) -> impl IntoView
117-
where
118-
F: Fn(TableHeadEvent) + 'static,
117+
where
118+
F: Fn(TableHeadEvent) + 'static,
119119
{
120120
let style = move || {
121121
let sort = match sort_direction() {
@@ -160,9 +160,9 @@ pub fn SvgTextCellRenderer<T, F>(
160160
on_change: F,
161161
index: usize,
162162
) -> impl IntoView
163-
where
164-
T: IntoView + Clone + 'static,
165-
F: Fn(T) + 'static,
163+
where
164+
T: IntoView + Clone + 'static,
165+
F: Fn(T) + 'static,
166166
{
167167
let x = x_from_index(index);
168168

@@ -181,8 +181,8 @@ pub fn SvgPathCellRenderer<F>(
181181
on_change: F,
182182
index: usize,
183183
) -> impl IntoView
184-
where
185-
F: Fn(String) + 'static,
184+
where
185+
F: Fn(String) + 'static,
186186
{
187187
let transform = transform_from_index(index, 3);
188188

src/components/table_content.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ pub fn TableContent<Row, DataP, Err, ClsP>(
170170
loading_row_display_limit: Option<usize>,
171171
#[prop(optional)] _marker: PhantomData<Err>,
172172
) -> impl IntoView
173-
where
174-
Row: TableRow<ClassesProvider=ClsP> + Clone + 'static,
175-
DataP: TableDataProvider<Row, Err> + 'static,
176-
Err: Debug,
177-
ClsP: TableClassesProvider + Copy + 'static,
173+
where
174+
Row: TableRow<ClassesProvider = ClsP> + Clone + 'static,
175+
DataP: TableDataProvider<Row, Err> + 'static,
176+
Err: Debug,
177+
ClsP: TableClassesProvider + Copy + 'static,
178178
{
179179
let on_change = store_value(on_change);
180180
let rows = Rc::new(RefCell::new(rows));
@@ -299,7 +299,7 @@ pub fn TableContent<Row, DataP, Err, ClsP>(
299299
create_memo(move |_| {
300300
((height.get() / average_row_height.get()).ceil() as usize).max(20)
301301
})
302-
.into()
302+
.into()
303303
}
304304
};
305305

@@ -325,7 +325,7 @@ pub fn TableContent<Row, DataP, Err, ClsP>(
325325

326326
row_count_after * average_row_height.get()
327327
})
328-
.into()
328+
.into()
329329
};
330330

331331
let tbody_ref = create_node_ref::<AnyElement>();
@@ -592,7 +592,7 @@ fn compute_average_row_height_from_loaded<Row, ClsP>(
592592
placeholder_height_before: Signal<f64>,
593593
loaded_rows: RwSignal<LoadedRows<Row>>,
594594
) where
595-
Row: TableRow<ClassesProvider=ClsP> + Clone + 'static,
595+
Row: TableRow<ClassesProvider = ClsP> + Clone + 'static,
596596
{
597597
if let Some(el) = tbody_ref.get_untracked() {
598598
let el: &web_sys::Element = &el;

src/table_row.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ pub trait TableRow: Clone {
1818
///
1919
/// This render function has to render exactly one root element.
2020
fn render_row(&self, index: usize, on_change: EventHandler<ChangeEvent<Self>>)
21-
-> impl IntoView;
21+
-> impl IntoView;
2222

2323
/// Render the head row of the table.
2424
fn render_head_row<F>(
2525
sorting: Signal<VecDeque<(usize, ColumnSort)>>,
2626
on_head_click: F,
2727
) -> impl IntoView
28-
where
29-
F: Fn(TableHeadEvent) + Clone + 'static;
28+
where
29+
F: Fn(TableHeadEvent) + Clone + 'static;
3030

3131
/// The name of the column (= struct field name) at the given index. This can be used to implement
3232
/// sorting in a database. It takes the `#[table(skip)]` attributes into account. `col_index`

0 commit comments

Comments
 (0)