Content-Length: 703963 | pFad | http://github.com/postgresml/postgresml/commit/044ec86142940057dfd937a39d96d92f59f3019c

3B Dan updates for post mvp dbs (#1117) · postgresml/postgresml@044ec86 · GitHub
Skip to content

Commit 044ec86

Browse files
Dan updates for post mvp dbs (#1117)
1 parent b0f91e3 commit 044ec86

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: 8px 4px;
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
<div class="tick-unit">
4343
<div class="tick" data-inputs-range-group-target="tick"></div>
4444

45+
<!-- large screen content -->
4546
<div class="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
<div class="legal-text fw-bold" ><%- info %></div>
4849
<% } %>
4950
</div>
5051

52+
<!-- small screen content -->
5153
<div class="d-block d-lg-none">
5254
<div class="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
static targets = ["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(new Event('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-
<div data-controller="inputs-select">
5+
<div data-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-
<input type="hidden" name="<%= name %>" value="<%= value %>" data-inputs-select-target="input" <%- value_target %> data-action="<%- action %>" />
32+
<input type="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-
pub fn start_toggled(mut self) -> Switch {
64-
self.initial_state = State::Right;
63+
pub fn default_position(mut self, 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: 8px 20px;
10+
padding: 8px 40px;
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: 1px solid #{$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
<div class="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-
<span data-inputs-text-editable-header-target="header">
8+
<span data-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+
pub struct Item {
7+
value: String,
8+
}
9+
10+
impl Item {
11+
pub fn new() -> Item {
12+
Item {
13+
value: String::from("Your list item"),
14+
}
15+
}
16+
17+
pub fn value(mut self, value: &str) -> Item {
18+
self.value = value.into();
19+
self
20+
}
21+
}
22+
23+
component!(Item);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgresml/postgresml/commit/044ec86142940057dfd937a39d96d92f59f3019c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy