Skip to content

Commit 3e532eb

Browse files
committed
Convert SuperSelect::Single::Field to TypeScript
1 parent 092ffea commit 3e532eb

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

packages/components/src/components/hds/form/super-select/single/field.hbs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{! @glint-nocheck: not typesafe yet }}
21
{{!
32
Copyright (c) HashiCorp, Inc.
43
SPDX-License-Identifier: MPL-2.0
@@ -12,8 +11,7 @@
1211
as |F|
1312
>
1413
{{! Notice: the order of the elements is not relevant here, because is controlled at "Hds::Form::Field" component level }}
15-
{{yield (hash Label=F.Label isRequired=F.isRequired isOptional=F.isOptional)}}
16-
{{yield (hash HelperText=F.HelperText Error=F.Error)}}
14+
{{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}
1715
<F.Control>
1816
{{! Important: if an argument is added in base.hbs, it must also be added/processed here }}
1917
<Hds::Form::SuperSelect::Single::Base
@@ -66,7 +64,7 @@
6664
@triggerComponent={{@triggerComponent}}
6765
@triggerId={{F.id}}
6866
@triggerRole={{@triggerRole}}
69-
@typeAheadMatcher={{@typeAheadMatcher}}
67+
@typeAheadOptionMatcher={{@typeAheadOptionMatcher}}
7068
@verticalPosition={{@verticalPosition}}
7169
@isInvalid={{@isInvalid}}
7270
...attributes

packages/components/src/components/hds/form/super-select/single/field.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33
* SPDX-License-Identifier: MPL-2.0
44
*/
55

6-
import PowerSelectComponent from 'ember-power-select/components/power-select';
6+
import Component from '@glimmer/component';
77
import { ID_PREFIX } from '../../label/index.ts';
88

9-
export default class HdsSuperSelectSingleFieldComponent extends PowerSelectComponent {
10-
get idPrefix() {
9+
import type { HdsFormFieldSignature } from '../../field/index.ts';
10+
import type { HdsFormSuperSelectSingleBaseSignature } from './base.ts';
11+
12+
interface HdsFormSuperSelectSingleFieldSignature {
13+
Args: HdsFormSuperSelectSingleBaseSignature['Args'] &
14+
HdsFormFieldSignature['Args'];
15+
Blocks: {
16+
default: [unknown];
17+
};
18+
Element: HdsFormFieldSignature['Element'];
19+
}
20+
21+
export default class HdsFormSuperSelectSingleFieldComponent extends Component<HdsFormSuperSelectSingleFieldSignature> {
22+
get idPrefix(): string {
1123
return ID_PREFIX;
1224
}
1325
}

0 commit comments

Comments
 (0)