@ouestfrance/sipa-bms-ui 8.9.2 → 8.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouestfrance/sipa-bms-ui",
3
- "version": "8.9.2",
3
+ "version": "8.9.3",
4
4
  "author": "Ouest-France BMS",
5
5
  "license": "ISC",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -11,6 +11,7 @@ import BmsLoader from './components/feedback/BmsLoader.vue';
11
11
  import BmsTooltip from './components/feedback/BmsTooltip.vue';
12
12
 
13
13
  import BmsAutocomplete from './components/form/BmsAutocomplete.vue';
14
+ import BmsServerAutocomplete from '@/components/form/BmsServerAutocomplete.vue';
14
15
  import BmsBetweenInput from './components/form/BmsBetweenInput.vue';
15
16
  import BmsChip from './components/form/BmsChip.vue';
16
17
  import BmsFilePicker from './components/form/BmsFilePicker.vue';
@@ -80,6 +81,8 @@ export const createBmsUi = () => ({
80
81
  app.component('BmsTooltip', BmsTooltip);
81
82
 
82
83
  app.component('BmsAutocomplete', BmsAutocomplete);
84
+ app.component('BmsServerAutocomplete', BmsServerAutocomplete);
85
+
83
86
  app.component('BmsBetweenInput', BmsBetweenInput);
84
87
  app.component('BmsChip', BmsChip);
85
88
  app.component('BmsFilePicker', BmsFilePicker);
@@ -157,6 +160,7 @@ export {
157
160
  BmsLoader,
158
161
  BmsTooltip,
159
162
  BmsAutocomplete,
163
+ BmsServerAutocomplete,
160
164
  BmsBetweenInput,
161
165
  BmsChip,
162
166
  BmsFilePicker,
@@ -9,27 +9,17 @@ app.use(cors());
9
9
  const port = 3000;
10
10
 
11
11
  app.get('/pokemon-types', (req, res) => {
12
- res.send({
13
- data: [
14
- { label: 'Grass', value: 'Grass' },
15
- { label: 'Poison', value: 'Poison' },
16
- { label: 'Fire', value: 'Fire' },
17
- { label: 'Flying', value: 'Flying' },
18
- { label: 'Water', value: 'Water' },
19
- { label: 'Bug', value: 'Bug' },
20
- { label: 'Normal', value: 'Normal' },
21
- { label: 'Electric', value: 'Electric' },
22
- { label: 'Ground', value: 'Ground' },
23
- { label: 'Fairy', value: 'Fairy' },
24
- { label: 'Fighting', value: 'Fighting' },
25
- { label: 'Psychic', value: 'Psychic' },
26
- { label: 'Rock', value: 'Rock' },
27
- { label: 'Steel', value: 'Steel' },
28
- { label: 'Ice', value: 'Ice' },
29
- { label: 'Ghost', value: 'Ghost' },
30
- { label: 'Dragon', value: 'Dragon' },
31
- ],
32
- });
12
+ let data = pokemons.map((pokemon) => ({
13
+ label: pokemon.name,
14
+ value: pokemon.name,
15
+ }));
16
+ if (req.query.search) {
17
+ data = data.filter((pokemon) =>
18
+ pokemon.label.toLowerCase().includes(req.query.search.toLowerCase()),
19
+ );
20
+ }
21
+
22
+ res.send({ data });
33
23
  });
34
24
 
35
25
  app.get('/pokemons', (req, res) => {