css-zero 0.0.36 → 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02bf5fecc4db0a341a8e9787bf93ff11f447b0c36d71d02105fccfb544db431e
4
- data.tar.gz: 6c39de744cd1c74965873dc531e55b8c8229785d698bcbf355de88a6f5f4ff04
3
+ metadata.gz: 8d03cbc1032455ed1426a832bd3f71fcc6091275b6a6a75fa1d2111cf0105f24
4
+ data.tar.gz: e4aae85c8fdcea540a262ae0de03546c367afabb6a3bbb0e769eceff328e3a2b
5
5
  SHA512:
6
- metadata.gz: eb4d6e6c8b0ec2b26e98eb4b3cd504d20024787ab435a65b0b624cbf1acdf044e5afe13be4118091bfb2b321e7f7d0e6afc5ab08b8e12bbcbdce93e9196fae0b
7
- data.tar.gz: d93dfdf03c9752c3c938c81282b48c4fef238b344f7409e35af9a4f5369eca79b8c2feed210c0301639c9b21e367258640a7e97c4142b83adb5e393129ac674c
6
+ metadata.gz: eae8de16d7008f3c47960c19a90840e236b9846505b3e988d20c10c41f21e5319200bb10b1fd0154d9dc61072bddb479efd8369597c9051bd1724ac32b64ecb0
7
+ data.tar.gz: 8fcecce58a61bfa94b08879bd9338357988cb217da22c3398f6832b2a2842fc2d0802c9403502b70f80531dc7100b6d8fd591d0dc10211c4ba2185f994494c6e
@@ -1,3 +1,3 @@
1
1
  module CssZero
2
- VERSION = "0.0.36"
2
+ VERSION = "0.0.37"
3
3
  end
@@ -40,13 +40,13 @@ input:
40
40
  - app/javascript/controllers/check_all_controller.js
41
41
  input_concerns:
42
42
  - app/javascript/controllers/autoselect_controller.js
43
- - app/javascript/controllers/clear_button_controller.js
44
- - app/assets/images/x.svg
45
- - app/javascript/controllers/reveal_button_controller.js
43
+ - app/javascript/controllers/copyable_input_controller.js
44
+ - app/javascript/controllers/clearable_input_controller.js
45
+ - app/javascript/controllers/revealable_input_controller.js
46
+ - app/assets/images/copy.svg
46
47
  - app/assets/images/eye.svg
47
48
  - app/assets/images/eye-off.svg
48
- - app/javascript/controllers/copy_button_controller.js
49
- - app/assets/images/copy.svg
49
+ - app/assets/images/x.svg
50
50
  layouts:
51
51
  - app/assets/stylesheets/layouts.css
52
52
  - app/assets/images/menu.svg
@@ -4,12 +4,20 @@ export default class extends Controller {
4
4
  static targets = [ "content" ]
5
5
 
6
6
  next() {
7
- this.contentTarget.scrollTo({ left: this.#scrollLeft + this.#slideSize, behavior: "smooth" })
7
+ this.contentTarget.scrollTo({ left: this.#nextPosition, behavior: "smooth" })
8
8
  }
9
9
 
10
- previous() {
11
- this.contentTarget.scrollTo({ left: this.#scrollLeft - this.#slideSize, behavior: "smooth" })
12
- }
10
+ prev() {
11
+ this.contentTarget.scrollTo({ left: this.#prevPosition, behavior: "smooth" })
12
+ }
13
+
14
+ get #nextPosition() {
15
+ return this.#scrollLeft + this.#slideSize
16
+ }
17
+
18
+ get #prevPosition() {
19
+ return this.#scrollLeft - this.#slideSize
20
+ }
13
21
 
14
22
  get #scrollLeft() {
15
23
  return this.contentTarget.scrollLeft
@@ -16,4 +16,4 @@ export default class extends Controller {
16
16
  get #imageSrc() {
17
17
  return this.inputTarget.type === "text" ? this.hideImageValue : this.showImageValue
18
18
  }
19
- }
19
+ }
@@ -4,12 +4,24 @@ export default class extends Controller {
4
4
  static targets = [ "button", "tab" ]
5
5
  static values = { index: Number, default: 0 }
6
6
 
7
+ indexValueChanged() {
8
+ this.#showSelectedTab()
9
+ }
10
+
7
11
  select({ target }) {
8
12
  this.indexValue = target.dataset.index
9
13
  }
10
14
 
11
- indexValueChanged() {
12
- this.#showSelectedTab()
15
+ prev() {
16
+ if (this.indexValue > 0) this.indexValue--
17
+ }
18
+
19
+ next() {
20
+ if (this.indexValue < this.#lastIndex) this.indexValue++
21
+ }
22
+
23
+ get #lastIndex() {
24
+ return this.tabTargets.length -1
13
25
  }
14
26
 
15
27
  #showSelectedTab() {
@@ -18,4 +18,4 @@ export default class extends Controller {
18
18
  this.imageTarget.src = this.defaultImageValue
19
19
  this.removeInputTarget.value = true
20
20
  }
21
- }
21
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lázaro Nixon
@@ -79,16 +79,16 @@ files:
79
79
  - lib/generators/css_zero/add/templates/app/javascript/controllers/autoselect_controller.js
80
80
  - lib/generators/css_zero/add/templates/app/javascript/controllers/carousel_controller.js
81
81
  - lib/generators/css_zero/add/templates/app/javascript/controllers/check_all_controller.js
82
- - lib/generators/css_zero/add/templates/app/javascript/controllers/clear_button_controller.js
82
+ - lib/generators/css_zero/add/templates/app/javascript/controllers/clearable_input_controller.js
83
83
  - lib/generators/css_zero/add/templates/app/javascript/controllers/collapsible_controller.js
84
- - lib/generators/css_zero/add/templates/app/javascript/controllers/copy_button_controller.js
84
+ - lib/generators/css_zero/add/templates/app/javascript/controllers/copyable_input_controller.js
85
85
  - lib/generators/css_zero/add/templates/app/javascript/controllers/dialog_controller.js
86
86
  - lib/generators/css_zero/add/templates/app/javascript/controllers/element_removal_controller.js
87
87
  - lib/generators/css_zero/add/templates/app/javascript/controllers/form_controller.js
88
88
  - lib/generators/css_zero/add/templates/app/javascript/controllers/fullscreen_controller.js
89
89
  - lib/generators/css_zero/add/templates/app/javascript/controllers/hotkey_controller.js
90
90
  - lib/generators/css_zero/add/templates/app/javascript/controllers/lightbox_controller.js
91
- - lib/generators/css_zero/add/templates/app/javascript/controllers/reveal_button_controller.js
91
+ - lib/generators/css_zero/add/templates/app/javascript/controllers/revealable_input_controller.js
92
92
  - lib/generators/css_zero/add/templates/app/javascript/controllers/tabs_controller.js
93
93
  - lib/generators/css_zero/add/templates/app/javascript/controllers/upload_preview_controller.js
94
94
  - lib/generators/css_zero/add/templates/app/javascript/controllers/web_share_controller.js