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

Commit044ec86

Browse files
Dan updates for post mvp dbs (#1117)
1 parentb0f91e3 commit044ec86

File tree

18 files changed

+96
-25
lines changed

18 files changed

+96
-25
lines changed

‎pgml-dashboard/src/components/inputs/range_group/range_group.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,8 @@ div[data-controller="inputs-range-group"] {
44
}
55

66
.hourly-rate {
7-
display:flex;
8-
flex-direction:row;
97
background-color:#{$gray-900};
10-
border-radius:$border-radius;
11-
padding:8px4px;
12-
138
color:#{$gray-400};
14-
text-align:center;
15-
font-size:18px;
16-
font-style:normal;
17-
font-weight:700;
18-
line-height:24px;
19-
letter-spacing:0.18px;
209
}
2110

2211
.cost {

‎pgml-dashboard/src/components/inputs/range_group/template.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ <h6 class="h6"><%- title %></h6>
4242
<divclass="tick-unit">
4343
<divclass="tick"data-inputs-range-group-target="tick"></div>
4444

45+
<!-- large screen content -->
4546
<divclass="d-none d-lg-flex flex-column text-nowrap mt-2 tick-text"data-inputs-range-group-target="tickText">
4647
<% for info in item { %>
4748
<divclass="legal-text fw-bold"><%- info %></div>
4849
<% } %>
4950
</div>
5051

52+
<!-- small screen content -->
5153
<divclass="d-block d-lg-none">
5254
<divclass="flex-column text-nowrap mt-2 tick-text"data-inputs-range-group-target="smScreenText">
5355
<% for info in item { %>

‎pgml-dashboard/src/components/inputs/select/select_controller.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ export default class extends Controller {
44
statictargets=["input","value"]
55

66
choose(e){
7-
this.inputTarget.value=e.target.innerHTML
8-
this.valueTarget.innerHTML=e.target.innerHTML
7+
this.setValue(e.target.innerHTML)
8+
}
9+
10+
resetSelect(){
11+
this.setValue(this.element.dataset.initial)
12+
}
13+
14+
setValue(value){
15+
this.inputTarget.value=value
16+
this.valueTarget.innerHTML=value
917
this.inputTarget.dispatchEvent(newEvent('change'))
1018
}
1119
}

‎pgml-dashboard/src/components/inputs/select/template.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use crate::components::dropdown::Dropdown;
33
use crate::components::stimulus::stimulus_target::StimulusTarget;
44
%>
5-
<divdata-controller="inputs-select">
5+
<divdata-controller="inputs-select"data-initial="<%- value.clone() %>">
66

77
<% let mut dropdown = Dropdown::new()
88
.items(options)
@@ -29,5 +29,5 @@
2929

3030
<%+ dropdown %>
3131

32-
<inputtype="hidden"name="<%= name %>"value="<%= value %>"data-inputs-select-target="input"<%- value_target %> data-action="<%- action %>"/>
32+
<inputtype="hidden"name="<%= name %>"value="<%= value %>"data-inputs-select-target="input"<%- value_target %> data-action="<%- action %> reset->inputs-select#resetSelect"/>
3333
</div>

‎pgml-dashboard/src/components/inputs/switch/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ impl Switch {
6060
self
6161
}
6262

63-
pubfnstart_toggled(mutself) ->Switch{
64-
self.initial_state =State::Right;
63+
pubfndefault_position(mutself,state:State) ->Switch{
64+
self.initial_state =state;
6565
self
6666
}
6767

‎pgml-dashboard/src/components/inputs/switch/switch.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ div[data-controller="inputs-switch"] {
77
}
88

99
.label {
10-
padding:8px20px;
10+
padding:8px40px;
1111
border-radius:5rem;
1212
text-align:center;
1313
display:flex;
1414
justify-content:center;
15+
align-items:center;
1516
@extend.gap-2;
1617
}
1718

‎pgml-dashboard/src/components/inputs/text/editable_header/editable_header.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,10 @@ div[data-controller="inputs-text-editable-header"] {
3333
padding:0px;
3434
margin-bottom:-2px;// compensate for border space
3535
}
36+
37+
#title {
38+
&.error {
39+
border-bottom:1pxsolid#{$error}
40+
}
41+
}
3642
}

‎pgml-dashboard/src/components/inputs/text/editable_header/editable_header_controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ export default class extends Controller {
3131
error(e){
3232
this.errorTarget.innerHTML=e.detail
3333
this.errorTarget.style.display="block"
34+
this.headerTarget.classList.add("error")
3435
}
3536

3637
clear(){
3738
this.errorTarget.style.display="none"
39+
this.headerTarget.classList.remove("error")
3840
}
3941
}

‎pgml-dashboard/src/components/inputs/text/editable_header/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<divclass="editable-header-container"style="display: block"
66
data-action="click->inputs-text-editable-header#toggleEditor">
77
<<%= header_type.to_string() %> class="align-items-center<%= header_type.to_string() %> d-flex gap-3">
8-
<spandata-inputs-text-editable-header-target="header">
8+
<spandata-inputs-text-editable-header-target="header"id="title">
99
<%= value %>
1010
</span>
1111

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use pgml_components::component;
2+
use sailfish::TemplateOnce;
3+
4+
#[derive(TemplateOnce,Default)]
5+
#[template(path ="lists/item/template.html")]
6+
pubstructItem{
7+
value:String,
8+
}
9+
10+
implItem{
11+
pubfnnew() ->Item{
12+
Item{
13+
value:String::from("Your list item"),
14+
}
15+
}
16+
17+
pubfnvalue(mutself,value:&str) ->Item{
18+
self.value = value.into();
19+
self
20+
}
21+
}
22+
23+
component!(Item);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp