@pronto-tools-and-more/components 8.20.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js CHANGED
@@ -241,11 +241,40 @@ var Heading = ({
241
241
  return /* @__PURE__ */ React.createElement("h4", { className: fullClassName }, text);
242
242
  };
243
243
 
244
+ // src/parts/CreateFilterFromProperties/CreateFilterFromProperties.ts
245
+ var createFilterFromProperties = (properties) => {
246
+ const entries = Object.entries(properties);
247
+ if (entries.length === 0) {
248
+ return [];
249
+ }
250
+ const outerFilter = [];
251
+ for (const [key, value] of Object.entries(properties)) {
252
+ if (Array.isArray(value)) {
253
+ const innerFilter = [];
254
+ for (const item of value) {
255
+ innerFilter.push({
256
+ properties: {
257
+ key,
258
+ value: item
259
+ }
260
+ });
261
+ }
262
+ if (innerFilter.length > 0) {
263
+ outerFilter.push({
264
+ OR: innerFilter
265
+ });
266
+ }
267
+ }
268
+ }
269
+ return outerFilter;
270
+ };
271
+
244
272
  // src/parts/IssueList/IssueList.tsx
245
273
  var IssueList = ({
246
274
  properties,
247
275
  render
248
276
  }) => {
277
+ const additionalFilter = createFilterFromProperties(properties);
249
278
  const json = {
250
279
  render,
251
280
  dataSource: {
@@ -262,9 +291,7 @@ var IssueList = ({
262
291
  value: "POST"
263
292
  }
264
293
  },
265
- {
266
- properties
267
- }
294
+ ...additionalFilter
268
295
  ]
269
296
  },
270
297
  offset: "0",
@@ -14,6 +14,7 @@ export * from "../HeaderLogoSection/HeaderLogoSection.tsx";
14
14
  export * from "../HeaderMenuItems/HeaderMenuItems.tsx";
15
15
  export * from "../Heading/Heading.tsx";
16
16
  export * from "../IFooterSocialLink/IFooterSocialLink.ts";
17
+ export * from "../IIssueListItem/IIsueListItem.ts";
17
18
  export * from "../ISearchResult/ISearchResult.ts";
18
19
  export * from "../ISearchResultComponent/ISearchResultComponent.tsx";
19
20
  export * from "../IssueList/IssueList.tsx";
@@ -0,0 +1 @@
1
+ export declare const createFilterFromProperties: (properties: any) => any[];
@@ -0,0 +1,6 @@
1
+ export interface IIssueListItem {
2
+ readonly name: string;
3
+ readonly description: string;
4
+ readonly imageSrc: string;
5
+ readonly properties: any;
6
+ }
@@ -1,9 +1,5 @@
1
1
  import type React from "react";
2
+ import type { IIssueListItem } from "../IIssueListItem/IIsueListItem.ts";
2
3
  export interface IssueListItemRenderer {
3
- ({ name, description, imageSrc, properties, }: {
4
- name: string;
5
- description: string;
6
- imageSrc: string;
7
- properties: any;
8
- }): React.ReactNode;
4
+ ({ name, description, imageSrc, properties, }: IIssueListItem): React.ReactNode;
9
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "8.20.0",
3
+ "version": "9.0.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",