Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): incorrect filtered child props #3190

Merged
merged 1 commit into from
Mar 17, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/ui/src/components/va-data-table/VaDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ export default defineComponent({
class: pick(props, ['striped', 'selectable', 'hoverable', 'clickable']),
}) as TableHTMLAttributes)

const filteredVirtualScrollerProps = filterComponentProps(VaVirtualScrollerProps)
const virtualScrollerPropsComputed = computed(() => ({
...filterComponentProps(VaVirtualScrollerProps).value,
...filteredVirtualScrollerProps.value,
items: paginatedRows.value,
trackBy: props.virtualTrackBy,
disabled: !props.virtualScroller,
Expand All @@ -367,8 +368,9 @@ export default defineComponent({
...virtualScrollerPropsComputed.value,
}))

const filteredThProps = filterComponentProps(VaDataTableThRowProps)
const thAttributesComputed = computed(() => ({
...filterComponentProps(VaDataTableThRowProps).value,
...filteredThProps.value,
columns: columnsComputed.value,
sortingOrderIconName: sortingOrderIconName.value,
severalRowsSelected: severalRowsSelected.value,
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/components/va-date-input/VaDateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ import { VaDropdown, VaDropdownContent } from '../va-dropdown'
import { VaInputWrapper } from '../va-input'
import { VaIcon } from '../va-icon'

const VaInputWrapperProps = extractComponentProps(VaInputWrapper, ['focused', 'maxLength', 'counterValue', 'disabled'])
const VaInputWrapperProps = extractComponentProps(VaInputWrapper, ['focused', 'maxLength', 'counterValue'])
const VaDatePickerProps = extractComponentProps(VaDatePicker)
const VaDropdownProps = extractComponentProps(VaDropdown,
['innerAnchorSelector', 'stateful', 'offset', 'keyboardNavigation', 'closeOnContentClick', 'modelValue'],
Expand Down Expand Up @@ -349,8 +349,9 @@ export default defineComponent({
tabindex: iconTabindexComputed.value,
}))

const filteredWrapperProps = filterComponentProps(VaInputWrapperProps)
const computedInputWrapperProps = computed(() => ({
...filterComponentProps(VaInputWrapperProps).value,
...filteredWrapperProps.value,
focused: isFocused.value,
error: hasError.value,
errorMessages: computedErrorMessages.value,
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/components/va-select/VaSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,9 @@ export default defineComponent({

const { tp, t } = useTranslation()

const filteredDropdownProps = filterComponentProps(VaDropdownProps)
const dropdownPropsComputed = computed(() => ({
...filterComponentProps(VaDropdownProps).value,
...filteredDropdownProps.value,
closeOnContentClick: closeOnContentClick.value,
stateful: false,
offset: [1, 0] as DropdownOffsetProp,
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/va-time-input/VaTimeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ import VaTimePicker from '../va-time-picker/VaTimePicker.vue'
import { VaInputWrapper } from '../va-input'
import VaIcon from '../va-icon/VaIcon.vue'
import { VaDropdown, VaDropdownContent } from '../va-dropdown'
import type { DropdownOffsetProp } from '../va-dropdown/types'

const VaInputWrapperProps = extractComponentProps(VaInputWrapper, ['focused', 'maxLength', 'counterValue', 'disabled'])
const VaInputWrapperProps = extractComponentProps(VaInputWrapper, ['focused', 'maxLength', 'counterValue'])
const VaDropdownProps = extractComponentProps(VaDropdown,
['keyboardNavigation', 'offset', 'placement', 'closeOnContentClick', 'innerAnchorSelector', 'modelValue'],
)
Expand Down Expand Up @@ -240,8 +239,9 @@ export default defineComponent({
canBeCleared.value && valueText.value !== format(props.clearValue)
))

const filteredWrapperProps = filterComponentProps(VaInputWrapperProps)
const computedInputWrapperProps = computed(() => ({
...filterComponentProps(VaInputWrapperProps).value,
...filteredWrapperProps.value,
focused: isFocused.value,
error: computedError.value,
errorMessages: computedErrorMessages.value,
Expand Down