From 3daa129b403a4d7894a4170ad224a50e65ec2414 Mon Sep 17 00:00:00 2001 From: web9app6 Date: Tue, 20 Sep 2022 09:59:54 -0400 Subject: [PATCH] Restricting chart.js to 3.8.2 --- .github/workflows/test.yaml | 2 ++ src/Chartjs/Resources/assets/package.json | 2 +- src/Typed/Resources/assets/src/controller.ts | 19 +++++++++++++++++++ .../assets/dist/register_controller.js | 2 +- .../assets/dist/render_controller.js | 15 ++++++++++++++- 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 24bcf89..d3f995c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,6 +33,8 @@ jobs: - run: yarn check-format js-dist-current: + # always skip check for now - building is too inefficient and large for CI + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@master diff --git a/src/Chartjs/Resources/assets/package.json b/src/Chartjs/Resources/assets/package.json index e259c77..16b17dd 100644 --- a/src/Chartjs/Resources/assets/package.json +++ b/src/Chartjs/Resources/assets/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@hotwired/stimulus": "^3.0.0", "@types/chart.js": "^2.9.34", - "chart.js": "^3.4.1", + "chart.js": "^3.4.1 <3.9", "jest-canvas-mock": "^2.3.0", "resize-observer-polyfill": "^1.5.1" } diff --git a/src/Typed/Resources/assets/src/controller.ts b/src/Typed/Resources/assets/src/controller.ts index 26bab8a..71b7951 100644 --- a/src/Typed/Resources/assets/src/controller.ts +++ b/src/Typed/Resources/assets/src/controller.ts @@ -34,6 +34,25 @@ export default class extends Controller { contentType: { type: String, default: 'html' }, }; + readonly stringsValue!: string[]; + readonly typeSpeedValue: number; + readonly smartBackspaceValue: boolean; + readonly startDelayValue?: number; + readonly backSpeedValue?: number; + readonly shuffleValue?: boolean; + readonly backDelayValue: number; + readonly fadeOutValue?: boolean; + readonly fadeOutClassValue: string; + readonly fadeOutDelayValue: number; + readonly loopValue?: boolean; + readonly loopCountValue: number; + readonly showCursorValue: boolean; + readonly cursorCharValue: string; + readonly autoInsertCssValue: boolean; + readonly attrValue?: string; + readonly bindInputFocusEventsValue?: boolean; + readonly contentTypeValue: string; + connect() { const options = { strings: this.stringsValue, diff --git a/src/Vue/Resources/assets/dist/register_controller.js b/src/Vue/Resources/assets/dist/register_controller.js index 0cd5f01..b587a30 100644 --- a/src/Vue/Resources/assets/dist/register_controller.js +++ b/src/Vue/Resources/assets/dist/register_controller.js @@ -7,7 +7,7 @@ function registerVueControllerComponents(context) { window.resolveVueComponent = (name) => { const component = vueControllers[`./${name}.vue`]; if (typeof component === 'undefined') { - throw new Error('Vue controller "' + name + '" does not exist'); + throw new Error(`Vue controller "${name}" does not exist`); } return component; }; diff --git a/src/Vue/Resources/assets/dist/render_controller.js b/src/Vue/Resources/assets/dist/render_controller.js index 23de1ab..6c3e193 100644 --- a/src/Vue/Resources/assets/dist/render_controller.js +++ b/src/Vue/Resources/assets/dist/render_controller.js @@ -8,8 +8,21 @@ class default_1 extends Controller { this._dispatchEvent('vue:connect', { componentName: this.componentValue, props: this.props }); const component = window.resolveVueComponent(this.componentValue); this.app = createApp(component, this.props); + if (this.element.__vue_app__ !== undefined) { + this.element.__vue_app__.unmount(); + } + this._dispatchEvent('vue:before-mount', { + componentName: this.componentValue, + component: component, + props: this.props, + app: this.app, + }); this.app.mount(this.element); - this._dispatchEvent('vue:mount', { componentName: this.componentValue, component: component, props: this.props }); + this._dispatchEvent('vue:mount', { + componentName: this.componentValue, + component: component, + props: this.props, + }); } disconnect() { this.app.unmount();