# Search Widget

# Description

This widget displays a full featured commitment searching mechanism.

Features:

  1. free text search

  2. aichi-target filter

  3. sdg filter

  4. actor type filter

  5. SCBD subject filter

  6. text search to search available filters

  7. Envoke a filter change from external JS program by dispatching event $scbdFilterChange

  8. url derived search for creating pages and or sharing

    a. make a country page such as: (opens new window) https://www.cbd.int/action-agenda/contributions/?filter=fr

    b. a page dedicated to a target: (opens new window) https://www.cbd.int/action-agenda/contributions/?filter=AICHI-TARGET-01

# Install

# Widget

To install as a copy and paste widget. As seen here: (opens new window) https://www.cbd.int/action-agenda/contributions/

TIP

This component's options can be passed as an attribute on the script tag. See options details

# Properties





props     : {
  options : { type: Object, required: false },
  forceEnv: { type: String, required: false, default: 'production' }
},
1
2
3

# forceEnv

Tell the component which api to use by passing: dev | stg | prod

dev : https://api.cbddev.xyz/api/actions

stg : https://api.stg.cbd.int/api/actions

prod : https://api.cbd.int/api/actions

# options

const validationMap =
{ forceEnv        : String,  /* default: production */
  basePath        : String,  /* default: '/' */
  locale          : String,  /* default: derives from the client automatically otherwise 'en' */
  api             : String,  /* default: api/cbd.int/api/actions */
  hostname        : String,  /* default: cbd.int - this is also used to derive the env if set. */
  listenExternally: Boolean, /* default: false - listen for js event $scbdFilterChange */
  preLoadFilter   : String,  /* preload a single filter by identifier 'AICHI-TARGET-01' */
  smTop           : String,  /* offset sticky header in small devices */
  mdTop           : String,  /* offset sticky header in medium devices */
  lgTop           : String   /* offset sticky header in large devices */
}
1
2
3
4
5
6
7
8
9
10
11

