@payloadcms/ui 3.37.0-canary.2 → 3.37.0-canary.3

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.
@@ -1,10 +1,9 @@
1
1
  import type { LabelFunction } from 'payload';
2
2
  import type { CommonProps, GroupBase, Props as ReactSelectStateManagerProps } from 'react-select';
3
- import type { DocumentDrawerProps, UseDocumentDrawer } from '../DocumentDrawer/types.js';
3
+ import type { DocumentDrawerProps } from '../DocumentDrawer/types.js';
4
4
  type CustomSelectProps = {
5
5
  disableKeyDown?: boolean;
6
6
  disableMouseDown?: boolean;
7
- DocumentDrawerToggler?: ReturnType<UseDocumentDrawer>[1];
8
7
  draggableProps?: any;
9
8
  droppableRef?: React.RefObject<HTMLDivElement | null>;
10
9
  editableProps?: (data: Option<{
@@ -12,10 +11,11 @@ type CustomSelectProps = {
12
11
  value: string;
13
12
  }>, className: string, selectProps: ReactSelectStateManagerProps) => any;
14
13
  onDelete?: DocumentDrawerProps['onDelete'];
15
- onDocumentDrawerOpen?: (args: {
14
+ onDocumentOpen?: (args: {
16
15
  collectionSlug: string;
17
16
  hasReadPermission: boolean;
18
17
  id: number | string;
18
+ openInNewTab?: boolean;
19
19
  }) => void;
20
20
  onDuplicate?: DocumentDrawerProps['onSave'];
21
21
  onSave?: DocumentDrawerProps['onSave'];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/ReactSelect/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,IAAI,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAEjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAExF,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,C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AU,CAAC,EAAE,OAAO,CAAA;IACpB,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAA;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IAC7C,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAA;IACjC,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACjC,WAAW,CAAC,EAAE,aAAa,GAAG,MAAM,CAAA;IACpC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/ReactSelect/types.ts"],"sourcesContent":["import type { LabelFunction } from 'payload'\nimport type { CommonProps, GroupBase, Props as ReactSelectStateManagerProps } from 'react-select'\n\nimport type { DocumentDrawerProps, UseDocumentDrawer } from '../DocumentDrawer/types.js'\n\ntype CustomSelectProps = {\n disableKeyDown?: boolean\n disableMouseDown?: boolean\n DocumentDrawerToggler?: ReturnType<UseDocumentDrawer>[1]\n draggableProps?: any\n droppableRef?: React.RefObject<HTMLDivElement | null>\n editableProps?: (\n data: Option<{ label: string; value: string }>,\n className: string,\n selectProps: ReactSelectStateManagerProps,\n ) => any\n onDelete?: DocumentDrawerProps['onDelete']\n onDocumentDrawerOpen?: (args: {\n collectionSlug: string\n hasReadPermission: boolean\n id: number | string\n }) => void\n onDuplicate?: DocumentDrawerProps['onSave']\n onSave?: DocumentDrawerProps['onSave']\n}\n\n// augment the types for the `Select` component from `react-select`\n// this is to include the `selectProps` prop at the top-level `Select` component\n// @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module\ndeclare module 'react-select/dist/declarations/src/Select' {\n export interface Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {\n customProps?: CustomSelectProps\n }\n}\n\n// augment the types for the `CommonPropsAndClassName` from `react-select`\n// this will include the `selectProps` prop to every `react-select` component automatically\n// @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module\ndeclare module 'react-select/dist/declarations/src' {\n export interface CommonPropsAndClassName<\n Option,\n IsMulti extends boolean,\n Group extends GroupBase<Option>,\n > extends CommonProps<Option, IsMulti, Group> {\n customProps?: CustomSelectProps & ReactSelectStateManagerProps<Option, IsMulti, Group>\n }\n}\n\nexport type Option<TValue = unknown> = {\n [key: string]: unknown\n //* The ID is used to identify the option in the UI. If it doesn't exist and value cannot be transformed into a string, sorting won't work */\n id?: string\n value: TValue\n}\n\nexport type OptionGroup = {\n label: string\n options: Option[]\n}\n\nexport type ReactSelectAdapterProps = {\n backspaceRemovesValue?: boolean\n blurInputOnSelect?: boolean\n className?: string\n components?: {\n [key: string]: React.FC<any>\n }\n customProps?: CustomSelectProps\n disabled?: boolean\n filterOption?:\n | ((\n {\n allowEdit,\n data,\n label,\n value,\n }: { allowEdit: boolean; data: Option; label: string; value: string },\n search: string,\n ) => boolean)\n | undefined\n getOptionValue?: ReactSelectStateManagerProps<\n Option,\n boolean,\n GroupBase<Option>\n >['getOptionValue']\n inputId?: string\n isClearable?: boolean\n /** Allows you to create own values in the UI despite them not being pre-specified */\n isCreatable?: boolean\n isLoading?: boolean\n /** Allows you to specify multiple values instead of just one */\n isMulti?: boolean\n isOptionSelected?: any\n isSearchable?: boolean\n isSortable?: boolean\n menuIsOpen?: boolean\n noOptionsMessage?: (obj: { inputValue: string }) => string\n numberOnly?: boolean\n onChange?: (value: Option | Option[]) => void\n onInputChange?: (val: string) => void\n onMenuClose?: () => void\n onMenuOpen?: () => void\n onMenuScrollToBottom?: () => void\n options: Option[] | OptionGroup[]\n placeholder?: LabelFunction | string\n showError?: boolean\n value?: Option | Option[]\n}\n"],"mappings":"AA4DA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/ReactSelect/types.ts"],"sourcesContent":["import type { LabelFunction } from 'payload'\nimport type { CommonProps, GroupBase, Props as ReactSelectStateManagerProps } from 'react-select'\n\nimport type { DocumentDrawerProps } from '../DocumentDrawer/types.js'\n\ntype CustomSelectProps = {\n disableKeyDown?: boolean\n disableMouseDown?: boolean\n draggableProps?: any\n droppableRef?: React.RefObject<HTMLDivElement | null>\n editableProps?: (\n data: Option<{ label: string; value: string }>,\n className: string,\n selectProps: ReactSelectStateManagerProps,\n ) => any\n onDelete?: DocumentDrawerProps['onDelete']\n onDocumentOpen?: (args: {\n collectionSlug: string\n hasReadPermission: boolean\n id: number | string\n openInNewTab?: boolean\n }) => void\n onDuplicate?: DocumentDrawerProps['onSave']\n onSave?: DocumentDrawerProps['onSave']\n}\n\n// augment the types for the `Select` component from `react-select`\n// this is to include the `selectProps` prop at the top-level `Select` component\n// @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module\ndeclare module 'react-select/dist/declarations/src/Select' {\n export interface Props<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {\n customProps?: CustomSelectProps\n }\n}\n\n// augment the types for the `CommonPropsAndClassName` from `react-select`\n// this will include the `selectProps` prop to every `react-select` component automatically\n// @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module\ndeclare module 'react-select/dist/declarations/src' {\n export interface CommonPropsAndClassName<\n Option,\n IsMulti extends boolean,\n Group extends GroupBase<Option>,\n > extends CommonProps<Option, IsMulti, Group> {\n customProps?: CustomSelectProps & ReactSelectStateManagerProps<Option, IsMulti, Group>\n }\n}\n\nexport type Option<TValue = unknown> = {\n [key: string]: unknown\n //* The ID is used to identify the option in the UI. If it doesn't exist and value cannot be transformed into a string, sorting won't work */\n id?: string\n value: TValue\n}\n\nexport type OptionGroup = {\n label: string\n options: Option[]\n}\n\nexport type ReactSelectAdapterProps = {\n backspaceRemovesValue?: boolean\n blurInputOnSelect?: boolean\n className?: string\n components?: {\n [key: string]: React.FC<any>\n }\n customProps?: CustomSelectProps\n disabled?: boolean\n filterOption?:\n | ((\n {\n allowEdit,\n data,\n label,\n value,\n }: { allowEdit: boolean; data: Option; label: string; value: string },\n search: string,\n ) => boolean)\n | undefined\n getOptionValue?: ReactSelectStateManagerProps<\n Option,\n boolean,\n GroupBase<Option>\n >['getOptionValue']\n inputId?: string\n isClearable?: boolean\n /** Allows you to create own values in the UI despite them not being pre-specified */\n isCreatable?: boolean\n isLoading?: boolean\n /** Allows you to specify multiple values instead of just one */\n isMulti?: boolean\n isOptionSelected?: any\n isSearchable?: boolean\n isSortable?: boolean\n menuIsOpen?: boolean\n noOptionsMessage?: (obj: { inputValue: string }) => string\n numberOnly?: boolean\n onChange?: (value: Option | Option[]) => void\n onInputChange?: (val: string) => void\n onMenuClose?: () => void\n onMenuOpen?: () => void\n onMenuScrollToBottom?: () => void\n options: Option[] | OptionGroup[]\n placeholder?: LabelFunction | string\n showError?: boolean\n value?: Option | Option[]\n}\n"],"mappings":"AA4DA","ignoreList":[]}