@widergy/energy-ui 3.98.1 → 3.98.2

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,10 @@
1
+ ## [3.98.2](https://github.com/widergy/energy-ui/compare/v3.98.1...v3.98.2) (2025-08-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [SFPE-483] UTDataCategory empty data ([#664](https://github.com/widergy/energy-ui/issues/664)) ([be73350](https://github.com/widergy/energy-ui/commit/be7335017612682e9b44a7950c6d9e0999427867))
7
+
1
8
  ## [3.98.1](https://github.com/widergy/energy-ui/compare/v3.98.0...v3.98.1) (2025-08-12)
2
9
 
3
10
 
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WITHOUT_DATA_TEXT = void 0;
7
+ const WITHOUT_DATA_TEXT = exports.WITHOUT_DATA_TEXT = 'Sin datos';
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _propTypes = require("prop-types");
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
9
10
  var _WithTheme = _interopRequireDefault(require("../WithTheme"));
10
11
  var _UTDataElement = _interopRequireDefault(require("../UTDataElement"));
11
12
  var _UTLabel = _interopRequireDefault(require("../UTLabel"));
@@ -14,6 +15,7 @@ var _classesUtils = require("../../utils/classesUtils");
14
15
  var _testIds = require("../../constants/testIds");
15
16
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
16
17
  var _theme = require("./theme");