# I18n (translations)

 export default {
   "messages": {
     "en": {
       "New": "New",
       "Rejected": "Rejected",
       "Published": "Published",
       "Publish": "Publish",
       "Unpublish": "Unpublish",
       "Reject": "Reject",
       "Deleted": "Deleted",
       "Type to narrow filter options below or press enter to apply free text search": "Type to narrow filter options below or press enter to apply free text search",
       "Press enter or click to select filter": "Press enter or click to select filter",
       "Press enter to apply free text search or click the Search button": "Press enter to apply free text search or click the Search button",
       "deleted": "Deleted",
       "draft": "New",
       "rejected": "Rejected",
       "published": "Published",
       "showing": "showing",
       "to": "to",
       "of": "of",
       "filters": "Filters",
       "action": "Action",
       "actor": "Actor",
       "View Action": "View Action",
       "Text Search": "Text Search",
       "Search": "Search",
       "Free Text Searches": "Free Text Searches",
       "close": "close",
       "edit": "edit",
       "help": "help",
       "earth": "earth",
       "delete": "delete",
       "file": "file",
       "upload to cloud": "upload to cloud",
       "down": "down",
       "search": "search",
       "filter": "filter",
       "Filter": "Filter",
       "or": "or",
       "page": "page",
       "results": "results",
       "Select option": "Select option"
     },
     "ar": {
       "deleted": "تم الحذف",
       "draft": "جديد",
       "rejected": "مرفوض",
       "published": "نشرت",
       "showing": "عرض",
       "to": "ل",
       "of": "من",
       "filters": "المرشحات",
       "action": "عمل",
       "actor": "الممثل",
       "View Action": "مشاهدة ملف Action",
       "Text Search": "البحث عن النص",
       "Search": "يبحث",
       "Free Text Searches": "بحث نصي مجاني",
       "close": "قريب",
       "edit": "تعديل",
       "help": "يساعد",
       "earth": "أرض",
       "delete": "حذف",
       "file": "ملف",
       "upload to cloud": "تحميل إلى السحابة",
       "down": "تحت",
       "search": "بحث",
       "filter": "منقي",
       "or": "أو",
       "Filter": "منقي",
       "Type to narrow filter options below or press enter to apply free text search": "اكتب لتضييق خيارات التصفية أدناه أو اضغط على إدخال لتطبيق بحث نصي مجاني",
       "Press enter or click to select filter": "اضغط على Enter أو انقر لتحديد عامل التصفية",
       "Press enter to apply free text search or click the Search button": "اضغط على Enter لتطبيق بحث نصي مجاني أو انقر فوق الزر \"بحث\"",
       "Deleted": "تم الحذف",
       "page": "صفحة",
       "results": "النتائج",
       "Select option": "حدد الخيار",
       "New": "جديد",
       "Rejected": "مرفوض",
       "Published": "نشرت",
       "Publish": "ينشر",
       "Unpublish": "إلغاء النشر",
       "Reject": "رفض"
     },
     "es": {
       "deleted": "Eliminado",
       "draft": "Nuevo",
       "rejected": "Rechazado",
       "published": "Publicado",
       "showing": "demostración",
       "to": "a",
       "of": "de",
       "filters": "Filtros",
       "action": "Acción",
       "actor": "Actor",
       "View Action": "Ver acción",
       "Text Search": "Búsqueda de texto",
       "Search": "Buscar",
       "Free Text Searches": "Búsquedas de texto libre",
       "close": "cerca",
       "edit": "editar",
       "help": "ayuda",
       "earth": "tierra",
       "delete": "Eliminar",
       "file": "expediente",
       "upload to cloud": "subir a la nube",
       "down": "abajo",
       "search": "buscar",
       "filter": "filtrar",
       "or": "o",
       "Filter": "Filtrar",
       "Type to narrow filter options below or press enter to apply free text search": "Escriba para restringir las opciones de filtro a continuación o presione Intro para aplicar la búsqueda de texto libre",
       "Press enter or click to select filter": "Presione enter o haga clic para seleccionar el filtro",
       "Press enter to apply free text search or click the Search button": "Presione enter para aplicar la búsqueda de texto libre o haga clic en el botón Buscar",
       "Deleted": "Eliminado",
       "page": "página",
       "results": "resultados",
       "Select option": "Seleccionar opción",
       "New": "Nuevo",
       "Rejected": "Rechazado",
       "Published": "Publicado",
       "Publish": "Publicar",
       "Unpublish": "Anular publicación",
       "Reject": "Rechazar"
     },
     "fr": {
       "deleted": "Supprimé",
       "draft": "Nouveau",
       "rejected": "Rejeté",
       "published": "Publié",
       "showing": "montrant",
       "to": "à",
       "of": "de",
       "filters": "Filtres",
       "action": "action",
       "actor": "Acteur",
       "View Action": "Afficher l'action",
       "Text Search": "Recherche de texte",
       "Search": "Rechercher",
       "Free Text Searches": "Recherches de texte libre",
       "close": "Fermer",
       "edit": "Éditer",
       "help": "aider",
       "earth": "Terre",
       "delete": "effacer",
       "file": "déposer",
       "upload to cloud": "télécharger dans le cloud",
       "down": "vers le bas",
       "search": "rechercher",
       "filter": "filtre",
       "or": "ou alors",
       "Filter": "Filtre",
       "Type to narrow filter options below or press enter to apply free text search": "Tapez pour affiner les options de filtre ci-dessous ou appuyez sur Entrée pour appliquer la recherche de texte libre",
       "Press enter or click to select filter": "Appuyez sur Entrée ou cliquez pour sélectionner le filtre",
       "Press enter to apply free text search or click the Search button": "Appuyez sur Entrée pour appliquer la recherche de texte libre ou cliquez sur le bouton Rechercher",
       "Deleted": "Supprimé",
       "page": "page",
       "results": "résultats",
       "Select option": "Sélectionnez l'option",
       "New": "Nouveau",
       "Rejected": "Rejeté",
       "Published": "Publié",
       "Publish": "Publier",
       "Unpublish": "Dépublier",
       "Reject": "Rejeter"
     },
     "ru": {
       "deleted": "Удалено",
       "draft": "Новый",
       "rejected": "Отклоненный",
       "published": "Опубликовано",
       "showing": "показывая",
       "to": "к",
       "of": "из",
       "filters": "Фильтры",
       "action": "Действие",
       "actor": "Актер",
       "View Action": "Посмотреть действие",
       "Text Search": "Текстовый поиск",
       "Search": "Поиск",
       "Free Text Searches": "Бесплатные текстовые поиски",
       "close": "Закрыть",
       "edit": "редактировать",
       "help": "помощь",
       "earth": "земля",
       "delete": "Удалить",
       "file": "файл",
       "upload to cloud": "загрузить в облако",
       "down": "вниз",
       "search": "поиск",
       "filter": "фильтр",
       "or": "или же",
       "Filter": "Фильтр",
       "Type to narrow filter options below or press enter to apply free text search": "Введите текст, чтобы сузить параметры фильтра ниже, или нажмите клавишу ВВОД, чтобы применить поиск по свободному тексту.",
       "Press enter or click to select filter": "Нажмите Enter или щелкните, чтобы выбрать фильтр",
       "Press enter to apply free text search or click the Search button": "Нажмите клавишу ВВОД, чтобы применить поиск по свободному тексту, или нажмите кнопку Поиск",
       "Deleted": "Удалено",
       "page": "страница",
       "results": "полученные результаты",
       "Select option": "Выберите опцию",
       "New": "Новый",
       "Rejected": "Отклоненный",
       "Published": "Опубликовано",
       "Publish": "Публиковать",
       "Unpublish": "Отменить публикацию",
       "Reject": "Отклонять"
     },
     "zh": {
       "deleted": "已删除",
       "draft": "新的",
       "rejected": "拒绝了",
       "published": "已发表",
       "showing": "显示",
       "to": "至",
       "of": "的",
       "filters": "过滤器",
       "action": "行动",
       "actor": "演员",
       "View Action": "查看操作",
       "Text Search": "文本搜索",
       "Search": "搜索",
       "Free Text Searches": "自由文本搜索",
       "close": "关闭",
       "edit": "编辑",
       "help": "帮助",
       "earth": "地球",
       "delete": "删除",
       "file": "文件",
       "upload to cloud": "上传到云端",
       "down": "下",
       "search": "搜索",
       "filter": "筛选",
       "or": "或者",
       "Filter": "筛选",
       "Type to narrow filter options below or press enter to apply free text search": "键入以缩小下面的过滤器选项或按 Enter 应用自由文本搜索",
       "Press enter or click to select filter": "按 Enter 或单击以选择过滤器",
       "Press enter to apply free text search or click the Search button": "按 Enter 键应用自由文本搜索或单击“搜索”按钮",
       "Deleted": "已删除",
       "page": "页",
       "results": "结果",
       "Select option": "选择选项",
       "New": "新的",
       "Rejected": "拒绝了",
       "Published": "已发表",
       "Publish": "发布",
       "Unpublish": "取消发布",
       "Reject": "拒绝"
     }
   }
 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249

# Example