funicular-datepicker 0.2.0 → 0.3.0

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: 0cccdef7050f58fdae30fccc488a56e5015674d0e1fe00f1639f5fdad238fc67
4
- data.tar.gz: 394fa0df64acc89c947c36bae88c621f435373f977bfb0098346cfc1f00e2e27
3
+ metadata.gz: d04601933fcfd7f014ffa25d16332dafe5e9a1df8a72535d77042cd759b63480
4
+ data.tar.gz: 3e1efcdc036a108d8989cb8204ae38cadf54f75266243d163cbf4b86d4a0f0e0
5
5
  SHA512:
6
- metadata.gz: 43936b1c205fcd1e365e9d591a8628c0475a59b38731a162dd6c4dbbb90b4173475f8bcaf9bd10cf154a84f4547aa060b97fdf7711266bc967dc5cab323ec334
7
- data.tar.gz: 3c27d85680a4002065382787fd8b8a003f4e178a802b6fcd6b921915ac77b4b6a747e7d16ff1ef3747c98ec5b47195371cb07842070cd5b1ade266fafd613d53
6
+ metadata.gz: 532cd7985f1484e8624ee27d9e8616a20470dfa99d1c97e7010e2eea080816c8cd8d76ada4525840d7801002d6e07f07836ff366f9a9ee73bf898cfa42252e17
7
+ data.tar.gz: '085517c3741e4309288ccf8400491f2e58decfe8ac870dd3979a76ed4ec3bd0be6df9e60f866f224657534f00ab9ee01ae61be26d6052fc804337ad8a2fcd389'
@@ -60,10 +60,10 @@ class DatePickerComponent < Funicular::Component
60
60
  patch(calendar_open: false)
61
61
  end
62
62
 
63
- def render(h)
64
- h.div(class: "funicular-date-picker") do
65
- h.div(class: "funicular-date-picker__input_row") do
66
- h.input(
63
+ def render
64
+ div(class: "funicular-date-picker") do
65
+ div(class: "funicular-date-picker__input_row") do
66
+ input(
67
67
  type: "text",
68
68
  name: props[:name],
69
69
  value: props[:value].to_s,
@@ -72,10 +72,10 @@ class DatePickerComponent < Funicular::Component
72
72
  oninput: :handle_input,
73
73
  onfocus: -> { open_calendar }
74
74
  )
75
- h.button(type: "button", class: button_class, onclick: -> { open_calendar }) { "Calendar" }
75
+ button(type: "button", class: button_class, onclick: -> { open_calendar }) { "Calendar" }
76
76
  end
77
77
 
78
- render_calendar(h) if state[:calendar_open]
78
+ render_calendar if state[:calendar_open]
79
79
  end
80
80
  end
81
81
 
@@ -85,23 +85,23 @@ class DatePickerComponent < Funicular::Component
85
85
  props[:button_class] || "funicular-date-picker__button"
86
86
  end
87
87
 
88
- def render_calendar(h)
89
- h.div(class: "funicular-date-picker__panel") do
90
- h.div(class: "funicular-date-picker__header") do
91
- h.button(type: "button", class: "funicular-date-picker__nav", onclick: -> { prev_month }) { "<" }
92
- h.div(class: "funicular-date-picker__month") do
88
+ def render_calendar
89
+ div(class: "funicular-date-picker__panel") do
90
+ div(class: "funicular-date-picker__header") do
91
+ button(type: "button", class: "funicular-date-picker__nav", onclick: -> { prev_month }) { "<" }
92
+ div(class: "funicular-date-picker__month") do
93
93
  "#{MONTH_NAMES[state[:view_month] - 1]} #{state[:view_year]}"
94
94
  end
95
- h.button(type: "button", class: "funicular-date-picker__nav", onclick: -> { next_month }) { ">" }
95
+ button(type: "button", class: "funicular-date-picker__nav", onclick: -> { next_month }) { ">" }
96
96
  end
97
97
 
98
- h.div(class: "funicular-date-picker__grid") do
98
+ div(class: "funicular-date-picker__grid") do
99
99
  WEEKDAYS.each do |day|
100
- h.div(class: "funicular-date-picker__weekday") { day }
100
+ div(class: "funicular-date-picker__weekday") { day }
101
101
  end
102
102
 
103
103
  first_weekday(state[:view_year], state[:view_month]).times do
104
- h.div(class: "funicular-date-picker__empty") { "" }
104
+ div(class: "funicular-date-picker__empty") { "" }
105
105
  end
106
106
 
107
107
  selected_year, selected_month, selected_day = parse_date(props[:value])
@@ -109,7 +109,7 @@ class DatePickerComponent < Funicular::Component
109
109
  selected = selected_year == state[:view_year] &&
110
110
  selected_month == state[:view_month] &&
111
111
  selected_day == day
112
- h.button(
112
+ button(
113
113
  type: "button",
114
114
  class: selected ? "funicular-date-picker__day funicular-date-picker__day--selected" : "funicular-date-picker__day",
115
115
  onclick: -> { select_day(day) }
@@ -119,9 +119,9 @@ class DatePickerComponent < Funicular::Component
119
119
  end
120
120
  end
121
121
 
122
- h.div(class: "funicular-date-picker__footer") do
123
- h.button(type: "button", class: "funicular-date-picker__footer_button", onclick: -> { clear }) { "Clear" }
124
- h.button(type: "button", class: "funicular-date-picker__footer_button", onclick: -> { close_calendar }) { "Close" }
122
+ div(class: "funicular-date-picker__footer") do
123
+ button(type: "button", class: "funicular-date-picker__footer_button", onclick: -> { clear }) { "Clear" }
124
+ button(type: "button", class: "funicular-date-picker__footer_button", onclick: -> { close_calendar }) { "Close" }
125
125
  end
126
126
  end
127
127
  end
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - HASUMI Hitoshi
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.3.0
18
+ version: 0.4.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 0.3.0
25
+ version: 0.4.0
26
26
  description: A Funicular date picker component packaged as a Ruby-script CRubygem.
27
27
  email:
28
28
  - hasumikin@gmail.com