@widergy/mobile-ui 1.38.0 → 1.40.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [1.40.0](https://github.com/widergy/mobile-ui/compare/v1.39.0...v1.40.0) (2025-04-04)
2
+
3
+
4
+ ### Features
5
+
6
+ * new consumption box icon ([#421](https://github.com/widergy/mobile-ui/issues/421)) ([2c0bf7e](https://github.com/widergy/mobile-ui/commit/2c0bf7ed19ad3fba4f98d870aa27d2f08e379643))
7
+
8
+ # [1.39.0](https://github.com/widergy/mobile-ui/compare/v1.38.0...v1.39.0) (2025-04-04)
9
+
10
+
11
+ ### Features
12
+
13
+ * clean object func in single event multitracking added ([#420](https://github.com/widergy/mobile-ui/issues/420)) ([36762be](https://github.com/widergy/mobile-ui/commit/36762bedd180f4a369271ca39f8673f93753ef26))
14
+
1
15
  # [1.38.0](https://github.com/widergy/mobile-ui/compare/v1.37.0...v1.38.0) (2025-03-26)
2
16
 
3
17
 
@@ -0,0 +1,4 @@
1
+ <svg width="100" height="100" viewBox="0 0 100 100" stroke="none" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M25 20.8333C22.6988 20.8333 20.8333 22.6988 20.8333 25V75C20.8333 77.3012 22.6988 79.1667 25 79.1667H75C77.3012 79.1667 79.1667 77.3012 79.1667 75V25C79.1667 22.6988 77.3012 20.8333 75 20.8333H25ZM12.5 25C12.5 18.0964 18.0964 12.5 25 12.5H75C81.9036 12.5 87.5 18.0964 87.5 25V75C87.5 81.9036 81.9036 87.5 75 87.5H25C18.0964 87.5 12.5 81.9036 12.5 75V25Z"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M50.1827 33.4577C51.8176 33.9132 52.7367 35.4876 52.2356 36.9741L48.9501 46.7207H55.2371C56.2544 46.7207 57.2067 47.175 57.7848 47.9361C58.3629 48.6971 58.4929 49.6677 58.1327 50.5327L52.1709 64.8477C51.5654 66.3017 49.7781 67.034 48.1789 66.4835C46.5798 65.9329 45.7743 64.3079 46.3798 62.8539L50.754 52.3509H44.7629C43.7809 52.3509 42.8572 51.9274 42.2733 51.2095C41.6895 50.4916 41.5149 49.5645 41.8026 48.7109L46.3151 35.3243C46.8162 33.8378 48.5477 33.0021 50.1827 33.4577Z"/>
4
+ </svg>
@@ -26,6 +26,7 @@ import EnergyIconDeleteOutline from './components/EnergyIcons/EnergyIconDeleteOu
26
26
  import EnergyIconDeleteVariant from './components/EnergyIcons/EnergyIconDeleteVariant.svg';
27
27
  import EnergyIconEdit from './components/EnergyIcons/EnergyIconEdit.svg';
28
28
  import EnergyIconEditVariant from './components/EnergyIcons/EnergyIconEditVariant.svg';
29
+ import EnergyIconConsumptionBoxFilled from './components/EnergyIcons/EnergyIconConsumptionBoxFilled.svg';
29
30
  import EnergyIconGraphicCircle from './components/EnergyIcons/EnergyIconGraphicCircle.svg';
30
31
  import EnergyIconHome from './components/EnergyIcons/EnergyIconHome.svg';
31
32
  import EnergyIconHome2 from './components/EnergyIcons/EnergyIconHome2.svg';
@@ -70,6 +71,7 @@ export const ENERGY_ICONS = {
70
71
  EnergyIconDeleteVariant,
71
72
  EnergyIconEdit,
72
73
  EnergyIconEditVariant,
74
+ EnergyIconConsumptionBoxFilled,
73
75
  EnergyIconGraphicCircle,
74
76
  EnergyIconHome,
75
77
  EnergyIconHome2,
@@ -128,6 +128,27 @@ export const singleArgosEvent = sendArgosAnalytics => eventData => {
128
128
  sendArgosAnalytics(eventData);
129
129
  };
130
130
 
131
+ const cleanObject = obj => {
132
+ if (typeof obj !== 'object' || obj === null) return obj;
133
+
134
+ return Object.entries(obj).reduce((acc, [key, value]) => {
135
+ if (value === null || value === 'null' || value === '' || value === undefined || value === 'undefined') {
136
+ return acc;
137
+ }
138
+
139
+ if (typeof value === 'object' && !Array.isArray(value)) {
140
+ const cleanedValue = cleanObject(value);
141
+ if (Object.keys(cleanedValue).length > 0) {
142
+ acc[key] = cleanedValue;
143
+ }
144
+ } else {
145
+ acc[key] = value;
146
+ }
147
+
148
+ return acc;
149
+ }, {});
150
+ };
151
+
131
152
  export const singleEventMultitracking = (trackers, eventDefinitions) => (name, eventData) => {
132
153
  const mergedData = merge(cloneDeep(eventDefinitions[name] || {}), eventData || {});
133
154
  const { sharedProps, ...trackerProps } = mergedData;
@@ -136,7 +157,8 @@ export const singleEventMultitracking = (trackers, eventDefinitions) => (name, e
136
157
  trackersArray.forEach(trackerName => {
137
158
  const eventTracker = trackers[trackerName];
138
159
  const fullEventData = merge(trackerProps[trackerName], sharedProps);
139
- eventTracker?.(fullEventData);
160
+ const fullEventDataCleaned = cleanObject(fullEventData);
161
+ eventTracker?.(fullEventDataCleaned);
140
162
  });
141
163
  };
142
164
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "1.38.0",
5
+ "version": "1.40.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [