polaris_view_components 2.2.0 → 2.2.3

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: 2d31c4bdf79eb1b9306c46f8506c57a26fdaffb6af1ddf0d5ae48f560faffeb9
4
- data.tar.gz: fa9fe8d5d9450fcb128970910a3b5ec1828d5cafda8a80bc745e41122a81ca60
3
+ metadata.gz: bfcd865ea7f96c18d71b124a475636fb29687710604cb19f13a33c79b3f1a0b5
4
+ data.tar.gz: 6fcc6cec21ba32a429c27a3329e08ec606b5022b2b7f87880277b8ad18880260
5
5
  SHA512:
6
- metadata.gz: 825ec26adbde83a5f56f3288bb5c2c4294c741a28965f90d25fa28b2acfdb29cae9b1efdb9692f29bf1599d35dc39ed55653cab78eabbb2fdb12a8acdb082603
7
- data.tar.gz: 3447d874bdc8b3905f63b5bdcdb1a1d063d706451e71a5ce063b7d33694a0b1be5576416f25e1d74919760e302bd283571c52ac78a52173f85f091e16126a067
6
+ metadata.gz: 9d50945aec4b984c2706e1725b1b59908e6829872d736fbc0712434dbceff186cf8ea6a9855921f3af45f49e8c286178c53b54e83f5288cb928d01835b584f21
7
+ data.tar.gz: b88e835ccc820407627a67a31ad0a78dd79d3e467549865d054ac7431f03e3ccdef5119de05f2ee3b67b451a6371d17d90d266853a525cc7027b14c1ee7d6907
@@ -1,28 +1,30 @@
1
1
  import { Controller } from "@hotwired/stimulus"
2
2
 
