@terreno/ui 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionSheet.js.map +1 -1
- package/dist/Box.js +2 -0
- package/dist/Box.js.map +1 -1
- package/dist/Common.d.ts +8 -7
- package/dist/Common.js.map +1 -1
- package/dist/ConsentNavigator.js.map +1 -1
- package/dist/CustomSelectField.js +2 -2
- package/dist/CustomSelectField.js.map +1 -1
- package/dist/DateTimeField.js +1 -0
- package/dist/DateTimeField.js.map +1 -1
- package/dist/EmailField.js +1 -1
- package/dist/EmailField.js.map +1 -1
- package/dist/Modal.js +7 -2
- package/dist/Modal.js.map +1 -1
- package/dist/Page.js +1 -0
- package/dist/Page.js.map +1 -1
- package/dist/PickerSelect.d.ts +4 -5
- package/dist/PickerSelect.js +4 -3
- package/dist/PickerSelect.js.map +1 -1
- package/dist/SelectBadge.js +1 -1
- package/dist/SelectBadge.js.map +1 -1
- package/dist/SelectField.js +3 -3
- package/dist/SelectField.js.map +1 -1
- package/dist/SplitPage.js +3 -0
- package/dist/SplitPage.js.map +1 -1
- package/dist/SplitPage.native.js +2 -0
- package/dist/SplitPage.native.js.map +1 -1
- package/dist/TapToEdit.js +1 -0
- package/dist/TapToEdit.js.map +1 -1
- package/dist/ToastNotifications.js.map +1 -1
- package/dist/Unifier.js.map +1 -1
- package/dist/WebDropdownMenu.d.ts +7 -8
- package/dist/WebDropdownMenu.js +4 -3
- package/dist/WebDropdownMenu.js.map +1 -1
- package/dist/useSubmitConsent.d.ts +1 -1
- package/dist/useSubmitConsent.js +1 -1
- package/dist/useSubmitConsent.js.map +1 -1
- package/package.json +2 -2
- package/src/ActionSheet.test.tsx +1 -0
- package/src/ActionSheet.tsx +2 -0
- package/src/Box.test.tsx +56 -0
- package/src/Box.tsx +4 -0
- package/src/Button.test.tsx +34 -0
- package/src/Common.ts +31 -7
- package/src/ConsentNavigator.test.tsx +1 -0
- package/src/ConsentNavigator.tsx +1 -0
- package/src/CustomSelectField.test.tsx +3 -8
- package/src/CustomSelectField.tsx +2 -2
- package/src/DataTable.test.tsx +1 -0
- package/src/DateTimeField.test.tsx +1 -0
- package/src/DateTimeField.tsx +1 -0
- package/src/EmailField.tsx +1 -1
- package/src/Modal.test.tsx +261 -66
- package/src/Modal.tsx +7 -2
- package/src/ModalSheet.test.tsx +7 -6
- package/src/Page.tsx +1 -0
- package/src/PickerSelect.test.tsx +23 -18
- package/src/PickerSelect.tsx +6 -6
- package/src/SelectBadge.test.tsx +1 -2
- package/src/SelectBadge.tsx +1 -1
- package/src/SelectField.tsx +2 -2
- package/src/SplitPage.native.tsx +2 -0
- package/src/SplitPage.test.tsx +6 -4
- package/src/SplitPage.tsx +3 -0
- package/src/TapToEdit.test.tsx +1 -0
- package/src/TapToEdit.tsx +2 -0
- package/src/Text.test.tsx +29 -0
- package/src/TextField.test.tsx +57 -1
- package/src/ToastNotifications.test.tsx +1 -0
- package/src/ToastNotifications.tsx +1 -0
- package/src/Tooltip.test.tsx +1 -1
- package/src/Unifier.ts +1 -0
- package/src/UpgradeRequiredScreen.test.tsx +40 -0
- package/src/UserInactivity.test.tsx +44 -1
- package/src/WebDropdownMenu.test.tsx +14 -19
- package/src/WebDropdownMenu.tsx +8 -8
- package/src/__snapshots__/DataTable.test.tsx.snap +0 -148
- package/src/__snapshots__/InfoModalIcon.test.tsx.snap +255 -1088
- package/src/__snapshots__/Modal.test.tsx.snap +950 -1108
- package/src/bunSetup.ts +24 -0
- package/src/types/react-native-swiper-flatlist.d.ts +1 -0
- package/src/useSubmitConsent.test.ts +2 -1
- package/src/useSubmitConsent.ts +2 -2
package/src/ActionSheet.tsx
CHANGED
|
@@ -168,9 +168,11 @@ export class ActionSheet extends Component<Props, State, unknown> {
|
|
|
168
168
|
|
|
169
169
|
deviceLayoutCalled = false;
|
|
170
170
|
|
|
171
|
+
// noExplicitAny: FlatList ref is accessed via internal _listRef._scrollRef which is not part of the public type
|
|
171
172
|
// biome-ignore lint/suspicious/noExplicitAny: FlatList ref is accessed via internal _listRef._scrollRef which is not part of the public type
|
|
172
173
|
scrollViewRef: React.RefObject<any>;
|
|
173
174
|
|
|
175
|
+
// noExplicitAny: SafeAreaView ref is passed to findNodeHandle and accessed via untyped React Native internals
|
|
174
176
|
// biome-ignore lint/suspicious/noExplicitAny: SafeAreaView ref is passed to findNodeHandle and accessed via untyped React Native internals
|
|
175
177
|
safeAreaViewRef: React.RefObject<any>;
|
|
176
178
|
|
package/src/Box.test.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// noExplicitAny: test mock typing
|
|
1
2
|
// biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
|
|
2
3
|
import {describe, expect, it, mock, spyOn} from "bun:test";
|
|
3
4
|
import {act, fireEvent} from "@testing-library/react-native";
|
|
@@ -419,6 +420,13 @@ describe("Box", () => {
|
|
|
419
420
|
const view = root.findByType("View");
|
|
420
421
|
expect(view.props.style).toBeDefined();
|
|
421
422
|
});
|
|
423
|
+
|
|
424
|
+
it("applies no shadow style when shadow is false", () => {
|
|
425
|
+
const {root} = renderWithTheme(<Box shadow={false} />);
|
|
426
|
+
const view = root.findByType("View");
|
|
427
|
+
expect(view.props.style.boxShadow).toBeUndefined();
|
|
428
|
+
expect(view.props.style.elevation).toBeUndefined();
|
|
429
|
+
});
|
|
422
430
|
});
|
|
423
431
|
|
|
424
432
|
describe("clickable behavior", () => {
|
|
@@ -554,6 +562,30 @@ describe("Box", () => {
|
|
|
554
562
|
expect(ref.current).toBeTruthy();
|
|
555
563
|
expect(typeof ref.current.scrollTo).toBe("function");
|
|
556
564
|
});
|
|
565
|
+
|
|
566
|
+
it("scrollTo forwards to the underlying scroll ref after the delay", async () => {
|
|
567
|
+
const scrollTo = mock(() => {});
|
|
568
|
+
const scrollToEnd = mock(() => {});
|
|
569
|
+
const scrollRef = {current: {scrollTo, scrollToEnd}} as any;
|
|
570
|
+
const ref = React.createRef<any>();
|
|
571
|
+
// Intentionally omit `scroll` so the ScrollView does not claim `scrollRef`
|
|
572
|
+
// and overwrite `.current`; the imperative handle still reads it.
|
|
573
|
+
renderWithTheme(
|
|
574
|
+
<Box ref={ref} scrollRef={scrollRef}>
|
|
575
|
+
<Text>Content</Text>
|
|
576
|
+
</Box>
|
|
577
|
+
);
|
|
578
|
+
|
|
579
|
+
ref.current.scrollTo(42);
|
|
580
|
+
ref.current.scrollToEnd();
|
|
581
|
+
|
|
582
|
+
await act(async () => {
|
|
583
|
+
await new Promise((resolve) => setTimeout(resolve, 80));
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
expect(scrollTo).toHaveBeenCalledWith({y: 42});
|
|
587
|
+
expect(scrollToEnd).toHaveBeenCalledTimes(1);
|
|
588
|
+
});
|
|
557
589
|
});
|
|
558
590
|
|
|
559
591
|
describe("dangerous inline styles", () => {
|
|
@@ -715,6 +747,30 @@ describe("Box", () => {
|
|
|
715
747
|
warnSpy.mockRestore();
|
|
716
748
|
});
|
|
717
749
|
|
|
750
|
+
it("applies a valid maxHeight value", () => {
|
|
751
|
+
const {root} = renderWithTheme(<Box maxHeight={120} />);
|
|
752
|
+
const view = root.findByType("View");
|
|
753
|
+
expect(view.props.style).toMatchObject({maxHeight: 120});
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
it("applies a valid minHeight value", () => {
|
|
757
|
+
const {root} = renderWithTheme(<Box minHeight={"50%" as any} />);
|
|
758
|
+
const view = root.findByType("View");
|
|
759
|
+
expect(view.props.style).toMatchObject({minHeight: "50%"});
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
it("applies a valid maxWidth value", () => {
|
|
763
|
+
const {root} = renderWithTheme(<Box maxWidth={200} />);
|
|
764
|
+
const view = root.findByType("View");
|
|
765
|
+
expect(view.props.style).toMatchObject({maxWidth: 200});
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
it("applies a valid minWidth value", () => {
|
|
769
|
+
const {root} = renderWithTheme(<Box minWidth={"25%" as any} />);
|
|
770
|
+
const view = root.findByType("View");
|
|
771
|
+
expect(view.props.style).toMatchObject({minWidth: "25%"});
|
|
772
|
+
});
|
|
773
|
+
|
|
718
774
|
it("warns when invalid minWidth value is provided", () => {
|
|
719
775
|
const warnSpy = spyOn(console, "warn").mockImplementation(() => {});
|
|
720
776
|
renderWithTheme(<Box minWidth={"abc" as any} />);
|
package/src/Box.tsx
CHANGED
|
@@ -87,8 +87,10 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
|
|
|
87
87
|
|
|
88
88
|
const BOX_STYLE_MAP: {
|
|
89
89
|
[prop: string]: (
|
|
90
|
+
// noExplicitAny: Box's style mapper accepts heterogeneous prop values (spacing, colors, dimensions, theme tokens, booleans) that cannot be enumerated in a single union; the mapper functions narrow at call site
|
|
90
91
|
// biome-ignore lint/suspicious/noExplicitAny: Box's style mapper accepts heterogeneous prop values (spacing, colors, dimensions, theme tokens, booleans) that cannot be enumerated in a single union; the mapper functions narrow at call site
|
|
91
92
|
value: any,
|
|
93
|
+
// noExplicitAny: see above - heterogeneous prop values
|
|
92
94
|
// biome-ignore lint/suspicious/noExplicitAny: see above - heterogeneous prop values
|
|
93
95
|
all: {[prop: string]: any}
|
|
94
96
|
) => {[style: string]: string | number} | {};
|
|
@@ -265,8 +267,10 @@ export const Box = React.forwardRef((props: BoxProps, ref) => {
|
|
|
265
267
|
|
|
266
268
|
const scrollRef = props.scrollRef ?? React.createRef();
|
|
267
269
|
|
|
270
|
+
// noExplicitAny: the style object is assembled from heterogeneous mapper outputs and consumed by RN ViewStyle which has narrow union types per property
|
|
268
271
|
// biome-ignore lint/suspicious/noExplicitAny: the style object is assembled from heterogeneous mapper outputs and consumed by RN ViewStyle which has narrow union types per property
|
|
269
272
|
const propsToStyle = (): any => {
|
|
273
|
+
// noExplicitAny: same as above - heterogeneous style assembly
|
|
270
274
|
// biome-ignore lint/suspicious/noExplicitAny: same as above - heterogeneous style assembly
|
|
271
275
|
let style: any = {};
|
|
272
276
|
for (const prop of Object.keys(props) as Array<keyof typeof props>) {
|
package/src/Button.test.tsx
CHANGED
|
@@ -3,9 +3,14 @@ import {act, fireEvent, render, waitFor} from "@testing-library/react-native";
|
|
|
3
3
|
|
|
4
4
|
import {Button} from "./Button";
|
|
5
5
|
import {isMobileDevice} from "./MediaQuery";
|
|
6
|
+
import * as ThemeModule from "./Theme";
|
|
6
7
|
import {renderWithIcons, renderWithTheme, TEST_CUSTOM_ICON_TEST_ID} from "./test-utils";
|
|
7
8
|
import * as Utilities from "./Utilities";
|
|
8
9
|
|
|
10
|
+
interface PressableTestProps {
|
|
11
|
+
onPress: () => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
describe("Button", () => {
|
|
10
15
|
it("renders correctly with default props", () => {
|
|
11
16
|
const {toJSON} = renderWithTheme(<Button onClick={() => {}} text="Click me" />);
|
|
@@ -364,4 +369,33 @@ describe("Button", () => {
|
|
|
364
369
|
nativeSpy.mockRestore();
|
|
365
370
|
(isMobileDevice as ReturnType<typeof mock>).mockImplementation(() => false);
|
|
366
371
|
});
|
|
372
|
+
|
|
373
|
+
it("resets loading and rethrows when onClick rejects", async () => {
|
|
374
|
+
const error = new Error("boom");
|
|
375
|
+
const handleClick = mock(() => Promise.reject(error));
|
|
376
|
+
const {getByTestId} = renderWithTheme(
|
|
377
|
+
<Button onClick={handleClick} pressAnimation="none" testID="throwing-button" text="Throw" />
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
const button = getByTestId("throwing-button");
|
|
381
|
+
await act(async () => {
|
|
382
|
+
await expect((button.props as PressableTestProps).onPress()).rejects.toThrow("boom");
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
expect(handleClick).toHaveBeenCalled();
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
it("renders null when no theme is available from context", () => {
|
|
389
|
+
const useThemeSpy = spyOn(ThemeModule, "useTheme").mockReturnValue({
|
|
390
|
+
resetTheme: () => {},
|
|
391
|
+
setPrimitives: () => {},
|
|
392
|
+
setTheme: () => {},
|
|
393
|
+
theme: undefined,
|
|
394
|
+
} as unknown as ReturnType<typeof ThemeModule.useTheme>);
|
|
395
|
+
|
|
396
|
+
const {toJSON} = render(<Button onClick={() => {}} text="No theme" />);
|
|
397
|
+
expect(toJSON()).toBeNull();
|
|
398
|
+
|
|
399
|
+
useThemeSpy.mockRestore();
|
|
400
|
+
});
|
|
367
401
|
});
|
package/src/Common.ts
CHANGED
|
@@ -531,6 +531,7 @@ export interface BoxPropsBase extends WithTestID {
|
|
|
531
531
|
lgColumn?: UnsignedUpTo12;
|
|
532
532
|
dangerouslySetInlineStyle?: {
|
|
533
533
|
__style: {
|
|
534
|
+
// noExplicitAny: escape hatch for arbitrary inline style values that users may need to set
|
|
534
535
|
// biome-ignore lint/suspicious/noExplicitAny: escape hatch for arbitrary inline style values that users may need to set
|
|
535
536
|
[key: string]: any;
|
|
536
537
|
};
|
|
@@ -989,16 +990,19 @@ export interface SplitPageProps {
|
|
|
989
990
|
loading?: boolean;
|
|
990
991
|
color?: SurfaceColor;
|
|
991
992
|
keyboardOffset?: number;
|
|
993
|
+
// noExplicitAny: ListRenderItemInfo generic type depends on the consumer's data shape
|
|
992
994
|
// biome-ignore lint/suspicious/noExplicitAny: ListRenderItemInfo generic type depends on the consumer's data shape
|
|
993
995
|
renderListViewItem: (itemInfo: ListRenderItemInfo<any>) => ReactElement | null;
|
|
994
996
|
renderListViewHeader?: () => ReactElement | null;
|
|
995
997
|
renderContent?: (index?: number) => ReactElement | ReactElement[] | null;
|
|
998
|
+
// noExplicitAny: list data type varies by consumer's data model
|
|
996
999
|
// biome-ignore lint/suspicious/noExplicitAny: list data type varies by consumer's data model
|
|
997
1000
|
listViewData: any[];
|
|
998
1001
|
listViewExtraData?: unknown;
|
|
999
1002
|
listViewWidth?: number;
|
|
1000
1003
|
listViewMaxWidth?: number;
|
|
1001
1004
|
renderChild?: () => ReactChild;
|
|
1005
|
+
// noExplicitAny: callback value type varies by consumer's data model
|
|
1002
1006
|
// biome-ignore lint/suspicious/noExplicitAny: callback value type varies by consumer's data model
|
|
1003
1007
|
onSelectionChange?: (value?: any) => void | Promise<void>;
|
|
1004
1008
|
}
|
|
@@ -1790,10 +1794,10 @@ export interface CustomSelectFieldProps extends WithTestID {
|
|
|
1790
1794
|
title?: string;
|
|
1791
1795
|
|
|
1792
1796
|
/**
|
|
1793
|
-
* When true,
|
|
1794
|
-
* @default
|
|
1797
|
+
* When true, hides the type-to-filter search UI. Search is enabled by default.
|
|
1798
|
+
* @default false
|
|
1795
1799
|
*/
|
|
1796
|
-
|
|
1800
|
+
disableSearch?: boolean;
|
|
1797
1801
|
}
|
|
1798
1802
|
|
|
1799
1803
|
export interface DateTimeActionSheetProps {
|
|
@@ -1801,6 +1805,7 @@ export interface DateTimeActionSheetProps {
|
|
|
1801
1805
|
type?: "date" | "time" | "datetime";
|
|
1802
1806
|
// Returns an ISO 8601 string. If mode is "time", the date portion is today.
|
|
1803
1807
|
onChange: OnChangeCallback;
|
|
1808
|
+
// noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
1804
1809
|
// biome-ignore lint/suspicious/noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
1805
1810
|
actionSheetRef: React.RefObject<any>;
|
|
1806
1811
|
visible: boolean;
|
|
@@ -1813,6 +1818,7 @@ export interface DecimalRangeActionSheetProps {
|
|
|
1813
1818
|
min: number;
|
|
1814
1819
|
max: number;
|
|
1815
1820
|
onChange: OnChangeCallback;
|
|
1821
|
+
// noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
1816
1822
|
// biome-ignore lint/suspicious/noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
1817
1823
|
actionSheetRef: React.RefObject<any>;
|
|
1818
1824
|
}
|
|
@@ -1873,6 +1879,7 @@ export type FieldProps =
|
|
|
1873
1879
|
export interface HeightActionSheetProps {
|
|
1874
1880
|
value?: string;
|
|
1875
1881
|
onChange: OnChangeCallback;
|
|
1882
|
+
// noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
1876
1883
|
// biome-ignore lint/suspicious/noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
1877
1884
|
actionSheetRef: React.RefObject<any>;
|
|
1878
1885
|
/** Minimum height in total inches */
|
|
@@ -1885,16 +1892,20 @@ export interface HeightActionSheetProps {
|
|
|
1885
1892
|
|
|
1886
1893
|
export interface HyperlinkProps {
|
|
1887
1894
|
linkDefault?: boolean;
|
|
1895
|
+
// noExplicitAny: linkify-it library's main export lacks a TypeScript type definition
|
|
1888
1896
|
// biome-ignore lint/suspicious/noExplicitAny: linkify-it library's main export lacks a TypeScript type definition
|
|
1889
1897
|
linkify?: any;
|
|
1898
|
+
// noExplicitAny: StyleProp's generic is heterogeneous (TextStyle | ViewStyle) for link contexts
|
|
1890
1899
|
// biome-ignore lint/suspicious/noExplicitAny: StyleProp's generic is heterogeneous (TextStyle | ViewStyle) for link contexts
|
|
1891
1900
|
linkStyle?: StyleProp<any>;
|
|
1892
1901
|
linkText?: string | ((url: string) => string);
|
|
1893
1902
|
onPress?: (url: string) => void;
|
|
1894
1903
|
onLongPress?: (url: string, text: string) => void;
|
|
1904
|
+
// noExplicitAny: returned view props are spread onto a heterogeneous View; consumers pass arbitrary props
|
|
1895
1905
|
// biome-ignore lint/suspicious/noExplicitAny: returned view props are spread onto a heterogeneous View; consumers pass arbitrary props
|
|
1896
1906
|
injectViewProps?: (url: string) => any;
|
|
1897
1907
|
children?: React.ReactNode;
|
|
1908
|
+
// noExplicitAny: StyleProp's generic is heterogeneous for the container which holds mixed Text/View children
|
|
1898
1909
|
// biome-ignore lint/suspicious/noExplicitAny: StyleProp's generic is heterogeneous for the container which holds mixed Text/View children
|
|
1899
1910
|
style?: StyleProp<any>;
|
|
1900
1911
|
}
|
|
@@ -2054,11 +2065,13 @@ export interface ModalProps extends WithTestID {
|
|
|
2054
2065
|
/**
|
|
2055
2066
|
* The function to call when the primary button is clicked.
|
|
2056
2067
|
*/
|
|
2068
|
+
// noExplicitAny: callback value type varies by consumer context
|
|
2057
2069
|
// biome-ignore lint/suspicious/noExplicitAny: callback value type varies by consumer context
|
|
2058
2070
|
primaryButtonOnClick?: (value?: any) => void | Promise<void>;
|
|
2059
2071
|
/**
|
|
2060
2072
|
* The function to call when the secondary button is clicked.
|
|
2061
2073
|
*/
|
|
2074
|
+
// noExplicitAny: callback value type varies by consumer context
|
|
2062
2075
|
// biome-ignore lint/suspicious/noExplicitAny: callback value type varies by consumer context
|
|
2063
2076
|
secondaryButtonOnClick?: (value?: any) => void | Promise<void>;
|
|
2064
2077
|
}
|
|
@@ -2068,11 +2081,13 @@ export interface NumberPickerActionSheetProps {
|
|
|
2068
2081
|
min: number;
|
|
2069
2082
|
max: number;
|
|
2070
2083
|
onChange: OnChangeCallback;
|
|
2084
|
+
// noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
2071
2085
|
// biome-ignore lint/suspicious/noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
2072
2086
|
actionSheetRef: React.RefObject<any>;
|
|
2073
2087
|
}
|
|
2074
2088
|
|
|
2075
2089
|
export interface PageProps extends WithTestID {
|
|
2090
|
+
// noExplicitAny: React Navigation type varies by navigation stack configuration
|
|
2076
2091
|
// biome-ignore lint/suspicious/noExplicitAny: React Navigation type varies by navigation stack configuration
|
|
2077
2092
|
navigation?: any;
|
|
2078
2093
|
scroll?: boolean;
|
|
@@ -2406,6 +2421,7 @@ export interface TextFieldPickerActionSheetProps {
|
|
|
2406
2421
|
value?: string;
|
|
2407
2422
|
mode?: "date" | "time";
|
|
2408
2423
|
onChange: OnChangeCallback;
|
|
2424
|
+
// noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
2409
2425
|
// biome-ignore lint/suspicious/noExplicitAny: ActionSheet class lives in ActionSheet.tsx which imports from Common.ts; typing this would create a circular import
|
|
2410
2426
|
actionSheetRef: React.RefObject<any>;
|
|
2411
2427
|
}
|
|
@@ -2526,18 +2542,21 @@ export type TapToEditProps =
|
|
|
2526
2542
|
|
|
2527
2543
|
export interface BaseTapToEditProps extends Omit<FieldProps, "onChange" | "value"> {
|
|
2528
2544
|
title: string;
|
|
2545
|
+
// noExplicitAny: value type varies across TapToEdit field types (text, number, date, etc.)
|
|
2529
2546
|
// biome-ignore lint/suspicious/noExplicitAny: value type varies across TapToEdit field types (text, number, date, etc.)
|
|
2530
2547
|
value: any;
|
|
2531
2548
|
|
|
2532
2549
|
/**
|
|
2533
2550
|
* Not required if not editable.
|
|
2534
2551
|
*/
|
|
2552
|
+
// noExplicitAny: value type varies across TapToEdit field types
|
|
2535
2553
|
// biome-ignore lint/suspicious/noExplicitAny: value type varies across TapToEdit field types
|
|
2536
2554
|
setValue?: (value: any) => void;
|
|
2537
2555
|
|
|
2538
2556
|
/**
|
|
2539
2557
|
* Not required if not editable.
|
|
2540
2558
|
*/
|
|
2559
|
+
// noExplicitAny: value type varies across TapToEdit field types
|
|
2541
2560
|
// biome-ignore lint/suspicious/noExplicitAny: value type varies across TapToEdit field types
|
|
2542
2561
|
onSave?: (value: any) => void | Promise<void>;
|
|
2543
2562
|
|
|
@@ -2551,6 +2570,7 @@ export interface BaseTapToEditProps extends Omit<FieldProps, "onChange" | "value
|
|
|
2551
2570
|
* Enable edit mode from outside the component.
|
|
2552
2571
|
*/
|
|
2553
2572
|
isEditing?: boolean;
|
|
2573
|
+
// noExplicitAny: input value type varies across TapToEdit field types
|
|
2554
2574
|
// biome-ignore lint/suspicious/noExplicitAny: input value type varies across TapToEdit field types
|
|
2555
2575
|
transform?: (value: any) => string;
|
|
2556
2576
|
/**
|
|
@@ -2640,11 +2660,13 @@ export interface ModelFields {
|
|
|
2640
2660
|
|
|
2641
2661
|
export interface OpenAPISpec {
|
|
2642
2662
|
paths: {
|
|
2663
|
+
// noExplicitAny: OpenAPI path items are deeply accessed with chained property lookups
|
|
2643
2664
|
// biome-ignore lint/suspicious/noExplicitAny: OpenAPI path items are deeply accessed with chained property lookups
|
|
2644
2665
|
[key: string]: any;
|
|
2645
2666
|
};
|
|
2646
2667
|
}
|
|
2647
2668
|
|
|
2669
|
+
// noExplicitAny: ModelFieldConfig is a passthrough for arbitrary field configuration objects from various model contexts
|
|
2648
2670
|
// biome-ignore lint/suspicious/noExplicitAny: ModelFieldConfig is a passthrough for arbitrary field configuration objects from various model contexts
|
|
2649
2671
|
export type ModelFieldConfig = any;
|
|
2650
2672
|
|
|
@@ -2674,6 +2696,7 @@ export interface ModelAdminFieldConfig {
|
|
|
2674
2696
|
|
|
2675
2697
|
// The props for a custom column component for ModelAdmin.
|
|
2676
2698
|
export interface ModelAdminCustomComponentProps extends Omit<FieldProps, "name"> {
|
|
2699
|
+
// noExplicitAny: document shape varies by model used with ModelAdmin
|
|
2677
2700
|
// biome-ignore lint/suspicious/noExplicitAny: document shape varies by model used with ModelAdmin
|
|
2678
2701
|
doc: any;
|
|
2679
2702
|
fieldKey: string; // Dot notation representation of the field.
|
|
@@ -2844,12 +2867,13 @@ export interface SelectFieldPropsBase extends WithTestID {
|
|
|
2844
2867
|
placeholder?: string;
|
|
2845
2868
|
|
|
2846
2869
|
/**
|
|
2847
|
-
* When true,
|
|
2870
|
+
* When true, hides the type-to-filter search UI. On web, search normally happens
|
|
2848
2871
|
* in the trigger field; on native, search appears in the dropdown menu and
|
|
2849
|
-
* Android uses a centered modal similar to the platform picker.
|
|
2850
|
-
*
|
|
2872
|
+
* Android uses a centered modal similar to the platform picker. Search is enabled
|
|
2873
|
+
* by default.
|
|
2874
|
+
* @default false
|
|
2851
2875
|
*/
|
|
2852
|
-
|
|
2876
|
+
disableSearch?: boolean;
|
|
2853
2877
|
|
|
2854
2878
|
/**
|
|
2855
2879
|
* The title of the select field.
|
package/src/ConsentNavigator.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import type {SubmitConsentBody} from "./useSubmitConsent";
|
|
|
10
10
|
import {useSubmitConsent} from "./useSubmitConsent";
|
|
11
11
|
|
|
12
12
|
interface ConsentNavigatorProps {
|
|
13
|
+
// noExplicitAny: RTK Query api instance is a complex generic type that varies per consumer
|
|
13
14
|
// biome-ignore lint/suspicious/noExplicitAny: RTK Query api instance is a complex generic type that varies per consumer
|
|
14
15
|
api: any;
|
|
15
16
|
baseUrl?: string;
|
|
@@ -87,12 +87,7 @@ describe("CustomSelectField", () => {
|
|
|
87
87
|
it("shows custom input when 'custom' is selected from dropdown", async () => {
|
|
88
88
|
const onChange = mock(() => {});
|
|
89
89
|
const {getByTestId, queryByPlaceholderText} = renderWithTheme(
|
|
90
|
-
<CustomSelectField
|
|
91
|
-
onChange={onChange}
|
|
92
|
-
options={defaultOptions}
|
|
93
|
-
searchable={false}
|
|
94
|
-
value="a"
|
|
95
|
-
/>
|
|
90
|
+
<CustomSelectField disableSearch onChange={onChange} options={defaultOptions} value="a" />
|
|
96
91
|
);
|
|
97
92
|
|
|
98
93
|
const picker = getByTestId("ios_picker");
|
|
@@ -112,9 +107,9 @@ describe("CustomSelectField", () => {
|
|
|
112
107
|
// Start with a custom value so custom input is already shown
|
|
113
108
|
const {getByTestId, queryByPlaceholderText} = renderWithTheme(
|
|
114
109
|
<CustomSelectField
|
|
110
|
+
disableSearch
|
|
115
111
|
onChange={onChange}
|
|
116
112
|
options={defaultOptions}
|
|
117
|
-
searchable={false}
|
|
118
113
|
value="my-custom-value"
|
|
119
114
|
/>
|
|
120
115
|
);
|
|
@@ -134,7 +129,7 @@ describe("CustomSelectField", () => {
|
|
|
134
129
|
it("calls onChange with selected value for a regular option", async () => {
|
|
135
130
|
const onChange = mock(() => {});
|
|
136
131
|
const {getByTestId} = renderWithTheme(
|
|
137
|
-
<CustomSelectField onChange={onChange} options={defaultOptions}
|
|
132
|
+
<CustomSelectField disableSearch onChange={onChange} options={defaultOptions} value="" />
|
|
138
133
|
);
|
|
139
134
|
|
|
140
135
|
const picker = getByTestId("ios_picker");
|
|
@@ -18,7 +18,7 @@ export const CustomSelectField: FC<CustomSelectFieldProps> = ({
|
|
|
18
18
|
helperText,
|
|
19
19
|
testID,
|
|
20
20
|
testIDs,
|
|
21
|
-
|
|
21
|
+
disableSearch,
|
|
22
22
|
}) => {
|
|
23
23
|
const [currentValue, setCurrentValue] = useState(value);
|
|
24
24
|
const [showCustomInput, setShowCustomInput] = useState(false);
|
|
@@ -87,11 +87,11 @@ export const CustomSelectField: FC<CustomSelectFieldProps> = ({
|
|
|
87
87
|
>
|
|
88
88
|
<SelectField
|
|
89
89
|
disabled={disabled}
|
|
90
|
+
disableSearch={disableSearch}
|
|
90
91
|
errorText={errorText}
|
|
91
92
|
onChange={handleCustomSelectListChange}
|
|
92
93
|
options={[...options, {label: "Custom", value: "custom"}]}
|
|
93
94
|
placeholder={placeholder}
|
|
94
|
-
searchable={searchable}
|
|
95
95
|
testID={fieldTestIDs.input}
|
|
96
96
|
testIDs={testIDs}
|
|
97
97
|
title={title}
|
package/src/DataTable.test.tsx
CHANGED
package/src/DateTimeField.tsx
CHANGED
|
@@ -424,6 +424,7 @@ export const DateTimeField: FC<DateTimeFieldProps> = ({
|
|
|
424
424
|
}): React.ReactElement => {
|
|
425
425
|
const {theme} = useTheme();
|
|
426
426
|
const fieldTestIDs = resolveFieldTestIDsFromProps({testID, testIDs});
|
|
427
|
+
// noExplicitAny: ActionSheet class is defined in ActionSheet.tsx which imports from Common.ts indirectly; using its type here would create a circular dependency
|
|
427
428
|
// biome-ignore lint/suspicious/noExplicitAny: ActionSheet class is defined in ActionSheet.tsx which imports from Common.ts indirectly; using its type here would create a circular dependency
|
|
428
429
|
const dateActionSheetRef: React.RefObject<any> = React.createRef();
|
|
429
430
|
const [amPm, setAmPm] = useState<"am" | "pm">("am");
|
package/src/EmailField.tsx
CHANGED
|
@@ -36,7 +36,7 @@ export const EmailField: FC<EmailFieldProps> = ({
|
|
|
36
36
|
setLocalValue(e);
|
|
37
37
|
const err = validateEmail(e);
|
|
38
38
|
// remove error if valid email
|
|
39
|
-
if (!err &&
|
|
39
|
+
if (!err && localError) {
|
|
40
40
|
setLocalError(undefined);
|
|
41
41
|
}
|
|
42
42
|
if (!err && onChange) {
|