bullet_train-themes-tailwind_css 1.3.1 → 1.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcddcd3ebc08ff9776d4b1d9553dc1cb5f62904bf355ec4b1663f650977e0292
|
4
|
+
data.tar.gz: f5ba1d827b9e78b0688af5edd746b5a4c250fd38ac997a38a0f951bd51da6366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 116a5da2d2c67b31f99ff1efe045b7731784cd6a7a21d175d840f12b94ad1f8f548e920dcda23184b2dcfbe01a3657f05e4f5660b260f1542edb7c0c926eddc7
|
7
|
+
data.tar.gz: 7adf7638c5788afef2d18f54f1630379d42d843497fb0013e27dfbb7883ef387922d475327b29908c26f7b55b55c47b1e9947125f3c904f42ef536de0d354d43
|
@@ -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"
|