From 2ac1f48a95a9627fc8dd20a6298d276d45ff1b4e Mon Sep 17 00:00:00 2001 From: Tyler Sheaffer <1238684+tsheaff@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:12:54 -1000 Subject: [PATCH 1/8] support a modalAnimationType prop --- index.d.ts | 1 + src/components/Picker.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 9beba118..d25331f2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -176,6 +176,7 @@ declare module 'react-native-dropdown-picker' { searchPlaceholderTextColor?: string; dropDownContainerStyle?: StyleProp; modalContentContainerStyle?: StyleProp; + modalAnimationType?: 'none' | 'slide' | 'fade'; arrowIconContainerStyle?: StyleProp; closeIconContainerStyle?: StyleProp; tickIconContainerStyle?: StyleProp; diff --git a/src/components/Picker.js b/src/components/Picker.js index 0b069400..07f40a72 100644 --- a/src/components/Picker.js +++ b/src/components/Picker.js @@ -75,6 +75,7 @@ function Picker({ searchPlaceholderTextColor = Colors.GREY, dropDownContainerStyle = {}, modalContentContainerStyle = {}, + modalAnimationType = 'none', arrowIconContainerStyle = {}, closeIconContainerStyle = {}, tickIconContainerStyle = {}, @@ -1749,7 +1750,7 @@ function Picker({ * @returns {JSX.Element} */ const DropDownModalComponent = useMemo(() => ( - + {SearchComponent} {DropDownFlatListComponent} From 43a39fc04c8a4c44379ef6322c9e221f9098a7e8 Mon Sep 17 00:00:00 2001 From: pedropaulodf Date: Wed, 23 Nov 2022 13:57:51 -0300 Subject: [PATCH 2/8] feat: add brazilian portuguese translation --- src/translations/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/translations/index.js b/src/translations/index.js index 1b5e05a1..52c06752 100644 --- a/src/translations/index.js +++ b/src/translations/index.js @@ -59,4 +59,13 @@ export default { }, NOTHING_TO_SHOW: 'Non c\'è nulla da mostrare!' }, + PT: { + PLACEHOLDER: 'Selecione um item', + SEARCH_PLACEHOLDER: 'Faça sua busca...', + SELECTED_ITEMS_COUNT_TEXT: { + 1: 'Um item selecionado', + n: '{count} alguns itens selecionados' + }, + NOTHING_TO_SHOW: 'Nada a ser mostrado!' + }, } From b6f23750f828f67fe1581c39f045498e78d63e45 Mon Sep 17 00:00:00 2001 From: Randall71 <51382079+Randall71@users.noreply.github.com> Date: Mon, 28 Nov 2022 00:31:32 +0000 Subject: [PATCH 3/8] feat: add french translation --- src/translations/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/translations/index.js b/src/translations/index.js index 52c06752..a6a933ca 100644 --- a/src/translations/index.js +++ b/src/translations/index.js @@ -68,4 +68,13 @@ export default { }, NOTHING_TO_SHOW: 'Nada a ser mostrado!' }, + FR: { + PLACEHOLDER: 'Sélectionnez un élément', + SEARCH_PLACEHOLDER: 'Tapez quelque chose...', + SELECTED_ITEMS_COUNT_TEXT: { + 1: 'Un élément a été sélectionné', + n: '{count} éléments ont été sélectionnés' + }, + NOTHING_TO_SHOW: 'Il n\'y a rien à montrer!' + }, } From d726dc082d8055d061578922bf18779b591bd583 Mon Sep 17 00:00:00 2001 From: marcel-fly <62428763+marcel-fly@users.noreply.github.com> Date: Mon, 19 Dec 2022 09:48:21 +0100 Subject: [PATCH 4/8] Add ability to search with regional accents --- src/components/Picker.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Picker.js b/src/components/Picker.js index 07f40a72..29259678 100644 --- a/src/components/Picker.js +++ b/src/components/Picker.js @@ -99,6 +99,7 @@ function Picker({ listMode = LIST_MODE.DEFAULT, categorySelectable = true, searchable = false, + searchWithRegionalAccents = false, searchPlaceholder = null, modalTitle, schema = {}, @@ -455,8 +456,14 @@ function Picker({ return sortedItems; const values = []; + const normalizeText = (text) => label.normalize("NFD").replace(/[\u0300-\u036f]/g, "") + let results = sortedItems.filter(item => { - if (item[_schema.label].toLowerCase().includes(searchText.toLowerCase())) { + const label = item[_schema.label].toLowerCase(); + if ( + label.includes(searchText.toLowerCase()) + || searchWithRegionalAccents && normalizeText(label).includes(searchText.toLowerCase()) + ) { values.push(item[_schema.value]); return true; } From a5c158abf6489a828cf68cc8ebff3c1f2750ca1d Mon Sep 17 00:00:00 2001 From: marcel-fly <62428763+marcel-fly@users.noreply.github.com> Date: Mon, 19 Dec 2022 09:50:46 +0100 Subject: [PATCH 5/8] Add prop type search withRegional accents --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index d25331f2..4b2e98a4 100644 --- a/index.d.ts +++ b/index.d.ts @@ -174,6 +174,7 @@ declare module 'react-native-dropdown-picker' { searchContainerStyle?: StyleProp; searchTextInputStyle?: StyleProp; searchPlaceholderTextColor?: string; + searchWithRegionalAccents?: boolean; dropDownContainerStyle?: StyleProp; modalContentContainerStyle?: StyleProp; modalAnimationType?: 'none' | 'slide' | 'fade'; From 31b49da658b3eb9f3ab1b6ea332fcbc1eaecc5db Mon Sep 17 00:00:00 2001 From: marcel-fly <62428763+marcel-fly@users.noreply.github.com> Date: Mon, 19 Dec 2022 10:27:17 +0100 Subject: [PATCH 6/8] Fix variable name --- src/components/Picker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Picker.js b/src/components/Picker.js index 29259678..c7696832 100644 --- a/src/components/Picker.js +++ b/src/components/Picker.js @@ -456,7 +456,7 @@ function Picker({ return sortedItems; const values = []; - const normalizeText = (text) => label.normalize("NFD").replace(/[\u0300-\u036f]/g, "") + const normalizeText = (text) => text.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); let results = sortedItems.filter(item => { const label = item[_schema.label].toLowerCase(); From 96f3f38d93b00780b59cca24e5cff22d760bfcc1 Mon Sep 17 00:00:00 2001 From: Hossein Zare <56504893+hossein-zare@users.noreply.github.com> Date: Tue, 20 Dec 2022 18:44:47 +0330 Subject: [PATCH 7/8] Update index.d.ts --- index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 4b2e98a4..bb084f1d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -70,7 +70,9 @@ declare module 'react-native-dropdown-picker' { | 'RU' | 'ES' | 'ID' - | 'IT'; + | 'IT' + | 'PT' + | 'FR'; export interface TranslationInterface { PLACEHOLDER: string; From de1ba75dc4f6c57ed5e40452a0049c8e70ad0bfc Mon Sep 17 00:00:00 2001 From: Hossein Zare <56504893+hossein-zare@users.noreply.github.com> Date: Tue, 20 Dec 2022 18:56:47 +0330 Subject: [PATCH 8/8] Update version. [v5.4.4] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d4e3ef7..a051bdd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-dropdown-picker", - "version": "5.4.3", + "version": "5.4.4", "description": "A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.", "keywords": [ "picker",