bullet_train-themes-tailwind_css 1.3.1 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1909b211c334dd08644ca1ba4427505731692911035582dc79ecc4b68b79456b
|
4
|
+
data.tar.gz: 1ba02d43f0beb68d3e1317165e6135bb9eb74732060a2b28115286d7b4e33f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cd3e54f4e15040cdc5ed538a1aed8769dead43dbdf99dcc7fe81321b467b34174b9d8e721e4672e167581316db26868717ac99b49a51c019db195aab8684d61
|
7
|
+
data.tar.gz: 5a8ce22c70fd50c7fb66fcc9fafa45e6f176cc7aa5aa47f8839d5597eb22da01ed2fae4360c6409c59ddb79b4fa8b547896fa7a4eff33350df702117e72a585c
|
@@ -1,43 +1,73 @@
|
|
1
1
|
<%
|
2
|
+
stimulus_controller = 'fields--date'
|
3
|
+
|
2
4
|
form ||= current_fields_form
|
3
5
|
options ||= {}
|
4
|
-
|
6
|
+
user_tz = ActiveSupport::TimeZone.find_tzinfo(current_user.time_zone).name
|
7
|
+
team_tz = ActiveSupport::TimeZone.find_tzinfo(current_user.current_team.time_zone).name
|
8
|
+
|
9
|
+
# data options
|
10
|
+
data_options ||= {}
|
11
|
+
data_options[:id] ||= form.field_id(method)
|
12
|
+
data_options[:class] = "hidden"
|
13
|
+
data_options[:value] = form.object.send(method)&.in_time_zone(current_time_zone)&.iso8601
|
14
|
+
data_options = data_options.merge({ data: {"#{stimulus_controller}-target": 'field' }})
|
15
|
+
|
16
|
+
# localized display options
|
17
|
+
options[:id] ||= "#{form.field_id(method)}_display"
|
5
18
|
options[:class] = "form-control single-daterange w-full border-slate-300 dark:bg-slate-800 dark:border-slate-900 #{options[:class]}".strip
|
6
|
-
|
7
|
-
options =
|
19
|
+
raw_value = form.object.send(method)&.in_time_zone(current_user.time_zone || current_team.time_zone || "UTC")
|
20
|
+
options[:value] = raw_value && I18n.l(raw_value, format: :date_and_time_field)
|
21
|
+
options = options.merge({ data: {"#{stimulus_controller}-target": 'displayField' }})
|
22
|
+
|
8
23
|
other_options ||= {}
|
9
24
|
%>
|
10
25
|
|
11
26
|
<%= render 'shared/fields/field', form: form, method: method, options: options, other_options: other_options do %>
|
12
27
|
<% content_for :field do %>
|
13
|
-
<div
|
28
|
+
<div
|
29
|
+
class="date-input relative"
|
30
|
+
data-controller="<%=stimulus_controller%>"
|
31
|
+
data-<%= stimulus_controller %>-include-time-value="true"
|
32
|
+
data-<%= stimulus_controller %>-date-format-value="<%= I18n.t('date.formats.date_controller') %>"
|
33
|
+
data-<%= stimulus_controller %>-time-format-value="<%= I18n.t('time.formats.date_controller') %>"
|
34
|
+
data-<%= stimulus_controller %>-is-am-pm-value="<%= am_pm? %>"
|
35
|
+
data-<%= stimulus_controller %>-picker-locale-value="<%= I18n.t("daterangepicker").deep_transform_keys { |k| k.to_s.camelize(:lower) }.to_json %>"
|
36
|
+
data-<%= stimulus_controller %>-default-time-zones-value="<%= "[\"#{current_user.time_zone}\",\"#{current_user.current_team.time_zone}\"]" %>"
|
37
|
+
data-<%= stimulus_controller %>-current-time-zone-value="<%= current_time_zone %>"
|
38
|
+
>
|
14
39
|
<%= form.text_field method, options %>
|
40
|
+
<%= form.text_field method, data_options %>
|
15
41
|
<% unless options[:disabled] %>
|
16
42
|
<button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md top-1 md:top-0.5 right-0.5"
|
17
|
-
data
|
18
|
-
data-action="
|
43
|
+
data-<%= stimulus_controller %>-target="clearButton"
|
44
|
+
data-action="<%=stimulus_controller%>#clearDate"
|
19
45
|
>
|
20
46
|
<i class="leading-4 text-lg ti ti-trash dark:text-blue-500"></i>
|
21
47
|
</button>
|
22
48
|
<% end %>
|
23
49
|
<% if current_user.time_zone != current_user.current_team.time_zone %>
|
24
50
|
<div class="mt-1.5 text-xs text-slate-500">
|
25
|
-
|
26
|
-
<div data
|
27
|
-
<%= link_to current_user.current_team.time_zone, '#', class: 'button-secondary p-0', data: {action:
|
51
|
+
<input class="hidden" data-<%=stimulus_controller%>-target="timeZoneField" value="<%= current_time_zone %>"></span>
|
52
|
+
<div data-<%= stimulus_controller %>-target="currentTimeZoneWrapper">
|
53
|
+
<%= link_to (current_user.time_zone || current_user.current_team.time_zone || "UTC"), '#', class: 'button-secondary p-0', data: {action: "#{stimulus_controller}#showTimeZoneButtons"} %>
|
28
54
|
</div>
|
29
|
-
<div class="space-x-1 hidden" data
|
30
|
-
<%= link_to '', '#', hidden: true, class: 'time-zone-button button-alternative button-smaller selected-option-time-zone-button hidden', data: {action:
|
31
|
-
<%= link_to current_user.current_team.time_zone, '#', class: 'time-zone-button button button-smaller', data: {action:
|
32
|
-
<%= link_to current_user.time_zone, '#', class: 'time-zone-button button
|
33
|
-
<%= link_to t('global.buttons.other'), '#', class: 'button-alternative button-smaller', data: {action:
|
34
|
-
<%= link_to t('global.buttons.cancel'), '#', class: 'button-secondary button-smaller', data: {action:
|
55
|
+
<div class="space-x-1 hidden" data-<%= stimulus_controller %>-target="timeZoneButtons">
|
56
|
+
<%= link_to '', '#', hidden: true, class: 'time-zone-button button-alternative button-smaller selected-option-time-zone-button hidden', data: {action: "#{stimulus_controller}#setTimeZone", value: ''} %>
|
57
|
+
<%= link_to current_user.current_team.time_zone, '#', class: 'time-zone-button button-alternative button-smaller', data: {action: "#{stimulus_controller}#setTimeZone", value: team_tz, label: current_user.current_team.time_zone } %>
|
58
|
+
<%= link_to current_user.time_zone, '#', class: 'time-zone-button button button-smaller', data: {action: "#{stimulus_controller}#setTimeZone", value: user_tz, label: current_user.time_zone } %>
|
59
|
+
<%= link_to t('global.buttons.other'), '#', class: 'button-alternative button-smaller', data: {action: "#{stimulus_controller}#showTimeZoneSelectWrapper"} %>
|
60
|
+
<%= link_to t('global.buttons.cancel'), '#', class: 'button-secondary button-smaller', data: {action: "#{stimulus_controller}#resetTimeZoneUI"} %>
|
35
61
|
</div>
|
36
|
-
<div class="hidden flex flex-row items-center mt-3 text-sm" data
|
62
|
+
<div class="hidden flex flex-row items-center mt-3 text-sm" data-<%= stimulus_controller %>-target="timeZoneSelectWrapper">
|
37
63
|
<div class="flex-grow">
|
38
|
-
<%= select_tag :time_zone,
|
64
|
+
<%= select_tag :time_zone,
|
65
|
+
options_for_select(ActiveSupport::TimeZone.all.map{|tz| [tz.name.to_s, tz.tzinfo.name.to_s]}, [ user_tz || team_tz ]),
|
66
|
+
class: 'form-control select2',
|
67
|
+
data: { "#{stimulus_controller}-target": "timeZoneSelect", action: "#{stimulus_controller}#selectTimeZoneChange"}
|
68
|
+
%>
|
39
69
|
</div>
|
40
|
-
<%= link_to t('global.buttons.cancel'), '#', class: 'button-secondary ml-1.5', data: {action:
|
70
|
+
<%= link_to t('global.buttons.cancel'), '#', class: 'button-secondary ml-1.5', data: {action: "#{stimulus_controller}#cancelSelect"} %>
|
41
71
|
</div>
|
42
72
|
</div>
|
43
73
|
<% end %>
|
@@ -3,18 +3,36 @@ stimulus_controller = 'fields--date'
|
|
3
3
|
|
4
4
|
form ||= current_fields_form
|
5
5
|
options ||= {}
|
6
|
-
|
6
|
+
|
7
|
+
# data options
|
8
|
+
data_options ||= {}
|
9
|
+
data_options[:id] ||= form.field_id(method)
|
10
|
+
data_options[:class] = "hidden"
|
11
|
+
data_options[:value] = form.object.send(method)&.strftime("%Y-%m-%d")
|
12
|
+
data_options = data_options.merge({ data: {"#{stimulus_controller}-target": 'field' }})
|
13
|
+
|
14
|
+
# localized display options
|
15
|
+
options[:id] ||= "#{form.field_id(method)}_display"
|
7
16
|
options[:class] = "form-control single-daterange w-full border-slate-300 dark:bg-slate-800 dark:border-slate-900 #{options[:class]}".strip
|
8
|
-
options[:value] = form.object.send(method)
|
9
|
-
options = options.merge({ data: {"#{stimulus_controller}-target": '
|
17
|
+
options[:value] = form.object.send(method) && I18n.l(form.object.send(method), format: :date_field)
|
18
|
+
options = options.merge({ data: {"#{stimulus_controller}-target": 'displayField' }})
|
19
|
+
|
10
20
|
other_options ||= {}
|
11
21
|
|
12
22
|
%>
|
13
|
-
|
14
23
|
<%= render 'shared/fields/field', form: form, method: method, options: options, other_options: other_options do %>
|
15
24
|
<% content_for :field do %>
|
16
|
-
<div
|
25
|
+
<div
|
26
|
+
class="date-input relative"
|
27
|
+
data-controller="<%= stimulus_controller %>"
|
28
|
+
data-<%= stimulus_controller %>-date-format-value="<%= I18n.t('date.formats.date_controller') %>"
|
29
|
+
data-<%= stimulus_controller %>-time-format-value="<%= I18n.t('time.formats.date_controller') %>"
|
30
|
+
data-<%= stimulus_controller %>-is-am-pm-value="<%= am_pm? %>"
|
31
|
+
data-<%= stimulus_controller %>-picker-locale-value="<%= I18n.t("daterangepicker").deep_transform_keys { |k| k.to_s.camelize(:lower) }.to_json %>"
|
32
|
+
data-<%= stimulus_controller %>-current-time-zone-value="<%= current_time_zone %>"
|
33
|
+
>
|
17
34
|
<%= form.text_field method, options %>
|
35
|
+
<%= form.text_field method, data_options %>
|
18
36
|
<% unless options[:disabled] %>
|
19
37
|
<button type="button" class="clear py-2 px-3 border border-transparent inline-flex items-center whitespace-nowrap absolute rounded-md top-1 md:top-0.5 right-0.5"
|
20
38
|
data-<%= stimulus_controller %>-target="clearButton"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-themes-tailwind_css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|