keystone_ui 0.29.2 → 0.29.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5f95f61ce4ce116f5a90606360ef4f3f7f4d8f6cfba83a20258daa1e8b3647c
4
- data.tar.gz: bcba2c1dc07d22182b5bf42c9b18d70dc2b054c736ee9633cb8ecc60522ff3e1
3
+ metadata.gz: 6957989b7a51f3fdd94ce32536025f31b9f3d1cc35fae4b92c1957da717ffd80
4
+ data.tar.gz: 9c3a4af4f7a27c7082ca8bf64578de1d96a415cf06019143bf1b9dbbc1f9b0ac
5
5
  SHA512:
6
- metadata.gz: 27128b59ee933daf7b980c2ab480b607f988997b94f83c3eceaa1ebf958d34f625fa0dee0ffb8a146db2b00be5b725d49bc2408ce16d89aab6d9731f8ab3c8aa
7
- data.tar.gz: 6e66c6fe6e7c83001aad703e135c3dea55b2c491460a139f974d98efcc3169c1942a6c85ad9d6a28d51e18e4a90cdcae37b96797b7d52308f828d65e0137e516
6
+ metadata.gz: 60cb001c00c818f4990338a8ad9575ba48d97fd1874dbc86ac03370959b49223cf82c4bf3b92d4b65ddbd0d92e7a5fceba909cbd558222dc584e96473402e910
7
+ data.tar.gz: 9148787bdf6de7526e77cd73012d156468183d0f5b3a21e5a873d71c6d677b35fbc2ad8c8adc7735b9ed9f0523912f3b80907bd8cc96eb1fa5ba52fea581d6a7
@@ -1,13 +1,19 @@
1
1
  import { Controller } from "@hotwired/stimulus"
2
- import { Chart, registerables } from "chart.js"
3
2
 
4
- Chart.register(...registerables)
3
+ const loadChart = async () => {
4
+ const { Chart, registerables } = await import("chart.js")
5
+ Chart.register(...registerables)
6
+ return Chart
7
+ }
5
8
 
6
9
  export default class extends Controller {
7
10
  static targets = ["canvas"]
8
11
  static values = { data: Object }
9
12
 
10
- connect() {
13
+ async connect() {
14
+ const Chart = await loadChart()
15
+ if (!this.element.isConnected) return
16
+
11
17
  this.chart = new Chart(this.canvasTarget, {
12
18
  type: "line",
13
19
  data: this.resolveColors(this.dataValue),
data/config/importmap.rb CHANGED
@@ -20,4 +20,4 @@ pin "keystone_ui/page_theme", to: "keystone_ui/page_theme.js"
20
20
 
21
21
  # Chart.js for the line-chart controller, so host apps don't pin it themselves.
22
22
  # Vendored as a single self-contained bundle (deps inlined, no external imports).
23
- pin "chart.js", to: "keystone_ui/chartjs.js"
23
+ pin "chart.js", to: "keystone_ui/chartjs.js", preload: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KeystoneUi
4
- VERSION = "0.29.2"
4
+ VERSION = "0.29.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keystone_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.2
4
+ version: 0.29.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider