tramway 3.1.1 → 3.1.1.1
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 +4 -4
- data/app/components/tramway/button_component.rb +1 -1
- data/app/components/tramway/form/tramway_select/selected_item_template_component.rb +1 -1
- data/app/components/tramway/form/tramway_select_component.html.haml +4 -4
- data/app/components/tramway/form/tramway_select_component.rb +7 -2
- data/config/tailwind.config.js +5 -0
- data/lib/tramway/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40cb18c2889eabe0449961489e2ffa0ab002666bf8ba3cc8b151f73c5604ef68
|
|
4
|
+
data.tar.gz: ea1cbe9afbb6ffc7960191b01f86b3a20f99d080261e59f79adce76388f1500a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75a4baa73c4e7e2f3e7d36940c603ddb8cd7717686bd03449da8879dc8fe8dad44c657f82654c76d0274572f26c5240b1a4031abcad67ab88f88f6976140c08a
|
|
7
|
+
data.tar.gz: dd6ff607ce46fc129aeebe52ea514ccdd3b18d288089695e55a409bea060d49dba8934debe63238cb964bc1860cdd162cb13df993224a18058534cd3561e1b18
|
|
@@ -15,7 +15,7 @@ module Tramway
|
|
|
15
15
|
}.freeze
|
|
16
16
|
|
|
17
17
|
def selected_item_classes
|
|
18
|
-
classes = 'flex justify-center items-center font-medium py-1 px-2 rounded-md ' \
|
|
18
|
+
classes = 'flex flex-none justify-center items-center font-medium py-1 px-2 rounded-md ' \
|
|
19
19
|
'bg-zinc-900 text-zinc-50 shadow-sm hover:bg-zinc-800 cursor-pointer ' \
|
|
20
20
|
'space-x-1 selected-option ' + SIZE_CLASSES[size].to_s
|
|
21
21
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
= component('tramway/form/label', for: @for, class: 'mb-0') do
|
|
4
4
|
= @label
|
|
5
5
|
%div{ role: :combobox, data: tramway_select_hash, id: "#{@for}_tramway_select", class: tramway_select_classes }
|
|
6
|
-
-
|
|
7
|
-
.flex.flex-end.justify-between{ data: dropdown_data, **dropdown_options }
|
|
8
|
-
|
|
9
|
-
.flex.flex-col.justify-center
|
|
6
|
+
- selected_items_classes = ['flex flex-row w-full', multiple ? 'flex-wrap gap-1 min-w-0' : 'flex-nowrap overflow-x-auto space-x-1'].join(' ')
|
|
7
|
+
.flex.flex-end.justify-between.gap-1{ data: dropdown_data, **dropdown_options }
|
|
8
|
+
%div{ class: selected_items_classes, data: { "tramway-select-target" => "showSelectedArea" } }
|
|
9
|
+
.flex.flex-col.justify-center.shrink-0
|
|
10
10
|
.caret-down{ data: { "tramway-select-target" => "caretDown" } }
|
|
11
11
|
= component 'tramway/form/tramway_select/caret', size:, direction: :down
|
|
12
12
|
.caret-up.hidden{ data: { "tramway-select-target" => "caretUp" } }
|
|
@@ -73,11 +73,16 @@ module Tramway
|
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def input_classes
|
|
76
|
-
"#{
|
|
76
|
+
"#{tramway_select_size_class} #{select_base_classes}"
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
private
|
|
80
80
|
|
|
81
|
+
def tramway_select_size_class
|
|
82
|
+
classes = size_class(:tramway_select_input)
|
|
83
|
+
multiple ? classes.gsub(/\bh-/, 'min-h-') : classes
|
|
84
|
+
end
|
|
85
|
+
|
|
81
86
|
def action
|
|
82
87
|
'click->tramway-select#toggleDropdown'
|
|
83
88
|
end
|
|
@@ -100,7 +105,7 @@ module Tramway
|
|
|
100
105
|
options:,
|
|
101
106
|
attribute:,
|
|
102
107
|
input:,
|
|
103
|
-
size_class:
|
|
108
|
+
size_class: tramway_select_size_class
|
|
104
109
|
)
|
|
105
110
|
end
|
|
106
111
|
|
data/config/tailwind.config.js
CHANGED
|
@@ -318,6 +318,7 @@ module.exports = {
|
|
|
318
318
|
'flex-wrap',
|
|
319
319
|
'flex-row-reverse',
|
|
320
320
|
'flex-auto',
|
|
321
|
+
'flex-none',
|
|
321
322
|
'flex-initial',
|
|
322
323
|
'justify-between',
|
|
323
324
|
'justify-end',
|
|
@@ -333,6 +334,10 @@ module.exports = {
|
|
|
333
334
|
'w-fit',
|
|
334
335
|
'w-8',
|
|
335
336
|
'min-w-96',
|
|
337
|
+
'min-w-0',
|
|
338
|
+
'min-h-10',
|
|
339
|
+
'min-h-12',
|
|
340
|
+
'min-h-15',
|
|
336
341
|
'max-w-full',
|
|
337
342
|
|
|
338
343
|
// === Spacing utilities ===
|
data/lib/tramway/version.rb
CHANGED