@widergy/utilitygo-smart-bill-web 3.3.0 → 3.4.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,10 @@
1
+ # [3.4.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.3.0...v3.4.0) (2025-03-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * [CX-243] glossary ([#43](https://github.com/widergy/UtilityGO-Smart-Bill-Web/issues/43)) ([09ca7d7](https://github.com/widergy/UtilityGO-Smart-Bill-Web/commit/09ca7d705c86e515e715acaa42cd237e00d77554))
7
+
1
8
  # [3.3.0](https://github.com/widergy/UtilityGO-Smart-Bill-Web/compare/v3.2.0...v3.3.0) (2025-03-19)
2
9
 
3
10
 
@@ -7,6 +7,7 @@ exports.TAB_COMPONENT_MAPPER = exports.BIMESTRAL_PERIODICITY = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _tabs = require("../../shared/constants/tabs");
9
9
  var _Consumptions = _interopRequireDefault(require("./tabs/Consumptions"));
10
+ var _Glossary = _interopRequireDefault(require("./tabs/Glossary"));
10
11
  var _Billing = _interopRequireDefault(require("./tabs/Billing"));
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
13
  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); } /* eslint-disable react/prop-types */
@@ -18,7 +19,5 @@ const renderComponentWithProps = (Component, tab) => props => /*#__PURE__*/_reac
18
19
  const TAB_COMPONENT_MAPPER = exports.TAB_COMPONENT_MAPPER = {
19
20
  [_tabs.SMARTBILL_TABS.CONSUMPTIONS]: renderComponentWithProps(_Consumptions.default, _tabs.SMARTBILL_TABS.CONSUMPTIONS),
20
21
  [_tabs.SMARTBILL_TABS.BILLING]: renderComponentWithProps(_Billing.default, _tabs.SMARTBILL_TABS.BILLING),
21
- [_tabs.SMARTBILL_TABS.GLOSSARY]: renderComponentWithProps(() => /*#__PURE__*/_react.default.createElement("div", null, "Glosario: CX-243"),
22
- // TODO
23
- _tabs.SMARTBILL_TABS.GLOSSARY)
22
+ [_tabs.SMARTBILL_TABS.GLOSSARY]: renderComponentWithProps(_Glossary.default, _tabs.SMARTBILL_TABS.GLOSSARY)
24
23
  };
@@ -21,6 +21,9 @@ const SmartBillSummary = _ref => {
21
21
  consumptionLevels,
22
22
  components,
23
23
  currentAccount,
24
+ getGlossaryData,
25
+ glossaryData,
26
+ glossaryLoading,
24
27
  handlers,
25
28
  isDesktopSize,
26
29
  loading,
@@ -29,7 +32,7 @@ const SmartBillSummary = _ref => {
29
32
  translations,
30
33
  utils
31
34
  } = _ref;
32
- const filteredTabOptions = (0, _utils.getTabOptions)(tabOptions, smartBill) || [];
35
+ const filteredTabOptions = loading ? [] : (0, _utils.getTabOptions)(tabOptions, smartBill);
33
36
  const defaultCurrentTab = (0, _utils.getDefaultCurrentTab)(filteredTabOptions);
34
37
  const [currentTab, setCurrentTab] = (0, _react.useState)(defaultCurrentTab);
35
38
  const changeCurrentTab = newTab => setCurrentTab(newTab);
@@ -60,6 +63,9 @@ const SmartBillSummary = _ref => {
60
63
  consumptionLevels,
61
64
  components,
62
65
  currentAccount,
66
+ getGlossaryData,
67
+ glossaryData,
68
+ glossaryLoading,
63
69
  handlers,
64
70
  isDesktopSize,
65
71
  loading,
@@ -76,6 +82,9 @@ SmartBillSummary.propTypes = {
76
82
  [_propTypes.string]: _propTypes.elementType
77
83
  }),
78
84
  currentAccount: _propTypes.array,
85
+ getGlossaryData: undefined || _propTypes.object,
86
+ glossaryData: undefined || _propTypes.object,
87
+ glossaryLoading: _propTypes.bool,
79
88
  handlers: (0, _propTypes.shape)({
80
89
  [_propTypes.string]: _propTypes.func
81
90
  }),
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _energyUi = require("@widergy/energy-ui");
8
+ var _propTypes = require("prop-types");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ const Glossary = _ref => {
15
+ let {
16
+ getGlossaryData,
17
+ glossaryData,
18
+ glossaryLoading,
19
+ translations
20
+ } = _ref;
21
+ const {
22
+ pages,
23
+ sections
24
+ } = glossaryData ?? {};
25
+ (0, _react.useEffect)(() => {
26
+ getGlossaryData();
27
+ }, []);
28
+ return glossaryLoading ? /*#__PURE__*/_react.default.createElement("div", {
29
+ className: _stylesModule.default.loadingContainer
30
+ }, /*#__PURE__*/_react.default.createElement(_energyUi.UTLoading, {
31
+ loading: true,
32
+ size: 80,
33
+ thickness: 5
34
+ })) : /*#__PURE__*/_react.default.createElement(_energyUi.UTDocumentWizard, {
35
+ pages: pages,
36
+ sections: sections,
37
+ labels: translations
38
+ });
39
+ };
40
+ Glossary.propTypes = {
41
+ getGlossaryData: _propTypes.func,
42
+ glossaryData: undefined || _propTypes.object,
43
+ glossaryLoading: _propTypes.bool,
44
+ translations: _propTypes.object
45
+ };
46
+ var _default = exports.default = Glossary;
@@ -0,0 +1,7 @@
1
+ .loadingContainer {
2
+ align-items: center;
3
+ display: flex;
4
+ flex: 1;
5
+ justify-content: center;
6
+ min-height: 800px;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/utilitygo-smart-bill-web",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "UtilityGO SmartBill Web",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",