Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license Pimcore Open Core License (POCL)
*/

import React, { useEffect, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import { Select } from '@Pimcore/components/select/select'
import { useDynamicFilter } from '@Pimcore/components/dynamic-filter/provider/use-dynamic-filter'
import { type DefaultOptionType } from 'antd/es/select'
Expand Down Expand Up @@ -42,6 +42,7 @@ const boolToNum = (value: boolean | null): number => {
export const DynamicTypeFieldFilterBooleanSelectComponent = (): React.JSX.Element => {
const { setData, data, config: rawConfig } = useDynamicFilter()
const config: IAssetSelectConfig | IObjectSelectConfig = rawConfig
const selectRef = useRef<any>(null)

const [_value, setValue] = useState<number[]>([])

Expand Down Expand Up @@ -75,7 +76,13 @@ export const DynamicTypeFieldFilterBooleanSelectComponent = (): React.JSX.Elemen
<Select
mode="multiple"
onChange={ handleChange }
onDropdownVisibleChange={ (open: boolean) => {
if (!open && selectRef.current !== null) {
selectRef.current.focus()
}
} }
options={ formattedOptions }
ref={ selectRef }
style={ { width: '100%' } }
value={ _value }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license Pimcore Open Core License (POCL)
*/

import React from 'react'
import React, { useRef } from 'react'
import dayjs from 'dayjs'
import { Select } from '@Pimcore/components/select/select'
import { Flex } from '@Pimcore/components/flex/flex'
Expand All @@ -30,6 +30,8 @@ const DATE_FORMAT = 'YYYY-MM-DD'
export interface DynamicTypeFieldFilterDateProps extends AbstractFieldFilterDefinition {}

export const DynamicTypeFieldFilterDateComponent = (props: DynamicTypeFieldFilterDateProps): React.JSX.Element => {
const datePickerRef = useRef<any>(null)

interface DateValue {
setting: DatePickerSettingValue
from: string | null
Expand Down Expand Up @@ -135,6 +137,8 @@ export const DynamicTypeFieldFilterDateComponent = (props: DynamicTypeFieldFilte
<Flex
align="center"
gap="extra-small"
ref={ datePickerRef }
tabIndex={ -1 }
>
<Select
defaultValue={ DatePickerSettingValue.ON }
Expand All @@ -152,6 +156,11 @@ export const DynamicTypeFieldFilterDateComponent = (props: DynamicTypeFieldFilte

handleDateRangeChange(convertValueToISOFormat(newFrom), convertValueToISOFormat(newTo))
} }
onOpenChange={ (open: boolean) => {
if (!open && datePickerRef.current !== null) {
datePickerRef.current.focus()
}
} }
outputType="timestamp"
value={ [convertISOToTimestamp(data?.from ?? null), convertISOToTimestamp(data?.to ?? null)] }
/>
Expand All @@ -172,6 +181,11 @@ export const DynamicTypeFieldFilterDateComponent = (props: DynamicTypeFieldFilte
handleDateChange('from', convertedValue)
}
} }
onOpenChange={ (open: boolean) => {
if (!open && datePickerRef.current !== null) {
datePickerRef.current.focus()
}
} }
outputType="timestamp"
value={ convertISOToTimestamp(getDatePickerValue()) }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license Pimcore Open Core License (POCL)
*/

import React, { useEffect, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import { Select } from '@Pimcore/components/select/select'
import { useDynamicFilter } from '@Pimcore/components/dynamic-filter/provider/use-dynamic-filter'
import { type DefaultOptionType } from 'antd/es/select'
Expand All @@ -26,6 +26,7 @@ interface IAssetSelectConfig {
export const DynamicTypeFieldFilterMultiselectComponent = (): React.JSX.Element => {
const { setData, data, config: rawConfig } = useDynamicFilter()
const [_value, setValue] = useState<string[]>(data as string[])
const selectRef = useRef<any>(null)

const config: IAssetSelectConfig | IObjectSelectConfig = rawConfig
let formattedOptions: DefaultOptionType[] = []
Expand Down Expand Up @@ -55,7 +56,13 @@ export const DynamicTypeFieldFilterMultiselectComponent = (): React.JSX.Element
<Select
mode="multiple"
onChange={ handleChange }
onDropdownVisibleChange={ (open: boolean) => {
if (!open && selectRef.current !== null) {
selectRef.current.focus()
}
} }
options={ formattedOptions }
ref={ selectRef }
showSearch={ rawConfig?.showSearch ?? false }
style={ { width: '100%' } }
value={ _value }
Expand Down
23 changes: 0 additions & 23 deletions public/build/01fef709-9d44-41ec-927a-9f9ac7761633/entrypoints.json

This file was deleted.

Loading