Skip to content

Commit 5d24b9f

Browse files
authored
Convert addon to gts & remove @embroider/util (#1960)
* refactor: use @embroider/template-tag-codemod to move first things to gts * chore: format * chore: delete old .ts components * chore: fix imports * refactor: power-select -> gts * refactor: convert remaining components to gts * fix: drop all ensureSafeComponent
1 parent ccc3cb1 commit 5d24b9f

25 files changed

+960
-939
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import type { PowerSelectArgs } from './power-select.gts';
2+
import type { Option, Select } from '../types.ts';
3+
4+
import PowerSelect from './power-select.gts';
5+
import Component from '@glimmer/component';
6+
7+
type PowerSelectMultipleArgs<T, TExtra> = PowerSelectArgs<T, true, TExtra>;
8+
9+
export interface PowerSelectMultipleSignature<T, TExtra = unknown> {
10+
Element: Element;
11+
Args: PowerSelectMultipleArgs<T, TExtra>;
12+
Blocks: {
13+
default: [option: Option<T>, select: Select<T, true>];
14+
};
15+
}
16+
17+
export default class PowerSelectMultipleComponent<T, TExtra> extends Component<
18+
PowerSelectMultipleSignature<T, TExtra>
19+
> {
20+
<template>
21+
<PowerSelect
22+
@animationEnabled={{@animationEnabled}}
23+
@triggerRole={{@triggerRole}}
24+
@ariaDescribedBy={{@ariaDescribedBy}}
25+
@ariaInvalid={{@ariaInvalid}}
26+
@ariaLabel={{@ariaLabel}}
27+
@ariaLabelledBy={{@ariaLabelledBy}}
28+
@labelClass={{@labelClass}}
29+
@labelText={{@labelText}}
30+
@labelTag={{@labelTag}}
31+
@labelClickAction={{@labelClickAction}}
32+
@labelComponent={{@labelComponent}}
33+
@afterOptionsComponent={{@afterOptionsComponent}}
34+
@allowClear={{@allowClear}}
35+
@beforeOptionsComponent={{@beforeOptionsComponent}}
36+
@buildSelection={{@buildSelection}}
37+
@calculatePosition={{@calculatePosition}}
38+
@closeOnSelect={{@closeOnSelect}}
39+
@defaultHighlighted={{@defaultHighlighted}}
40+
@highlightOnHover={{@highlightOnHover}}
41+
@typeAheadOptionMatcher={{@typeAheadOptionMatcher}}
42+
@destination={{@destination}}
43+
@destinationElement={{@destinationElement}}
44+
@disabled={{@disabled}}
45+
@dropdownClass={{@dropdownClass}}
46+
@extra={{@extra}}
47+
@groupComponent={{@groupComponent}}
48+
@horizontalPosition={{@horizontalPosition}}
49+
@initiallyOpened={{@initiallyOpened}}
50+
@loadingMessage={{@loadingMessage}}
51+
@matcher={{@matcher}}
52+
@matchTriggerWidth={{@matchTriggerWidth}}
53+
@noMatchesMessage={{@noMatchesMessage}}
54+
@noMatchesMessageComponent={{@noMatchesMessageComponent}}
55+
@multiple={{true}}
56+
@onBlur={{@onBlur}}
57+
@onChange={{@onChange}}
58+
@onClose={{@onClose}}
59+
@onFocus={{@onFocus}}
60+
@onInput={{@onInput}}
61+
@onKeydown={{@onKeydown}}
62+
@onOpen={{@onOpen}}
63+
@options={{@options}}
64+
@optionsComponent={{@optionsComponent}}
65+
@placeholder={{@placeholder}}
66+
@placeholderComponent={{@placeholderComponent}}
67+
@preventScroll={{@preventScroll}}
68+
@registerAPI={{@registerAPI}}
69+
@renderInPlace={{@renderInPlace}}
70+
@required={{@required}}
71+
@scrollTo={{@scrollTo}}
72+
@search={{@search}}
73+
@searchEnabled={{@searchEnabled}}
74+
@searchField={{@searchField}}
75+
@searchFieldPosition={{@searchFieldPosition}}
76+
@searchMessage={{@searchMessage}}
77+
@searchMessageComponent={{@searchMessageComponent}}
78+
@searchPlaceholder={{@searchPlaceholder}}
79+
@selected={{@selected}}
80+
@selectedItemComponent={{@selectedItemComponent}}
81+
@eventType={{@eventType}}
82+
@title={{@title}}
83+
@triggerClass={{@triggerClass}}
84+
@triggerComponent={{@triggerComponent}}
85+
@triggerId={{@triggerId}}
86+
@verticalPosition={{@verticalPosition}}
87+
@tabindex={{@tabindex}}
88+
@ebdTriggerComponent={{@ebdTriggerComponent}}
89+
@ebdContentComponent={{@ebdContentComponent}}
90+
...attributes
91+
as |option select|
92+
>
93+
{{yield option select}}
94+
</PowerSelect>
95+
</template>
96+
}

ember-power-select/src/components/power-select-multiple.hbs

Lines changed: 0 additions & 74 deletions
This file was deleted.

ember-power-select/src/components/power-select-multiple.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)