funicular-datepicker 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/assets/date_picker.css +17 -5
- data/lib/components/date_picker_component.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d95ca094c408765d950bfdbcb1af695783998e7d1a7f64a334f46dfe7fb1dae
|
|
4
|
+
data.tar.gz: 54c5927016a32b382ba639c3542e60da0bcd625d4aefdc02a311bb9670cb7901
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c37569a0336ec47423b204692d129537afe7f81ac4492d7ed19921899ed98440b5d1d05aea86ebc4f0d514f854d755894c1609d726cad485c67df9159490da45
|
|
7
|
+
data.tar.gz: 8ddb59f662b6a631fd3e5775ee4bd9a486e79116d90e01f5f4acf4e05e0ffe7dc366506f02c928d222ca2f448df623912f1dc4083c9941446aace39e67958323
|
data/README.md
CHANGED
|
@@ -9,3 +9,13 @@ group :funicular do
|
|
|
9
9
|
gem "funicular-datepicker"
|
|
10
10
|
end
|
|
11
11
|
```
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
component(
|
|
15
|
+
Funicular::Plugins::DatePicker::Component,
|
|
16
|
+
value: state.birthday,
|
|
17
|
+
input_class: "birthday-input",
|
|
18
|
+
button_class: "birthday-calendar-button",
|
|
19
|
+
on_change: ->(value) { patch(birthday: value) }
|
|
20
|
+
)
|
|
21
|
+
```
|
data/assets/date_picker.css
CHANGED
|
@@ -10,19 +10,31 @@
|
|
|
10
10
|
.funicular-date-picker__button,
|
|
11
11
|
.funicular-date-picker__nav,
|
|
12
12
|
.funicular-date-picker__footer_button {
|
|
13
|
-
border: 1px solid #d1d5db;
|
|
14
13
|
border-radius: 0.375rem;
|
|
15
|
-
background: #fff;
|
|
16
|
-
color: #374151;
|
|
17
14
|
cursor: pointer;
|
|
15
|
+
font: inherit;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
.funicular-date-picker__button {
|
|
21
|
-
|
|
19
|
+
border: 0;
|
|
20
|
+
background: #2563eb;
|
|
21
|
+
color: #fff;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
padding: 0.5rem 1rem;
|
|
22
24
|
white-space: nowrap;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
.funicular-date-picker__button:hover
|
|
27
|
+
.funicular-date-picker__button:hover {
|
|
28
|
+
background: #1d4ed8;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.funicular-date-picker__nav,
|
|
32
|
+
.funicular-date-picker__footer_button {
|
|
33
|
+
border: 1px solid #d1d5db;
|
|
34
|
+
background: #fff;
|
|
35
|
+
color: #374151;
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
.funicular-date-picker__nav:hover,
|
|
27
39
|
.funicular-date-picker__footer_button:hover,
|
|
28
40
|
.funicular-date-picker__day:hover {
|
|
@@ -71,7 +71,7 @@ class DatePickerComponent < Funicular::Component
|
|
|
71
71
|
oninput: :handle_input,
|
|
72
72
|
onfocus: -> { open_calendar }
|
|
73
73
|
)
|
|
74
|
-
button(type: "button", class:
|
|
74
|
+
button(type: "button", class: button_class, onclick: -> { open_calendar }) { "Calendar" }
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
render_calendar if state.calendar_open
|
|
@@ -80,6 +80,10 @@ class DatePickerComponent < Funicular::Component
|
|
|
80
80
|
|
|
81
81
|
private
|
|
82
82
|
|
|
83
|
+
def button_class
|
|
84
|
+
props[:button_class] || "funicular-date-picker__button"
|
|
85
|
+
end
|
|
86
|
+
|
|
83
87
|
def render_calendar
|
|
84
88
|
div(class: "funicular-date-picker__panel") do
|
|
85
89
|
div(class: "funicular-date-picker__header") do
|