Skip to content

Commit 3bc6847

Browse files
authored
Move test-app to gts (#1029)
1 parent 84ce160 commit 3bc6847

21 files changed

Lines changed: 1534 additions & 738 deletions

pnpm-lock.yaml

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { BasicDropdownContentSignature } from 'ember-basic-dropdown/components/basic-dropdown-content';
2+
import type { TemplateOnlyComponent } from '@ember/component/template-only';
3+
4+
export default <template>
5+
<span id="my-custom-content" ...attributes>My custom content</span>
6+
</template> satisfies TemplateOnlyComponent<BasicDropdownContentSignature>;

test-app/app/components/my-custom-content.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-app/app/components/my-custom-content.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { BasicDropdownTriggerSignature } from 'ember-basic-dropdown/components/basic-dropdown-trigger';
2+
import type { TemplateOnlyComponent } from '@ember/component/template-only';
3+
4+
export default <template>
5+
<span id="my-custom-trigger" ...attributes>My custom trigger</span>
6+
</template> satisfies TemplateOnlyComponent<BasicDropdownTriggerSignature>;

test-app/app/components/my-custom-trigger.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

test-app/app/components/my-custom-trigger.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Component from '@glimmer/component';
22
import { getOwner } from '@ember/owner';
3+
import not from 'ember-truth-helpers/helpers/not';
34

45
// @ts-expect-error Public property 'isFastBoot' of exported class
56
const isFastBoot = typeof FastBoot !== 'undefined';
@@ -38,6 +39,18 @@ export default class ShadowRoot extends Component<{
3839
get getStyles() {
3940
return [...document.head.querySelectorAll('link')].map((link) => link.href);
4041
}
42+
<template>
43+
{{#if (not this.shadowDom)}}
44+
{{yield}}
45+
{{else if this.shadowRootElement}}
46+
{{#in-element this.shadowRootElement}}
47+
{{#each this.getStyles as |styleHref|}}
48+
<link rel="stylesheet" type="text/css" href={{styleHref}} />
49+
{{/each}}
50+
{{yield}}
51+
{{/in-element}}
52+
{{/if}}
53+
</template>
4154
}
4255

4356
declare module '@glint/environment-ember-loose/registry' {

test-app/app/components/shadow-root.hbs

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ export default class Shadow extends Component<{
2424
set(div);
2525
},
2626
);
27+
<template>
28+
<div data-shadow {{this.attachShadow this.setShadow}} ...attributes></div>
29+
30+
{{#if this.shadow}}
31+
{{#in-element this.shadow}}
32+
{{#each this.getStyles as |styleHref|}}
33+
<link rel="stylesheet" type="text/css" href={{styleHref}} />
34+
{{/each}}
35+
{{yield}}
36+
{{/in-element}}
37+
{{/if}}
38+
</template>
2739
}
2840

2941
declare module '@glint/environment-ember-loose/registry' {

0 commit comments

Comments
 (0)