Skip to content

Commit

Permalink
Refactor #1865
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Dec 10, 2021
1 parent 1d23034 commit 37f05e6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 5 deletions.
26 changes: 24 additions & 2 deletions src/components/config/PrimeVue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ interface PrimeVueConfiguration {
}

interface PrimeVueLocaleOptions {
startsWith?: string;
contains?: string;
notContains?: string;
endWith?: string;
equals?: string;
notEquals?: string;
noFilter?: string;
lt?: string;
lte?: string;
gt?: string;
gte?: string;
dateIs?: string;
dateIsNot?: string;
dateBefore?: string;
dateAfter?: string;
clear?: string;
apply?: string;
matchAll?: string;
matchAny?: string;
addRule?: string;
removeRule?: string;
accept?: string;
reject?: string;
choose?: string;
Expand All @@ -17,14 +38,15 @@ interface PrimeVueLocaleOptions {
monthNames: string[];
monthNamesShort: string[];
today?: string;
clear?: string;
weekHeader?: string;
firstDayOfWeek?: number;
dateFormat?: string;
weak?: string;
medium?: string;
strong?: string;
passwordPrompt?: string;
emptyFilterMessage?: string;
emptyMessage?: string;
}

export const install: PluginFunction<{}>;
Expand All @@ -35,4 +57,4 @@ declare module 'vue/types/vue' {
config: PrimeVueConfiguration;
}
}
}
}
54 changes: 51 additions & 3 deletions src/components/config/PrimeVue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
import {FilterMatchMode} from '../api';

const defaultOptions = {
ripple: false,
locale: {
startsWith: 'Starts with',
contains: 'Contains',
notContains: 'Not contains',
endsWith: 'Ends with',
equals: 'Equals',
notEquals: 'Not equals',
noFilter: 'No Filter',
lt: 'Less than',
lte: 'Less than or equal to',
gt: 'Greater than',
gte: 'Greater than or equal to',
dateIs: 'Date is',
dateIsNot: 'Date is not',
dateBefore: 'Date is before',
dateAfter: 'Date is after',
clear: 'Clear',
apply: 'Apply',
matchAll: 'Match All',
matchAny: 'Match Any',
addRule: 'Add Rule',
removeRule: 'Remove Rule',
accept: 'Yes',
reject: 'No',
choose: 'Choose',
Expand All @@ -12,15 +35,40 @@ const defaultOptions = {
monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: 'Today',
clear: 'Clear',
weekHeader: 'Wk',
firstDayOfWeek: 0,
dateFormat: 'mm/dd/yy',
weak: 'Weak',
medium: 'Medium',
strong: 'Strong',
passwordPrompt: 'Enter a password'
}
passwordPrompt: 'Enter a password',
emptyFilterMessage: 'No results found',
emptyMessage: 'No available options'
},
filterMatchModeOptions: {
text: [
FilterMatchMode.STARTS_WITH,
FilterMatchMode.CONTAINS,
FilterMatchMode.NOT_CONTAINS,
FilterMatchMode.ENDS_WITH,
FilterMatchMode.EQUALS,
FilterMatchMode.NOT_EQUALS
],
numeric: [
FilterMatchMode.EQUALS,
FilterMatchMode.NOT_EQUALS,
FilterMatchMode.LESS_THAN,
FilterMatchMode.LESS_THAN_OR_EQUAL_TO,
FilterMatchMode.GREATER_THAN,
FilterMatchMode.GREATER_THAN_OR_EQUAL_TO
],
date: [
FilterMatchMode.DATE_IS,
FilterMatchMode.DATE_IS_NOT,
FilterMatchMode.DATE_BEFORE,
FilterMatchMode.DATE_AFTER
]
},
};

export default {
Expand Down

0 comments on commit 37f05e6

Please sign in to comment.