@opengis/fastify-table 2.5.49 → 2.5.51

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.
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../server/helpers/core/badge.ts"],"names":[],"mappings":"AAEA,wBAA8B,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,gBAWxD"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../server/helpers/core/badge.ts"],"names":[],"mappings":"AACA,wBAA8B,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,gBAoBxD"}
@@ -1,16 +1,20 @@
1
- import getSelect from '../../plugins/table/funcs/getSelect.js';
1
+ import getSelectVal from "../../plugins/table/funcs/metaFormat/getSelectVal.js";
2
2
  export default async function badge(id, options) {
3
3
  if (!id?.toString)
4
- return '-';
4
+ return "-";
5
5
  const data = options.hash?.data;
6
6
  if (!data)
7
7
  return id;
8
- const classifier = await getSelect(data);
9
- if (!classifier?.arr)
8
+ const classifier = await getSelectVal({
9
+ name: data,
10
+ values: [id],
11
+ ar: true,
12
+ });
13
+ if (!classifier?.length)
10
14
  return id;
11
- const item = classifier?.arr.find((el) => el.id?.toString?.() === id.toString());
15
+ const item = classifier.find((el) => el.id?.toString?.() === id.toString());
12
16
  if (!item)
13
17
  return id;
14
- return `<span style='color:${item.color || '#14b8a6'};border-color:${item.color || '#14b8a6'}; overflow:hidden;
18
+ return `<span style='color:${item.color || "#14b8a6"};border-color:${item.color || "#14b8a6"}; overflow:hidden;
15
19
  text-overflow:ellipsis; white-space:nowrap;' class="block w-fit py-1.5 px-3 rounded-full text-xs font-medium border border-teal-500 text-teal-500 max-w-[220px] text-nowrap ">${item.text}</span>`;
16
20
  }
@@ -248,7 +248,7 @@ export default function formatValue({ table, filter = {}, name, value, dataTypeI
248
248
  return {
249
249
  op: "=",
250
250
  query,
251
- values: [value],
251
+ values: [value.split(",")],
252
252
  };
253
253
  }
254
254
  const query = `${name}::text=any($${args.length})`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.5.49",
3
+ "version": "2.5.51",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [