@opengis/fastify-table 2.1.5 → 2.1.7

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":"tableList.d.ts","sourceRoot":"","sources":["../../../../server/helpers/list/tableList.ts"],"names":[],"mappings":"AA+BA,wBAA8B,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,gBA+F1D"}
1
+ {"version":3,"file":"tableList.d.ts","sourceRoot":"","sources":["../../../../server/helpers/list/tableList.ts"],"names":[],"mappings":"AA8BA,wBAA8B,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,gBA4F1D"}
@@ -73,7 +73,7 @@ export default async function tableList(data, opt) {
73
73
  // body
74
74
  for (let k = 0; k < data.length; k += 1) {
75
75
  const row = data[k];
76
- result.push('<tr class="bg-white odd:bg-gray-50 ">');
76
+ result.push('<tr class="bg-white odd:bg-gray-50" style="page-break-inside: avoid; break-inside: avoid;">');
77
77
  const obj = { form: hash.form, table: hash.table, id: row[hash.id] };
78
78
  const token = hash.table
79
79
  ? setToken({ ids: [JSON.stringify(obj)], uid: hash.uid, array: 1 })[0]
@@ -100,5 +100,5 @@ export default async function tableList(data, opt) {
100
100
  }
101
101
  result.push("</tbody>");
102
102
  // console.log(Date.now() - time)
103
- return `<table class="min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600">${result.join("")}</table>`;
103
+ return `<table class="min-w-full relative divide-y-2 divide-gray-200 bg-white min-w-full overflow-auto divide-y-2 divide-gray-200 bg-white text-[12px] text-gray-600" style="page-break-inside: avoid;">${result.join("")}</table>`;
104
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getResources.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/access/funcs/getResources.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,aAAa,KAEb,CAAC;AAEP,QAAA,MAAM,mBAAmB,EAAE,GAAG,EAM7B,CAAC;AAEF,QAAA,MAAM,SAAS,KAGd,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,SAAS,EAAE,CAAC;;AACzD,wBAAoB"}
1
+ {"version":3,"file":"getResources.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/access/funcs/getResources.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,aAAa,KAEb,CAAC;AAEP,QAAA,MAAM,mBAAmB,EAAE,GAAG,EAO7B,CAAC;AAEF,QAAA,MAAM,SAAS,KAGd,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,SAAS,EAAE,CAAC;;AACzD,wBAAoB"}
@@ -2,8 +2,9 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  const resourcesList = existsSync("config/resources.json")
3
3
  ? JSON.parse(readFileSync("config/resources.json", "utf-8") || "[]")
4
4
  : [];
5
- const publicResourcesList = resourcesList.map(({ name, actions, feature }) => ({
5
+ const publicResourcesList = resourcesList.map(({ name, title, actions, feature }) => ({
6
6
  name,
7
+ title,
7
8
  actions,
8
9
  feature,
9
10
  }));
@@ -101,7 +101,7 @@ export default async function getFilterSQL({ table, filter, pg = pgClients.clien
101
101
  const { pk } = tableSQL.find((el) => el.name === name) || {};
102
102
  return pk && !fieldsList.includes(name)
103
103
  ? `${pk} in (select ${pk} from (${fieldQuery.replace(/limit 0/g, "")} where ${name} ${sval} )q where 1=1)`
104
- : `${name} ${sval}`;
104
+ : `${name}::text ${sval}`;
105
105
  })
106
106
  .join(" or ")} )`
107
107
  : "";
@@ -17,7 +17,7 @@ export default function formatValue({ pg, table, filter = {}, name, value, dataT
17
17
  const columns = filter.columns.split(",");
18
18
  const sval = `ilike '%${decodeURIComponent(value.replace(/%/g, "%25")).replace(/%/g, "\\%")}%'`;
19
19
  const query = `(${columns
20
- .map((el) => `"${el}" ${sval}`)
20
+ .map((el) => `"${el}"::text ${sval}`)
21
21
  .join(" or ")})`;
22
22
  return { op: "~", query };
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [