Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-U committed Aug 17, 2024
1 parent b5ed36e commit 520d100
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 35 deletions.
2 changes: 1 addition & 1 deletion dash_drag_grid/dash_drag_grid.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_drag_grid/dash_drag_grid.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/dash_drag_grid.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/dash_drag_grid.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/dash_drag_grid.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/dash_drag_grid.min.js.map

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions src/lib/components/ToolBox2.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,12 @@ function ToolBox(props) {
key={key}
className="item toolbox"
data-grid={_data_grid}

unselectable="on"
onDragStart={handleDragStart(key)}
onClick={handleItemClick(key)}
>
<div className="toolbox-item-content">

{props.component(content)}
</div>
</div>
);
} catch (e) {
Expand Down Expand Up @@ -201,7 +199,7 @@ function ToolBox(props) {
isResizable={false}
isDraggable={false}
containerPadding={[0, 0]}
compactType={'horizontal'}
compactType={'vertical'}
onBreakpointChange={handleBreakpointChange}
style={style}
>
Expand Down
11 changes: 5 additions & 6 deletions src/lib/components/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@
align-items: center;
}


.toolbox-container {
background-color: chartreuse;
.react-grid-item.item.toolbox.cssTransforms.react-resizable-hide.react-resizable {
width: 200px !important;
align-content: center !important;
justify-content: center !important;
}

.toolbox-bg {
background-color: blue;
}

32 changes: 13 additions & 19 deletions usage/components/sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
dash_drag_grid.ToolboxItem(
id="test6",
inToolbox=False,
children=[
DashIconify(icon="ion:logo-github", width=30),
html.Div("icon test6"),
],
children=dmc.Group(
[
DashIconify(icon="ion:logo-github", width=30),
html.Div("icon test6"),
]
),
),
]

Expand All @@ -40,23 +42,15 @@
]

drawer_toolbox = dmc.Drawer(
dmc.Box(
dash_drag_grid.ToolBox2(
title="",
linkedId="test",
items=[],
id="toolbox_id"
),
style={"height": "400px", "width": "200px", "background-color": 'red'},
),
dash_drag_grid.ToolBox2(title="", linkedId="test", items=[], id="toolbox_id"),
title="Toolbox",
id="toolbox_drawer",
padding="md",
zIndex=150,
position="right",
size=500,
trapFocus=False,
keepMounted=True
keepMounted=True,
)


Expand Down Expand Up @@ -87,13 +81,14 @@ def make_tooltip_icon(text, icon, id, disabled=False):
prevent_initial_call=True,
)


@callback(
Output('toolbox_id', "items"),
Output('toolbox_id', "linkedId"),
Input('url', 'pathname'),
Output("toolbox_id", "items"),
Output("toolbox_id", "linkedId"),
Input("url", "pathname"),
)
def update_toolbox_items(pathname):
if pathname == '/':
if pathname == "/":
return toolBoxItems, "test_2"
return toolBoxItems2, "test"

Expand All @@ -108,4 +103,3 @@ def make_sidebar():
]

return dmc.Stack(content, justify="center", align="center")

0 comments on commit 520d100

Please sign in to comment.