♻️ Convert grid-cell/options and set-self-alignment to modern * suffix

Rename options -> options*, set-self-alignment -> set-self-alignment*.
Rename prop is-col? -> is-col. Update all 9 call sites to [:> ...] syntax.
This commit is contained in:
Andrey Antukh
2026-04-02 16:54:47 +00:00
parent a3b3526aa5
commit 0c4ebbbb36
10 changed files with 24 additions and 24 deletions

View File

@@ -157,7 +157,7 @@
(cond
(and edit-grid? (d/not-empty? selected-cells))
[:& grid-cell/options
[:> grid-cell/options*
{:shape (get objects edition)
:cells selected-cells}]

View File

@@ -35,10 +35,10 @@
:justify-self
:area-name])
(mf/defc set-self-alignment
[{:keys [is-col? alignment set-alignment] :as props}]
(mf/defc set-self-alignment*
[{:keys [is-col alignment set-alignment]}]
(let [alignment (or alignment :auto)
type (if is-col? "col" "row")
type (if is-col "col" "row")
handle-set-alignment
(mf/use-callback
@@ -52,37 +52,37 @@
:allow-empty true
:name (dm/str "flex-align-items-" type)}
[:& radio-button {:value "start"
:icon (if is-col?
:icon (if is-col
i/align-self-row-left
i/align-self-column-top)
:title "Align self start"
:id (dm/str "align-self-start-" type)}]
[:& radio-button {:value "center"
:icon (if is-col?
:icon (if is-col
i/align-self-row-center
i/align-self-column-center)
:title "Align self center"
:id (dm/str "align-self-center-" type)}]
[:& radio-button {:value "end"
:icon (if is-col?
:icon (if is-col
i/align-self-row-right
i/align-self-column-bottom)
:title "Align self end"
:id (dm/str "align-self-end-" type)}]
[:& radio-button {:value "stretch"
:icon (if is-col?
:icon (if is-col
i/align-self-row-stretch
i/align-self-column-stretch)
:title "Align self stretch"
:id (dm/str "align-self-stretch-" type)}]]]))
(mf/defc options
(mf/defc options*
{::mf/wrap [mf/memo]}
[{:keys [shape cell cells] :as props}]
[{:keys [shape cell cells]}]
(let [state* (mf/use-state {:open true})
open? (:open @state*)
@@ -261,12 +261,12 @@
:value row-end}]]]])
[:div {:class (stl/css :row)}
[:& set-self-alignment {:is-col? false
:alignment align-self
:set-alignment set-alignment}]
[:& set-self-alignment {:is-col? true
:alignment justify-self
:set-alignment set-justify-self}]]
[:> set-self-alignment* {:is-col false
:alignment align-self
:set-alignment set-alignment}]
[:> set-self-alignment* {:is-col true
:alignment justify-self
:set-alignment set-justify-self}]]
[:div {:class (stl/css :row)}
[:button

View File

@@ -102,7 +102,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -101,7 +101,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -121,7 +121,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -127,7 +127,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -101,7 +101,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -101,7 +101,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -168,7 +168,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])

View File

@@ -142,7 +142,7 @@
:multiple false}]
(when (and (= (count ids) 1) is-layout-child? is-grid-parent?)
[:& grid-cell/options
[:> grid-cell/options*
{:shape (first parents)
:cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])