@sphereon/ui-components.credential-branding 0.4.1-unstable.164 → 0.4.1-unstable.165

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.
@@ -111,19 +111,17 @@ const toCredentialDetailsRow = async (args) => {
111
111
  if (Array.isArray(value)) {
112
112
  const label = (_b = (_a = branding === null || branding === void 0 ? void 0 : branding.find(claim => claim.key === (parentKey ? `${parentKey}.${key}` : key))) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : key;
113
113
  const items = value.filter(item => item !== undefined && item !== null);
114
- let isFirst = true;
115
- for (const item of items) {
116
- if (typeof item === 'object') {
117
- rows = rows.concat(await (0, exports.toCredentialDetailsRow)({ object: item, subject, issuer, branding, parentKey: parentKey ? `${parentKey}.${key}` : key }));
118
- }
119
- else {
120
- rows.push({
121
- id: (0, uuid_1.v4)(),
122
- label: isFirst ? label : '',
123
- value: `\u00A0\u00A0\u00A0\u00A0${item}`,
124
- });
125
- }
126
- isFirst = false;
114
+ const primitiveItems = items.filter(item => typeof item !== 'object');
115
+ const objectItems = items.filter(item => typeof item === 'object');
116
+ if (primitiveItems.length > 0) {
117
+ rows.push({
118
+ id: (0, uuid_1.v4)(),
119
+ label,
120
+ value: primitiveItems.length === 1 ? primitiveItems[0] : primitiveItems,
121
+ });
122
+ }
123
+ for (const item of objectItems) {
124
+ rows = rows.concat(await (0, exports.toCredentialDetailsRow)({ object: item, subject, issuer, branding, parentKey: parentKey ? `${parentKey}.${key}` : key }));
127
125
  }
128
126
  }
129
127
  else if (typeof value === 'object' && value !== null && value !== undefined) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sphereon/ui-components.credential-branding",
3
3
  "private": false,
4
- "version": "0.4.1-unstable.164+4ae7ffd",
4
+ "version": "0.4.1-unstable.165+b45ffbc",
5
5
  "description": "SSI UI components credential branding",
6
6
  "repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
7
7
  "author": "Sphereon <dev@sphereon.com>",
@@ -31,7 +31,7 @@
31
31
  "@sphereon/ssi-sdk.core": "0.36.1-next.155",
32
32
  "@sphereon/ssi-sdk.data-store-types": "0.36.1-next.155",
33
33
  "@sphereon/ssi-types": "0.36.1-next.155",
34
- "@sphereon/ui-components.core": "0.4.1-unstable.164+4ae7ffd",
34
+ "@sphereon/ui-components.core": "0.4.1-unstable.165+b45ffbc",
35
35
  "@veramo/core": "4.2.0",
36
36
  "@veramo/utils": "4.2.0",
37
37
  "i18n-js": "^3.8.0",
@@ -51,5 +51,5 @@
51
51
  "peerDependencies": {
52
52
  "react": ">= 18.2"
53
53
  },
54
- "gitHead": "4ae7ffdd2a3edf2c4c7631c59ea5a8129e6ca8c1"
54
+ "gitHead": "b45ffbc090b929a6ac451512c2b93282a734de23"
55
55
  }