@wordpress/dataviews 4.16.0 → 4.18.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.18.0 (2025-04-11)
6
+
7
+ ## 4.17.0 (2025-03-27)
8
+
5
9
  ## 4.16.0 (2025-03-13)
6
10
 
7
11
  ## 4.15.0 (2025-02-28)
package/README.md CHANGED
@@ -296,7 +296,7 @@ const actions = [
296
296
  label: 'View',
297
297
  isPrimary: true,
298
298
  icon: <Icon icon={ view } />,
299
- isEligible: ( item ) => item.status === 'published'
299
+ isEligible: ( item ) => item.status === 'published',
300
300
  callback: ( items ) => {
301
301
  console.log( 'Viewing item:', items[0] );
302
302
  },
@@ -722,6 +722,23 @@ Example:
722
722
  }
723
723
  ```
724
724
 
725
+ ### `modalFocusOnMount`
726
+
727
+ Specifies the focus on mount property of the modal.
728
+
729
+ - Type: `boolean` | `string`
730
+ - Optional
731
+ - Default: `true`
732
+ - One of: `true` | `false` | `'firstElement'` | `'firstContentElement'`
733
+
734
+ Example:
735
+
736
+ ```js
737
+ {
738
+ modalFocusOnMount: 'firstContentElement';
739
+ }
740
+ ```
741
+
725
742
  ## Fields API
726
743
 
727
744
  ### `id`
@@ -64,12 +64,13 @@ function ActionModal({
64
64
  items,
65
65
  closeModal
66
66
  }) {
67
+ var _action$modalFocusOnM;
67
68
  const label = typeof action.label === 'string' ? action.label : action.label(items);
68
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
69
70
  title: action.modalHeader || label,
70
71
  __experimentalHideHeader: !!action.hideModalHeader,
71
72
  onRequestClose: closeModal,
72
- focusOnMount: "firstContentElement",
73
+ focusOnMount: (_action$modalFocusOnM = action.modalFocusOnMount) !== null && _action$modalFocusOnM !== void 0 ? _action$modalFocusOnM : true,
73
74
  size: action.modalSize || 'medium',
74
75
  overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(action.id)}`,
