diff --git a/CHANGELOG.md b/CHANGELOG.md index 55b1935..5274ad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 4.6.4 + +- Convert to `.gjs` + ## 4.6.3 - Run ember-cli-update diff --git a/addon/components/expander/button.gjs b/addon/components/expander/button.gjs new file mode 100644 index 0000000..d95ec90 --- /dev/null +++ b/addon/components/expander/button.gjs @@ -0,0 +1,14 @@ +/* https://github.com/ember-cli/eslint-plugin-ember/issues/2035 */ +/* eslint-disable no-unused-expressions */ + + + + diff --git a/addon/components/expander/button.hbs b/addon/components/expander/button.hbs deleted file mode 100644 index 3677324..0000000 --- a/addon/components/expander/button.hbs +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/addon/components/expander/content.gjs b/addon/components/expander/content.gjs new file mode 100644 index 0000000..a3fc3e7 --- /dev/null +++ b/addon/components/expander/content.gjs @@ -0,0 +1,18 @@ +/* https://github.com/ember-cli/eslint-plugin-ember/issues/2035 */ +/* eslint-disable no-unused-expressions */ + +import didInsert from '@ember/render-modifiers/modifiers/did-insert'; + + + {{! template-lint-disable no-inline-styles }} + {{! Issue: https://github.com/emberjs/rfcs/issues/497 }} + +
+ diff --git a/addon/components/expander/content.hbs b/addon/components/expander/content.hbs deleted file mode 100644 index 29a2ba2..0000000 --- a/addon/components/expander/content.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{! template-lint-disable no-inline-styles }} - -{{! Issue: https://github.com/emberjs/rfcs/issues/497 }} - - \ No newline at end of file diff --git a/addon/components/expander/index.js b/addon/components/expander/index.gjs similarity index 79% rename from addon/components/expander/index.js rename to addon/components/expander/index.gjs index 1736697..25c740f 100644 --- a/addon/components/expander/index.js +++ b/addon/components/expander/index.gjs @@ -1,17 +1,20 @@ -import Component from '@glimmer/component'; -import ExpanderContent from '@zestia/ember-expander/components/expander/content'; -import ExpanderButton from '@zestia/ember-expander/components/expander/button'; +import { action } from '@ember/object'; +import { guidFor } from '@ember/object/internals'; +import { hash } from '@ember/helper'; import { htmlSafe } from '@ember/template'; -import { tracked } from '@glimmer/tracking'; -import { waitFor } from '@ember/test-waiters'; import { next, scheduleOnce } from '@ember/runloop'; -import { action } from '@ember/object'; import { task } from 'ember-concurrency'; -import { guidFor } from '@ember/object/internals'; +import { tracked } from '@glimmer/tracking'; +import { waitFor } from '@ember/test-waiters'; import { waitForAnimation } from '@zestia/animation-utils'; +import Component from '@glimmer/component'; +import didInsert from '@ember/render-modifiers/modifiers/did-insert'; +import didUpdate from '@ember/render-modifiers/modifiers/did-update'; +import ExpanderButton from '@zestia/ember-expander/components/expander/button'; +import ExpanderContent from '@zestia/ember-expander/components/expander/content'; const { assign } = Object; -class ExpanderComponent extends Component { +export default class ExpanderComponent extends Component { @tracked isExpanded = !!this.args.expanded; @tracked isTransitioning = false; @tracked maxHeight = null; @@ -20,8 +23,6 @@ class ExpanderComponent extends Component { Button; Content; contentElement = null; - ExpanderButton = ExpanderButton; - ExpanderContent = ExpanderContent; id = guidFor(this); registerComponents = (components) => { @@ -167,6 +168,30 @@ class ExpanderComponent extends Component { }, set() {} }); -} -export default ExpanderComponent; + + {{! template-lint-disable no-unsupported-role-attributes }} + {{this.registerComponents + (hash + Button=(component + ExpanderButton aria-controls=this.id aria-expanded=this.isExpanded + ) + Content=(component + ExpanderContent onInsert=this.registerContentElement style=this.style + ) + ) + }} + + +} diff --git a/addon/components/expander/index.hbs b/addon/components/expander/index.hbs deleted file mode 100644 index 2c49200..0000000 --- a/addon/components/expander/index.hbs +++ /dev/null @@ -1,23 +0,0 @@ -{{! template-lint-disable no-unsupported-role-attributes }} -{{this.registerComponents - (hash - Button=(component - this.ExpanderButton aria-controls=this.id aria-expanded=this.isExpanded - ) - Content=(component - this.ExpanderContent onInsert=this.registerContentElement style=this.style - ) - ) -}} - \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0d8e0d0..cc8769c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,8 @@ "ember-auto-import": "^2.7.1", "ember-cli-babel": "^8.2.0", "ember-cli-htmlbars": "^6.3.0", - "ember-concurrency": "^3.1.1" + "ember-concurrency": "^3.1.1", + "ember-template-imports": "^4.0.0" }, "devDependencies": { "@ember/optional-features": "^2.0.0", @@ -44,7 +45,6 @@ "ember-resolver": "^11.0.1", "ember-source": "~5.5.0", "ember-source-channel-url": "^3.0.0", - "ember-template-imports": "^4.0.0", "ember-template-lint": "^5.13.0", "ember-try": "^3.0.0", "eslint": "^8.55.0", @@ -8972,7 +8972,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/broccoli-stew/-/broccoli-stew-3.0.0.tgz", "integrity": "sha512-NXfi+Vas24n3Ivo21GvENTI55qxKu7OwKRnCLWXld8MiLiQKQlWIq28eoARaFj0lTUFwUa4jKZeA7fW9PiWQeg==", - "dev": true, "dependencies": { "broccoli-debug": "^0.6.5", "broccoli-funnel": "^2.0.0", @@ -8997,7 +8996,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/broccoli-funnel/-/broccoli-funnel-2.0.2.tgz", "integrity": "sha512-/vDTqtv7ipjEZQOVqO4vGDVAOZyuYzQ/EgGoyewfOgh1M7IQAToBKZI0oAQPgMBeFPPlIbfMuAngk+ohPBuaHQ==", - "dev": true, "dependencies": { "array-equal": "^1.0.0", "blank-object": "^1.0.1", @@ -9021,7 +9019,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.3.1.tgz", "integrity": "sha512-DW8XASZkmorp+q7J4EeDEZz+LoyKLAd2XZULXyD9l4m9/hAKV3vjHmB1kiUshcWAYMgTP1m2i4NnqCE/23h6AQ==", - "dev": true, "dependencies": { "promise-map-series": "^0.2.1", "quick-temp": "^0.1.3", @@ -9033,7 +9030,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "dependencies": { "ms": "2.0.0" } @@ -9042,7 +9038,6 @@ "version": "0.3.4", "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-0.3.4.tgz", "integrity": "sha512-ttGcuHA/OBnN2pcM6johpYlEms7XpO5/fyKIr48541xXedan4roO8cS1Q2S/zbbjGH/BarYDAMeS2Mi9HE5Tig==", - "dev": true, "dependencies": { "ensure-posix-path": "^1.0.0", "matcher-collection": "^1.0.0" @@ -9052,7 +9047,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/broccoli-persistent-filter/-/broccoli-persistent-filter-2.3.1.tgz", "integrity": "sha512-hVsmIgCDrl2NFM+3Gs4Cr2TA6UPaIZip99hN8mtkaUPgM8UeVnCbxelCvBjUBHo0oaaqP5jzqqnRVvb568Yu5g==", - "dev": true, "dependencies": { "async-disk-cache": "^1.2.1", "async-promise-queue": "^1.0.3", @@ -9077,7 +9071,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-1.3.1.tgz", "integrity": "sha512-DW8XASZkmorp+q7J4EeDEZz+LoyKLAd2XZULXyD9l4m9/hAKV3vjHmB1kiUshcWAYMgTP1m2i4NnqCE/23h6AQ==", - "dev": true, "dependencies": { "promise-map-series": "^0.2.1", "quick-temp": "^0.1.3", @@ -9089,7 +9082,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/fs-tree-diff/-/fs-tree-diff-2.0.1.tgz", "integrity": "sha512-x+CfAZ/lJHQqwlD64pYM5QxWjzWhSjroaVsr8PW831zOApL55qPibed0c+xebaLWVr2BnHFoHdrwOv8pzt8R5A==", - "dev": true, "dependencies": { "@types/symlink-or-copy": "^1.2.0", "heimdalljs-logger": "^0.1.7", @@ -9105,7 +9097,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/broccoli-plugin/-/broccoli-plugin-2.1.0.tgz", "integrity": "sha512-ElE4caljW4slapyEhSD9jU9Uayc8SoSABWdmY9SqbV8DHNxU6xg1jJsPcMm+cXOvggR3+G+OXAYQeFjWVnznaw==", - "dev": true, "dependencies": { "promise-map-series": "^0.2.1", "quick-temp": "^0.1.3", @@ -9120,7 +9111,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -9134,7 +9124,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -9143,7 +9132,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/matcher-collection/-/matcher-collection-1.1.2.tgz", "integrity": "sha512-YQ/teqaOIIfUHedRam08PB3NK7Mjct6BvzRnJmpGDm8uFXpNr1sbY4yuflI5JcEs6COpYA0FpRQhSDBf1tT95g==", - "dev": true, "dependencies": { "minimatch": "^3.0.2" } @@ -9152,7 +9140,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -9163,14 +9150,12 @@ "node_modules/broccoli-stew/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/broccoli-stew/node_modules/rsvp": { "version": "4.8.5", "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true, "engines": { "node": "6.* || >= 7.*" } @@ -9179,7 +9164,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -9188,7 +9172,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/walk-sync/-/walk-sync-1.1.4.tgz", "integrity": "sha512-nowc9thB/Jg0KW4TgxoRjLLYRPvl3DB/98S89r4ZcJqq2B0alNcKDh6pzLkBSkPMzRSMsJghJHQi79qw0YWEkA==", - "dev": true, "dependencies": { "@types/minimatch": "^3.0.3", "ensure-posix-path": "^1.1.0", @@ -10901,8 +10884,7 @@ "node_modules/content-tag": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/content-tag/-/content-tag-1.2.1.tgz", - "integrity": "sha512-aKOsM+GojHMvRuqOa+qamATA3IEK9QksXcIX2NSGHpU5euNhrg6mZFT3Z7kDuNz55sH9NRPJKqeGhkhaq9ED2w==", - "dev": true + "integrity": "sha512-aKOsM+GojHMvRuqOa+qamATA3IEK9QksXcIX2NSGHpU5euNhrg6mZFT3Z7kDuNz55sH9NRPJKqeGhkhaq9ED2w==" }, "node_modules/content-type": { "version": "1.0.5", @@ -17356,7 +17338,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/ember-template-imports/-/ember-template-imports-4.0.0.tgz", "integrity": "sha512-Kw1FnFX3MrBesfsjJDFvVgOf1mANOvMprAH1ngDd5SvdlkltNWCF2UKI9WXKQV3lw5noQC1+n6S80L9Q03D3Hw==", - "dev": true, "dependencies": { "broccoli-stew": "^3.0.0", "content-tag": "^1.1.2", diff --git a/package.json b/package.json index c23d35f..de1dcd6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "ember-auto-import": "^2.7.1", "ember-cli-babel": "^8.2.0", "ember-cli-htmlbars": "^6.3.0", - "ember-concurrency": "^3.1.1" + "ember-concurrency": "^3.1.1", + "ember-template-imports": "^4.0.0" }, "description": "A component to help transition to height auto", "devDependencies": { @@ -37,7 +38,6 @@ "ember-resolver": "^11.0.1", "ember-source": "~5.5.0", "ember-source-channel-url": "^3.0.0", - "ember-template-imports": "^4.0.0", "ember-template-lint": "^5.13.0", "ember-try": "^3.0.0", "eslint": "^8.55.0",