Skip to content

Commit

Permalink
convert to gjs
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Jan 31, 2024
1 parent 981fa29 commit 0e1175a
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 81 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.6.4

- Convert to `.gjs`

## 4.6.3

- Run ember-cli-update
Expand Down
14 changes: 14 additions & 0 deletions addon/components/expander/button.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* https://github.com/ember-cli/eslint-plugin-ember/issues/2035 */
/* eslint-disable no-unused-expressions */

<template>
<button
type="button"
class="expander__button"
aria-controls="{{@aria-controls}}"
aria-expanded="{{@aria-expanded}}"
...attributes
>
{{yield}}
</button>
</template>
9 changes: 0 additions & 9 deletions addon/components/expander/button.hbs

This file was deleted.

18 changes: 18 additions & 0 deletions addon/components/expander/content.gjs
Original file line number Diff line number Diff line change
@@ -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>
{{! template-lint-disable no-inline-styles }}
{{! Issue: https://github.com/emberjs/rfcs/issues/497 }}

<div
class="expander__content"
style={{@style}}
...attributes
{{didInsert @onInsert}}
>
{{yield}}
</div>
</template>
12 changes: 0 additions & 12 deletions addon/components/expander/content.hbs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -20,8 +23,6 @@ class ExpanderComponent extends Component {
Button;
Content;
contentElement = null;
ExpanderButton = ExpanderButton;
ExpanderContent = ExpanderContent;
id = guidFor(this);

registerComponents = (components) => {
Expand Down Expand Up @@ -167,6 +168,30 @@ class ExpanderComponent extends Component {
},
set() {}
});
}

export default ExpanderComponent;
<template>
{{! 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
)
)
}}
<div
id={{this.id}}
class="expander"
data-transitioning="{{this.isTransitioning}}"
data-expanded="{{this.isExpanded}}"
role="region"
...attributes
{{didInsert this.handleInsertElement}}
{{didUpdate this.handleUpdatedArguments @expanded}}
>
{{yield this.api}}
</div>
</template>
}
23 changes: 0 additions & 23 deletions addon/components/expander/index.hbs

This file was deleted.

27 changes: 4 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0e1175a

Please sign in to comment.