mirror of
https://github.com/penpot/penpot.git
synced 2025-06-17 04:11:43 +02:00
💄 Disable group selection
This commit is contained in:
parent
f0735417f4
commit
9c7e15f43f
2 changed files with 12 additions and 11 deletions
|
@ -60,16 +60,8 @@
|
||||||
:default-value default-value}]))
|
:default-value default-value}]))
|
||||||
|
|
||||||
(mf/defc sets-tree-set-group
|
(mf/defc sets-tree-set-group
|
||||||
[{:keys [label tree-depth tree-path selected? collapsed? on-select editing? on-edit on-edit-reset on-edit-submit]}]
|
[{:keys [label tree-depth tree-path selected? collapsed? editing? on-edit on-edit-reset on-edit-submit]}]
|
||||||
(let [editing?' (editing? tree-path)
|
(let [editing?' (editing? tree-path)
|
||||||
on-click
|
|
||||||
(mf/use-fn
|
|
||||||
(mf/deps editing? tree-path)
|
|
||||||
(fn [event]
|
|
||||||
(dom/stop-propagation event)
|
|
||||||
(when-not (editing? tree-path)
|
|
||||||
(on-select tree-path))))
|
|
||||||
|
|
||||||
on-context-menu
|
on-context-menu
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps editing? tree-path)
|
(mf/deps editing? tree-path)
|
||||||
|
@ -86,12 +78,13 @@
|
||||||
:data-testid "tokens-set-group-item"
|
:data-testid "tokens-set-group-item"
|
||||||
:style {"--tree-depth" tree-depth}
|
:style {"--tree-depth" tree-depth}
|
||||||
:class (stl/css-case :set-item-container true
|
:class (stl/css-case :set-item-container true
|
||||||
|
:set-item-group true
|
||||||
:selected-set selected?)
|
:selected-set selected?)
|
||||||
:on-click on-click
|
|
||||||
:on-context-menu on-context-menu
|
:on-context-menu on-context-menu
|
||||||
:on-double-click #(on-edit tree-path)}
|
:on-double-click #(on-edit tree-path)}
|
||||||
[:> icon-button*
|
[:> icon-button*
|
||||||
{:on-click (fn [event]
|
{:class (stl/css :set-item-group-collapse-button)
|
||||||
|
:on-click (fn [event]
|
||||||
(.stopPropagation event)
|
(.stopPropagation event)
|
||||||
(swap! collapsed? not))
|
(swap! collapsed? not))
|
||||||
:aria-label (tr "labels.collapse")
|
:aria-label (tr "labels.collapse")
|
||||||
|
|
|
@ -34,6 +34,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.set-item-group {
|
||||||
|
cursor: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.set-item-group-collapse-button {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.set-name {
|
.set-name {
|
||||||
@include textEllipsis;
|
@include textEllipsis;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue