♻️ (pagetop): Incorpora Context al render de Props
This commit is contained in:
parent
a2b3ae2eb8
commit
ab1d4f0efb
49 changed files with 212 additions and 133 deletions
|
|
@ -144,7 +144,7 @@ impl Component for Field {
|
|||
let container_id = self.id().unwrap();
|
||||
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label class="form-label" { (label) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ impl Component for Checkbox {
|
|||
let is_switch = *self.checkbox_kind() == form::CheckboxKind::Switch;
|
||||
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
input
|
||||
type="checkbox"
|
||||
role=[is_switch.then_some("switch")]
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ impl Component for Form {
|
|||
};
|
||||
Ok(html! {
|
||||
form
|
||||
(self.props())
|
||||
(self.props().unpack(cx))
|
||||
action=[self.action().try_resolve(cx)]
|
||||
method=[method]
|
||||
accept-charset=[self.charset().as_deref()]
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ impl Component for Fieldset {
|
|||
}
|
||||
|
||||
Ok(html! {
|
||||
fieldset (self.props()) disabled[*self.disabled()] {
|
||||
fieldset (self.props().unpack(cx)) disabled[*self.disabled()] {
|
||||
@if let Some(legend) = self.legend().lookup(cx) {
|
||||
legend { (legend) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ impl Component for Field {
|
|||
};
|
||||
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label for=[input_id.as_deref()] class="form-label" {
|
||||
(label)
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ impl Component for Number {
|
|||
let container_id = self.id();
|
||||
let input_id = container_id.as_deref().map(|id| util::join!(id, "-input"));
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label for=[input_id.as_deref()] class="form-label" {
|
||||
(label)
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ impl Component for Field {
|
|||
let container_id = self.id().unwrap();
|
||||
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label class="form-label" {
|
||||
(label)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ impl Component for Range {
|
|||
let container_id = self.id();
|
||||
let range_id = container_id.as_deref().map(|id| util::join!(id, "-range"));
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label for=[range_id.as_deref()] class="form-label" { (label) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ impl Component for Field {
|
|||
let select_id = container_id.as_deref().map(|id| util::join!(id, "-select"));
|
||||
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label for=[select_id.as_deref()] class="form-label" {
|
||||
(label)
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ impl Component for Textarea {
|
|||
.map(|id| util::join!(id, "-textarea"));
|
||||
|
||||
Ok(html! {
|
||||
div (self.props()) {
|
||||
div (self.props().unpack(cx)) {
|
||||
@if let Some(label) = self.label().lookup(cx) {
|
||||
label for=[textarea_id.as_deref()] class="form-label" {
|
||||
(label)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue