css-zero 0.0.62 → 0.0.63
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/engine.rb +0 -4
- data/lib/css_zero/version.rb +1 -1
- data/lib/generators/css_zero/add/resources.yml +1 -0
- data/lib/generators/css_zero/add/templates/app/javascript/controllers/otp_input_controller.js +31 -0
- data/lib/generators/css_zero/install/templates/app/assets/stylesheets/application.css +0 -1
- 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: 1dcad18cf8b767d6b04eeffa882dc11a58855ccfee8bc4bbfc5b0f53dee40ba5
|
4
|
+
data.tar.gz: f508def8ee8def3ed3046af44ee40ed506b528d9d200c780a3d4f5581197e192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa4e8e29b184bcd7d9c131d0c8990abf0c95e72650e95638d97668682607162549dbad1232acf774470c5ee8908992f486004d1fd012ca19f344f813d834992
|
7
|
+
data.tar.gz: 0f905749c2d50d27191ae171f6337859fa1217f4f1d8b2660cf7372b4c8228f4baa15b18a53d84a2a13455e078db2b047e8c35c4730faece0465d4aedf14820b
|
data/lib/css_zero/engine.rb
CHANGED
data/lib/css_zero/version.rb
CHANGED
@@ -73,6 +73,7 @@ input_concerns:
|
|
73
73
|
- app/javascript/controllers/revealable_input_controller.js
|
74
74
|
- app/assets/images/eye.svg
|
75
75
|
- app/assets/images/eye-off.svg
|
76
|
+
- app/javascript/controllers/otp_input_controller.js
|
76
77
|
inputmask:
|
77
78
|
- app/javascript/controllers/inputmask_controller.js
|
78
79
|
layouts:
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus";
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
initialize() {
|
5
|
+
this.abortController = new AbortController()
|
6
|
+
}
|
7
|
+
|
8
|
+
disconnect() {
|
9
|
+
this.abortController.abort()
|
10
|
+
}
|
11
|
+
|
12
|
+
connect() {
|
13
|
+
this.#supportsOTP && this.#requestOTP()
|
14
|
+
}
|
15
|
+
|
16
|
+
#requestOTP() {
|
17
|
+
navigator.credentials.get(this.#options).then(otp => {
|
18
|
+
this.element.value = otp.code
|
19
|
+
}).catch(error => {
|
20
|
+
console.log(error)
|
21
|
+
})
|
22
|
+
}
|
23
|
+
|
24
|
+
get #options() {
|
25
|
+
return { otp: { transport: ["sms"] }, signal: this.abortController.signal }
|
26
|
+
}
|
27
|
+
|
28
|
+
get #supportsOTP() {
|
29
|
+
return "OTPCredential" in window
|
30
|
+
}
|
31
|
+
}
|
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.63
|
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-11-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lazaronixon@hotmail.com
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/local_time_controller.js
|
109
109
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/menu_controller.js
|
110
110
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/navigation_controller.js
|
111
|
+
- lib/generators/css_zero/add/templates/app/javascript/controllers/otp_input_controller.js
|
111
112
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/popover_controller.js
|
112
113
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/revealable_input_controller.js
|
113
114
|
- lib/generators/css_zero/add/templates/app/javascript/controllers/sortable_controller.js
|