|
2 | 2 | (:require-macros |
3 | 3 | [re-com.core :refer [at]]) |
4 | 4 | (:require |
| 5 | + [re-com :as-alias rc] |
5 | 6 | [re-com.args :as args] |
6 | 7 | re-com.alert-box.theme |
7 | 8 | re-com.alert-list.theme |
|
67 | 68 | :as props}] |
68 | 69 | (or |
69 | 70 | (validate-args-macro alert-box-args-desc props) |
70 | | - (let [part (partial part/part part-structure props) |
| 71 | + (let [part (partial part/part part-structure (part/descend props ::rc/alert-box)) |
71 | 72 | heading? (part/get-part part-structure props ::ab/heading) |
72 | 73 | body? (part/get-part part-structure props ::ab/body) |
73 | 74 | re-com {:state {:alert-type alert-type |
|
182 | 183 | (validate-args-macro alert-list-args-desc props) |
183 | 184 | (let [alerts (deref-or-value alerts) |
184 | 185 | theme (theme/comp pre-theme theme) |
185 | | - part (partial part/part alert-list-part-structure props) |
| 186 | + part (partial part/part alert-list-part-structure (part/descend props ::rc/alert-list)) |
186 | 187 | re-com {:state {:max-height max-height |
187 | 188 | :padding padding |
188 | 189 | :border-style border-style |
189 | 190 | :alert-class alert-class |
190 | 191 | :alert-style alert-style}}] |
191 | 192 | (part ::al/wrapper |
192 | | - {:impl box |
| 193 | + {:impl box |
| 194 | + :theme theme |
| 195 | + :post-props (debug/instrument {} props) |
| 196 | + :props |
| 197 | + {:re-com re-com |
| 198 | + :child |
| 199 | + (part ::al/body |
| 200 | + {:impl border |
193 | 201 | :theme theme |
194 | | - :post-props (debug/instrument {} props) |
| 202 | + :post-props (-> props |
| 203 | + (select-keys [:class :style :attr]) |
| 204 | + (assoc :border border-style |
| 205 | + :padding padding)) |
195 | 206 | :props |
196 | 207 | {:re-com re-com |
197 | 208 | :child |
198 | | - (part ::al/body |
199 | | - {:impl border |
200 | | - :theme theme |
201 | | - :post-props (-> props |
202 | | - (select-keys [:class :style :attr]) |
203 | | - (assoc :border border-style |
204 | | - :padding padding)) |
205 | | - :props |
206 | | - {:re-com re-com |
207 | | - :child |
208 | | - (part ::al/scroller |
209 | | - {:impl scroller |
210 | | - :theme theme |
211 | | - :post-props {:style (when max-height {:max-height max-height})} |
212 | | - :props {:re-com re-com |
| 209 | + (part ::al/scroller |
| 210 | + {:impl scroller |
| 211 | + :theme theme |
| 212 | + :post-props {:style (when max-height {:max-height max-height})} |
| 213 | + :props {:re-com re-com |
213 | 214 | :child |
214 | 215 | (part ::al/v-box |
215 | | - {:impl v-box |
216 | | - :theme theme |
217 | | - :props |
218 | | - {:re-com re-com |
219 | | - :children |
220 | | - (for [alert alerts] |
221 | | - (let [{:keys [id alert-type heading body padding closeable?]} alert] |
222 | | - (part ::al/alert-box |
223 | | - {:impl alert-box |
224 | | - :theme theme |
225 | | - :key id |
226 | | - :post-props {:class alert-class |
227 | | - :style alert-style} |
228 | | - :props |
229 | | - {:id id |
230 | | - :alert-type alert-type |
231 | | - :heading heading |
232 | | - :body body |
233 | | - :padding padding |
234 | | - :closeable? closeable? |
235 | | - :on-close on-close}})))}})}})}})}})))) |
| 216 | + {:impl v-box |
| 217 | + :theme theme |
| 218 | + :props |
| 219 | + {:re-com re-com |
| 220 | + :children |
| 221 | + (for [alert alerts] |
| 222 | + (let [{:keys [id alert-type heading body padding closeable?]} alert] |
| 223 | + (part ::al/alert-box |
| 224 | + {:impl alert-box |
| 225 | + :theme theme |
| 226 | + :key id |
| 227 | + :post-props {:class alert-class |
| 228 | + :style alert-style} |
| 229 | + :props |
| 230 | + {:id id |
| 231 | + :alert-type alert-type |
| 232 | + :heading heading |
| 233 | + :body body |
| 234 | + :padding padding |
| 235 | + :closeable? closeable? |
| 236 | + :on-close on-close}})))}})}})}})}})))) |
0 commit comments