tam_select 1.2.4 → 1.2.5
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/README.md +4 -1
- data/lib/generators/tam_select/install_generator.rb +22 -1
- data/lib/tam_select/version.rb +1 -1
- data/package.json +1 -1
- data/src/tam-select.js +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: '0578f460df897c76c9c1ac0226ddfebe2c212e1d03165ec6e8274c7a49428fd9'
|
|
4
|
+
data.tar.gz: 43a099f40cded849cb692ae5977e40c2d16aaf2314282a0660b2f6ec2e1cda83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff3af882118f723d898b3b1376ce67fb360b4803122d227c9b797ca4b50f2fcf06357d7ca80567bd8c2baecbe2a453171a985fec6f594d293726fdf07d78bbc2
|
|
7
|
+
data.tar.gz: 44c3b6533294118d614d9e345dc3ae87bf4648f719092ad8f9a08ad24c3d743657b55e6ab9211c9a062262f7a148f01c7c52730db7a7b919ae254cfa4c151a33
|
data/README.md
CHANGED
|
@@ -56,7 +56,7 @@ The generated Stimulus controller imports `TamSelect` from `"tam_select"`. Runni
|
|
|
56
56
|
|
|
57
57
|
### jsbundling-rails and esbuild
|
|
58
58
|
|
|
59
|
-
The same generated controller works with esbuild when the bare `tam_select` import is aliased to the generated core file.
|
|
59
|
+
The same generated controller works with esbuild when the bare `tam_select` import is aliased to the generated core file. When Importmap is absent, the installer detects an existing esbuild `build` script in `package.json` and appends the alias automatically:
|
|
60
60
|
|
|
61
61
|
```json
|
|
62
62
|
{
|
|
@@ -66,6 +66,8 @@ The same generated controller works with esbuild when the bare `tam_select` impo
|
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
The update is idempotent, so rerunning the installer does not duplicate the alias. If `package.json` or an esbuild build script is not present, the installer prints the exact alias flag to add manually.
|
|
70
|
+
|
|
69
71
|
This uses the local file installed by the generator. For non-Rails bundler use, install the npm package from GitHub and import its published package name instead:
|
|
70
72
|
|
|
71
73
|
```bash
|
|
@@ -109,6 +111,7 @@ Versions before this release generated a relative controller import. After upgra
|
|
|
109
111
|
- Remote JSON search with debouncing and incremental pagination
|
|
110
112
|
- Loading, empty, and error states
|
|
111
113
|
- Select2-style closed selection and open search states with clear active, selected, disabled, loading, empty, and error feedback
|
|
114
|
+
- Right-aligned select chevron that remains pinned to the control edge for short and default labels
|
|
112
115
|
- Keyboard navigation: arrows, Enter, Escape, Tab, and Backspace
|
|
113
116
|
- Combobox/listbox ARIA semantics
|
|
114
117
|
- Light and dark Tailwind themes
|
|
@@ -15,7 +15,7 @@ module TamSelect
|
|
|
15
15
|
def configure_importmap
|
|
16
16
|
importmap = "config/importmap.rb"
|
|
17
17
|
unless File.exist?(destination_path(importmap))
|
|
18
|
-
|
|
18
|
+
configure_esbuild
|
|
19
19
|
return
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -60,6 +60,27 @@ module TamSelect
|
|
|
60
60
|
|
|
61
61
|
private
|
|
62
62
|
|
|
63
|
+
def configure_esbuild
|
|
64
|
+
package_json = "package.json"
|
|
65
|
+
unless File.exist?(destination_path(package_json))
|
|
66
|
+
say "Importmap and package.json were not detected; configure the tam_select JavaScript import manually.", :yellow
|
|
67
|
+
return
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
contents = File.read(destination_path(package_json))
|
|
71
|
+
alias_flag = "--alias:tam_select=./app/javascript/tam_select/tam_select.js"
|
|
72
|
+
return if contents.include?(alias_flag)
|
|
73
|
+
|
|
74
|
+
build_script = /(\"build\"\s*:\s*\")([^\"]*\besbuild\b[^\"]*)(\")/
|
|
75
|
+
if contents.match?(build_script)
|
|
76
|
+
gsub_file package_json, build_script do |match|
|
|
77
|
+
%(#{match.delete_suffix('"')} #{alias_flag}")
|
|
78
|
+
end
|
|
79
|
+
else
|
|
80
|
+
say "An esbuild script was not detected; add #{alias_flag} to the JavaScript build command.", :yellow
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
63
84
|
def destination_path(relative_path)
|
|
64
85
|
File.join(destination_root, relative_path)
|
|
65
86
|
end
|
data/lib/tam_select/version.rb
CHANGED
data/package.json
CHANGED
data/src/tam-select.js
CHANGED
|
@@ -12,7 +12,7 @@ const DEFAULT_CLASSES = {
|
|
|
12
12
|
tag: "relative z-10 inline-flex max-w-full items-center gap-1 rounded-lg bg-blue-50 px-2 py-1 text-xs font-medium text-blue-700 ring-1 ring-inset ring-blue-200 transition-colors dark:bg-blue-950/50 dark:text-blue-300 dark:ring-blue-800",
|
|
13
13
|
tagRemove: "rounded p-0.5 hover:bg-blue-100 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:hover:bg-blue-900",
|
|
14
14
|
clear: "relative z-20 ml-auto rounded p-1 text-zinc-400 transition-colors hover:bg-zinc-100 hover:text-zinc-700 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200 dark:focus:ring-blue-400",
|
|
15
|
-
chevron: "pointer-events-none relative z-10 ml-
|
|
15
|
+
chevron: "pointer-events-none relative z-10 ml-auto size-4 shrink-0 text-zinc-400 transition-transform",
|
|
16
16
|
chevronOpen: "rotate-180",
|
|
17
17
|
dropdown: "absolute z-50 mt-1.5 max-h-72 w-full origin-top overflow-auto rounded-xl border border-zinc-200 bg-white p-1.5 shadow-2xl ring-1 ring-black/5 dark:border-zinc-700 dark:bg-zinc-900 dark:shadow-black/50 dark:ring-white/10",
|
|
18
18
|
option: "flex min-h-11 cursor-pointer items-center justify-between gap-3 rounded-lg px-3 py-2 text-sm text-zinc-700 outline-none transition-colors duration-100 dark:text-zinc-200",
|