3
3
  export default class extends Controller {
4
+ static values = { disabled: Boolean }
5
+
4
6
  disable(event) {
5
- if (this.button.disabled) {
6
- event.preventDefault()
7
+ if (this.disabledValue) {
8
+ if (event) event.preventDefault()
7
9
  } else {
8
- this.button.disabled = true
10
+ this.disabledValue = true
9
11
  this.button.classList.add("Polaris-Button--disabled", "Polaris-Button--loading")
10
12
  this.buttonContent.insertAdjacentHTML("afterbegin", this.spinnerHTML)
11
13
  }
12
14
  }
13
15
 
14
16
  disableWithoutLoader(event) {
15
- if (this.button.disabled) {
16
- event.preventDefault()
17
+ if (this.disabledValue) {
18
+ if (event) event.preventDefault()
17
19
  } else {
18
- this.button.disabled = true
20
+ this.disabledValue = true
19
21
  this.button.classList.add("Polaris-Button--disabled")
20
22
  }
21
23
  }
22
24
 
23
25
  enable() {
24
- if (this.button.disabled) {
25
- this.button.disabled = false
26
+ if (this.disabledValue) {
27
+ this.disabledValue = false
26
28
  this.button.classList.remove("Polaris-Button--disabled", "Polaris-Button--loading")
27
29
  if (this.spinner) this.spinner.remove()
28
30
  }
@@ -298,26 +298,29 @@ class Autocomplete extends Controller {
298
298
  }
299
299
 
300
300
  class Button extends Controller {
301
+ static values={
302
+ disabled: Boolean
303
+ };
301
304
  disable(event) {
302
- if (this.button.disabled) {
303
- event.preventDefault();
305
+ if (this.disabledValue) {
306
+ if (event) event.preventDefault();
304
307
  } else {
305
- this.button.disabled = true;
308
+ this.disabledValue = true;
306
309
  this.button.classList.add("Polaris-Button--disabled", "Polaris-Button--loading");
307
310
  this.buttonContent.insertAdjacentHTML("afterbegin", this.spinnerHTML);
308
311
  }
309
312
  }
310
313
  disableWithoutLoader(event) {
311
- if (this.button.disabled) {
312
- event.preventDefault();
314
+ if (this.disabledValue) {
315
+ if (event) event.preventDefault();
313
316
  } else {
314
- this.button.disabled = true;
317
+ this.disabledValue = true;
315
318
  this.button.classList.add("Polaris-Button--disabled");
316
319
  }
317
320
  }
318
321
  enable() {
319
- if (this.button.disabled) {
320
- this.button.disabled = false;
322
+ if (this.disabledValue) {
323
+ this.disabledValue = false;
321
324
  this.button.classList.remove("Polaris-Button--disabled", "Polaris-Button--loading");
322
325
  if (this.spinner) this.spinner.remove();
323
326
  }
@@ -54,7 +54,6 @@ html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button {
54
54
  }
55
55
 
56
56
  /* Destructive */
57
- &.Polaris-Button--destructive,
58
57
  &.Polaris-Button--destructive:is(.Polaris-Button--primary) {
59
58
  --pc-button-color: var(--p-color-bg-fill-critical);
60
59
  --pc-button-text: var(--p-color-bg-surface);
@@ -68,6 +67,19 @@ html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button {
68
67
  }
69
68
  }
70
69
 
70
+ &.Polaris-Button--destructive:not(.Polaris-Button--primary) {
71
+ --pc-button-text: var(--p-color-text-critical);
72
+ --pc-button-icon-fill: currentColor;
73
+
74
+ &:active {
75
+ --pc-button-text: var(--p-color-text-critical-active);
76
+ }
77
+
78
+ &:hover {
79
+ --pc-button-text: var(--p-color-text-critical-hover);
80
+ }
81
+ }
82
+
71
83
  /* Primary */
72
84
  &.Polaris-Button--primary {
73
85
  --pc-button-bg-gradient: var(--p-color-button-gradient-bg-fill);
@@ -309,16 +309,22 @@
309
309
  background: var(--p-color-bg-fill-tertiary);
310
310
  }/* Loading */html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--loading svg {
311
311
  fill: var(--p-color-icon-disabled);
312
- }/* Destructive */html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive,
313
- html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:is(.Polaris-Button--primary) {
312
+ }/* Destructive */html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:is(.Polaris-Button--primary) {
314
313
  --pc-button-color: var(--p-color-bg-fill-critical);
315
314
  --pc-button-text: var(--p-color-bg-surface);
316
315
  --pc-button-color-hover: var(--p-color-bg-fill-critical-hover);
317
316
  --pc-button-color-active: var(--p-color-bg-fill-critical-active);
318
317
  --pc-button-color-depressed: var(--p-color-bg-fill-critical-selected);
319
318
  box-shadow: var(--p-shadow-button-primary-critical);
320
- }html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:active, html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:is(.Polaris-Button--primary):active {
319
+ }html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:is(.Polaris-Button--primary):active {
321
320
  background: var(--pc-button-color-active);
321
+ }html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:not(.Polaris-Button--primary) {
322
+ --pc-button-text: var(--p-color-text-critical);
323
+ --pc-button-icon-fill: currentColor;
324
+ }html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:not(.Polaris-Button--primary):active {
325
+ --pc-button-text: var(--p-color-text-critical-active);
326
+ }html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--destructive:not(.Polaris-Button--primary):hover {
327
+ --pc-button-text: var(--p-color-text-critical-hover);
322
328
  }/* Primary */html[class~="Polaris-Summer-Editions-2023"] .Polaris-Button.Polaris-Button--primary {
323
329
  --pc-button-bg-gradient: var(--p-color-button-gradient-bg-fill);
324
330
  --pc-button-color: var(--pc-button-bg-gradient), var(--p-color-bg-fill-brand);
@@ -4,6 +4,8 @@
4
4
  <%= text_field %>
5
5
  <% if @form.present? && @attribute.present? %>
6
6
  <%= @form.hidden_field @attribute, data: {polaris_autocomplete_target: "hiddenInput"} %>
7
+ <% elsif !@multiple %>
8
+ <%= hidden_field_tag @name, @selected, data: {polaris_autocomplete_target: "hiddenInput"} %>
7
9
  <% else %>
8
10
  <%= hidden_field_tag @name, nil, data: {polaris_autocomplete_target: "hiddenInput"} %>
9
11
  <% end %>
@@ -4,7 +4,7 @@ module Polaris
4
4
  form: nil,
5
5
  attribute: nil,
6
6
  name: nil,
7
- checked: false,
7
+ checked: nil,
8
8
  disabled: false,
9
9
  value: nil,
10
10
  **system_arguments
@@ -22,8 +22,17 @@ module Polaris
22
22
  @system_arguments.tap do |opts|
23
23
  opts[:disabled] = true if @disabled
24
24
  opts[:aria] ||= {}
25
- opts[:aria][:checked] = @checked
26
25
  opts[:class] = opts.delete(:classes)
26
+
27
+ if @form.present? && @attribute.present?
28
+ unless @checked.nil?
29
+ opts[:aria][:checked] = !!@checked
30
+ opts[:checked] = !!@checked
31
+ end
32
+ else
33
+ opts[:aria][:checked] = !!@checked
34
+ opts[:checked] = !!@checked
35
+ end
27
36
  end
28
37
  end
29
38
 
@@ -8,7 +8,7 @@ module Polaris
8
8
  name: nil,
9
9
  label: nil,
10
10
  label_hidden: false,
11
- checked: false,
11
+ checked: nil,
12
12
  disabled: false,
13
13
  help_text: nil,
14
14
  value: nil,
data/config/deploy.yml CHANGED
@@ -1,37 +1,19 @@
1
+ <% require "dotenv"; Dotenv.load(".env") %>
2
+
1
3
  service: polaris_view_components
2
4
  image: kirillplatonov/polaris_view_components
3
-
5
+ servers:
6
+ - 195.201.128.126
7
+ proxy:
8
+ app_port: 3000
9
+ ssl: true
10
+ host: polarisviewcomponents.org
4
11
  registry:
5
12
  username: kirillplatonov
6
13
  password:
7
14
  - KAMAL_REGISTRY_PASSWORD
8
-
15
+ builder:
16
+ arch: amd64
9
17
  env:
10
18
  secret:
11
19
  - RAILS_MASTER_KEY
12
-
13
- servers:
14
- web:
15
- hosts:
16
- - 195.201.128.126
17
- labels:
18
- traefik.http.routers.polaris_view_components.entrypoints: websecure
19
- traefik.http.routers.polaris_view_components.rule: "Host(`polarisviewcomponents.org`) || Host(`www.polarisviewcomponents.org`)"
20
- traefik.http.routers.polaris_view_components.tls.certresolver: letsencrypt
21
-
22
- traefik:
23
- options:
24
- publish:
25
- - "443:443"
26
- volume:
27
- - "/letsencrypt/acme.json:/letsencrypt/acme.json"
28
- args:
29
- entryPoints.web.address: ":80"
30
- entryPoints.websecure.address: ":443"
31
- entryPoints.web.http.redirections.entryPoint.to: websecure # We want to force https
32
- entryPoints.web.http.redirections.entryPoint.scheme: https
33
- entryPoints.web.http.redirections.entrypoint.permanent: true
34
- certificatesResolvers.letsencrypt.acme.email: "admin@polarisviewcomponents.org"
35
- certificatesResolvers.letsencrypt.acme.storage: "/letsencrypt/acme.json" # Must match the path in `volume`
36
- certificatesResolvers.letsencrypt.acme.httpchallenge: true
37
- certificatesResolvers.letsencrypt.acme.httpchallenge.entrypoint: web
@@ -30,7 +30,7 @@ if IMPORTMAP_BINSTUB.exist?
30
30
 
31
31
  unless importmaps.include?("@rails/request.js")
32
32
  say "Pin @rails/request.js dependency"
33
- run "bin/importmap pin @rails/request.js --download"
33
+ run "bin/importmap pin @rails/request.js"
34
34
  end
35
35
 
36
36
  say "Pin polaris_view_components"
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "2.2.0"
3
+ VERSION = "2.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polaris_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gamble
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-07-30 00:00:00.000000000 Z
12
+ date: 2024-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -117,6 +117,20 @@ dependencies:
117
117
  version: '0'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: kamal
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 2.0.0
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 2.0.0
132
+ - !ruby/object:Gem::Dependency
133
+ name: dotenv
120
134
  requirement: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - ">="