18
+ var _constants = require("./constants");
17
19
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
20
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
21
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
@@ -65,7 +67,10 @@ const UTDataCategory = _ref => {
65
67
  }, /*#__PURE__*/_react.default.createElement("div", {
66
68
  ref: childrenRef,
67
69
  className: _stylesModule.default.childrenContent
68
- }, elements.map((element, index) => {
70
+ }, (0, _isEmpty.default)(elements) ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
71
+ align: "center",
72
+ colorTheme: "gray"
73
+ }, _constants.WITHOUT_DATA_TEXT) : elements.map((element, index) => {
69
74
  const {
70
75
  key,
71
76
  ...dataElementProps
@@ -46,10 +46,8 @@ const normalizeCSSContent = content => {
46
46
  // Remover espacios alrededor de caracteres especiales
47
47
  .replace(/\s*([{}:;,])\s*/g, '$1')
48
48
  // Normalizar valores de colores
49
- .replace(/#([0-9a-fA-F]{3})\b/g, (match, hex) => {
50
- // Expandir colores de 3 dígitos a 6 dígitos
51
- return '#' + hex.split('').map(char => char + char).join('');
52
- })
49
+ .replace(/#([0-9a-fA-F]{3})\b/g, (match, hex) => // Expandir colores de 3 dígitos a 6 dígitos
50
+ "#".concat(hex.split('').map(char => char + char).join('')))
53
51
  // Normalizar valores de unidades
54
52
  .replace(/(\d+)px/g, '$1px').replace(/(\d+)em/g, '$1em').replace(/(\d+)rem/g, '$1rem')
55
53
  // Remover espacios extra entre reglas
@@ -207,9 +205,7 @@ const markStylesheetAsLoaded = href => {
207
205
  /**
208
206
  * Verifica si estamos en un entorno compatible
209
207
  */
210
- const isCompatibleEnvironment = () => {
211
- return typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.head !== 'undefined';
212
- };
208
+ const isCompatibleEnvironment = () => typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.head !== 'undefined';
213
209
 
214
210
  /**
215
211
  * Intercepta la creación de elementos <style> para evitar duplicados
@@ -224,7 +220,7 @@ const interceptStyleCreation = () => {
224
220
  }
225
221
 
226
222
  // Usar el punto de inserción existente (meta tag)
227
- let insertionPoint = document.getElementById('energyui-insertion-point');
223
+ const insertionPoint = document.getElementById('energyui-insertion-point');
228
224
  if (!insertionPoint) {
229
225
  console.warn('Energy UI: No se encontró el punto de inserción <meta id="energyui-insertion-point"/>');
230
226
  return;
@@ -325,6 +321,24 @@ const cleanupDuplicateStyles = () => {
325
321
  });
326
322
  };
327
323
 
324
+ /**
325
+ * Función para limpiar recursos y desconectar observers
326
+ */
327
+ const cleanupStyleDeduplication = () => {
328
+ if (globalObserver) {
329
+ globalObserver.disconnect();
330
+ globalObserver = null;
331
+ }
332
+
333
+ // Limpiar caches
334
+ loadedStyles.clear();
335
+ styleElementsByHash.clear();
336
+ loadedStylesheets.clear();
337
+
338
+ // Resetear estado
339
+ isConfigured = false;
340
+ };
341
+
328
342
  /**
329
343
  * Hook para React
330
344
  */
@@ -353,63 +367,37 @@ const setupStyleDeduplication = () => {
353
367
  cleanupDuplicateStyles();
354
368
  };
355
369
 
356
- /**
357
- * Función para limpiar recursos y desconectar observers
358
- */
359
- const cleanupStyleDeduplication = () => {
360
- if (globalObserver) {
361
- globalObserver.disconnect();
362
- globalObserver = null;
363
- }
364
-
365
- // Limpiar caches
366
- loadedStyles.clear();
367
- styleElementsByHash.clear();
368
- loadedStylesheets.clear();
369
-
370
- // Resetear estado
371
- isConfigured = false;
372
- };
373
-
374
370
  /**
375
371
  * Función para verificar si está configurado
376
372
  */
377
- const isStyleDeduplicationConfigured = () => {
378
- return isConfigured && globalObserver !== null;
379
- };
373
+ const isStyleDeduplicationConfigured = () => isConfigured && globalObserver !== null;
380
374
 
381
375
  /**
382
376
  * Función para obtener estadísticas de deduplicación
383
377
  */
384
- const getDeduplicationStats = () => {
385
- return {
386
- loadedStylesCount: loadedStyles.size,
387
- styleElementsByHashCount: styleElementsByHash.size,
388
- loadedStylesheetsCount: loadedStylesheets.size,
389
- isConfigured: isStyleDeduplicationConfigured()
390
- };
391
- };
378
+ const getDeduplicationStats = () => ({
379
+ loadedStylesCount: loadedStyles.size,
380
+ styleElementsByHashCount: styleElementsByHash.size,
381
+ loadedStylesheetsCount: loadedStylesheets.size,
382
+ isConfigured: isStyleDeduplicationConfigured()
383
+ });
392
384
 
393
385
  /**
394
386
  * Función para testing: verificar si un contenido sería detectado como Energy UI
395
387
  */
396
- const testEnergyUIDetection = content => {
397
- return {
398
- isEnergyUI: isEnergyUIStyle(content),
399
- normalizedContent: normalizeCSSContent(content),
400
- hash: generateStyleHash(content)
401
- };
402
- };
388
+ const testEnergyUIDetection = content => ({
389
+ isEnergyUI: isEnergyUIStyle(content),
390
+ normalizedContent: normalizeCSSContent(content),
391
+ hash: generateStyleHash(content)
392
+ });
403
393
 
404
394
  /**
405
395
  * Función para testing: verificar si una URL sería detectada como Energy UI
406
396
  */
407
- const testEnergyUIURLDetection = url => {
408
- return {
409
- isEnergyUI: isEnergyUIURL(url),
410
- normalizedURL: normalizeURL(url)
411
- };
412
- };
397
+ const testEnergyUIURLDetection = url => ({
398
+ isEnergyUI: isEnergyUIURL(url),
399
+ normalizedURL: normalizeURL(url)
400
+ });
413
401
 
414
402
  /**
415
403
  * Función para debugging: obtener información detallada de estilos cargados
@@ -426,7 +414,7 @@ const getDetailedStats = () => {
426
414
  index,
427
415
  hash: generateStyleHash(content),
428
416
  isDuplicate: isStyleAlreadyLoaded(content),
429
- normalizedContent: normalizeCSSContent(content).substring(0, 100) + '...'
417
+ normalizedContent: "".concat(normalizeCSSContent(content).substring(0, 100), "...")
430
418
  });
431
419
  }
432
420
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.98.1",
3
+ "version": "3.98.2",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",