-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overall type improvements #3707
base: develop
Are you sure you want to change the base?
Changes from all commits
ed1529c
96c1e63
2010f89
1e7d3cf
d500557
d3f0025
a94d18f
53b2506
9a7f3c8
722758d
99bd39a
68e6cf6
18dee68
b8fe9df
edc42f0
fb91079
8feec54
5ecbbb1
596aca9
6182cd6
c7ab0db
aa18871
e7d8156
853f04c
4a52025
d99c671
f4c587a
bf4acb2
e06da96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* | ||
* Copyright © 2024 Extremely Heavy Industries Inc. | ||
*/ | ||
import {HoistInputModel} from '@xh/hoist/cmp/input'; | ||
import { | ||
HoistModel, | ||
managed, | ||
|
@@ -145,7 +146,7 @@ export class FilterChooserModel extends HoistModel { | |
@observable.ref selectValue: string[]; | ||
@observable favoritesIsOpen = false; | ||
@observable unsupportedFilter = false; | ||
inputRef = createObservableRef<HTMLElement>(); | ||
inputRef = createObservableRef<HoistInputModel<null>>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious about the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made HoistInputModel generic to provide a type for the inputRef. In cases where that isn't being used, I thought it made sense to pass null since inputRef.current will always be null. |
||
|
||
constructor({ | ||
fieldSpecs, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,10 @@ | |
* Copyright © 2024 Extremely Heavy Industries Inc. | ||
*/ | ||
import { | ||
DefaultHoistProps, | ||
elementFactory, | ||
hoistCmp, | ||
HoistProps, | ||
PlainObject, | ||
TestSupportProps, | ||
uses | ||
} from '@xh/hoist/core'; | ||
|
@@ -21,7 +21,7 @@ import {FormModel} from './FormModel'; | |
/** @internal */ | ||
export interface FormContextType { | ||
/** Defaults props to be applied to contained fields. */ | ||
fieldDefaults?: Partial<BaseFormFieldProps> & DefaultHoistProps; | ||
fieldDefaults?: Partial<BaseFormFieldProps> & PlainObject; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming that use of Is mobile vs. desktop split the thing that's driving this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DefaultHoistProps was effectively an alias for PlainObject. Happy to revert this change, but in the process of reviewing some of this with Lee, we talked about the possibility of removing DefaultHoistProps entirely, so lots to consider here! I'm not entirely sure why this needs to be so generous-- might be desktop vs mobile, will investigate. |
||
|
||
/** Reference to associated FormModel. */ | ||
model?: FormModel; | ||
|
@@ -44,7 +44,7 @@ export interface FormProps extends HoistProps<FormModel>, TestSupportProps { | |
* Defaults for certain props on child/nested FormFields. | ||
* @see FormField (note there are both desktop and mobile implementations). | ||
*/ | ||
fieldDefaults?: Partial<BaseFormFieldProps> & DefaultHoistProps; | ||
fieldDefaults?: Partial<BaseFormFieldProps> & PlainObject; | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realizing that I need to catch up with the
ref
handling I see we have throughout the toolkit. I had not realized that we were passing refs through on so many components, and I confess I don't know what the rules are here as to when / why we do that (or when/why app components should do the same).