Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dan estimator fix#1075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
chillenberger merged 3 commits intomasterfromdan-estimator-fix
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
use StimulusTarget
  • Loading branch information
@chillenberger
chillenberger committedOct 13, 2023
commite68162cae66ae370209068042ce450d6d1c49f7e
25 changes: 13 additions & 12 deletionspgml-dashboard/src/components/inputs/range_group/mod.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
use pgml_components::component;
use sailfish::TemplateOnce;
use crate::components::stimulus::stimulus_target::StimulusTarget;

#[derive(TemplateOnce, Default)]
#[template(path = "inputs/range_group/template.html")]
Expand All@@ -10,11 +11,11 @@ pub struct RangeGroup {
pub max: i64,
pub step: f32,
pub initial_value: f64,
pub text_target:Option<String>,
pub range_target:Option<String>,
pub text_target:StimulusTarget,
pub range_target:StimulusTarget,
pub cost_rate: Option<f32>,
pub units: String,
pub group_target:Option<String>,
pub group_target:StimulusTarget,
}

impl RangeGroup {
Expand All@@ -26,11 +27,11 @@ impl RangeGroup {
max: 100,
step: 1.0,
initial_value: 1.0,
text_target:None,
range_target:None,
text_target:StimulusTarget::new(),
range_target:StimulusTarget::new(),
cost_rate: None,
units: String::default(),
group_target:None,
group_target:StimulusTarget::new(),
}
}

Expand All@@ -51,13 +52,13 @@ impl RangeGroup {
self
}

pub fn text_target(mut self, target:&str) -> Self {
self.text_target =Some(target.to_owned());
pub fn text_target(mut self, target:StimulusTarget) -> Self {
self.text_target = target;
self
}

pub fn range_target(mut self, target:&str) -> Self {
self.range_target =Some(target.to_owned());
pub fn range_target(mut self, target:StimulusTarget) -> Self {
self.range_target = target.to_owned();
self
}

Expand All@@ -71,8 +72,8 @@ impl RangeGroup {
self
}

pub fn group_target(mut self, target:&str) -> Self {
self.group_target =Some(target.to_owned());
pub fn group_target(mut self, target:StimulusTarget) -> Self {
self.group_target = target;
self
}
}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@
data-inputs-range-group-bounds-value='{"min": <%- min%>, "max": <%- max%>}'
data-inputs-range-group-initial-value="<%- initial_value.to_string() %>"
data-inputs-range-group-target="group"
<% if group_target.is_some() { %><%- group_target.unwrap() %> <% } %>
<%- group_target %>
data-action="reset->inputs-range-group#reset">
<div class="d-flex flex-column flex-md-row">
<div class="flex-grow-1">
Expand All@@ -13,7 +13,7 @@ <h6 class="h6"><%- title %></h6>
<input class="text-input form-control text-end text-white fw-bold" maxlength="4" type="text"
data-inputs-range-group-target="text"
data-action="focusout->inputs-range-group#updateRange"
<% if text_target.is_some() {%><%- text_target.unwrap()%><% } %>>
<%- text_target %>>
<div class="input-group-text fw-bold text-start" style="width: 2em;">
<%- units %>
</div>
Expand All@@ -30,7 +30,7 @@ <h6 class="h6"><%- title %></h6>
value="<%- initial_value.to_string() %>"
data-action="inputs-range-group#updateText"
data-inputs-range-group-target="range"
<% if range_target.is_some() { %><%- range_target.unwrap() %><% } %>>
<%- range_target %>>

<% if cost_rate.is_some() { %>
<div class="w-100 d-flex justify-content-end">
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp