@uniformdev/mesh-sdk-react 19.141.1-alpha.5 → 19.142.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/index.d.mts +509 -137
- package/dist/index.d.ts +509 -137
- package/dist/index.esm.js +2057 -607
- package/dist/index.js +2127 -655
- package/dist/index.mjs +2057 -607
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ import { DynamicInputs, MeshLocation, SetValueOptions, EditConnectedDataResponse
|
|
|
9
9
|
export * from '@uniformdev/mesh-sdk';
|
|
10
10
|
import { DataVariableDefinition, DataResourceVariables, DataType } from '@uniformdev/canvas';
|
|
11
11
|
import { Emitter } from 'mitt';
|
|
12
|
-
import { BadgeThemeProps, InputSelectProps,
|
|
12
|
+
import { BadgeThemeProps, InputSelectProps, IconType } from '@uniformdev/design-system';
|
|
13
13
|
export { AddListButton, AddListButtonProps, Button, ButtonProps, Callout, CalloutProps, DrawerContent, Heading, HeadingProps, Input, InputComboBox, InputComboBoxProps, InputKeywordSearch, InputProps, InputSelect, InputToggle, InputToggleProps, Label, LabelProps, LoadingIndicator, LoadingOverlay, Menu, MenuItem, MenuItemProps, MenuProps, ParameterGroup, ParameterGroupProps, ParameterImage, ParameterImageInner, ParameterImageProps, ParameterInput, ParameterInputInner, ParameterInputProps, ParameterLabel, ParameterLabelProps, ParameterMenuButton, ParameterMenuButtonProps, ParameterSelect, ParameterSelectInner, ParameterSelectProps, ParameterShell, ParameterShellContext, ParameterShellProps, ParameterTextarea, ParameterTextareaInner, ParameterTextareaProps, ParameterToggle, ParameterToggleInner, ParameterToggleProps, ScrollableList, ScrollableListItem, ScrollableListItemProps, ScrollableListProps, Switch, SwitchProps, Textarea, TextareaProps, Theme, ThemeProps, useParameterShell } from '@uniformdev/design-system';
|
|
14
14
|
import * as lexical from 'lexical';
|
|
15
15
|
import { SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode, NodeKey, LexicalNode, LexicalEditor, EditorState } from 'lexical';
|
|
@@ -391,8 +391,6 @@ type DataResourceDynamicInputProviderProps = {
|
|
|
391
391
|
/** Child components of the provider. Variables-using components, such as InputVariables, can be used here. */
|
|
392
392
|
children: ReactNode;
|
|
393
393
|
};
|
|
394
|
-
declare const DataResourceInputContext: React$1.Context<DynamicInputs | undefined>;
|
|
395
|
-
declare const useDataResourceDynamicInputs: () => DynamicInputs | undefined;
|
|
396
394
|
/**
|
|
397
395
|
* Wrapper for data resource locations. Provides read-only access to dynamic inputs as if they were variables,
|
|
398
396
|
* using variables-aware components (i.e. InputVariables). This simplifies building dynamic-input-aware editors,
|
|
@@ -514,7 +512,7 @@ type VariableNodeState = {
|
|
|
514
512
|
* Note that this is ignored if `isFresh` is true, which is set for the result of edits or insertions
|
|
515
513
|
* made after the editor has mounted (which we know are good and don't validate to prevent flicker or false errors)
|
|
516
514
|
*/
|
|
517
|
-
referenceIsValid: boolean | 'info';
|
|
515
|
+
referenceIsValid: boolean | 'info' | 'warning';
|
|
518
516
|
/**
|
|
519
517
|
* Whether the variable node has been inserted or edited during this editing session
|
|
520
518
|
* Fresh nodes are always considered "valid" because they are the result of a user action
|
|
@@ -604,6 +602,7 @@ type MeshDataVariableDefinition = Omit<DataVariableDefinition, 'default'> & {
|
|
|
604
602
|
type KnownUndefinedVariableInfo = {
|
|
605
603
|
error?: string;
|
|
606
604
|
info?: string;
|
|
605
|
+
warning?: string;
|
|
607
606
|
displayName?: string;
|
|
608
607
|
};
|
|
609
608
|
type DataVariableDefinitionWithName = {
|
|
@@ -615,9 +614,25 @@ type DataVariableDefinitionWithName = {
|
|
|
615
614
|
*/
|
|
616
615
|
declare function variablesToList(variables: Record<string, MeshDataVariableDefinition> | undefined): Array<DataVariableDefinitionWithName>;
|
|
617
616
|
|
|
617
|
+
type KnownUndefinedVariableInfoWithName = KnownUndefinedVariableInfo & {
|
|
618
|
+
name: string;
|
|
619
|
+
resultType: 'undefined';
|
|
620
|
+
};
|
|
621
|
+
type VariableEditorProps<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = {
|
|
622
|
+
variable: string;
|
|
623
|
+
onSubmit: (values: DataVariableDefinitionWithName | KnownUndefinedVariableInfoWithName, context: TEditVariableCompletedContext) => void | Promise<void>;
|
|
624
|
+
/** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
|
|
625
|
+
disableMeshTip?: boolean;
|
|
626
|
+
onCancel: (context: TEditVariableCancelledContext) => void;
|
|
627
|
+
context: TEditorContext | undefined;
|
|
628
|
+
disableAutoFocusOnMount?: boolean;
|
|
629
|
+
showDisplayName?: boolean;
|
|
630
|
+
};
|
|
631
|
+
declare function VariableEditor({ variable, onSubmit, onCancel, showDisplayName, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
632
|
+
|
|
618
633
|
type SelectVariableMenuProps<TEditorContext = undefined> = {
|
|
619
634
|
/** sets the onClick menu item event. Also called if the menu adds a variable with the newly added variable. */
|
|
620
|
-
onSelectVariable: (selectedVariable: DataVariableDefinitionWithName) => void;
|
|
635
|
+
onSelectVariable: (selectedVariable: DataVariableDefinitionWithName | KnownUndefinedVariableInfoWithName) => void;
|
|
621
636
|
/** Controls whether one can add variables from the menu */
|
|
622
637
|
showAddVariableMenuOption?: boolean | string;
|
|
623
638
|
/** Emotion styles to apply to the menu trigger icon button */
|
|
@@ -786,6 +801,12 @@ type InputVariablesProps<TEditorContext = unknown> = {
|
|
|
786
801
|
* @deprecated this is ignored if passed, computation is now automatic
|
|
787
802
|
*/
|
|
788
803
|
disableReset?: boolean;
|
|
804
|
+
/**
|
|
805
|
+
* By default when keyDown happens in the variables input, any active variable editor is dismissed automatically.
|
|
806
|
+
* This makes sense, until you want to put a variables input _into_ a variables editor component. In that case,
|
|
807
|
+
* disable it with this prop.
|
|
808
|
+
*/
|
|
809
|
+
disableDismissEditorOnChange?: boolean;
|
|
789
810
|
/** Enables mutliple lines in the input (\n in the value) */
|
|
790
811
|
multiLine?: boolean;
|
|
791
812
|
/** Disables the inline variable selection menu when rendering a variables input */
|
|
@@ -908,18 +929,6 @@ type ParameterVariablesProps<TEditorContext = unknown> = {
|
|
|
908
929
|
*/
|
|
909
930
|
declare function ParameterVariables<TEditorContext = unknown>(props: ParameterVariablesProps<TEditorContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
910
931
|
|
|
911
|
-
type VariableEditorProps<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = {
|
|
912
|
-
variable: string;
|
|
913
|
-
onSubmit: (values: DataVariableDefinitionWithName, context: TEditVariableCompletedContext) => void | Promise<void>;
|
|
914
|
-
/** Disables the tip about Mesh integrations. Intended for use when this is placed on a custom Mesh integration to edit variables. */
|
|
915
|
-
disableMeshTip?: boolean;
|
|
916
|
-
onCancel: (context: TEditVariableCancelledContext) => void;
|
|
917
|
-
context: TEditorContext | undefined;
|
|
918
|
-
disableAutoFocusOnMount?: boolean;
|
|
919
|
-
showDisplayName?: boolean;
|
|
920
|
-
};
|
|
921
|
-
declare function VariableEditor({ variable, onSubmit, onCancel, showDisplayName, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
922
|
-
|
|
923
932
|
type VariablesProviderProps<TEditVariableContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = React.PropsWithChildren<{
|
|
924
933
|
/**
|
|
925
934
|
* Signals that components in this variables context are not intended to allow mutation
|
|
@@ -939,6 +948,14 @@ type VariablesProviderProps<TEditVariableContext = unknown, TEditVariableComplet
|
|
|
939
948
|
knownUndefinedValues?: Record<string, KnownUndefinedVariableInfo>;
|
|
940
949
|
/** Function to handle mutations to the variable values (optional when readOnly is true) */
|
|
941
950
|
onChange?: (newValue: Record<string, MeshDataVariableDefinition>) => void;
|
|
951
|
+
/**
|
|
952
|
+
* Called when a custom editVariableComponent signals that it wants to add a known undefined value to the variable context
|
|
953
|
+
* instead of a valid variable. This is useful when the variable editor component may be allowed to select invalid values that should produce
|
|
954
|
+
* warning or info messages when referenced, rather than being treated as an error.
|
|
955
|
+
*
|
|
956
|
+
* The caller must wire up the logic to pass back new `knownUndefinedValues` after they are modified.
|
|
957
|
+
*/
|
|
958
|
+
onChangeKnownUndefinedValue?: (name: string, value: KnownUndefinedVariableInfo) => void;
|
|
942
959
|
/**
|
|
943
960
|
* Provide a component to handle editing a variable definition (e.g. a modal wrapper)
|
|
944
961
|
* If not passed, the editor will be rendered inline, with potentially strange results.
|
|
@@ -975,7 +992,7 @@ type VariablesAction<TEditVariableContext> = {
|
|
|
975
992
|
type VariableEditorCompleteEvent<TEditVariableCompletedContext, TEditVariableCancelledContext> = {
|
|
976
993
|
canceled: false;
|
|
977
994
|
/** Selected variable */
|
|
978
|
-
selectedVariable: DataVariableDefinitionWithName;
|
|
995
|
+
selectedVariable: DataVariableDefinitionWithName | KnownUndefinedVariableInfoWithName;
|
|
979
996
|
/**
|
|
980
997
|
* Arbitrary object that was returned by the variables editor component's onSubmit
|
|
981
998
|
* Can be used to convey context data about the submit from custom editor components
|
|
@@ -1037,7 +1054,7 @@ type VariablesContext<TEditVariableContext, TEditVariableCompletedContext, TEdit
|
|
|
1037
1054
|
*/
|
|
1038
1055
|
isLoading: boolean;
|
|
1039
1056
|
};
|
|
1040
|
-
declare function VariablesProvider<TEditComponentContext = never, TEditVariableCompletedContext = never, TEditVariableCancelledContext = never>({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, }: VariablesProviderProps<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1057
|
+
declare function VariablesProvider<TEditComponentContext = never, TEditVariableCompletedContext = never, TEditVariableCancelledContext = never>({ value, onChange, editVariableComponent, readOnly, isLoading, children, knownUndefinedValues, onChangeKnownUndefinedValue, }: VariablesProviderProps<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1041
1058
|
declare function useVariables<TEditComponentContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown>(returnEmptyWithoutProvider?: boolean): VariablesContext<TEditComponentContext, TEditVariableCompletedContext, TEditVariableCancelledContext>;
|
|
1042
1059
|
|
|
1043
1060
|
declare function useVariableEditor<TEditorContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown>(): {
|
|
@@ -1206,11 +1223,57 @@ type ObjectSearchContainerProps = {
|
|
|
1206
1223
|
};
|
|
1207
1224
|
/**
|
|
1208
1225
|
* @description Object search container is an opinionated layout for search parameters and retrieved results
|
|
1209
|
-
* @example <ObjectSearchContainer searchFilters={<>your component</>} resultList={<>your result list component<>} onSave={yourSaveAction} onCancel={yourCancelAction} />
|
|
1210
|
-
* @deprecated Please use ControlledObjectSearchProvider with SearchAndFilter instead. You can use Mesh Example for reference.
|
|
1211
|
-
*/
|
|
1226
|
+
* @example <ObjectSearchContainer searchFilters={<>your component</>} resultList={<>your result list component<>} onSave={yourSaveAction} onCancel={yourCancelAction} /> */
|
|
1212
1227
|
declare const ObjectSearchContainer: ({ label, enableDynamicInputToResultId, searchFilters, resultList, children, }: ObjectSearchContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1213
1228
|
|
|
1229
|
+
type ObjectSearchFilterProps = {
|
|
1230
|
+
/** shows or hides the required content type select option */
|
|
1231
|
+
requireContentType?: boolean;
|
|
1232
|
+
/** sets the text for the required content type select option
|
|
1233
|
+
* @default 'All content types'
|
|
1234
|
+
*/
|
|
1235
|
+
typeSelectorAllTypesOptionText?: string;
|
|
1236
|
+
/** sets the select input value label text
|
|
1237
|
+
* @default 'Content Type Select'
|
|
1238
|
+
*/
|
|
1239
|
+
selectLabel?: string;
|
|
1240
|
+
/** sets the select input options, if empty - only keyword search field will be rendered */
|
|
1241
|
+
selectOptions?: Array<{
|
|
1242
|
+
id?: string;
|
|
1243
|
+
name?: string;
|
|
1244
|
+
label: string;
|
|
1245
|
+
value?: string;
|
|
1246
|
+
}>;
|
|
1247
|
+
/** sets the search input name value
|
|
1248
|
+
* @default 'searchText'
|
|
1249
|
+
*/
|
|
1250
|
+
searchInputName?: string;
|
|
1251
|
+
/** sets the search input placeholder text
|
|
1252
|
+
* @default 'Enter keyword to narrow your results'
|
|
1253
|
+
*/
|
|
1254
|
+
searchInputPlaceholderText?: string;
|
|
1255
|
+
};
|
|
1256
|
+
/**
|
|
1257
|
+
* @description Object search filter is an opinionated filter that has pre-defined query and setQuery functions
|
|
1258
|
+
* that can be extended with custom functions
|
|
1259
|
+
* @example <ObjectSearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} /> */
|
|
1260
|
+
declare const ObjectSearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, selectOptions, }: ObjectSearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1261
|
+
|
|
1262
|
+
type ObjectSearchFilterContainerProps = {
|
|
1263
|
+
/**
|
|
1264
|
+
* sets the title for the container
|
|
1265
|
+
* @deprecated we recommend setting the label on ObjectSearchContainer instead
|
|
1266
|
+
*/
|
|
1267
|
+
label?: string;
|
|
1268
|
+
/** sets child components in an opinionated layout */
|
|
1269
|
+
children?: React.ReactNode;
|
|
1270
|
+
};
|
|
1271
|
+
/**
|
|
1272
|
+
* @description an opinionated layout for search filters
|
|
1273
|
+
* @example <ObjectSearchFilterContainer label="my label"><input type="text" aria-label="my input" /></ObjectSearchFilterContainer>
|
|
1274
|
+
*/
|
|
1275
|
+
declare const ObjectSearchFilterContainer: ({ label, children }: ObjectSearchFilterContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1276
|
+
|
|
1214
1277
|
type SearchQueryProps<TExtraFilters = unknown> = {
|
|
1215
1278
|
/** sets the content type in the search context */
|
|
1216
1279
|
contentType?: string;
|
|
@@ -1218,7 +1281,6 @@ type SearchQueryProps<TExtraFilters = unknown> = {
|
|
|
1218
1281
|
keyword?: string;
|
|
1219
1282
|
/** sets the locale in the search context */
|
|
1220
1283
|
locale?: string;
|
|
1221
|
-
dynamicEntryId?: string;
|
|
1222
1284
|
} & TExtraFilters;
|
|
1223
1285
|
type SelectedItemProps<TExtraProps = unknown> = {
|
|
1224
1286
|
/** sets the id value */
|
|
@@ -1288,105 +1350,18 @@ type ObjectSearchContextProps<TExtraFilters = unknown, TExtraItemProps = unknown
|
|
|
1288
1350
|
/** current list of results in state */
|
|
1289
1351
|
list: ItemListProps<TExtraItemProps>;
|
|
1290
1352
|
/** function that sets the list of items to state */
|
|
1291
|
-
onSetList
|
|
1353
|
+
onSetList: (value: ItemListProps) => void;
|
|
1292
1354
|
/** is multi items selection allowed or not */
|
|
1293
1355
|
isMulti: boolean;
|
|
1294
|
-
/** Locale options for filtering. Will be picked up and render inside default ObjectSearchFilter implementation */
|
|
1295
|
-
localeOptions?: {
|
|
1296
|
-
label: string;
|
|
1297
|
-
value: string;
|
|
1298
|
-
}[];
|
|
1299
|
-
/** For backwards compatibility you need to explicitly enable default locale filter. */
|
|
1300
|
-
enableFilterByLocale?: boolean;
|
|
1301
|
-
/** Indicator of weather or not render loader for search results list */
|
|
1302
|
-
isListLoading?: boolean;
|
|
1303
|
-
/** Indicator of weather or not render loader for selected items list */
|
|
1304
|
-
isSelectedItemsListLoading?: boolean;
|
|
1305
|
-
/**
|
|
1306
|
-
* Dynamic entry id for dynamic entry filtering, if instead of static entry being selected - bound dynamic value is being used.
|
|
1307
|
-
* You can use `import { hasReferencedVariables } from '@uniformdev/mesh-sdk-react';` to check if you value contains variable.
|
|
1308
|
-
* */
|
|
1309
|
-
dynamicEntryId?: string;
|
|
1310
1356
|
};
|
|
1311
|
-
declare const ObjectSearchContext: React$1.Context<ObjectSearchContextProps<unknown, unknown>>;
|
|
1312
1357
|
type ObjectSearchProviderProps = {
|
|
1313
1358
|
children: ReactNode;
|
|
1314
1359
|
currentlySelectedItems?: Array<SelectedItemProps>;
|
|
1315
|
-
searchResultList?: Array<SelectedItemProps>;
|
|
1316
1360
|
isMulti?: boolean;
|
|
1317
1361
|
defaultQuery?: SearchQueryProps;
|
|
1318
1362
|
};
|
|
1319
|
-
/**
|
|
1320
|
-
* @deprecated Please use ControlledObjectSearchProvider with SearchAndFilter instead. You can use Mesh Example for reference.
|
|
1321
|
-
*/
|
|
1322
1363
|
declare const ObjectSearchProvider: ({ currentlySelectedItems, isMulti, children, defaultQuery, }: ObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1323
1364
|
declare function useObjectSearchContext<TExtraSearchFilters = unknown, TExtraItemProps = unknown>(): ObjectSearchContextProps<TExtraSearchFilters, TExtraItemProps>;
|
|
1324
|
-
declare function bindQuery(query: SearchQueryProps, inputs: Record<string, unknown>): {
|
|
1325
|
-
/** sets the content type in the search context */
|
|
1326
|
-
contentType?: string | undefined;
|
|
1327
|
-
/** sets the keyword search in the search context */
|
|
1328
|
-
keyword?: string | undefined;
|
|
1329
|
-
/** sets the locale in the search context */
|
|
1330
|
-
locale?: string | undefined;
|
|
1331
|
-
dynamicEntryId?: string | undefined;
|
|
1332
|
-
};
|
|
1333
|
-
|
|
1334
|
-
type ObjectSearchFilterProps = {
|
|
1335
|
-
/** shows or hides the required content type select option */
|
|
1336
|
-
requireContentType?: boolean;
|
|
1337
|
-
/** sets the text for the required content type select option
|
|
1338
|
-
* @default 'All content types'
|
|
1339
|
-
*/
|
|
1340
|
-
typeSelectorAllTypesOptionText?: string;
|
|
1341
|
-
/** sets the select input value label text
|
|
1342
|
-
* @default 'Content Type Select'
|
|
1343
|
-
*/
|
|
1344
|
-
selectLabel?: string;
|
|
1345
|
-
/** sets the select input options, if empty - only keyword search field will be rendered */
|
|
1346
|
-
selectOptions?: Array<{
|
|
1347
|
-
id?: string;
|
|
1348
|
-
name?: string;
|
|
1349
|
-
label: string;
|
|
1350
|
-
value?: string;
|
|
1351
|
-
}>;
|
|
1352
|
-
/** sets the search input name value
|
|
1353
|
-
* @default 'searchText'
|
|
1354
|
-
*/
|
|
1355
|
-
searchInputName?: string;
|
|
1356
|
-
/** sets the search input placeholder text
|
|
1357
|
-
* @default 'Enter keyword to narrow your results'
|
|
1358
|
-
*/
|
|
1359
|
-
searchInputPlaceholderText?: string;
|
|
1360
|
-
/** sets the label for the locale selectbox filter */
|
|
1361
|
-
localeFilterLabel?: string;
|
|
1362
|
-
/** sets the locale options for the locale selectbox filter */
|
|
1363
|
-
localeOptions?: ObjectSearchContextProps['localeOptions'];
|
|
1364
|
-
/** enables or disables the locale filter */
|
|
1365
|
-
enableFilterByLocale?: ObjectSearchContextProps['enableFilterByLocale'];
|
|
1366
|
-
};
|
|
1367
|
-
/**
|
|
1368
|
-
* @description Object search filter is an opinionated filter that has pre-defined query and setQuery functions
|
|
1369
|
-
* that can be extended with custom functions
|
|
1370
|
-
* @example <ObjectSearchFilter selectOptions={[{ id: 'id value', name: 'name value'}]} />
|
|
1371
|
-
* @deprecated Please use SearchAndFilter from @uniformdev/design-system instead.
|
|
1372
|
-
*/
|
|
1373
|
-
declare const ObjectSearchFilter: ({ requireContentType, typeSelectorAllTypesOptionText, searchInputName, searchInputPlaceholderText, selectLabel, localeFilterLabel, selectOptions, }: ObjectSearchFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1374
|
-
|
|
1375
|
-
type ObjectSearchFilterContainerProps = {
|
|
1376
|
-
/**
|
|
1377
|
-
* sets the title for the container
|
|
1378
|
-
* @deprecated we recommend setting the label on ObjectSearchContainer instead
|
|
1379
|
-
*/
|
|
1380
|
-
label?: string;
|
|
1381
|
-
/** sets child components in an opinionated layout */
|
|
1382
|
-
children?: React.ReactNode;
|
|
1383
|
-
};
|
|
1384
|
-
/**
|
|
1385
|
-
* @description an opinionated layout for search filters
|
|
1386
|
-
* @example <ObjectSearchFilterContainer label="my label"><input type="text" aria-label="my input" /></ObjectSearchFilterContainer>
|
|
1387
|
-
* @deprecated Please use SearchAndFilter from @uniformdev/design-system instead.
|
|
1388
|
-
*/
|
|
1389
|
-
declare const ObjectSearchFilterContainer: ({ label, children }: ObjectSearchFilterContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1390
1365
|
|
|
1391
1366
|
type ObjectSearchListItemProps = SelectedItemProps & {
|
|
1392
1367
|
/** sets the content type value, this is normally used for subtitles e.g. Kitchens */
|
|
@@ -1425,7 +1400,7 @@ type ObjectSearchListItemProps = SelectedItemProps & {
|
|
|
1425
1400
|
/**
|
|
1426
1401
|
* @description entry search list item is an opinionated UI component best used for initial retrieved results
|
|
1427
1402
|
* @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
|
|
1428
|
-
declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children,
|
|
1403
|
+
declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, ...props }: ObjectSearchListItemProps & React$1.HTMLAttributes<HTMLDivElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1429
1404
|
/**
|
|
1430
1405
|
* An opinionated loading skeleton component best used with ObjectSearchListItem
|
|
1431
1406
|
* @example <ObjectSearchListItemLoadingSkeleton />
|
|
@@ -1591,33 +1566,9 @@ type QueryFilterProps<TSelectOptions extends QueryFilterSelectionOptionProps = Q
|
|
|
1591
1566
|
/**
|
|
1592
1567
|
* @description An opinionated multi query filter UI component, best used for querying product data or more complex scenarios
|
|
1593
1568
|
* @example <QueryFilter contentTypeOptions={[{ id: 'id', name: 'name' }]} sortOptions={[{ id: 'id', name: 'name' }]} sortOrderOptions={[{ id: 'id', name: 'name' }]} />
|
|
1594
|
-
* @deprecated Please use SearchAndFilter from @uniformdev/design-system instead.
|
|
1595
1569
|
*/
|
|
1596
1570
|
declare const QueryFilter: ({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, searchInputName, searchInputPlaceholderText, searchInputLabel, countLabel, countValue, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, }: QueryFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1597
1571
|
|
|
1598
|
-
declare function ObjectSearchListOfSearchResults(): _emotion_react_types_jsx_namespace.EmotionJSX.Element | _emotion_react_types_jsx_namespace.EmotionJSX.Element[] | undefined;
|
|
1599
|
-
|
|
1600
|
-
type ControlledObjectSearchProviderProps = {
|
|
1601
|
-
children: ReactNode;
|
|
1602
|
-
selectedItems: Array<SelectedItemProps> | undefined;
|
|
1603
|
-
searchResultItems: Array<SelectedItemProps> | undefined;
|
|
1604
|
-
isSelectedItemsListLoading?: boolean;
|
|
1605
|
-
isSearchResultsLoading?: boolean;
|
|
1606
|
-
onSelectItemsChange: (selectedItems: Array<SelectedItemProps>) => void;
|
|
1607
|
-
isMulti?: boolean;
|
|
1608
|
-
/** @deprecated use SearchAndFilter instead. Exists for migration purposes from <ObjectSearchProvider> */
|
|
1609
|
-
query?: SearchQueryProps;
|
|
1610
|
-
/** @deprecated use SearchAndFilter instead. Exists for migration purposes from <ObjectSearchProvider> */
|
|
1611
|
-
onQueryChange?: (value: SearchQueryProps) => void;
|
|
1612
|
-
/** @deprecated use SearchAndFilter instead. Exists for migration purposes from <ObjectSearchProvider> */
|
|
1613
|
-
localeOptions?: ObjectSearchContextProps['localeOptions'];
|
|
1614
|
-
/** @deprecated use SearchAndFilter instead. Exists for migration purposes from <ObjectSearchProvider> */
|
|
1615
|
-
enableFilterByLocale?: ObjectSearchContextProps['enableFilterByLocale'];
|
|
1616
|
-
/** @deprecated use SearchAndFilter instead */
|
|
1617
|
-
dynamicEntryId?: ObjectSearchContextProps['dynamicEntryId'];
|
|
1618
|
-
};
|
|
1619
|
-
declare const ControlledObjectSearchProvider: ({ selectedItems, searchResultItems, isSelectedItemsListLoading, isSearchResultsLoading, onSelectItemsChange, isMulti, children, onQueryChange, query, enableFilterByLocale, localeOptions, dynamicEntryId, }: ControlledObjectSearchProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1620
|
-
|
|
1621
1572
|
type ParamTypeDynamicDataProviderProps = {
|
|
1622
1573
|
/** Child components of the provider. Variables-using components, such as ParameterVariables, can be used here. */
|
|
1623
1574
|
children: ReactNode;
|
|
@@ -1758,6 +1709,427 @@ declare function useRequestParameter(paramName: string): {
|
|
|
1758
1709
|
update: (value: string) => void;
|
|
1759
1710
|
};
|
|
1760
1711
|
|
|
1712
|
+
/** @deprecated beta - Filter editor component names */
|
|
1713
|
+
type FilterEditor = 'singleChoice' | 'multiChoice' | 'dateRange' | 'date' | 'text' | 'empty' | 'number' | 'numberRange' | 'statusMultiChoice' | 'statusSingleChoice';
|
|
1714
|
+
/** @deprecated beta - Input option props */
|
|
1715
|
+
type InputOption = {
|
|
1716
|
+
/** The label for the option */
|
|
1717
|
+
label: string;
|
|
1718
|
+
/** The value for the option */
|
|
1719
|
+
value?: string | undefined;
|
|
1720
|
+
/** The options for the option */
|
|
1721
|
+
options?: Array<FilterOption>;
|
|
1722
|
+
/** Set a disabled state on the input */
|
|
1723
|
+
isDisabled?: boolean;
|
|
1724
|
+
/** Set a readonly state on the input */
|
|
1725
|
+
readOnly?: boolean;
|
|
1726
|
+
};
|
|
1727
|
+
/** @deprecated beta - Operator option props */
|
|
1728
|
+
type Operator = {
|
|
1729
|
+
/** The label for the operator */
|
|
1730
|
+
label: string;
|
|
1731
|
+
/** The symbol for the operator */
|
|
1732
|
+
value?: string;
|
|
1733
|
+
/** The symbol for the operator */
|
|
1734
|
+
symbol?: string;
|
|
1735
|
+
/** The editor type for the operator */
|
|
1736
|
+
options?: Array<InputOption>;
|
|
1737
|
+
/** The editor type for the operator */
|
|
1738
|
+
editorType?: FilterEditor;
|
|
1739
|
+
};
|
|
1740
|
+
/** @deprecated beta - Filter option props */
|
|
1741
|
+
type FilterOption = {
|
|
1742
|
+
/** The label for the option */
|
|
1743
|
+
label: string;
|
|
1744
|
+
/** The value for the option */
|
|
1745
|
+
value: string;
|
|
1746
|
+
/** The options for the option */
|
|
1747
|
+
options?: FilterOption[];
|
|
1748
|
+
/** The operator options for the option */
|
|
1749
|
+
operatorOptions?: Operator[];
|
|
1750
|
+
/** The value options for the option */
|
|
1751
|
+
valueOptions?: InputOption[];
|
|
1752
|
+
/** Set a readonly state on the input */
|
|
1753
|
+
readOnly?: boolean;
|
|
1754
|
+
/** Set a disabled state on the input */
|
|
1755
|
+
disabled?: boolean;
|
|
1756
|
+
/** If filter operator allows it allow bind dynamic value to this filter */
|
|
1757
|
+
bindable?: boolean;
|
|
1758
|
+
};
|
|
1759
|
+
/** @deprecated beta - Filter selected and query value props */
|
|
1760
|
+
type Filter = {
|
|
1761
|
+
/** The field value selected */
|
|
1762
|
+
field: string;
|
|
1763
|
+
/** The operator value selected */
|
|
1764
|
+
operator: string;
|
|
1765
|
+
/** The value selected */
|
|
1766
|
+
value: string | string[];
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
/** @deprecated beta - a list of possible operator values that sync with uniform search api */
|
|
1770
|
+
type OperatorValue = 'eq' | 'sys-date-eq' | 'neq' | 'sys-date-neq' | 'gt' | 'sys-date-gt' | 'gte' | 'sys-date-gte' | 'lt' | 'sys-date-lt' | 'lte' | 'sys-date-lte' | 'in' | 'nin' | 'between' | 'sys-date-between' | 'ndef' | 'def' | 'match' | 'starts';
|
|
1771
|
+
type OperatorValueType = {
|
|
1772
|
+
value: OperatorValue;
|
|
1773
|
+
};
|
|
1774
|
+
/** @deprecated beta - a list of possible operator types */
|
|
1775
|
+
type OperatorType = Array<Omit<Operator, 'value'> & OperatorValueType>;
|
|
1776
|
+
/** @deprecated beta - uniform number operators */
|
|
1777
|
+
declare const NUMBER_OPERATORS: OperatorType;
|
|
1778
|
+
/** @deprecated beta - uniform date operators */
|
|
1779
|
+
declare const DATE_OPERATORS: OperatorType;
|
|
1780
|
+
/** @deprecated beta - uniform textbox operators */
|
|
1781
|
+
declare const TEXTBOX_OPERATORS: OperatorType;
|
|
1782
|
+
/** @deprecated beta - uniform user operators */
|
|
1783
|
+
declare const USER_OPERATORS: OperatorType;
|
|
1784
|
+
/** @deprecated beta - uniform system date operators */
|
|
1785
|
+
declare const SYSTEM_DATE_OPERATORS: OperatorType;
|
|
1786
|
+
/** @deprecated beta - uniform rich text operators */
|
|
1787
|
+
declare const RICHTEXT_OPERATORS: OperatorType;
|
|
1788
|
+
/** @deprecated beta - uniform checkbox operators */
|
|
1789
|
+
declare const CHECKBOX_OPERATORS: OperatorType;
|
|
1790
|
+
/** @deprecated beta - uniform system field operators */
|
|
1791
|
+
declare const SYSTEM_FIELD_OPERATORS: OperatorType;
|
|
1792
|
+
/** @deprecated beta - uniform publish status field operators */
|
|
1793
|
+
declare const PUBLISH_STATUS_FIELD_OPERATORS: OperatorType;
|
|
1794
|
+
|
|
1795
|
+
/** @description beta - filter button type */
|
|
1796
|
+
type FilterButtonProps = {
|
|
1797
|
+
/** text to display on the button
|
|
1798
|
+
* @default "Filters"
|
|
1799
|
+
*/
|
|
1800
|
+
text?: string;
|
|
1801
|
+
/** icon to display on the button
|
|
1802
|
+
* @default "filter-add"
|
|
1803
|
+
*/
|
|
1804
|
+
icon?: IconType;
|
|
1805
|
+
/** number of filters to display on the button and sets the styles on the button */
|
|
1806
|
+
filterCount?: number;
|
|
1807
|
+
/** sets the selected styles on the button */
|
|
1808
|
+
hasSelectedValue?: boolean;
|
|
1809
|
+
/** sets the data-testid attribute on the button */
|
|
1810
|
+
dataTestId?: string;
|
|
1811
|
+
} & HTMLAttributes<HTMLButtonElement>;
|
|
1812
|
+
/**
|
|
1813
|
+
* @deprecated beta - A filter button component used to display filter menu options
|
|
1814
|
+
* @example <FilterButton text="Filters" filterCount={3} />
|
|
1815
|
+
*/
|
|
1816
|
+
declare const FilterButton: ({ text, icon, filterCount, hasSelectedValue, dataTestId, ...props }: FilterButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* @deprecated beta - Default filter controls for search and filter
|
|
1820
|
+
* @example <FilterControls />
|
|
1821
|
+
*/
|
|
1822
|
+
declare const FilterControls: ({ children, hideSearchInput, }: {
|
|
1823
|
+
/** optional param to allow you to add your own controls */
|
|
1824
|
+
children?: ReactNode;
|
|
1825
|
+
/** optional param to hide the search input */
|
|
1826
|
+
hideSearchInput?: boolean | undefined;
|
|
1827
|
+
}) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1828
|
+
|
|
1829
|
+
type FilterEditorProps = Record<FilterEditor, ComponentType<{
|
|
1830
|
+
label?: string;
|
|
1831
|
+
value?: string;
|
|
1832
|
+
options: any;
|
|
1833
|
+
onChange: (value: any) => void;
|
|
1834
|
+
}> | (() => ReactNode) | null>;
|
|
1835
|
+
type ComboboxOption = {
|
|
1836
|
+
label: string;
|
|
1837
|
+
value: string;
|
|
1838
|
+
};
|
|
1839
|
+
type SingleValueComboboxProps = Omit<FilterEditorCommonInputProps, 'value'> & {
|
|
1840
|
+
value?: string;
|
|
1841
|
+
options: ComboboxOption[];
|
|
1842
|
+
onChange: (e: string) => void;
|
|
1843
|
+
};
|
|
1844
|
+
type MultiValueComboboxProps = Omit<FilterEditorCommonInputProps, 'value'> & {
|
|
1845
|
+
value?: string[];
|
|
1846
|
+
options: ComboboxOption[];
|
|
1847
|
+
onChange: (e: string[]) => void;
|
|
1848
|
+
};
|
|
1849
|
+
type FilterEditorCommonInputProps = {
|
|
1850
|
+
ariaLabel: string;
|
|
1851
|
+
onChange: (e: string | string[]) => void;
|
|
1852
|
+
disabled?: boolean;
|
|
1853
|
+
value?: string | string[];
|
|
1854
|
+
readOnly?: boolean;
|
|
1855
|
+
valueTestId?: string;
|
|
1856
|
+
bindable?: boolean;
|
|
1857
|
+
};
|
|
1858
|
+
/**
|
|
1859
|
+
* @deprecated beta - Multie select filter component
|
|
1860
|
+
* @example <FilterMultiChoiceEditor options={options} value={options.filter((option) => values.includes(option.value)} onChange={(e) => onChange(e.map((option) => option.value))} />
|
|
1861
|
+
*/
|
|
1862
|
+
declare const FilterMultiChoiceEditor: ({ value, options, disabled, readOnly, valueTestId, ...props }: MultiValueComboboxProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1863
|
+
/**
|
|
1864
|
+
* @deprecated beta - Single select filter component
|
|
1865
|
+
* @example <FilterSingleChoiceEditor options={options} value={options.find((option) => values.includes(option.value)} onChange={(e) => onChange(e.value)} />
|
|
1866
|
+
*/
|
|
1867
|
+
declare const FilterSingleChoiceEditor: ({ options, value, disabled, readOnly, onChange, valueTestId, }: SingleValueComboboxProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1868
|
+
/**
|
|
1869
|
+
* @deprecated beta - Status multi select filter component that renders a custom dropdown menu
|
|
1870
|
+
* @example <StatusMultiEditor options={options} value={value} onChange={onChange} />
|
|
1871
|
+
*/
|
|
1872
|
+
declare const StatusMultiEditor: ({ options, value, disabled, readOnly, onChange, valueTestId, }: MultiValueComboboxProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1873
|
+
/**
|
|
1874
|
+
* @deprecated beta - Status single select filter component that renders a custom dropdown menu
|
|
1875
|
+
* @example <StatusSingleEditor options={options} value={value} onChange={onChange} />
|
|
1876
|
+
*/
|
|
1877
|
+
declare const StatusSingleEditor: ({ options, value, disabled, readOnly, onChange, valueTestId, }: SingleValueComboboxProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1878
|
+
/**
|
|
1879
|
+
* @deprecated beta - Renders a text input field for filtering
|
|
1880
|
+
* @example <TextEditor ariaLabel="Search" value={value} onChange={onChange} />
|
|
1881
|
+
*/
|
|
1882
|
+
declare const TextEditor: ({ onChange, ariaLabel, value, readOnly, valueTestId, }: FilterEditorCommonInputProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1883
|
+
/**
|
|
1884
|
+
* @deprecated beta - Renders a number range input field for filtering
|
|
1885
|
+
* @example <NumberRangeEditor ariaLabel="Number Range" value={value} onChange={onChange} />
|
|
1886
|
+
*/
|
|
1887
|
+
declare const NumberRangeEditor: ({ onChange, disabled, ariaLabel, value, readOnly, valueTestId, }: FilterEditorCommonInputProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1888
|
+
/**
|
|
1889
|
+
* @deprecated beta - Renders a number input field for filtering
|
|
1890
|
+
* @example <NumberEditor ariaLabel="Number" value={value} onChange={onChange} />
|
|
1891
|
+
*/
|
|
1892
|
+
declare const NumberEditor: ({ ariaLabel, onChange, disabled, value, readOnly, valueTestId, }: FilterEditorCommonInputProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1893
|
+
/**
|
|
1894
|
+
* @deprecated beta - Renders a date input field for filtering
|
|
1895
|
+
* @example <DateEditor ariaLabel="Date" value={value} onChange={onChange} />
|
|
1896
|
+
*/
|
|
1897
|
+
declare const DateEditor: ({ onChange, ariaLabel, disabled, value, readOnly, valueTestId, }: FilterEditorCommonInputProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1898
|
+
/**
|
|
1899
|
+
* @deprecated beta - Renders a date range input field for filtering
|
|
1900
|
+
* @example <DateRangeEditor ariaLabel="Date Range" value={value} onChange={onChange} />
|
|
1901
|
+
*/
|
|
1902
|
+
declare const DateRangeEditor: ({ ariaLabel, onChange, disabled, value, readOnly, valueTestId, }: FilterEditorCommonInputProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1903
|
+
type FilterEditorRendererProps = Pick<FilterOption, 'readOnly' | 'disabled' | 'bindable'> & {
|
|
1904
|
+
/** The type of filter editor to render */
|
|
1905
|
+
editorType: FilterEditor;
|
|
1906
|
+
/** The options for the filter editor */
|
|
1907
|
+
options?: Array<Operator>;
|
|
1908
|
+
/** The value for the filter editor */
|
|
1909
|
+
value?: string | string[] | InputOption[] | InputOption;
|
|
1910
|
+
/** The onChange event for the filter editor */
|
|
1911
|
+
onChange: (e: string) => void;
|
|
1912
|
+
/** Sets the data-testid value */
|
|
1913
|
+
valueTestId?: string;
|
|
1914
|
+
};
|
|
1915
|
+
/**
|
|
1916
|
+
* @deprecated beta - Renders a filter editor component
|
|
1917
|
+
* @example <FilterEditorRenderer editorType="multiChoice" options={options} value={value} onChange={onChange} />
|
|
1918
|
+
*/
|
|
1919
|
+
declare const FilterEditorRenderer: ({ editorType, ...props }: FilterEditorRendererProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
|
|
1920
|
+
/** @deprecated beta - A mapper for filter editor components */
|
|
1921
|
+
declare const filterMapper: Record<FilterEditor, ComponentType<any> | null>;
|
|
1922
|
+
|
|
1923
|
+
type FilterMapper = Record<string, ComponentType<any> | null>;
|
|
1924
|
+
type SearchAndFilterProviderProps = {
|
|
1925
|
+
/** sets the filter values */
|
|
1926
|
+
filters: Filter[];
|
|
1927
|
+
/** sets the filter visibility */
|
|
1928
|
+
filterVisible?: boolean;
|
|
1929
|
+
/** function to trigger search change event */
|
|
1930
|
+
onSearchChange?: (term: string) => void;
|
|
1931
|
+
/** function to trigger filter change events */
|
|
1932
|
+
onChange: (filters: Filter[]) => void;
|
|
1933
|
+
/** Sets default value for full text search input, useful for bindable search */
|
|
1934
|
+
defaultSearchTerm?: string;
|
|
1935
|
+
/** sets the reset filter values
|
|
1936
|
+
* @default "[{ field: '', operator: '', value: '' }]"
|
|
1937
|
+
*/
|
|
1938
|
+
resetFilterValues?: Filter[];
|
|
1939
|
+
/** sets the list of filter options for each filter row */
|
|
1940
|
+
filterOptions: FilterOption[];
|
|
1941
|
+
/** the total number of results */
|
|
1942
|
+
totalResults?: number;
|
|
1943
|
+
/** the filter mapper function */
|
|
1944
|
+
filterMapper?: FilterMapper;
|
|
1945
|
+
/** sets child components giving access to useSearchAndFilter context */
|
|
1946
|
+
children: ReactNode;
|
|
1947
|
+
};
|
|
1948
|
+
type SearchAndFilterContextProps = {
|
|
1949
|
+
/** the search term value */
|
|
1950
|
+
searchTerm: string;
|
|
1951
|
+
/** sets the search term value */
|
|
1952
|
+
setSearchTerm: (term: string) => void;
|
|
1953
|
+
/** current filter visibility */
|
|
1954
|
+
filterVisibility?: boolean;
|
|
1955
|
+
/** sets the filter visibility */
|
|
1956
|
+
setFilterVisibility: (visible: boolean) => void;
|
|
1957
|
+
/** sets the initial filters */
|
|
1958
|
+
filters: Filter[];
|
|
1959
|
+
/** function to update the current filters */
|
|
1960
|
+
setFilters: (updatedFilters: Filter[]) => void;
|
|
1961
|
+
/** function that adds a blank set of filter options */
|
|
1962
|
+
handleAddFilter: () => void;
|
|
1963
|
+
/** function to reset all filter values */
|
|
1964
|
+
handleResetFilters: (filters?: Filter[]) => void;
|
|
1965
|
+
/** function that deletes a row and it's values visually and from state */
|
|
1966
|
+
handleDeleteFilter: (index: number) => void;
|
|
1967
|
+
/** sets the initial list of filter options */
|
|
1968
|
+
filterOptions: FilterOption[];
|
|
1969
|
+
/** a valid list of valid filter options */
|
|
1970
|
+
validFilterQuery: Filter[] | undefined;
|
|
1971
|
+
/** a component list to map filter options */
|
|
1972
|
+
filterMapper?: FilterMapper;
|
|
1973
|
+
/** the total number of results */
|
|
1974
|
+
totalResults?: number;
|
|
1975
|
+
};
|
|
1976
|
+
declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProps>;
|
|
1977
|
+
/**
|
|
1978
|
+
* @deprecated beta - Search and filter provider
|
|
1979
|
+
* @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
|
|
1980
|
+
* */
|
|
1981
|
+
declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, totalResults, filterMapper, children, }: SearchAndFilterProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
1982
|
+
/** @deprecated beta - Search and filter hook
|
|
1983
|
+
* @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
|
|
1984
|
+
*/
|
|
1985
|
+
declare const useSearchAndFilter: () => {
|
|
1986
|
+
/** the search term value */
|
|
1987
|
+
searchTerm: string;
|
|
1988
|
+
/** sets the search term value */
|
|
1989
|
+
setSearchTerm: (term: string) => void;
|
|
1990
|
+
/** current filter visibility */
|
|
1991
|
+
filterVisibility?: boolean | undefined;
|
|
1992
|
+
/** sets the filter visibility */
|
|
1993
|
+
setFilterVisibility: (visible: boolean) => void;
|
|
1994
|
+
/** sets the initial filters */
|
|
1995
|
+
filters: Filter[];
|
|
1996
|
+
/** function to update the current filters */
|
|
1997
|
+
setFilters: (updatedFilters: Filter[]) => void;
|
|
1998
|
+
/** function that adds a blank set of filter options */
|
|
1999
|
+
handleAddFilter: () => void;
|
|
2000
|
+
/** function to reset all filter values */
|
|
2001
|
+
handleResetFilters: (filters?: Filter[]) => void;
|
|
2002
|
+
/** function that deletes a row and it's values visually and from state */
|
|
2003
|
+
handleDeleteFilter: (index: number) => void;
|
|
2004
|
+
/** sets the initial list of filter options */
|
|
2005
|
+
filterOptions: FilterOption[];
|
|
2006
|
+
/** a valid list of valid filter options */
|
|
2007
|
+
validFilterQuery: Filter[] | undefined;
|
|
2008
|
+
/** a component list to map filter options */
|
|
2009
|
+
filterMapper?: FilterMapper | undefined;
|
|
2010
|
+
/** the total number of results */
|
|
2011
|
+
totalResults?: number | undefined;
|
|
2012
|
+
};
|
|
2013
|
+
|
|
2014
|
+
type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
|
|
2015
|
+
/** The filter controls to be displayed
|
|
2016
|
+
* @default '<FilterControls />'
|
|
2017
|
+
*/
|
|
2018
|
+
filterControls?: React$1.ReactNode;
|
|
2019
|
+
/** sets the filter mode */
|
|
2020
|
+
filterVisible?: boolean;
|
|
2021
|
+
/** The view switch controls to be displayed */
|
|
2022
|
+
viewSwitchControls?: React$1.ReactNode;
|
|
2023
|
+
/** The number of total results */
|
|
2024
|
+
totalResults?: number;
|
|
2025
|
+
/** The results container view
|
|
2026
|
+
* @default '<SearchAndFilterResultContainer />'
|
|
2027
|
+
*/
|
|
2028
|
+
resultsContainerView?: React$1.ReactNode;
|
|
2029
|
+
/** sets the reset filter values */
|
|
2030
|
+
resetFilterValues?: Filter[];
|
|
2031
|
+
/** The filter mapper function */
|
|
2032
|
+
filterMapper?: Record<FilterEditor, React$1.ComponentType<any> | null>;
|
|
2033
|
+
/** Component to render inside filters container right below main Filters widget
|
|
2034
|
+
* that should contain additional controls like filters
|
|
2035
|
+
* which do not fit main structure or sorting */
|
|
2036
|
+
additionalFiltersContainer?: React$1.ReactNode;
|
|
2037
|
+
};
|
|
2038
|
+
/**
|
|
2039
|
+
* @deprecated beta - Search and filter component
|
|
2040
|
+
* @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
|
|
2041
|
+
* */
|
|
2042
|
+
declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, resetFilterValues, }: SearchAndFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
2043
|
+
|
|
2044
|
+
type FilterRowProps = {
|
|
2045
|
+
/** the index of the filter row */
|
|
2046
|
+
index: number;
|
|
2047
|
+
/** the list of filter options for each filter row */
|
|
2048
|
+
paramOptions: FilterOption[];
|
|
2049
|
+
/** function to trigger filter change events */
|
|
2050
|
+
onParamChange: (e: string) => void;
|
|
2051
|
+
/** the list of operator options for each filter row */
|
|
2052
|
+
operatorOptions: Operator[];
|
|
2053
|
+
/** function to trigger operator change events */
|
|
2054
|
+
onOperatorChange: (e: string) => void;
|
|
2055
|
+
/** function to trigger value change events */
|
|
2056
|
+
onValueChange: (e: string) => void;
|
|
2057
|
+
/** the list of value options for each filter row */
|
|
2058
|
+
valueOptions: InputOption[];
|
|
2059
|
+
};
|
|
2060
|
+
/** @deprecated beta - A filter item component used to display filter options */
|
|
2061
|
+
declare const FilterItem: ({ index, paramOptions, operatorOptions, valueOptions, onParamChange, onOperatorChange, onValueChange, }: FilterRowProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
2062
|
+
type FilterItemsProps = {
|
|
2063
|
+
/** The text for the add button */
|
|
2064
|
+
addButtonText?: string;
|
|
2065
|
+
additionalFiltersContainer: SearchAndFilterProps['additionalFiltersContainer'];
|
|
2066
|
+
};
|
|
2067
|
+
/** @deprecated beta - A filter items component used to display filter options */
|
|
2068
|
+
declare const FilterItems: ({ addButtonText, additionalFiltersContainer, }: FilterItemsProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
2069
|
+
|
|
2070
|
+
type SearchAndFilterOptionsContainerProps = {
|
|
2071
|
+
/** The button row to be displayed at the bottom of the container */
|
|
2072
|
+
buttonRow?: React__default.ReactNode;
|
|
2073
|
+
/** The children of the container */
|
|
2074
|
+
children: React__default.ReactNode;
|
|
2075
|
+
additionalFiltersContainer?: SearchAndFilterProps['additionalFiltersContainer'];
|
|
2076
|
+
};
|
|
2077
|
+
/**
|
|
2078
|
+
* @deprecated beta - A container component for search and filter options
|
|
2079
|
+
* @example <SearchAndFilterOptionsContainer buttonRow={<button>Button</button>}>Children</SearchAndFilterOptionsContainer>
|
|
2080
|
+
* */
|
|
2081
|
+
declare const SearchAndFilterOptionsContainer: ({ buttonRow, additionalFiltersContainer, children, }: SearchAndFilterOptionsContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
2082
|
+
type FiltersProps = {
|
|
2083
|
+
/** The id of the filter menu */
|
|
2084
|
+
id: string;
|
|
2085
|
+
/** The text for the filter title */
|
|
2086
|
+
filterTitle?: string;
|
|
2087
|
+
/** The controls to be displayed at the bottom of the filter menu */
|
|
2088
|
+
menuControls?: React__default.ReactNode;
|
|
2089
|
+
/** The children of the filter menu */
|
|
2090
|
+
children: React__default.ReactNode;
|
|
2091
|
+
/** Sets the data-test-id attribute for the filter menu */
|
|
2092
|
+
dataTestId?: string;
|
|
2093
|
+
/** The text for the reset button
|
|
2094
|
+
* @default 'reset'
|
|
2095
|
+
*/
|
|
2096
|
+
resetButtonText?: string;
|
|
2097
|
+
additionalFiltersContainer?: SearchAndFilterProps['additionalFiltersContainer'];
|
|
2098
|
+
};
|
|
2099
|
+
/**
|
|
2100
|
+
* @deprecated beta - A filter menu component used to display filter options
|
|
2101
|
+
* @example <FilterMenu id="search-and-filter-options">Children</FilterMenu>
|
|
2102
|
+
* */
|
|
2103
|
+
declare const FilterMenu: ({ id, filterTitle, menuControls, additionalFiltersContainer, children, dataTestId, resetButtonText, }: FiltersProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
2104
|
+
|
|
2105
|
+
type SearchAndFilterResultContainerProps = {
|
|
2106
|
+
/** The label for the clear button
|
|
2107
|
+
* @default 'Clear'
|
|
2108
|
+
*/
|
|
2109
|
+
clearButtonLabel?: string;
|
|
2110
|
+
/** The text for the button */
|
|
2111
|
+
buttonText?: string;
|
|
2112
|
+
/** The title for the callout */
|
|
2113
|
+
calloutTitle?: string;
|
|
2114
|
+
/** The text for the callout */
|
|
2115
|
+
calloutText?: string;
|
|
2116
|
+
/** The function to handle the clear button */
|
|
2117
|
+
onHandleClear?: () => void;
|
|
2118
|
+
/** Sets whether to show or hide both clear search buttons */
|
|
2119
|
+
hideClearButton?: boolean;
|
|
2120
|
+
};
|
|
2121
|
+
/** @deprecated beta - Search and filter results container */
|
|
2122
|
+
declare const SearchAndFilterResultContainer: ({ buttonText, clearButtonLabel, calloutTitle, calloutText, onHandleClear, hideClearButton, }: SearchAndFilterResultContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
|
|
2123
|
+
|
|
2124
|
+
declare const SearchOnlyContext: React$1.Context<Pick<SearchAndFilterContextProps, "searchTerm" | "setSearchTerm">>;
|
|
2125
|
+
type SearchOnlyProviderProps = Pick<SearchAndFilterProviderProps, 'onSearchChange'> & {
|
|
2126
|
+
/** sets the max width of input wrapper
|
|
2127
|
+
* @default '712px'
|
|
2128
|
+
*/
|
|
2129
|
+
maxWidth?: string;
|
|
2130
|
+
};
|
|
2131
|
+
declare const SearchOnlyFilter: ({ onSearchChange, maxWidth }: SearchOnlyProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
2132
|
+
|
|
1761
2133
|
declare const bindableFiltersMapper: {
|
|
1762
2134
|
multiChoice: React__default.FC<Omit<FilterEditorCommonInputProps, "value"> & {
|
|
1763
2135
|
value?: string[] | undefined;
|
|
@@ -1854,4 +2226,4 @@ type ContentDataResourceLocaleInfoProps = {
|
|
|
1854
2226
|
};
|
|
1855
2227
|
declare function useContentDataResourceLocaleInfo({ locale, setLocale, dynamicInputs, }: ContentDataResourceLocaleInfoProps): ContentDataResourceLocaleInfoResult;
|
|
1856
2228
|
|
|
1857
|
-
export { $createVariableNode, $isVariableNode, type BaseRequestData, type Brand, type ContentDataResourceLocaleInfoProps, type ContentDataResourceLocaleInfoResult,
|
|
2229
|
+
export { $createVariableNode, $isVariableNode, type BaseRequestData, type Brand, CHECKBOX_OPERATORS, type ContentDataResourceLocaleInfoProps, type ContentDataResourceLocaleInfoResult, ControlledValuePlugin, DATE_OPERATORS, DISCONNECT_VARIABLE_COMMAND, type DamItem, DamSelectedItem, type DamSelectedItemProps, DataRefreshButton, type DataRefreshButtonProps, DataResourceDynamicInputProvider, type DataResourceDynamicInputProviderProps, type DataResourceVariableRendererProps, DataResourceVariablesList, DataResourceVariablesListExplicit, type DataResourceVariablesListProps, DataSourceEditor, type DataSourceEditorProps, DataTypeEditor, type DataTypeEditorProps, type DataVariableDefinitionWithName, DateEditor, DateRangeEditor, DefaultSearchRow, DefaultSelectedItem, type DisconnectVariableCommandArguments, type DispatchResult, EDIT_VARIABLE_COMMAND, type EditVariableCommandArguments, EntrySearch, type EntrySearchContentType, type EntrySearchProps, type EntrySearchQueryOptions, type EntrySearchResult, type EntrySearchRowProps, type EntrySearchSelectedItemProps, type Filter, FilterButton, type FilterButtonProps, FilterControls, type FilterEditor, type FilterEditorCommonInputProps, type FilterEditorProps, FilterEditorRenderer, type FilterEditorRendererProps, FilterItem, FilterItems, type FilterItemsProps, type FilterMapper, FilterMenu, FilterMultiChoiceEditor, type FilterOption, type FilterRowProps, FilterSingleChoiceEditor, type FiltersProps, type GetProductOptions, type GetProductsOptions, INSERT_VARIABLE_COMMAND, index as Icons, type InputOption, InputVariables, type InputVariablesProps, type InsertVariableCommandArguments, type ItemListProps, type KnownUndefinedVariableInfo, type KnownUndefinedVariableInfoWithName, LinkButton, MeshApp, type MeshAppProps, type MeshDataVariableDefinition, NUMBER_OPERATORS, type NoResultsProps, NumberEditor, NumberRangeEditor, OPEN_INSERT_VARIABLE_COMMAND, ObjectSearchContainer, type ObjectSearchContainerProps, type ObjectSearchContextProps, ObjectSearchFilter, ObjectSearchFilterContainer, type ObjectSearchFilterContainerProps, type ObjectSearchFilterProps, ObjectSearchListItem, ObjectSearchListItemLoadingSkeleton, type ObjectSearchListItemProps, ObjectSearchProvider, type ObjectSearchProviderProps, ObjectSearchResultItem, ObjectSearchResultItemButton, type ObjectSearchResultItemButtonProps, type ObjectSearchResultItemProps, ObjectSearchResultList, type ObjectSearchResultListProps, type Operator, type OperatorType, type OperatorValue, type OperatorValueType, PUBLISH_STATUS_FIELD_OPERATORS, ParamTypeDynamicDataProvider, type ParamTypeDynamicDataProviderProps, type ParameterConnectOptions, ParameterConnectionIndicator, type ParameterConnectionIndicatorProps, ParameterOrSingleVariable, type ParameterOrSingleVariableProps, ParameterVariables, type ParameterVariablesProps, type ProductCategory, type ProductDynamicSelectorValue, ProductPreviewList, ProductQuery, type ProductQueryCategory, ProductQueryContext, type ProductQueryContextValue, type ProductQueryProps, ProductSearch, ProductSearchContext, type ProductSearchContextValue, type ProductSearchProps, type ProductSearchResult, type ProductSearchResults, ProductSearchRow, ProductSelectedItem, QueryFilter, type QueryFilterProps, type QueryFilterSearchProps, RICHTEXT_OPERATORS, type RequestAction, RequestBody, type RequestContext, type RequestData, RequestHeaders, RequestMethodSelect, type RequestParameter, RequestParameters, type RequestParametersProps, RequestProvider, type RequestProviderProps, RequestTypeContainer, type RequestTypeContainerProps, RequestUrl, RequestUrlInput, ResolvableLoadingValue, SYSTEM_DATE_OPERATORS, SYSTEM_FIELD_OPERATORS, SearchAndFilter, SearchAndFilterContext, type SearchAndFilterContextProps, SearchAndFilterOptionsContainer, type SearchAndFilterOptionsContainerProps, type SearchAndFilterProps, SearchAndFilterProvider, type SearchAndFilterProviderProps, SearchAndFilterResultContainer, type SearchAndFilterResultContainerProps, SearchOnlyContext, SearchOnlyFilter, type SearchOnlyProviderProps, type SearchQueryProps, type SelectedItemProps, SelectionField, type SelectionFieldValue, type SerializedVariableNode, type SetLocationValueDispatch, type SetLocationValueFunction, StatusMultiEditor, StatusSingleEditor, TEXTBOX_OPERATORS, TextEditor, TextVariableRenderer, USER_OPERATORS, type UseVariablesMenu, type UseVariablesMenuInput, VariableEditor, type VariableEditorCompleteEvent, type VariableEditorProps, VariableNode, type VariableNodeState, type VariableSourceGroup, type VariablesAction, type VariablesContext, type VariablesEvents, VariablesList, VariablesPlugin, type VariablesPluginProps, VariablesProvider, type VariablesProviderProps, badgeIcon, bindableFiltersMapper, convertConnectedDataToVariable, createLocationValidator, damSelectItemImage, damSelectedItemContainer, damSelectedItemCopy, damSelectedItemDetails, damSelectedItemIcon, damSelectedItemInfoBtn, damSelectedItemInner, damSelectedItemLinkBtn, damSelectedItemLinkContainer, damSelectedItemMediaContainer, damSelectedItemPopover, damSelectedItemPopoverLabel, damSelectedItemSmallText, damSelectedItemTitle, draggableContainer, draggableIcon, draggableIconOffset, draggableIconWrapper, entrySearchBtn, entrySearchConfig, entrySearchConfigHidden, entrySearchLoadMoreBtn, entrySearchResultList, entrySearchSelectIcon, entrySearchSelectImg, entrySearchSelectInput, entrySearchSelectOption, entrySearchWrapper, filterMapper, hasReferencedVariables, prettifyBindExpression, productSearchRowActiveIcon, productSearchRowCategory, productSearchRowContainer, productSearchRowContent, productSearchRowContentActive, productSearchRowDetails, productSearchRowTitle, productSelectedItemContainer, productSelectedItemContent, productSelectedItemDetails, productSelectedItemIcon, productSelectedItemImage, productSelectedItemLinkContainer, productedSelectedItemLinkBtn, productedSelectedItemSmallText, searchRowBtn, searchRowContainer, searchRowContainerActive, searchRowContainerWithPopover, searchRowPopover, searchRowText, searchRowTextSmall, selectItemLinkBtn, selectItemLinkContainer, selectItemPopover, selectItemPopoverLabel, selectItemSmallText, selectedItemContainer, selectedItemCopy, selectedItemDetails, selectedItemIcon, selectedItemInner, selectedItemTitle, serializeVariablesEditorState, setVariablesEditorValue, urlEncodeRequestParameter, urlEncodeRequestUrl, useConnectedDataAsVariables, useContentDataResourceLocaleInfo, useDynamicInputsAsVariables, useMeshLocation, useObjectSearchContext, useProductQueryContext, useProductSearchContext, useRequest, useRequestHeader, useRequestParameter, useSearchAndFilter, useUniformMeshSdk, useVariableEditor, useVariables, useVariablesMenu, variableDefaultTextValue, variablePrefix, variableSuffix, variablesToGroupedList, variablesToList };
|