css-zero 0.0.48 → 0.0.49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/USAGE +1 -1
- data/lib/generators/css_zero/add/resources.yml +2 -1
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/form_controller.js +4 -0
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/menu_controller.js +16 -2
- data/lib/generators/css_zero/install/install_generator.rb +10 -0
- data/lib/generators/css_zero/install/templates/app/javascript/initializers/index.js +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20f634891b019d8f1daeb601e8c4f095ad0bc4a0e17e4dc8af56a265a8d578d3
|
4
|
+
data.tar.gz: 1be7e6e2f94347c1419523f814f60f11bac915072c171a3d657d50cf576b8ab0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e49c19d5180e28cbfce2db4d3f7c21205de6708d8ef4cd340622846b52a4d089a7a32f829859e41577d68251e9d4f64cbaad629bf0d114ea9ad86087cdbe55d4
|
7
|
+
data.tar.gz: d2855e45ea3959712e2736746fdc1da91e0266da4bff2c0db1629317e5cff53eb4b32392841ef93b3b42e218ed369dc375bdc8249776c30e62a3cb6a8e640f2d
|
data/lib/css_zero/version.rb
CHANGED
@@ -2,7 +2,7 @@ Description:
|
|
2
2
|
This will add components into your project.
|
3
3
|
|
4
4
|
Components:
|
5
|
-
accordion alert avatar badge breadcrumb button card carousel check_all command collapsible dialog dropdown flash fullscreen hotkey input input_concerns layouts lightbox local_time pagination progress prose sheet skeleton switch table tabs upload_preview toggle web_share
|
5
|
+
accordion alert avatar badge breadcrumb button card carousel check_all command collapsible dialog dropdown flash form fullscreen hotkey input input_concerns layouts lightbox local_time pagination progress prose sheet skeleton switch table tabs upload_preview toggle web_share
|
6
6
|
|
7
7
|
Example:
|
8
8
|
bin/rails generate css_zero:add [components...]
|
@@ -40,6 +40,8 @@ dropdown:
|
|
40
40
|
flash:
|
41
41
|
- app/assets/stylesheets/flash.css
|
42
42
|
- app/javascript/controllers/element_removal_controller.js
|
43
|
+
form:
|
44
|
+
- app/javascript/controllers/form_controller.js
|
43
45
|
fullscreen:
|
44
46
|
- app/javascript/controllers/fullscreen_controller.js
|
45
47
|
hotkey:
|
@@ -88,7 +90,6 @@ skeleton:
|
|
88
90
|
- app/assets/stylesheets/skeleton.css
|
89
91
|
switch:
|
90
92
|
- app/assets/stylesheets/switch.css
|
91
|
-
- app/javascript/controllers/form_controller.js
|
92
93
|
table:
|
93
94
|
- app/assets/stylesheets/table.css
|
94
95
|
tabs:
|
@@ -4,6 +4,20 @@ export default class extends Controller {
|
|
4
4
|
static targets = [ "item" ]
|
5
5
|
static values = { index: Number }
|
6
6
|
|
7
|
+
#observer
|
8
|
+
|
9
|
+
initialize() {
|
10
|
+
this.#observer = new IntersectionObserver(this.#resetOnVisible.bind(this))
|
11
|
+
}
|
12
|
+
|
13
|
+
connect() {
|
14
|
+
this.#observer.observe(this.element)
|
15
|
+
}
|
16
|
+
|
17
|
+
disconnect() {
|
18
|
+
this.#observer.disconnect()
|
19
|
+
}
|
20
|
+
|
7
21
|
indexValueChanged(index, previousIndex) {
|
8
22
|
this.#updateTabstops(previousIndex !== undefined)
|
9
23
|
}
|
@@ -16,8 +30,8 @@ export default class extends Controller {
|
|
16
30
|
this.indexValue < this.itemTargets.length -1 && this.indexValue++
|
17
31
|
}
|
18
32
|
|
19
|
-
|
20
|
-
this.indexValue = 0
|
33
|
+
#resetOnVisible([ entry ]) {
|
34
|
+
if (entry.isIntersecting) this.indexValue = 0
|
21
35
|
}
|
22
36
|
|
23
37
|
#updateTabstops(shouldFocus) {
|
@@ -16,6 +16,16 @@ class CssZero::InstallGenerator < Rails::Generators::Base
|
|
16
16
|
append_to_file "config/importmap.rb", %(pin_all_from "app/javascript/helpers", under: "helpers"\n)
|
17
17
|
end
|
18
18
|
|
19
|
+
def copy_javascript_initializers
|
20
|
+
copy_file "app/javascript/initializers/index.js"
|
21
|
+
end
|
22
|
+
|
23
|
+
def pin_javascript_initializers
|
24
|
+
return unless install_with_importmap?
|
25
|
+
append_to_file "config/importmap.rb", %(pin_all_from "app/javascript/initializers", under: "initializers"\n)
|
26
|
+
append_to_file "app/javascript/application.js", %(import "initializers"\n)
|
27
|
+
end
|
28
|
+
|
19
29
|
private
|
20
30
|
def install_with_importmap?
|
21
31
|
Rails.root.join("config/importmap.rb").exist?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css-zero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lázaro Nixon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/generators/css_zero/install/templates/app/assets/stylesheets/base.css
|
106
106
|
- lib/generators/css_zero/install/templates/app/javascript/helpers/cookie_helpers.js
|
107
107
|
- lib/generators/css_zero/install/templates/app/javascript/helpers/timing_helpers.js
|
108
|
+
- lib/generators/css_zero/install/templates/app/javascript/initializers/index.js
|
108
109
|
homepage: https://github.com/lazaronixon/css-zero
|
109
110
|
licenses:
|
110
111
|
- MIT
|