@australiangreens/ag-internal-components 0.3.1 → 0.3.2
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts +20 -2
- package/dist/components/FetchAutocomplete/FetchAutocomplete.d.ts.map +1 -1
- package/dist/components/FetchAutocomplete/const.d.ts +16 -0
- package/dist/components/FetchAutocomplete/const.d.ts.map +1 -0
- package/dist/components/SingleAutocomplete/index.d.ts +8 -1
- package/dist/components/SingleAutocomplete/index.d.ts.map +1 -1
- package/dist/esm/index.js +669 -612
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SxProps, Theme } from '@mui/material';
|
|
1
|
+
import { SxProps, Theme, TooltipProps } from '@mui/material';
|
|
2
2
|
import { ReactNode, SyntheticEvent } from 'react';
|
|
3
3
|
import { AutocompleteGenericEntity, FetchAutocompleteChangeReason } from '../types';
|
|
4
4
|
export declare const useAutocompleteOptions: <EntityType extends AutocompleteGenericEntity>({ minLength, preLoadedOptions, lookup, label, inputValue, }: {
|
|
@@ -55,11 +55,29 @@ export type FetchAutocompleteProps<EntityType extends AutocompleteGenericEntity>
|
|
|
55
55
|
textFieldVariant?: 'filled' | 'outlined' | 'standard';
|
|
56
56
|
boxSx?: SxProps<Theme>;
|
|
57
57
|
disableIconFlip?: boolean;
|
|
58
|
+
chipToolTipSlotProps?: TooltipProps['slotProps'];
|
|
59
|
+
isPlaceholder?: boolean;
|
|
60
|
+
placeHolderText?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Called when a right click is detected.
|
|
63
|
+
*/
|
|
64
|
+
onRightClick?: (event: React.MouseEvent) => void;
|
|
65
|
+
/**
|
|
66
|
+
* If set to true, the default right click behaviour will be overridden: the
|
|
67
|
+
* dropdown/prompt will not appear and neither will the browser context menu.
|
|
68
|
+
*
|
|
69
|
+
* Use in combination with onRightClick to override the behaviour.
|
|
70
|
+
*
|
|
71
|
+
* Note: This can't just be done by passing through onRightClick having it
|
|
72
|
+
* prevent the event default, because there are two events that need to be
|
|
73
|
+
* listened for.
|
|
74
|
+
*/
|
|
75
|
+
disableDefaultRightClickBehaviour?: boolean;
|
|
58
76
|
};
|
|
59
77
|
/**
|
|
60
78
|
* A wrapper around MUI's Autocomplete component, specifically for use with live
|
|
61
79
|
* as-you-type fetching from an api and styled the way we want it across the app
|
|
62
80
|
* by default.
|
|
63
81
|
*/
|
|
64
|
-
export default function FetchAutocomplete<EntityType extends AutocompleteGenericEntity>({ lookup, enableHighlighting, onChange, minLength, label, value, 'data-testid': dataTestId, sx, boxSx, textFieldColor, textFieldVariant, loadingText, noOptionsText, popupIcon, error, helperText, preLoadedOptions, disablePortal, disableIconFlip, }: FetchAutocompleteProps<EntityType>): import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export default function FetchAutocomplete<EntityType extends AutocompleteGenericEntity>({ lookup, enableHighlighting, onChange, minLength, label, value, 'data-testid': dataTestId, sx, boxSx, textFieldColor, textFieldVariant, loadingText, noOptionsText, popupIcon, error, helperText, preLoadedOptions, disablePortal, disableIconFlip, chipToolTipSlotProps, isPlaceholder, placeHolderText, onRightClick, disableDefaultRightClickBehaviour, }: FetchAutocompleteProps<EntityType>): import("react/jsx-runtime").JSX.Element;
|
|
65
83
|
//# sourceMappingURL=FetchAutocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchAutocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/FetchAutocomplete/FetchAutocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,OAAO,EAEP,KAAK,
|
|
1
|
+
{"version":3,"file":"FetchAutocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/FetchAutocomplete/FetchAutocomplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,OAAO,EAEP,KA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AAC,UAAU,CAAC,2CAmMpC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DEFAULT_CHIP_TOOL_TIP_SLOT_PROPS: {
|
|
2
|
+
popper: {
|
|
3
|
+
modifiers: {
|
|
4
|
+
name: string;
|
|
5
|
+
options: {
|
|
6
|
+
offset: number[];
|
|
7
|
+
};
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const MOUSE_EVENT_BUTTONS: {
|
|
12
|
+
left: number;
|
|
13
|
+
middle: number;
|
|
14
|
+
right: number;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/components/FetchAutocomplete/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC;;;;;;;;;CAW5C,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC"}
|
|
@@ -50,7 +50,14 @@ type Props<EntityType extends AutocompleteGenericEntity> = {
|
|
|
50
50
|
disabled?: boolean;
|
|
51
51
|
popupIcon?: ReactNode;
|
|
52
52
|
disableIconFlip?: boolean;
|
|
53
|
+
isPlaceholder?: boolean;
|
|
54
|
+
placeHolderText?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Called when a right click is detected.
|
|
57
|
+
*/
|
|
58
|
+
onRightClick?: (event: React.MouseEvent) => void;
|
|
59
|
+
disableDefaultRightClickBehaviour?: boolean;
|
|
53
60
|
};
|
|
54
|
-
declare const SingleAutocomplete: <EntityType extends AutocompleteGenericEntity>({ lookup, onChange, label, value, sx, textFieldColor, textFieldVariant, error, "data-testid": dataTestId, noOptionsText, minLength, disablePortal, preLoadedOptions, helperText, disabled, popupIcon, disableIconFlip, }: Props<EntityType>) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
declare const SingleAutocomplete: <EntityType extends AutocompleteGenericEntity>({ lookup, onChange, label, value, sx, textFieldColor, textFieldVariant, error, "data-testid": dataTestId, noOptionsText, minLength, disablePortal, preLoadedOptions, helperText, disabled, popupIcon, disableIconFlip, isPlaceholder, placeHolderText, onRightClick, disableDefaultRightClickBehaviour, }: Props<EntityType>) => import("react/jsx-runtime").JSX.Element;
|
|
55
62
|
export default SingleAutocomplete;
|
|
56
63
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SingleAutocomplete/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAExB,OAAO,EAEP,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SingleAutocomplete/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EAExB,OAAO,EAEP,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;AAG5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,QAA4C,CAAC;AAE9F,KAAK,KAAK,CAAC,UAAU,SAAS,yBAAyB,IAAI;IACzD;;;;;OAKG;IACH,QAAQ,EAAE,CACR,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EACrC,QAAQ,EAAE,UAAU,GAAG,IAAI,EAC3B,MAAM,EAAE,wBAAwB,KAC7B,OAAO,CAAC;IACb,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IAEd,qFAAqF;IACrF,MAAM,CAAC,EAAE,CAAC,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