-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
assets/js/src/modules/asset-tree/search/search-container.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react' | ||
import { type TreeSearchProps } from '@Pimcore/components/tree/tree' | ||
import { Input } from 'antd' | ||
|
||
const { Search } = Input | ||
|
||
const SearchContainer = (props: TreeSearchProps): React.JSX.Element => { | ||
const { setAdditionalQueryParams } = props | ||
|
||
function onSearch (searchTerm: string): void { | ||
setAdditionalQueryParams!({ | ||
idSearchTerm: searchTerm | ||
}) | ||
} | ||
|
||
return ( | ||
<Search onSearch={onSearch} size='small' /> | ||
) | ||
} | ||
|
||
export { SearchContainer } |
47 changes: 47 additions & 0 deletions
47
assets/js/src/modules/example/containers/widget-manager-actions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react' | ||
import { Button, Space } from 'antd' | ||
import { useWidgetManager } from '@Pimcore/modules/widget-manager/hooks/use-widget-manager' | ||
import { Icon } from '@Pimcore/components/icon/icon' | ||
|
||
export const WidgetManagerActions = (): React.JSX.Element => { | ||
const { openMainWidget, openBottomWidget, openLeftWidget, openRightWidget } = useWidgetManager() | ||
|
||
function onOpenMainWidgetClick (): void { | ||
openMainWidget({ | ||
component: 'widget-manager-actions', | ||
name: 'Widget Manager Actions' | ||
}) | ||
} | ||
|
||
function onOpenBottomWidgetClick (): void { | ||
openBottomWidget({ | ||
component: 'widget-manager-actions', | ||
name: 'Widget Manager Actions' | ||
}) | ||
} | ||
|
||
function onOpenLeftWidgetClick (): void { | ||
openLeftWidget({ | ||
component: 'widget-manager-actions', | ||
name: 'Widget Manager Actions' | ||
}) | ||
} | ||
|
||
function onOpenRightWidgetClick (): void { | ||
openRightWidget({ | ||
component: 'widget-manager-actions', | ||
name: 'Widget Manager Actions' | ||
}) | ||
} | ||
|
||
return ( | ||
<> | ||
<Space style={{ padding: '8px' }}> | ||
<Button type="primary" icon={<Icon name='folder' options={{ width: 12, height: 12 }}/>} onClick={onOpenMainWidgetClick}>Open Main Widget</Button> | ||
<Button type="default" icon={<Icon name='camera' options={{ width: 12, height: 12 }} />} onClick={onOpenBottomWidgetClick}>Open Bottom Widget</Button> | ||
<Button type="text" icon={<Icon name='folder' options={{ width: 12, height: 12 }} />} onClick={onOpenLeftWidgetClick}>Open Left Widget</Button> | ||
<Button type="dashed" icon={<Icon name='camera' options={{ width: 12, height: 12 }} />} onClick={onOpenRightWidgetClick}>Open Right Widget</Button> | ||
</Space> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { registerWidget } from '../widget-manager/utils/widget-registry' | ||
import { Example } from './containers/example' | ||
import { WidgetManagerActions } from './containers/widget-manager-actions' | ||
|
||
registerWidget({ | ||
name: 'example', | ||
component: Example | ||
}) | ||
|
||
registerWidget({ | ||
name: 'widget-manager-actions', | ||
component: WidgetManagerActions | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters