Skip to content

Commit

Permalink
Refactor #5612
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Apr 18, 2024
1 parent b2ec54e commit c40b320
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 22 deletions.
14 changes: 7 additions & 7 deletions components/lib/column/Column.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { ComponentHooks } from '../basecomponent';
import { ButtonPassThroughOptions } from '../button';
import { CheckboxPassThroughOptionType } from '../checkbox';
import { DataTablePassThroughOptions } from '../datatable';
import { DropdownPassThroughOptionType } from '../dropdown';
import { PassThroughOptions } from '../passthrough';
import { RadioButtonPassThroughOptionType } from '../radiobutton';
import { SelectPassThroughOptionType } from '../select';
import { ClassComponent, DesignToken, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
import { VirtualScrollerLoaderOptions } from '../virtualscroller';

Expand Down Expand Up @@ -207,10 +207,10 @@ export interface ColumnPassThroughOptions {
*/
filterOperator?: ColumnPassThroughOptionType;
/**
* Used to pass attributes to the Dropdown component.
* @see {@link DropdownPassThroughOptionType}
* Used to pass attributes to the Select component.
* @see {@link SelectPassThroughOptionType}
*/
filterOperatorDropdown?: DropdownPassThroughOptionType<ColumnSharedPassThroughMethodOptions>;
filterOperatorDropdown?: SelectPassThroughOptionType<ColumnSharedPassThroughMethodOptions>;
/**
* Used to pass attributes to the filter constraints' DOM element.
*/
Expand All @@ -220,10 +220,10 @@ export interface ColumnPassThroughOptions {
*/
filterConstraint?: ColumnPassThroughOptionType;
/**
* Used to pass attributes to the Dropdown component.
* @see {@link DropdownPassThroughOptionType}
* Used to pass attributes to the Select component.
* @see {@link SelectPassThroughOptionType}
*/
filterMatchModeDropdown?: DropdownPassThroughOptionType<ColumnSharedPassThroughMethodOptions>;
filterMatchModeDropdown?: SelectPassThroughOptionType<ColumnSharedPassThroughMethodOptions>;
/**
* Used to pass attributes to the filter remove button container's DOM element.
*/
Expand Down
12 changes: 6 additions & 6 deletions components/lib/datatable/ColumnFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</template>
<template v-else>
<div v-if="isShowOperator" :class="cx('filterOperator')" v-bind="getColumnPT('filterOperator')">
<CFDropdown
<CFSelect
:options="operatorOptions"
:modelValue="operator"
:aria-label="filterOperatorAriaLabel"
Expand All @@ -69,11 +69,11 @@
@update:modelValue="onOperatorChange($event)"
:unstyled="unstyled"
:pt="getColumnPT('filterOperatorDropdown')"
></CFDropdown>
></CFSelect>
</div>
<div :class="cx('filterConstraints')" v-bind="getColumnPT('filterConstraints')">
<div v-for="(fieldConstraint, i) of fieldConstraints" :key="i" :class="cx('filterConstraint')" v-bind="getColumnPT('filterConstraint')">
<CFDropdown
<CFSelect
v-if="isShowMatchModes"
:options="matchModes"
:modelValue="fieldConstraint.matchMode"
Expand All @@ -84,7 +84,7 @@
@update:modelValue="onMenuMatchModeChange($event, i)"
:unstyled="unstyled"
:pt="getColumnPT('filterMatchModeDropdown')"
></CFDropdown>
></CFSelect>
<component v-if="display === 'menu'" :is="filterElement" :field="field" :filterModel="fieldConstraint" :filterCallback="filterCallback" :applyFilter="applyFilter" />
<div v-bind="getColumnPT('filterRemove')">
<CFButton
Expand Down Expand Up @@ -158,14 +158,14 @@
import { FilterOperator } from 'primevue/api';
import BaseComponent from 'primevue/basecomponent';
import Button from 'primevue/button';
import Dropdown from 'primevue/dropdown';
import FocusTrap from 'primevue/focustrap';
import FilterIcon from 'primevue/icons/filter';
import FilterSlashIcon from 'primevue/icons/filterslash';
import PlusIcon from 'primevue/icons/plus';
import TrashIcon from 'primevue/icons/trash';
import OverlayEventBus from 'primevue/overlayeventbus';
import Portal from 'primevue/portal';
import Select from 'primevue/select';
import { ConnectedOverlayScrollHandler, DomHandler, UniqueComponentId, ZIndexUtils } from 'primevue/utils';
import { mergeProps } from 'vue';
Expand Down Expand Up @@ -711,7 +711,7 @@ export default {
}
},
components: {
CFDropdown: Dropdown,
CFSelect: Select,
CFButton: Button,
Portal: Portal,
FilterSlashIcon: FilterSlashIcon,
Expand Down
8 changes: 4 additions & 4 deletions components/lib/paginator/JumpToPageDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<JTPDropdown
<JTPSelect
:modelValue="page"
:options="pageOptions"
optionLabel="label"
Expand All @@ -14,12 +14,12 @@
<template v-if="templates['jumptopagedropdownicon']" #dropdownicon="slotProps">
<component :is="templates['jumptopagedropdownicon']" :class="slotProps.class" />
</template>
</JTPDropdown>
</JTPSelect>
</template>

<script>
import BaseComponent from 'primevue/basecomponent';
import Dropdown from 'primevue/dropdown';
import Select from 'primevue/select';
export default {
name: 'JumpToPageDropdown',
Expand Down Expand Up @@ -49,7 +49,7 @@ export default {
}
},
components: {
JTPDropdown: Dropdown
JTPSelect: Select
}
};
</script>
8 changes: 4 additions & 4 deletions components/lib/paginator/RowsPerPageDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<RPPDropdown
<RPPSelect
:modelValue="rows"
:options="rowsOptions"
optionLabel="label"
Expand All @@ -14,12 +14,12 @@
<template v-if="templates['rowsperpagedropdownicon']" #dropdownicon="slotProps">
<component :is="templates['rowsperpagedropdownicon']" :class="slotProps.class" />
</template>
</RPPDropdown>
</RPPSelect>
</template>

<script>
import BaseComponent from 'primevue/basecomponent';
import Dropdown from 'primevue/dropdown';
import Select from 'primevue/select';
export default {
name: 'RowsPerPageDropdown',
Expand Down Expand Up @@ -51,7 +51,7 @@ export default {
}
},
components: {
RPPDropdown: Dropdown
RPPSelect: Select
}
};
</script>
1 change: 0 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ const CORE_DEPENDENCIES = {
'primevue/radiobutton': 'primevue.radiobutton',
'primevue/message': 'primevue.message',
'primevue/progressbar': 'primevue.progressbar',
'primevue/dropdown': 'primevue.dropdown',
'primevue/dialog': 'primevue.dialog',
'primevue/paginator': 'primevue.paginator',
'primevue/tree': 'primevue.tree',
Expand Down

0 comments on commit c40b320

Please sign in to comment.