funicular-datepicker 0.1.0 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 830a8b55ec3f3f18ecfb150d04d641e1f7831c77c144d47401719d69a00a3376
4
- data.tar.gz: 652c287646d6fca55fda72a6565d8b4e9ac06ed63fb4a0148c00b33897baf386
3
+ metadata.gz: 07d69fde23065cf6e239ac36690fc710c585dec584dfdff9256d031e7582ff0a
4
+ data.tar.gz: 9872e1112219c0aa16a5653b8448532b4360104611cc1e271d7442df9e7c8e04
5
5
  SHA512:
6
- metadata.gz: 7de6444bb5460fc04d45b42a8ecb04cf1505c70a160dc28e71b2d02b99a1e494ecd9692c95053a966dfdc9c7e2108f979f08f24cb621010da0926170df4d6cc7
7
- data.tar.gz: 8efed1ffa7f2c60890a2e1f24d484c68084521e00ba97702a05c8ce1ad127b6531b54393380bbad572c32ff0d5f7bde40877f9594a8688897309a4714c6588a0
6
+ metadata.gz: ff5b94a2af3de525bc724fcd5f9e4d449dee6944e716a2dcd936d5ab77574ba03708752d3de1855c202e82a9ea68af5ce8be8579c744a67c2fb39c5adb1886a6
7
+ data.tar.gz: 1b64c73e7720eb4edf660ca533bac1a89a7c84c9e6fab863f4f57157c8e8d1e3bd081d51c1dce1eb54af5d185d758c1802513c4c0060ead5029cf3c52e7106fe
data/README.md CHANGED
@@ -9,3 +9,14 @@ group :funicular do
9
9
  gem "funicular-datepicker"
10
10
  end
11
11
  ```
12
+
13
+ ```ruby
14
+ component(
15
+ Funicular::Plugins::DatePicker::Component,
16
+ name: "birthday",
17
+ value: state.birthday,
18
+ input_class: "birthday-input",
19
+ button_class: "birthday-calendar-button",
20
+ on_change: ->(value) { patch(birthday: value) }
21
+ )
22
+ ```
@@ -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
- padding: 0.5rem 0.75rem;
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 {
@@ -65,13 +65,14 @@ class DatePickerComponent < Funicular::Component
65
65
  div(class: "funicular-date-picker__input_row") do
66
66
  input(
67
67
  type: "text",
68
+ name: props[:name],
68
69
  value: props[:value].to_s,
69
70
  placeholder: props[:placeholder] || "YYYY-MM-DD",
70
71
  class: props[:input_class] || "funicular-date-picker__input",
71
72
  oninput: :handle_input,
72
73
  onfocus: -> { open_calendar }
73
74
  )
74
- button(type: "button", class: "funicular-date-picker__button", onclick: -> { open_calendar }) { "Calendar" }
75
+ button(type: "button", class: button_class, onclick: -> { open_calendar }) { "Calendar" }
75
76
  end
76
77
 
77
78
  render_calendar if state.calendar_open
@@ -80,6 +81,10 @@ class DatePickerComponent < Funicular::Component
80
81
 
81
82
  private
82
83
 
84
+ def button_class
85
+ props[:button_class] || "funicular-date-picker__button"
86
+ end
87
+
83
88
  def render_calendar
84
89
  div(class: "funicular-date-picker__panel") do
85
90
  div(class: "funicular-date-picker__header") do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funicular-datepicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HASUMI Hitoshi