75
76
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(action.RenderModal, {
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_icons","_data","_lockUnlock","_jsxRuntime","Menu","kebabCase","unlock","componentsPrivateApis","ButtonTrigger","action","onClick","items","label","jsx","Button","icon","disabled","accessibleWhenDisabled","isDestructive","size","MenuItemTrigger","Item","children","ItemLabel","ActionModal","closeModal","Modal","title","modalHeader","__experimentalHideHeader","hideModalHeader","onRequestClose","focusOnMount","modalSize","overlayClassName","id","RenderModal","ActionsMenuGroup","actions","item","registry","setActiveModalAction","Group","map","callback","ItemActions","isCompact","useRegistry","primaryActions","eligibleActions","useMemo","_eligibleActions","filter","isEligible","_primaryActions","isPrimary","CompactItemActions","isSmall","length","PrimaryActions","jsxs","__experimentalHStack","spacing","justify","className","style","flexShrink","width","activeModalAction","useState","Fragment","placement","TriggerButton","render","moreVertical","__","Popover","Array","isArray"],"sources":["@wordpress/dataviews/src/components/dataviews-item-actions/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MouseEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport type { Action, ActionModal as ActionModalType } from '../../types';\n\nconst { Menu, kebabCase } = unlock( componentsPrivateApis );\n\nexport interface ActionTriggerProps< Item > {\n\taction: Action< Item >;\n\tonClick: MouseEventHandler;\n\tisBusy?: boolean;\n\titems: Item[];\n}\n\nexport interface ActionModalProps< Item > {\n\taction: ActionModalType< Item >;\n\titems: Item[];\n\tcloseModal: () => void;\n}\n\ninterface ActionsMenuGroupProps< Item > {\n\tactions: Action< Item >[];\n\titem: Item;\n\tregistry: ReturnType< typeof useRegistry >;\n\tsetActiveModalAction: ( action: ActionModalType< Item > | null ) => void;\n}\n\ninterface ItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisCompact?: boolean;\n}\n\ninterface CompactItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisSmall?: boolean;\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\ninterface PrimaryActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\nfunction ButtonTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Button\n\t\t\tlabel={ label }\n\t\t\ticon={ action.icon }\n\t\t\tdisabled={ !! action.disabled }\n\t\t\taccessibleWhenDisabled\n\t\t\tisDestructive={ action.isDestructive }\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ onClick }\n\t\t/>\n\t);\n}\n\nfunction MenuItemTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Menu.Item disabled={ action.disabled } onClick={ onClick }>\n\t\t\t<Menu.ItemLabel>{ label }</Menu.ItemLabel>\n\t\t</Menu.Item>\n\t);\n}\n\nexport function ActionModal< Item >( {\n\taction,\n\titems,\n\tcloseModal,\n}: ActionModalProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ action.modalHeader || label }\n\t\t\t__experimentalHideHeader={ !! action.hideModalHeader }\n\t\t\tonRequestClose={ closeModal }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize={ action.modalSize || 'medium' }\n\t\t\toverlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(\n\t\t\t\taction.id\n\t\t\t) }` }\n\t\t>\n\t\t\t<action.RenderModal items={ items } closeModal={ closeModal } />\n\t\t</Modal>\n\t);\n}\n\nexport function ActionsMenuGroup< Item >( {\n\tactions,\n\titem,\n\tregistry,\n\tsetActiveModalAction,\n}: ActionsMenuGroupProps< Item > ) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<MenuItemTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Menu.Group>\n\t);\n}\n\nexport default function ItemActions< Item >( {\n\titem,\n\tactions,\n\tisCompact,\n}: ItemActionsProps< Item > ) {\n\tconst registry = useRegistry();\n\tconst { primaryActions, eligibleActions } = useMemo( () => {\n\t\t// If an action is eligible for all items, doesn't need\n\t\t// to provide the `isEligible` function.\n\t\tconst _eligibleActions = actions.filter(\n\t\t\t( action ) => ! action.isEligible || action.isEligible( item )\n\t\t);\n\t\tconst _primaryActions = _eligibleActions.filter(\n\t\t\t( action ) => action.isPrimary && !! action.icon\n\t\t);\n\t\treturn {\n\t\t\tprimaryActions: _primaryActions,\n\t\t\teligibleActions: _eligibleActions,\n\t\t};\n\t}, [ actions, item ] );\n\n\tif ( isCompact ) {\n\t\treturn (\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tisSmall\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// If all actions are primary, there is no need to render the dropdown.\n\tif ( primaryActions.length === eligibleActions.length ) {\n\t\treturn (\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<HStack\n\t\t\tspacing={ 1 }\n\t\t\tjustify=\"flex-end\"\n\t\t\tclassName=\"dataviews-item-actions\"\n\t\t\tstyle={ {\n\t\t\t\tflexShrink: '0',\n\t\t\t\twidth: 'auto',\n\t\t\t} }\n\t\t>\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n\nfunction CompactItemActions< Item >( {\n\titem,\n\tactions,\n\tisSmall,\n\tregistry,\n}: CompactItemActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState(\n\t\tnull as ActionModalType< Item > | null\n\t);\n\treturn (\n\t\t<>\n\t\t\t<Menu placement=\"bottom-end\">\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize={ isSmall ? 'small' : 'compact' }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\t\t\tclassName=\"dataviews-all-actions-button\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<ActionsMenuGroup\n\t\t\t\t\t\tactions={ actions }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\tregistry={ registry }\n\t\t\t\t\t\tsetActiveModalAction={ setActiveModalAction }\n\t\t\t\t\t/>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction PrimaryActions< Item >( {\n\titem,\n\tactions,\n\tregistry,\n}: PrimaryActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState( null as any );\n\tif ( ! Array.isArray( actions ) || actions.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<ButtonTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAQA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAA2C,IAAAM,WAAA,GAAAN,OAAA;AAtB3C;AACA;AACA;;AAG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BAAmB;MAC5BzD,KAAK,EAAG,CAAE4B,IAAI,CAAI;MAClBd,UAAU,EAAGA,CAAA,KAAMgB,oBAAoB,CAAE,IAAK;IAAG,CACjD,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_element","_icons","_data","_lockUnlock","_jsxRuntime","Menu","kebabCase","unlock","componentsPrivateApis","ButtonTrigger","action","onClick","items","label","jsx","Button","icon","disabled","accessibleWhenDisabled","isDestructive","size","MenuItemTrigger","Item","children","ItemLabel","ActionModal","closeModal","_action$modalFocusOnM","Modal","title","modalHeader","__experimentalHideHeader","hideModalHeader","onRequestClose","focusOnMount","modalFocusOnMount","modalSize","overlayClassName","id","RenderModal","ActionsMenuGroup","actions","item","registry","setActiveModalAction","Group","map","callback","ItemActions","isCompact","useRegistry","primaryActions","eligibleActions","useMemo","_eligibleActions","filter","isEligible","_primaryActions","isPrimary","CompactItemActions","isSmall","length","PrimaryActions","jsxs","__experimentalHStack","spacing","justify","className","style","flexShrink","width","activeModalAction","useState","Fragment","placement","TriggerButton","render","moreVertical","__","Popover","Array","isArray"],"sources":["@wordpress/dataviews/src/components/dataviews-item-actions/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MouseEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport type { Action, ActionModal as ActionModalType } from '../../types';\n\nconst { Menu, kebabCase } = unlock( componentsPrivateApis );\n\nexport interface ActionTriggerProps< Item > {\n\taction: Action< Item >;\n\tonClick: MouseEventHandler;\n\tisBusy?: boolean;\n\titems: Item[];\n}\n\nexport interface ActionModalProps< Item > {\n\taction: ActionModalType< Item >;\n\titems: Item[];\n\tcloseModal: () => void;\n}\n\ninterface ActionsMenuGroupProps< Item > {\n\tactions: Action< Item >[];\n\titem: Item;\n\tregistry: ReturnType< typeof useRegistry >;\n\tsetActiveModalAction: ( action: ActionModalType< Item > | null ) => void;\n}\n\ninterface ItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisCompact?: boolean;\n}\n\ninterface CompactItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisSmall?: boolean;\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\ninterface PrimaryActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\nfunction ButtonTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Button\n\t\t\tlabel={ label }\n\t\t\ticon={ action.icon }\n\t\t\tdisabled={ !! action.disabled }\n\t\t\taccessibleWhenDisabled\n\t\t\tisDestructive={ action.isDestructive }\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ onClick }\n\t\t/>\n\t);\n}\n\nfunction MenuItemTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Menu.Item disabled={ action.disabled } onClick={ onClick }>\n\t\t\t<Menu.ItemLabel>{ label }</Menu.ItemLabel>\n\t\t</Menu.Item>\n\t);\n}\n\nexport function ActionModal< Item >( {\n\taction,\n\titems,\n\tcloseModal,\n}: ActionModalProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ action.modalHeader || label }\n\t\t\t__experimentalHideHeader={ !! action.hideModalHeader }\n\t\t\tonRequestClose={ closeModal }\n\t\t\tfocusOnMount={ action.modalFocusOnMount ?? true }\n\t\t\tsize={ action.modalSize || 'medium' }\n\t\t\toverlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(\n\t\t\t\taction.id\n\t\t\t) }` }\n\t\t>\n\t\t\t<action.RenderModal items={ items } closeModal={ closeModal } />\n\t\t</Modal>\n\t);\n}\n\nexport function ActionsMenuGroup< Item >( {\n\tactions,\n\titem,\n\tregistry,\n\tsetActiveModalAction,\n}: ActionsMenuGroupProps< Item > ) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<MenuItemTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Menu.Group>\n\t);\n}\n\nexport default function ItemActions< Item >( {\n\titem,\n\tactions,\n\tisCompact,\n}: ItemActionsProps< Item > ) {\n\tconst registry = useRegistry();\n\tconst { primaryActions, eligibleActions } = useMemo( () => {\n\t\t// If an action is eligible for all items, doesn't need\n\t\t// to provide the `isEligible` function.\n\t\tconst _eligibleActions = actions.filter(\n\t\t\t( action ) => ! action.isEligible || action.isEligible( item )\n\t\t);\n\t\tconst _primaryActions = _eligibleActions.filter(\n\t\t\t( action ) => action.isPrimary && !! action.icon\n\t\t);\n\t\treturn {\n\t\t\tprimaryActions: _primaryActions,\n\t\t\teligibleActions: _eligibleActions,\n\t\t};\n\t}, [ actions, item ] );\n\n\tif ( isCompact ) {\n\t\treturn (\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tisSmall\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// If all actions are primary, there is no need to render the dropdown.\n\tif ( primaryActions.length === eligibleActions.length ) {\n\t\treturn (\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<HStack\n\t\t\tspacing={ 1 }\n\t\t\tjustify=\"flex-end\"\n\t\t\tclassName=\"dataviews-item-actions\"\n\t\t\tstyle={ {\n\t\t\t\tflexShrink: '0',\n\t\t\t\twidth: 'auto',\n\t\t\t} }\n\t\t>\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n\nfunction CompactItemActions< Item >( {\n\titem,\n\tactions,\n\tisSmall,\n\tregistry,\n}: CompactItemActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState(\n\t\tnull as ActionModalType< Item > | null\n\t);\n\treturn (\n\t\t<>\n\t\t\t<Menu placement=\"bottom-end\">\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize={ isSmall ? 'small' : 'compact' }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\t\t\tclassName=\"dataviews-all-actions-button\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<ActionsMenuGroup\n\t\t\t\t\t\tactions={ actions }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\tregistry={ registry }\n\t\t\t\t\t\tsetActiveModalAction={ setActiveModalAction }\n\t\t\t\t\t/>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction PrimaryActions< Item >( {\n\titem,\n\tactions,\n\tregistry,\n}: PrimaryActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState( null as any );\n\tif ( ! Array.isArray( actions ) || actions.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<ButtonTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAQA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IA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ACH/B,KAAK,EAAG,CAAE8B,IAAI;IAAI,GATZhC,MAAM,CAAC4B,EAUb,CACA,CAAC,EACD,CAAC,CAAEiC,iBAAiB,iBACrB,IAAAnE,WAAA,CAAAU,GAAA,EAACW,WAAW;MACXf,MAAM,EAAG6D,iBAAmB;MAC5B3D,KAAK,EAAG,CAAE8B,IAAI,CAAI;MAClBhB,UAAU,EAAGA,CAAA,KAAMkB,oBAAoB,CAAE,IAAK;IAAG,CACjD,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\ninterface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll';\n\nexport type FieldType = 'text' | 'integer' | 'datetime' | 'media';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | undefined;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Field< Item > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > >;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\ninterface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll';\n\nexport type FieldType = 'text' | 'integer' | 'datetime' | 'media';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | undefined;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Field< Item > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > >;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n\n\t/**\n\t * The focus on mount property of the modal.\n\t */\n\tmodalFocusOnMount?:\n\t\t| Parameters< typeof useFocusOnMount >[ 0 ]\n\t\t| 'firstContentElement';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -55,12 +55,13 @@ export function ActionModal({
55
55
  items,
56
56
  closeModal
57
57
  }) {
58
+ var _action$modalFocusOnM;
58
59
  const label = typeof action.label === 'string' ? action.label : action.label(items);
59
60
  return /*#__PURE__*/_jsx(Modal, {
60
61
  title: action.modalHeader || label,
61
62
  __experimentalHideHeader: !!action.hideModalHeader,
62
63
  onRequestClose: closeModal,
63
- focusOnMount: "firstContentElement",
64
+ focusOnMount: (_action$modalFocusOnM = action.modalFocusOnMount) !== null && _action$modalFocusOnM !== void 0 ? _action$modalFocusOnM : true,
64
65
  size: action.modalSize || 'medium',
65
66
  overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(action.id)}`,
66
67
  children: /*#__PURE__*/_jsx(action.RenderModal, {
@@ -1 +1 @@
1
- {"version":3,"names":["Button","Modal","__experimentalHStack","HStack","privateApis","componentsPrivateApis","__","useMemo","useState","moreVertical","useRegistry","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","kebabCase","ButtonTrigger","action","onClick","items","label","icon","disabled","accessibleWhenDisabled","isDestructive","size","MenuItemTrigger","Item","children","ItemLabel","ActionModal","closeModal","title","modalHeader","__experimentalHideHeader","hideModalHeader","onRequestClose","focusOnMount","modalSize","overlayClassName","id","RenderModal","ActionsMenuGroup","actions","item","registry","setActiveModalAction","Group","map","callback","ItemActions","isCompact","primaryActions","eligibleActions","_eligibleActions","filter","isEligible","_primaryActions","isPrimary","CompactItemActions","isSmall","length","PrimaryActions","spacing","justify","className","style","flexShrink","width","activeModalAction","placement","TriggerButton","render","Popover","Array","isArray"],"sources":["@wordpress/dataviews/src/components/dataviews-item-actions/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MouseEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport type { Action, ActionModal as ActionModalType } from '../../types';\n\nconst { Menu, kebabCase } = unlock( componentsPrivateApis );\n\nexport interface ActionTriggerProps< Item > {\n\taction: Action< Item >;\n\tonClick: MouseEventHandler;\n\tisBusy?: boolean;\n\titems: Item[];\n}\n\nexport interface ActionModalProps< Item > {\n\taction: ActionModalType< Item >;\n\titems: Item[];\n\tcloseModal: () => void;\n}\n\ninterface ActionsMenuGroupProps< Item > {\n\tactions: Action< Item >[];\n\titem: Item;\n\tregistry: ReturnType< typeof useRegistry >;\n\tsetActiveModalAction: ( action: ActionModalType< Item > | null ) => void;\n}\n\ninterface ItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisCompact?: boolean;\n}\n\ninterface CompactItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisSmall?: boolean;\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\ninterface PrimaryActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\nfunction ButtonTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Button\n\t\t\tlabel={ label }\n\t\t\ticon={ action.icon }\n\t\t\tdisabled={ !! action.disabled }\n\t\t\taccessibleWhenDisabled\n\t\t\tisDestructive={ action.isDestructive }\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ onClick }\n\t\t/>\n\t);\n}\n\nfunction MenuItemTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Menu.Item disabled={ action.disabled } onClick={ onClick }>\n\t\t\t<Menu.ItemLabel>{ label }</Menu.ItemLabel>\n\t\t</Menu.Item>\n\t);\n}\n\nexport function ActionModal< Item >( {\n\taction,\n\titems,\n\tcloseModal,\n}: ActionModalProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ action.modalHeader || label }\n\t\t\t__experimentalHideHeader={ !! action.hideModalHeader }\n\t\t\tonRequestClose={ closeModal }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize={ action.modalSize || 'medium' }\n\t\t\toverlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(\n\t\t\t\taction.id\n\t\t\t) }` }\n\t\t>\n\t\t\t<action.RenderModal items={ items } closeModal={ closeModal } />\n\t\t</Modal>\n\t);\n}\n\nexport function ActionsMenuGroup< Item >( {\n\tactions,\n\titem,\n\tregistry,\n\tsetActiveModalAction,\n}: ActionsMenuGroupProps< Item > ) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<MenuItemTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Menu.Group>\n\t);\n}\n\nexport default function ItemActions< Item >( {\n\titem,\n\tactions,\n\tisCompact,\n}: ItemActionsProps< Item > ) {\n\tconst registry = useRegistry();\n\tconst { primaryActions, eligibleActions } = useMemo( () => {\n\t\t// If an action is eligible for all items, doesn't need\n\t\t// to provide the `isEligible` function.\n\t\tconst _eligibleActions = actions.filter(\n\t\t\t( action ) => ! action.isEligible || action.isEligible( item )\n\t\t);\n\t\tconst _primaryActions = _eligibleActions.filter(\n\t\t\t( action ) => action.isPrimary && !! action.icon\n\t\t);\n\t\treturn {\n\t\t\tprimaryActions: _primaryActions,\n\t\t\teligibleActions: _eligibleActions,\n\t\t};\n\t}, [ actions, item ] );\n\n\tif ( isCompact ) {\n\t\treturn (\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tisSmall\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// If all actions are primary, there is no need to render the dropdown.\n\tif ( primaryActions.length === eligibleActions.length ) {\n\t\treturn (\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<HStack\n\t\t\tspacing={ 1 }\n\t\t\tjustify=\"flex-end\"\n\t\t\tclassName=\"dataviews-item-actions\"\n\t\t\tstyle={ {\n\t\t\t\tflexShrink: '0',\n\t\t\t\twidth: 'auto',\n\t\t\t} }\n\t\t>\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n\nfunction CompactItemActions< Item >( {\n\titem,\n\tactions,\n\tisSmall,\n\tregistry,\n}: CompactItemActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState(\n\t\tnull as ActionModalType< Item > | null\n\t);\n\treturn (\n\t\t<>\n\t\t\t<Menu placement=\"bottom-end\">\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize={ isSmall ? 'small' : 'compact' }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\t\t\tclassName=\"dataviews-all-actions-button\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<ActionsMenuGroup\n\t\t\t\t\t\tactions={ actions }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\tregistry={ registry }\n\t\t\t\t\t\tsetActiveModalAction={ setActiveModalAction }\n\t\t\t\t\t/>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction PrimaryActions< Item >( {\n\titem,\n\tactions,\n\tregistry,\n}: PrimaryActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState( null as any );\n\tif ( ! Array.isArray( actions ) || actions.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<ButtonTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,MAAM,EACNC,KAAK,EACLC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,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CACjD,CACD;EAAA,CACA,CAAC;AAEL;AAEA,SAASgB,cAAcA,CAAU;EAChClB,IAAI;EACJD,OAAO;EACPE;AAC4B,CAAC,EAAG;EAChC,MAAM,CAAEwB,iBAAiB,EAAEvB,oBAAoB,CAAE,GAAG1C,QAAQ,CAAE,IAAY,CAAC;EAC3E,IAAK,CAAEsE,KAAK,CAACC,OAAO,CAAEhC,OAAQ,CAAC,IAAIA,OAAO,CAACkB,MAAM,KAAK,CAAC,EAAG;IACzD,OAAO,IAAI;EACZ;EACA,oBACClD,KAAA,CAAAE,SAAA;IAAAe,QAAA,GACGe,OAAO,CAACK,GAAG,CAAI/B,MAAM,iBACtBR,IAAA,CAACO,aAAa;MAEbC,MAAM,EAAGA,MAAQ;MACjBC,OAAO,EAAGA,CAAA,KAAM;QACf,IAAK,aAAa,IAAID,MAAM,EAAG;UAC9B6B,oBAAoB,CAAE7B,MAAO,CAAC;UAC9B;QACD;QACAA,MAAM,CAACgC,QAAQ,CAAE,CAAEL,IAAI,CAAE,EAAE;UAAEC;QAAS,CAAE,CAAC;MAC1C,CAAG;MACH1B,KAAK,EAAG,CAAEyB,IAAI;IAAI,GATZ3B,MAAM,CAACuB,EAUb,CACA,CAAC,EACD,CAAC,CAAE6B,iBAAiB,iBACrB5D,IAAA,CAACqB,WAAW;MACXb,MAAM,EAAGoD,iBAAmB;MAC5BlD,KAAK,EAAG,CAAEyB,IAAI,CAAI;MAClBb,UAAU,EAAGA,CAAA,KAAMe,oBAAoB,CAAE,IAAK;IAAG,CACjD,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["Button","Modal","__experimentalHStack","HStack","privateApis","componentsPrivateApis","__","useMemo","useState","moreVertical","useRegistry","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","kebabCase","ButtonTrigger","action","onClick","items","label","icon","disabled","accessibleWhenDisabled","isDestructive","size","MenuItemTrigger","Item","children","ItemLabel","ActionModal","closeModal","_action$modalFocusOnM","title","modalHeader","__experimentalHideHeader","hideModalHeader","onRequestClose","focusOnMount","modalFocusOnMount","modalSize","overlayClassName","id","RenderModal","ActionsMenuGroup","actions","item","registry","setActiveModalAction","Group","map","callback","ItemActions","isCompact","primaryActions","eligibleActions","_eligibleActions","filter","isEligible","_primaryActions","isPrimary","CompactItemActions","isSmall","length","PrimaryActions","spacing","justify","className","style","flexShrink","width","activeModalAction","placement","TriggerButton","render","Popover","Array","isArray"],"sources":["@wordpress/dataviews/src/components/dataviews-item-actions/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MouseEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { moreVertical } from '@wordpress/icons';\nimport { useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport type { Action, ActionModal as ActionModalType } from '../../types';\n\nconst { Menu, kebabCase } = unlock( componentsPrivateApis );\n\nexport interface ActionTriggerProps< Item > {\n\taction: Action< Item >;\n\tonClick: MouseEventHandler;\n\tisBusy?: boolean;\n\titems: Item[];\n}\n\nexport interface ActionModalProps< Item > {\n\taction: ActionModalType< Item >;\n\titems: Item[];\n\tcloseModal: () => void;\n}\n\ninterface ActionsMenuGroupProps< Item > {\n\tactions: Action< Item >[];\n\titem: Item;\n\tregistry: ReturnType< typeof useRegistry >;\n\tsetActiveModalAction: ( action: ActionModalType< Item > | null ) => void;\n}\n\ninterface ItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisCompact?: boolean;\n}\n\ninterface CompactItemActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tisSmall?: boolean;\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\ninterface PrimaryActionsProps< Item > {\n\titem: Item;\n\tactions: Action< Item >[];\n\tregistry: ReturnType< typeof useRegistry >;\n}\n\nfunction ButtonTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Button\n\t\t\tlabel={ label }\n\t\t\ticon={ action.icon }\n\t\t\tdisabled={ !! action.disabled }\n\t\t\taccessibleWhenDisabled\n\t\t\tisDestructive={ action.isDestructive }\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ onClick }\n\t\t/>\n\t);\n}\n\nfunction MenuItemTrigger< Item >( {\n\taction,\n\tonClick,\n\titems,\n}: ActionTriggerProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Menu.Item disabled={ action.disabled } onClick={ onClick }>\n\t\t\t<Menu.ItemLabel>{ label }</Menu.ItemLabel>\n\t\t</Menu.Item>\n\t);\n}\n\nexport function ActionModal< Item >( {\n\taction,\n\titems,\n\tcloseModal,\n}: ActionModalProps< Item > ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ action.modalHeader || label }\n\t\t\t__experimentalHideHeader={ !! action.hideModalHeader }\n\t\t\tonRequestClose={ closeModal }\n\t\t\tfocusOnMount={ action.modalFocusOnMount ?? true }\n\t\t\tsize={ action.modalSize || 'medium' }\n\t\t\toverlayClassName={ `dataviews-action-modal dataviews-action-modal__${ kebabCase(\n\t\t\t\taction.id\n\t\t\t) }` }\n\t\t>\n\t\t\t<action.RenderModal items={ items } closeModal={ closeModal } />\n\t\t</Modal>\n\t);\n}\n\nexport function ActionsMenuGroup< Item >( {\n\tactions,\n\titem,\n\tregistry,\n\tsetActiveModalAction,\n}: ActionsMenuGroupProps< Item > ) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<MenuItemTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Menu.Group>\n\t);\n}\n\nexport default function ItemActions< Item >( {\n\titem,\n\tactions,\n\tisCompact,\n}: ItemActionsProps< Item > ) {\n\tconst registry = useRegistry();\n\tconst { primaryActions, eligibleActions } = useMemo( () => {\n\t\t// If an action is eligible for all items, doesn't need\n\t\t// to provide the `isEligible` function.\n\t\tconst _eligibleActions = actions.filter(\n\t\t\t( action ) => ! action.isEligible || action.isEligible( item )\n\t\t);\n\t\tconst _primaryActions = _eligibleActions.filter(\n\t\t\t( action ) => action.isPrimary && !! action.icon\n\t\t);\n\t\treturn {\n\t\t\tprimaryActions: _primaryActions,\n\t\t\teligibleActions: _eligibleActions,\n\t\t};\n\t}, [ actions, item ] );\n\n\tif ( isCompact ) {\n\t\treturn (\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tisSmall\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// If all actions are primary, there is no need to render the dropdown.\n\tif ( primaryActions.length === eligibleActions.length ) {\n\t\treturn (\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<HStack\n\t\t\tspacing={ 1 }\n\t\t\tjustify=\"flex-end\"\n\t\t\tclassName=\"dataviews-item-actions\"\n\t\t\tstyle={ {\n\t\t\t\tflexShrink: '0',\n\t\t\t\twidth: 'auto',\n\t\t\t} }\n\t\t>\n\t\t\t<PrimaryActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ primaryActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t\t<CompactItemActions\n\t\t\t\titem={ item }\n\t\t\t\tactions={ eligibleActions }\n\t\t\t\tregistry={ registry }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n\nfunction CompactItemActions< Item >( {\n\titem,\n\tactions,\n\tisSmall,\n\tregistry,\n}: CompactItemActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState(\n\t\tnull as ActionModalType< Item > | null\n\t);\n\treturn (\n\t\t<>\n\t\t\t<Menu placement=\"bottom-end\">\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize={ isSmall ? 'small' : 'compact' }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\t\t\tclassName=\"dataviews-all-actions-button\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<ActionsMenuGroup\n\t\t\t\t\t\tactions={ actions }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\tregistry={ registry }\n\t\t\t\t\t\tsetActiveModalAction={ setActiveModalAction }\n\t\t\t\t\t/>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction PrimaryActions< Item >( {\n\titem,\n\tactions,\n\tregistry,\n}: PrimaryActionsProps< Item > ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState( null as any );\n\tif ( ! Array.isArray( actions ) || actions.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t{ actions.map( ( action ) => (\n\t\t\t\t<ButtonTrigger\n\t\t\t\t\tkey={ action.id }\n\t\t\t\t\taction={ action }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\taction.callback( [ item ], { registry } );\n\t\t\t\t\t} }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SACCA,MAAM,EACNC,KAAK,EACLC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAG3C,MAAM;EAAEC,IAAI;EAAEC;AAAU,CAAC,GAAGR,MAAM,CAAEN,qBAAsB,CAAC;AAyC3D,SAASe,aAAaA,CAAU;EAC/BC,MAAM;EACNC,OAAO;EACPC;AAC2B,CAAC,EAAG;EAC/B,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OAAO,CAACkB,MAAM,KAAK,CAAC,EAAG;IACzD,OAAO,IAAI;EACZ;EACA,oBACCpD,KAAA,CAAAE,SAAA;IAAAe,QAAA,GACGiB,OAAO,CAACK,GAAG,CAAIjC,MAAM,iBACtBR,IAAA,CAACO,aAAa;MAEbC,MAAM,EAAGA,MAAQ;MACjBC,OAAO,EAAGA,CAAA,KAAM;QACf,IAAK,aAAa,IAAID,MAAM,EAAG;UAC9B+B,oBAAoB,CAAE/B,MAAO,CAAC;UAC9B;QACD;QACAA,MAAM,CAACkC,QAAQ,CAAE,CAAEL,IAAI,CAAE,EAAE;UAAEC;QAAS,CAAE,CAAC;MAC1C,CAAG;MACH5B,KAAK,EAAG,CAAE2B,IAAI;IAAI,GATZ7B,MAAM,CAACyB,EAUb,CACA,CAAC,EACD,CAAC,CAAE6B,iBAAiB,iBACrB9D,IAAA,CAACqB,WAAW;MACXb,MAAM,EAAGsD,iBAAmB;MAC5BpD,KAAK,EAAG,CAAE2B,IAAI,CAAI;MAClBf,UAAU,EAAGA,CAAA,KAAMiB,oBAAoB,CAAE,IAAK;IAAG,CACjD,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\ninterface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll';\n\nexport type FieldType = 'text' | 'integer' | 'datetime' | 'media';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | undefined;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Field< Item > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > >;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\ninterface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll';\n\nexport type FieldType = 'text' | 'integer' | 'datetime' | 'media';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | undefined;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Field< Item > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > >;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n\n\t/**\n\t * The focus on mount property of the modal.\n\t */\n\tmodalFocusOnMount?:\n\t\t| Parameters< typeof useFocusOnMount >[ 0 ]\n\t\t| 'firstContentElement';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -811,6 +811,11 @@
811
811
  right: 8px;
812
812
  z-index: 1;
813
813
  }
814
+ @media (hover: none) {
815
+ .dataviews-view-grid__card .dataviews-selection-checkbox {
816
+ top: 8px;
817
+ }
818
+ }
814
819
 
815
820
  .dataviews-view-grid__card:hover .dataviews-selection-checkbox,
816
821
  .dataviews-view-grid__card:focus-within .dataviews-selection-checkbox,
@@ -839,24 +844,34 @@ div.dataviews-view-list {
839
844
  box-sizing: border-box;
840
845
  }
841
846
  .dataviews-view-list div[role=row] .dataviews-view-list__item-actions {
842
- flex: 0;
843
- overflow: hidden;
844
- }
845
- .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > div {
846
- height: 24px;
847
+ display: flex;
848
+ width: max-content;
849
+ flex: 0 0 auto;
850
+ gap: 4px;
847
851
  }
848
852
  .dataviews-view-list div[role=row] .dataviews-view-list__item-actions .components-button {
849
853
  position: relative;
850
854
  z-index: 1;
851
- opacity: 0;
852
855
  }
853
- .dataviews-view-list div[role=row]:where(.is-selected, .is-hovered, :focus-within) .dataviews-view-list__item-actions {
856
+ .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > div {
857
+ height: 24px;
858
+ }
859
+ .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > :not(:last-child) {
860
+ flex: 0;
861
+ overflow: hidden;
862
+ width: 0;
863
+ }
864
+ .dataviews-view-list div[role=row]:where(.is-selected, .is-hovered, :focus-within) .dataviews-view-list__item-actions > :not(:last-child) {
854
865
  flex-basis: min-content;
866
+ width: auto;
855
867
  overflow: unset;
856
- padding-inline-end: 4px;
857
868
  }
858
- .dataviews-view-list div[role=row]:where(.is-selected, .is-hovered, :focus-within) .dataviews-view-list__item-actions .components-button {
859
- opacity: 1;
869
+ @media (hover: none) {
870
+ .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > :not(:last-child) {
871
+ flex-basis: min-content;
872
+ width: auto;
873
+ overflow: unset;
874
+ }
860
875
  }
861
876
  .dataviews-view-list div[role=row].is-selected.is-selected {
862
877
  border-top: 1px solid rgba(var(--wp-admin-theme-color--rgb), 0.12);
@@ -811,6 +811,11 @@
811
811
  left: 8px;
812
812
  z-index: 1;
813
813
  }
814
+ @media (hover: none) {
815
+ .dataviews-view-grid__card .dataviews-selection-checkbox {
816
+ top: 8px;
817
+ }
818
+ }
814
819
 
815
820
  .dataviews-view-grid__card:hover .dataviews-selection-checkbox,
816
821
  .dataviews-view-grid__card:focus-within .dataviews-selection-checkbox,
@@ -839,24 +844,34 @@ div.dataviews-view-list {
839
844
  box-sizing: border-box;
840
845
  }
841
846
  .dataviews-view-list div[role=row] .dataviews-view-list__item-actions {
842
- flex: 0;
843
- overflow: hidden;
844
- }
845
- .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > div {
846
- height: 24px;
847
+ display: flex;
848
+ width: max-content;
849
+ flex: 0 0 auto;
850
+ gap: 4px;
847
851
  }
848
852
  .dataviews-view-list div[role=row] .dataviews-view-list__item-actions .components-button {
849
853
  position: relative;
850
854
  z-index: 1;
851
- opacity: 0;
852
855
  }
853
- .dataviews-view-list div[role=row]:where(.is-selected, .is-hovered, :focus-within) .dataviews-view-list__item-actions {
856
+ .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > div {
857
+ height: 24px;
858
+ }
859
+ .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > :not(:last-child) {
860
+ flex: 0;
861
+ overflow: hidden;
862
+ width: 0;
863
+ }
864
+ .dataviews-view-list div[role=row]:where(.is-selected, .is-hovered, :focus-within) .dataviews-view-list__item-actions > :not(:last-child) {
854
865
  flex-basis: min-content;
866
+ width: auto;
855
867
  overflow: unset;
856
- padding-inline-end: 4px;
857
868
  }
858
- .dataviews-view-list div[role=row]:where(.is-selected, .is-hovered, :focus-within) .dataviews-view-list__item-actions .components-button {
859
- opacity: 1;
869
+ @media (hover: none) {
870
+ .dataviews-view-list div[role=row] .dataviews-view-list__item-actions > :not(:last-child) {
871
+ flex-basis: min-content;
872
+ width: auto;
873
+ overflow: unset;
874
+ }
860
875
  }
861
876
  .dataviews-view-list div[role=row].is-selected.is-selected {
862
877
  border-top: 1px solid rgba(var(--wp-admin-theme-color--rgb), 0.12);
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../src/components/dataviews/stories/fixtures.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,WAAW,EA+G7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,EA2Y5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAE,KAAK,CAAE,EAoBvC,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;CAOxB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAE,WAAW,CAAE,EAsC1C,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAE,WAAW,CAAE,EA8ExC,CAAC"}
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../../src/components/dataviews/stories/fixtures.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,WAAW,EA+G7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,EA2Y5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAE,KAAK,CAAE,EAoBvC,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;CAOxB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAE,WAAW,CAAE,EAuC1C,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAE,WAAW,CAAE,EA8ExC,CAAC"}
@@ -6,6 +6,10 @@ import type { ReactElement, ComponentType } from 'react';
6
6
  * Internal dependencies
7
7
  */
8
8
  import type { SetSelection } from './private-types';
9
+ /**
10
+ * WordPress dependencies
11
+ */
12
+ import type { useFocusOnMount } from '@wordpress/compose';
9
13
  export type SortDirection = 'asc' | 'desc';
10
14
  /**
11
15
  * Generic option type.
@@ -380,6 +384,10 @@ export interface ActionModal<Item> extends ActionBase<Item> {
380
384
  * @default 'medium'
381
385
  */
382
386
  modalSize?: 'small' | 'medium' | 'large' | 'fill';
387
+ /**
388
+ * The focus on mount property of the modal.
389
+ */
390
+ modalFocusOnMount?: Parameters<typeof useFocusOnMount>[0] | 'firstContentElement';
383
391
  }
384
392
  export interface ActionButton<Item> extends ActionBase<Item> {
385
393
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEzD;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,MAAM,CAAE,KAAK,SAAS,GAAG,GAAG,GAAG;IAC/C,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,cAAc;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,QAAQ,GACjB,IAAI,GACJ,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,UAAU,CAAC;AAEd,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAE,IAAI,IAAK;IACzC;;OAEG;IACH,IAAI,EAAE,CAAE,CAAC,EAAE,IAAI,EA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