@wordpress/dataviews 10.0.1-next.47f435fc9.0 → 10.0.1-next.b8c8708f3.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 +1 -0
- package/README.md +2 -1
- package/build/components/dataviews-item-actions/index.js +2 -1
- package/build/components/dataviews-item-actions/index.js.map +2 -2
- package/build/types/dataviews.js.map +1 -1
- package/build-module/components/dataviews-item-actions/index.js +2 -1
- package/build-module/components/dataviews-item-actions/index.js.map +2 -2
- package/build-types/components/dataviews-item-actions/index.d.ts.map +1 -1
- package/build-types/stories/dataviews.fixtures.d.ts.map +1 -1
- package/build-types/types/dataviews.d.ts +1 -1
- package/build-types/types/dataviews.d.ts.map +1 -1
- package/build-wp/index.js +2 -1
- package/package.json +16 -16
- package/src/components/dataviews-item-actions/index.tsx +6 -1
- package/src/stories/dataviews.fixtures.tsx +9 -4
- package/src/types/dataviews.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- DataForm control for `date` supports `required` and `custom` validation [#72048](https://github.com/WordPress/gutenberg/pull/72048).
|
|
19
19
|
- DataForm control for `datetime` supports `required` and `custom` validation. [#72060](https://github.com/WordPress/gutenberg/pull/72060).
|
|
20
20
|
- Standardise DataForm typography. [#72284](https://github.com/WordPress/gutenberg/pull/72284).
|
|
21
|
+
- Dataviews: Add support for dynamic modal headers. [#72384](https://github.com/WordPress/gutenberg/pull/72384)
|
|
21
22
|
|
|
22
23
|
### Breaking changes
|
|
23
24
|
|
package/README.md
CHANGED
|
@@ -875,8 +875,9 @@ Controls visibility of the modal's header when using `RenderModal`.
|
|
|
875
875
|
|
|
876
876
|
The header text to show in the modal.
|
|
877
877
|
|
|
878
|
-
- Type: `string`
|
|
878
|
+
- Type: `string | (items: Item[]) => string`
|
|
879
879
|
- Optional
|
|
880
|
+
- If a function is provided, it receives the selected items as an argument and should return the header text
|
|
880
881
|
|
|
881
882
|
### `modalSize`
|
|
882
883
|
|
|
@@ -63,10 +63,11 @@ function ActionModal({
|
|
|
63
63
|
closeModal
|
|
64
64
|
}) {
|
|
65
65
|
const label = typeof action.label === "string" ? action.label : action.label(items);
|
|
66
|
+
const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
|
|
66
67
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
68
|
import_components.Modal,
|
|
68
69
|
{
|
|
69
|
-
title:
|
|
70
|
+
title: modalHeader || label,
|
|
70
71
|
__experimentalHideHeader: !!action.hideModalHeader,
|
|
71
72
|
onRequestClose: closeModal,
|
|
72
73
|
focusOnMount: action.modalFocusOnMount ?? true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataviews-item-actions/index.tsx"],
|
|
4
|
-
"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\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={
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EE;AAlEF,wBAKO;AACP,kBAAmB;AACnB,qBAAkC;AAClC,mBAA6B;AAC7B,kBAA4B;AAK5B,yBAAuB;AAGvB,MAAM,EAAE,MAAM,UAAU,QAAI,2BAAQ,kBAAAA,WAAsB;AAyC1D,SAAS,cAAuB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACD,GAAgC;AAC/B,QAAM,QACL,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,OAAO,MAAO,KAAM;AACvE,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,MAAO,OAAO;AAAA,MACd,UAAW,CAAC,CAAE,OAAO;AAAA,MACrB,wBAAsB;AAAA,MACtB,MAAK;AAAA,MACL;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,gBAAyB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACD,GAAgC;AAC/B,QAAM,QACL,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,OAAO,MAAO,KAAM;AACvE,SACC,4CAAC,KAAK,MAAL,EAAU,UAAW,OAAO,UAAW,SACvC,sDAAC,KAAK,WAAL,EAAiB,iBAAO,GAC1B;AAEF;AAEO,SAAS,YAAqB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACD,GAA8B;AAC7B,QAAM,QACL,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,OAAO,MAAO,KAAM;
|
|
4
|
+
"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\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\n\tconst modalHeader =\n\t\ttypeof action.modalHeader === 'function'\n\t\t\t? action.modalHeader( items )\n\t\t\t: action.modalHeader;\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ 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\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{ primaryActions.length < eligibleActions.length && (\n\t\t\t\t<CompactItemActions\n\t\t\t\t\titem={ item }\n\t\t\t\t\tactions={ eligibleActions }\n\t\t\t\t\tregistry={ registry }\n\t\t\t\t/>\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EE;AAlEF,wBAKO;AACP,kBAAmB;AACnB,qBAAkC;AAClC,mBAA6B;AAC7B,kBAA4B;AAK5B,yBAAuB;AAGvB,MAAM,EAAE,MAAM,UAAU,QAAI,2BAAQ,kBAAAA,WAAsB;AAyC1D,SAAS,cAAuB;AAAA,EAC/B;AAAA,EACA;AAAA,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AC;AAAA;AAAA,QACA,QAAS;AAAA,QACT,OAAQ,CAAE,IAAK;AAAA,QACf,YAAa,MAAM,qBAAsB,IAAK;AAAA;AAAA,IAC/C;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": ["componentsPrivateApis", "HStack"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types/dataviews.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { ReactElement, ReactNode, ComponentProps } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tNormalizedField,\n\tOperator,\n\tOption,\n\tSortDirection,\n} from './field-api';\nimport type { SetSelection } from './private';\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\t/**\n\t * Whether the filter can be edited by the user.\n\t */\n\tisLocked?: boolean;\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\t/**\n\t * Whether the filter can be edited by the user.\n\t */\n\tisLocked: 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\t/**\n\t * The field to group by.\n\t */\n\tgroupByField?: string;\n\n\t/**\n\t * Whether infinite scroll is enabled.\n\t */\n\tinfiniteScrollEnabled?: 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\t/**\n\t * The alignment of the field column, defaults to left.\n\t */\n\talign?: 'start' | 'center' | 'end';\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\n\t\t/**\n\t\t * Whether the view allows column moving.\n\t\t */\n\t\tenableMoving?: boolean;\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 interface ViewPickerGrid extends ViewBase {\n\ttype: 'pickerGrid';\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 | ViewPickerGrid;\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 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\tclassName?: string;\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\trenderItemLink?: (\n\t\tprops: {\n\t\t\titem: Item;\n\t\t} & ComponentProps< 'a' >\n\t) => ReactElement;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n\tempty: ReactNode;\n}\n\nexport type ViewPickerBaseProps< Item > = Omit<\n\tViewBaseProps< Item >,\n\t| 'view'\n\t| 'onChangeView'\n\t// The following props are not supported for pickers.\n\t| 'isItemClickable'\n\t| 'onClickItem'\n\t| 'renderItemLink'\n\t| 'getItemLevel'\n> & {\n\tview: View;\n\tonChangeView: ( view: View ) => void;\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 interface ViewPickerGridProps< Item >\n\textends Omit< ViewPickerBaseProps< Item >, 'view' > {\n\tview: ViewPickerGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport type ViewPickerProps< Item > = ViewPickerGridProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n\tpickerGrid?: Omit< ViewPickerGrid, 'type' >;\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { ReactElement, ReactNode, ComponentProps } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tNormalizedField,\n\tOperator,\n\tOption,\n\tSortDirection,\n} from './field-api';\nimport type { SetSelection } from './private';\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\t/**\n\t * Whether the filter can be edited by the user.\n\t */\n\tisLocked?: boolean;\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\t/**\n\t * Whether the filter can be edited by the user.\n\t */\n\tisLocked: 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\t/**\n\t * The field to group by.\n\t */\n\tgroupByField?: string;\n\n\t/**\n\t * Whether infinite scroll is enabled.\n\t */\n\tinfiniteScrollEnabled?: 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\t/**\n\t * The alignment of the field column, defaults to left.\n\t */\n\talign?: 'start' | 'center' | 'end';\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\n\t\t/**\n\t\t * Whether the view allows column moving.\n\t\t */\n\t\tenableMoving?: boolean;\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 interface ViewPickerGrid extends ViewBase {\n\ttype: 'pickerGrid';\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 | ViewPickerGrid;\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 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 | ( ( items: Item[] ) => 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\tclassName?: string;\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\trenderItemLink?: (\n\t\tprops: {\n\t\t\titem: Item;\n\t\t} & ComponentProps< 'a' >\n\t) => ReactElement;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n\tempty: ReactNode;\n}\n\nexport type ViewPickerBaseProps< Item > = Omit<\n\tViewBaseProps< Item >,\n\t| 'view'\n\t| 'onChangeView'\n\t// The following props are not supported for pickers.\n\t| 'isItemClickable'\n\t| 'onClickItem'\n\t| 'renderItemLink'\n\t| 'getItemLevel'\n> & {\n\tview: View;\n\tonChangeView: ( view: View ) => void;\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 interface ViewPickerGridProps< Item >\n\textends Omit< ViewPickerBaseProps< Item >, 'view' > {\n\tview: ViewPickerGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport type ViewPickerProps< Item > = ViewPickerGridProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n\tpickerGrid?: Omit< ViewPickerGrid, 'type' >;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,10 +43,11 @@ function ActionModal({
|
|
|
43
43
|
closeModal
|
|
44
44
|
}) {
|
|
45
45
|
const label = typeof action.label === "string" ? action.label : action.label(items);
|
|
46
|
+
const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
|
|
46
47
|
return /* @__PURE__ */ jsx(
|
|
47
48
|
Modal,
|
|
48
49
|
{
|
|
49
|
-
title:
|
|
50
|
+
title: modalHeader || label,
|
|
50
51
|
__experimentalHideHeader: !!action.hideModalHeader,
|
|
51
52
|
onRequestClose: closeModal,
|
|
52
53
|
focusOnMount: action.modalFocusOnMount ?? true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataviews-item-actions/index.tsx"],
|
|
4
|
-
"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\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={
|
|
5
|
-
"mappings": "AA0EE,
|
|
4
|
+
"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\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\n\tconst modalHeader =\n\t\ttypeof action.modalHeader === 'function'\n\t\t\t? action.modalHeader( items )\n\t\t\t: action.modalHeader;\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ 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\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{ primaryActions.length < eligibleActions.length && (\n\t\t\t\t<CompactItemActions\n\t\t\t\t\titem={ item }\n\t\t\t\t\tactions={ eligibleActions }\n\t\t\t\t\tregistry={ registry }\n\t\t\t\t/>\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"],
|
|
5
|
+
"mappings": "AA0EE,SAmJA,UAnJA,KAgHA,YAhHA;AAlEF;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB,eAAe;AAAA,OACT;AACP,SAAS,UAAU;AACnB,SAAS,SAAS,gBAAgB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAK5B,SAAS,cAAc;AAGvB,MAAM,EAAE,MAAM,UAAU,IAAI,OAAQ,qBAAsB;AAyC1D,SAAS,cAAuB;AAAA,E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,MAAC;AAAA;AAAA,QACA,QAAS;AAAA,QACT,OAAQ,CAAE,IAAK;AAAA,QACf,YAAa,MAAM,qBAAsB,IAAK;AAAA;AAAA,IAC/C;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dataviews-item-actions/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAc/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAM9C,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,aAAa,CAAC;AAI1E,MAAM,WAAW,kBAAkB,CAAE,IAAI;IACxC,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB,CAAE,IAAI;IACtC,MAAM,EAAE,eAAe,CAAE,IAAI,CAAE,CAAC;IAChC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,UAAU,qBAAqB,CAAE,IAAI;IACpC,OAAO,EAAE,MAAM,CAAE,IAAI,CAAE,EAAE,CAAC;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,UAAU,CAAE,OAAO,WAAW,CAAE,CAAC;IAC3C,oBAAoB,EAAE,CAAE,MAAM,EAAE,eAAe,CAAE,IAAI,CAAE,GAAG,IAAI,KAAM,IAAI,CAAC;CACzE;AAED,UAAU,gBAAgB,CAAE,IAAI;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,CAAE,IAAI,CAAE,EAAE,CAAC;IAC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C,IAAI,CAAC,EAAE,IAAI,CAAE,QAAQ,EAAE,MAAM,CAAE,CAAC;IAChC,KAAK,CAAC,EAAE,IAAI,CAAE,SAAS,EAAE,MAAM,CAAE,CAAC;IAClC,UAAU,CAAC,EAAE,IAAI,CAAE,cAAc,EAAE,MAAM,CAAE,CAAC;CAC5C"}
|
package/build-wp/index.js
CHANGED
|
@@ -12969,10 +12969,11 @@ function ActionModal({
|
|
|
12969
12969
|
closeModal
|
|
12970
12970
|
}) {
|
|
12971
12971
|
const label = typeof action.label === "string" ? action.label : action.label(items);
|
|
12972
|
+
const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
|
|
12972
12973
|
return /* @__PURE__ */ jsx37(
|
|
12973
12974
|
modal_default,
|
|
12974
12975
|
{
|
|
12975
|
-
title:
|
|
12976
|
+
title: modalHeader || label,
|
|
12976
12977
|
__experimentalHideHeader: !!action.hideModalHeader,
|
|
12977
12978
|
onRequestClose: closeModal,
|
|
12978
12979
|
focusOnMount: action.modalFocusOnMount ?? true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/dataviews",
|
|
3
|
-
"version": "10.0.1-next.
|
|
3
|
+
"version": "10.0.1-next.b8c8708f3.0",
|
|
4
4
|
"description": "DataViews is a component that provides an API to render datasets using different types of layouts (table, grid, list, etc.).",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"./wp": {
|
|
34
34
|
"types": "./build-types/index.d.ts",
|
|
35
|
-
"
|
|
35
|
+
"default": "./build-wp/index.js"
|
|
36
36
|
},
|
|
37
37
|
"./package.json": {
|
|
38
38
|
"default": "./package.json"
|
|
@@ -44,19 +44,19 @@
|
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@ariakit/react": "^0.4.15",
|
|
47
|
-
"@wordpress/base-styles": "^6.8.1-next.
|
|
48
|
-
"@wordpress/components": "^30.6.1-next.
|
|
49
|
-
"@wordpress/compose": "^7.32.1-next.
|
|
50
|
-
"@wordpress/data": "^10.32.1-next.
|
|
51
|
-
"@wordpress/date": "^5.32.1-next.
|
|
52
|
-
"@wordpress/element": "^6.32.1-next.
|
|
53
|
-
"@wordpress/i18n": "^6.5.1-next.
|
|
54
|
-
"@wordpress/icons": "^11.0.1-next.
|
|
55
|
-
"@wordpress/keycodes": "^4.32.1-next.
|
|
56
|
-
"@wordpress/primitives": "^4.32.1-next.
|
|
57
|
-
"@wordpress/private-apis": "^1.32.1-next.
|
|
58
|
-
"@wordpress/url": "^4.32.1-next.
|
|
59
|
-
"@wordpress/warning": "^3.32.1-next.
|
|
47
|
+
"@wordpress/base-styles": "^6.8.1-next.b8c8708f3.0",
|
|
48
|
+
"@wordpress/components": "^30.6.1-next.b8c8708f3.0",
|
|
49
|
+
"@wordpress/compose": "^7.32.1-next.b8c8708f3.0",
|
|
50
|
+
"@wordpress/data": "^10.32.1-next.b8c8708f3.0",
|
|
51
|
+
"@wordpress/date": "^5.32.1-next.b8c8708f3.0",
|
|
52
|
+
"@wordpress/element": "^6.32.1-next.b8c8708f3.0",
|
|
53
|
+
"@wordpress/i18n": "^6.5.1-next.b8c8708f3.0",
|
|
54
|
+
"@wordpress/icons": "^11.0.1-next.b8c8708f3.0",
|
|
55
|
+
"@wordpress/keycodes": "^4.32.1-next.b8c8708f3.0",
|
|
56
|
+
"@wordpress/primitives": "^4.32.1-next.b8c8708f3.0",
|
|
57
|
+
"@wordpress/private-apis": "^1.32.1-next.b8c8708f3.0",
|
|
58
|
+
"@wordpress/url": "^4.32.1-next.b8c8708f3.0",
|
|
59
|
+
"@wordpress/warning": "^3.32.1-next.b8c8708f3.0",
|
|
60
60
|
"clsx": "^2.1.1",
|
|
61
61
|
"colord": "^2.7.0",
|
|
62
62
|
"date-fns": "^4.1.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build:wp": "node build"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "67cfd7e661931aeb0d06bec894599d287a4f8d0f"
|
|
78
78
|
}
|
|
@@ -104,9 +104,14 @@ export function ActionModal< Item >( {
|
|
|
104
104
|
}: ActionModalProps< Item > ) {
|
|
105
105
|
const label =
|
|
106
106
|
typeof action.label === 'string' ? action.label : action.label( items );
|
|
107
|
+
|
|
108
|
+
const modalHeader =
|
|
109
|
+
typeof action.modalHeader === 'function'
|
|
110
|
+
? action.modalHeader( items )
|
|
111
|
+
: action.modalHeader;
|
|
107
112
|
return (
|
|
108
113
|
<Modal
|
|
109
|
-
title={
|
|
114
|
+
title={ modalHeader || label }
|
|
110
115
|
__experimentalHideHeader={ !! action.hideModalHeader }
|
|
111
116
|
onRequestClose={ closeModal }
|
|
112
117
|
focusOnMount={ action.modalFocusOnMount ?? true }
|
|
@@ -768,15 +768,20 @@ export const actions: Action< SpaceObject >[] = [
|
|
|
768
768
|
label: 'Delete item',
|
|
769
769
|
isPrimary: true,
|
|
770
770
|
icon: trash,
|
|
771
|
-
|
|
771
|
+
modalHeader: ( items ) =>
|
|
772
|
+
items.length > 1
|
|
773
|
+
? `Delete ${ items.length } items`
|
|
774
|
+
: `Delete ${ items[ 0 ].name.title }`,
|
|
772
775
|
modalFocusOnMount: 'firstContentElement',
|
|
773
776
|
supportsBulk: true,
|
|
774
777
|
RenderModal: ( { items, closeModal } ) => {
|
|
778
|
+
const label =
|
|
779
|
+
items.length > 1
|
|
780
|
+
? `Are you sure you want to delete ${ items.length } items?`
|
|
781
|
+
: `Are you sure you want to delete "${ items[ 0 ].name.title }"?`;
|
|
775
782
|
return (
|
|
776
783
|
<VStack spacing="5">
|
|
777
|
-
<Text>
|
|
778
|
-
{ `Are you sure you want to delete "${ items[ 0 ].name.title }"?` }
|
|
779
|
-
</Text>
|
|
784
|
+
<Text>{ label }</Text>
|
|
780
785
|
<HStack justify="right">
|
|
781
786
|
<Button
|
|
782
787
|
__next40pxDefaultSize
|
package/src/types/dataviews.ts
CHANGED