simple_calendar-timeslot 0.1.0 → 0.2.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: 5cfde73c9c6d8b224e50a8f079ae7643f8b91137960d70756be3a11a75a978ac
4
- data.tar.gz: 6e7e4a61b8d70a1a1bfa142af26d955501959a9c632261926a48fe462137846a
3
+ metadata.gz: 2c7fac7ecd11cc8d00a90b849a3c73300851dd429fa7e497bcb8cd4d4e14a9e1
4
+ data.tar.gz: 7f7ba6d87d31f912f633e0bc3f834141951907744073eab32b29d913d2d001ae
5
5
  SHA512:
6
- metadata.gz: 26abeb52ef9536d375ae8a601b28ea74ee7c0bc7efd4d766fc2251858a39086810eea328bb411546f68dd4cef1d60b73329481173f40e0e01b7b38aa52b5e368
7
- data.tar.gz: 8827d6d91de47f8a21a8e7256489955957dfbc6c7363315672b8428668ee0622e4fbe3ed3f799543316f8c44b96aac073879d1b37458c2db347816c8a5842170
6
+ metadata.gz: 5150b9e8ac40ab7a75f6128222f0c4feb6d6367b2f1088887466351586b738e06cad16fd82399e9297e9239ca4154994a7b59240699e91a3165e6db39d703a8c
7
+ data.tar.gz: d5d2aa091297a2302ee416571561a75a4a3c3377b8bb399a8c31e361070719e0dbc5fcece8ad62cf76d661e4ff6fcd622f7f166f7e2f9abbc4b34ea700b04263
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2021-11-14
4
+
5
+ - Fix css styles to be tailwind agnostic
6
+
3
7
  ## [0.1.0] - 2021-11-12
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_calendar-timeslot (0.1.0)
4
+ simple_calendar-timeslot (0.2.0)
5
5
  simple_calendar (~> 2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -23,6 +23,8 @@ Or install it yourself as:
23
23
 
24
24
  $ gem install simple_calendar-timeslot
25
25
 
26
+ TODO: include stylesheet, show sprockets and scss usecases
27
+
26
28
  ## Usage
27
29
 
28
30
  TODO: Write usage instructions here
@@ -0,0 +1,99 @@
1
+ .timeslot-calendar div {
2
+ box-sizing: border-box;
3
+ }
4
+ .timeslot-calendar .days-wrapper-vertical {
5
+ display: flex;
6
+ flex-direction: row;
7
+ }
8
+ .timeslot-calendar .days-wrapper-horizontal {
9
+ display: flex;
10
+ flex-direction: column;
11
+ }
12
+ .timeslot-calendar .day-wrapper {
13
+ flex: 1 1 0;
14
+ }
15
+ .timeslot-calendar .day-content-vertical {
16
+ display: flex;
17
+ flex-direction: column;
18
+ position: relative;
19
+ }
20
+ .timeslot-calendar .day-content-horizontal {
21
+ display: flex;
22
+ flex-direction: column;
23
+ position: relative;
24
+ overflow-x: auto;
25
+ overflow-y: hidden;
26
+ }
27
+ .timeslot-calendar .day-content-horizontal-inner {
28
+ position: relative;
29
+ }
30
+
31
+ .timeslot-calendar .hour-indicator-col-vertical {
32
+ display: flex;
33
+ flex: 1 1 0;
34
+ flex-direction: column;
35
+ z-index: 0;
36
+ }
37
+ .timeslot-calendar .hour-indicator-col-horizontal {
38
+ display: flex;
39
+ flex: 1 1 0;
40
+ flex-direction: row;
41
+ height: 100%;
42
+ z-index: 0;
43
+ }
44
+ .timeslot-calendar .hour-indicator-vertical {
45
+ border-style: solid;
46
+ flex: 1 1 0;
47
+ border-width: 2px 0 0;
48
+ border-color: rgba(229, 231, 235, 0.5);
49
+ box-sizing: border-box;
50
+ }
51
+ .timeslot-calendar .hour-indicator-horizontal {
52
+ border-style: solid;
53
+ flex: 1 1 0;
54
+ border-width: 0 0 0 2px;
55
+ border-color: rgba(229, 231, 235, 0.5);
56
+ box-sizing: border-box;
57
+ }
58
+ .timeslot-calendar .buckets-wrapper {
59
+ position: absolute;
60
+
61
+ }
62
+ .timeslot-calendar .buckets-vertical {
63
+ display: flex;
64
+ flex-direction: row;
65
+ }
66
+ .timeslot-calendar .buckets-horizontal {
67
+ position: absolute;
68
+ display: flex;
69
+ flex-direction: column;
70
+ }
71
+ .timeslot-calendar .bucket-wrapper {
72
+ flex: 1 1 0;
73
+ }
74
+ .timeslot-calendar .bucket-horizontal {
75
+ flex: 1 1 0;
76
+ display: flex;
77
+ flex-direction: row;
78
+ }
79
+ .timeslot-calendar .bucket-inner-horizontal {
80
+ position: relative;
81
+ }
82
+ .timeslot-calendar .events-wrapper {
83
+ position: relative;
84
+ }
85
+ .timeslot-calendar .event-wrapper {
86
+ position: absolute;
87
+ z-index: 1;
88
+ box-sizing: border-box;
89
+ }
90
+ /*--- Event example style ----*/
91
+ .timeslot-event {
92
+ width: 100%;
93
+ height: 100%;
94
+ border-width: 2px;
95
+ border-style: solid;
96
+ border-color: rgba(0, 0, 0, 0.5);
97
+ border-radius: 0.25rem;
98
+ background-color: white;
99
+ }
@@ -1,4 +1,4 @@
1
- <div class="slotted-calendar">
1
+ <div class="simple-calendar timeslot-calendar">
2
2
  <div class="calendar-heading">
3
3
  <%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
4
4
  <span class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></span>
@@ -6,9 +6,9 @@
6
6
  </div>
7
7
 
8
8
  <% if calendar.orientation == :vertical %>
9
- <div class="flex flex-row">
9
+ <div class="days-wrapper-vertical">
10
10
  <% date_range.slice(0, 7).each do |day| %>
11
- <div class="flex-1 border-0 border-gray-500 border-opacity-25">
11
+ <div class="day-wrapper">
12
12
  <div class="day-title-row">
13
13
  <span class="day-weekday">
14
14
  <%= t('date.abbr_day_names')[day.wday] %>
@@ -18,14 +18,14 @@
18
18
  </span>
19
19
  </div>
20
20
  <%= content_tag :div, class: calendar.td_classes_for(day) do %>
21
- <div class="flex flex-col relative" style="height:<%=calendar.height%>px;">
21
+ <div class="day-content-vertical" style="height:<%=calendar.height%>px;">
22
22
  <% if calendar.display_grid %>
23
- <div class="cal-hour-indicator-col flex-1 flex flex-col" style="z-index:-10;">
23
+ <div class="hour-indicator-col-vertical">
24
24
  <% if calendar.display_bucket_title %>
25
25
  <div class="bucket-title" style="height:<%=calendar.bucket_title_size%>px"></div>
26
26
  <% end %>
27
27
  <% (0..23).each do |hour| %>
28
- <div class="cal-hour-indicator border-t-2 border-gray-200 border-opacity-50 flex-1" id="hour-<%=hour %>">
28
+ <div class="hour-indicator-vertical" id="hour-<%=hour %>">
29
29
  <%=hour%>
30
30
  </div>
31
31
  <% end %>
@@ -33,20 +33,20 @@
33
33
  <% end %>
34
34
  <% events = sorted_events.fetch(day, []) %>
35
35
  <% buckets = calendar.split_into_buckets(events) %>
36
- <div class="absolute" style="left:<%=calendar.grid_width%>;right:0">
37
- <div class="buckets w-full flex flex-row bg-white" style="z-index:1;">
36
+ <div class="buckets-wrapper" style="left:<%=calendar.grid_width%>;right:0">
37
+ <div class="buckets-vertical">
38
38
  <% buckets.each do |bucket| %>
39
- <div class="flex-1">
40
- <div class="bucket">
39
+ <div class="bucket-wrapper">
40
+ <div class="bucket-vertical">
41
41
  <% if calendar.display_bucket_title %>
42
42
  <div class="bucket-title" style="height:<%=calendar.bucket_title_size%>px">
43
43
  <%= bucket&.first&.send calendar.display_bucket_title %>
44
44
  </div>
45
45
  <% end %>
46
- <div class="relative">
46
+ <div class="events-wrapper">
47
47
  <% events_size = calendar.slot_events(bucket, day) %>
48
48
  <% bucket.each do |event| %>
49
- <div class="absolute border-2 border-opacity-25 border-red-500 bg-white rounded box-border hover:w-full" style="z-index:20;width:<%=events_size[event][0]%>%;top:<%=events_size[event][3]%>px;left:<%=events_size[event][1]%>%;height:<%=events_size[event][2]%>px">
49
+ <div class="event-wrapper" style="z-index:20;width:<%=events_size[event][0]%>%;top:<%=events_size[event][3]%>px;left:<%=events_size[event][1]%>%;height:<%=events_size[event][2]%>px">
50
50
  <% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
51
51
  <% capture_haml(event, &passed_block) %>
52
52
  <% else %>
@@ -66,9 +66,9 @@
66
66
  <% end %>
67
67
  </div>
68
68
  <% elsif calendar.orientation == :horizontal %>
69
- <div class="flex flex-col">
69
+ <div class="days-wrapper-horizontal">
70
70
  <% date_range.slice(0, 7).each do |day| %>
71
- <div class="flex-1 border-0 border-gray-500 border-opacity-25">
71
+ <div class="day-wrapper">
72
72
  <div class="day-title-row">
73
73
  <span class="day-weekday">
74
74
  <%= t('date.abbr_day_names')[day.wday] %>
@@ -78,15 +78,15 @@
78
78
  </span>
79
79
  </div>
80
80
  <%= content_tag :div, class: calendar.td_classes_for(day) do %>
81
- <div class="flex flex-col overflow-x-auto">
82
- <div class="relative" style="width:<%=calendar.height%>px;height:<%=calendar.horizontal_height_px%>px">
81
+ <div class="day-content-horizontal">
82
+ <div class="day-content-horizontal-inner" style="width:<%=calendar.height%>px;height:<%=calendar.horizontal_height_px%>px">
83
83
  <% if calendar.display_grid %>
84
- <div class="cal-hour-indicator-col flex-1 flex flex-row h-full" style="z-index:-10;">
84
+ <div class="hour-indicator-col-horizontal" style="z-index:-10;">
85
85
  <% if calendar.display_bucket_title %>
86
86
  <div class="bucket-title" style="width:<%=calendar.bucket_title_size%>px;"></div>
87
87
  <% end %>
88
88
  <% (0..23).each do |hour| %>
89
- <div class="cal-hour-indicator border-l-2 border-gray-200 border-opacity-50 flex-1" id="hour-<%=hour %>">
89
+ <div class="hour-indicator-horizontal" id="hour-<%=hour %>">
90
90
  <div style="height:20px">
91
91
  <%=hour%>
92
92
  </div>
@@ -96,10 +96,10 @@
96
96
  <% end %>
97
97
  <% events = sorted_events.fetch(day, []) %>
98
98
  <% buckets = calendar.split_into_buckets(events) %>
99
- <div class="absolute" style="top:<%=calendar.grid_width%>;bottom:0">
100
- <div class="buckets flex flex-col bg-white absolute" >
99
+ <div class="buckets-wrapper" style="top:<%=calendar.grid_width%>;bottom:0">
100
+ <div class="buckets" >
101
101
  <% buckets.each do |bucket| %>
102
- <div class="flex-1 flex flex-row">
102
+ <div class="bucket-horizontal">
103
103
  <% if calendar.display_bucket_title %>
104
104
  <div class="bucket-title-size-wrap" style="width:<%=calendar.bucket_title_size%>px;">
105
105
  <div class="bucket-title-text-wrapper">
@@ -109,11 +109,11 @@
109
109
  </div>
110
110
  </div>
111
111
  <% end %>
112
- <div class="bucket relative" style="height:<%=(calendar.horizontal_height_px-(calendar.display_grid ? 20 : 0)) / buckets.size%>px;">
113
- <div class="w-full">
112
+ <div class="events-wrapper" style="height:<%=(calendar.horizontal_height_px-(calendar.display_grid ? 20 : 0)) / buckets.size%>px;">
113
+ <div class="events-inner-horizontal">
114
114
  <% events_size = calendar.slot_events(bucket, day) %>
115
115
  <% bucket.each do |event| %>
116
- <div class="absolute border-2 border-opacity-25 border-red-500 bg-white rounded box-border" style="height:<%=events_size[event][0]%>%;left:<%=events_size[event][3]%>px;top:<%=events_size[event][1]%>%;width:<%=events_size[event][2]%>px">
116
+ <div class="event-wrapper" style="height:<%=events_size[event][0]%>%;left:<%=events_size[event][3]%>px;top:<%=events_size[event][1]%>%;width:<%=events_size[event][2]%>px">
117
117
  <% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
118
118
  <% capture_haml(event, &passed_block) %>
119
119
  <% else %>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SimpleCalendar
4
4
  module Timeslot
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -2,4 +2,5 @@
2
2
 
3
3
  require_relative "timeslot/version"
4
4
  require_relative "timeslot/timeslot_calendar"
5
+ require_relative "timeslot/railtie"
5
6
  require_relative "timeslot/view_helpers"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_calendar-timeslot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Laplume
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-13 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_calendar