myio-js-library 0.1.145 → 0.1.147

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/README.md CHANGED
@@ -1,11 +1,27 @@
1
1
  # myio-js-library
2
2
 
3
- A clean, standalone JavaScript SDK for **MYIO** projects.
4
- Works in **Node.js (>=18)** and modern browsers.
3
+ A clean, standalone JavaScript SDK for **MYIO** projects.
4
+ Works in **Node.js (>=18)** and modern browsers.
5
5
  Distributed as **ESM**, **CJS**, and **UMD** (with a pre-minified build for CDN usage).
6
6
 
7
7
  ---
8
8
 
9
+ ## 🎨 Interactive Showcase
10
+
11
+ Explore all library features with interactive demos and live examples:
12
+
13
+ **[Open Showcase Portal →](showcase/index.html)**
14
+
15
+ The showcase includes:
16
+ - 📊 Format Utilities - Energy, water, percentages, and numbers
17
+ - 📅 Date Utilities - Date formatting, intervals, timezone handling
18
+ - 🚦 Device Status - Status types, ranges, and calculations
19
+ - 🎴 Card Components - Head Office device cards with full interactivity
20
+ - 🪟 Modal Components - Settings, filters, and reports
21
+ - 🔧 MYIO Components - Selection store, authentication, CSV export
22
+
23
+ ---
24
+
9
25
  ## 🚀 Features
10
26
 
11
27
  - 🔑 **Core codecs** — e.g., `decodePayloadBase64Xor`.
package/dist/index.cjs CHANGED
@@ -4759,15 +4759,21 @@ var ICON_MAP = {
4759
4759
 
4760
4760
  // src/thingsboard/main-dashboard-shopping/v-4.0.0/head-office/card-head-office.types.ts
4761
4761
  var DEFAULT_I18N = {
4762
- in_operation: "Em opera\xE7\xE3o",
4763
- alert: "Alerta",
4764
- failure: "Falha",
4765
- offline: "Offline",
4762
+ // Status labels with icons
4763
+ in_operation: "\u26A1 Em funcionamento",
4764
+ standby: "\u{1F4A4} Em standby",
4765
+ alert: "\u26A0\uFE0F Alerta",
4766
+ failure: "\u{1F6A8} Falha",
4767
+ maintenance: "\u{1F527} Manuten\xE7\xE3o",
4768
+ not_installed: "\u{1F4E6} N\xE3o instalado",
4769
+ offline: "\u{1F4E1} Offline",
4770
+ // Metric labels
4766
4771
  efficiency: "Efici\xEAncia",
4767
4772
  temperature: "Temperatura",
4768
4773
  operation_time: "Tempo em opera\xE7\xE3o",
4769
4774
  updated: "Atualizado",
4770
4775
  current_suffix: "Atual",
4776
+ // Menu labels
4771
4777
  menu_dashboard: "Dashboard",
4772
4778
  menu_report: "Relat\xF3rio",
4773
4779
  menu_settings: "Configura\xE7\xF5es"
@@ -4863,15 +4869,17 @@ function getStatusInfo(deviceStatus, i18n) {
4863
4869
  switch (deviceStatus) {
4864
4870
  case DeviceStatusType.POWER_ON:
4865
4871
  return { chipClass: "chip--ok", label: i18n.in_operation };
4872
+ case DeviceStatusType.STANDBY:
4873
+ return { chipClass: "chip--standby", label: i18n.standby };
4866
4874
  case DeviceStatusType.WARNING:
4867
4875
  return { chipClass: "chip--alert", label: i18n.alert };
4868
- case DeviceStatusType.DANGER:
4876
+ case DeviceStatusType.FAILURE:
4869
4877
  case DeviceStatusType.POWER_OFF:
4870
4878
  return { chipClass: "chip--failure", label: i18n.failure };
4871
- case DeviceStatusType.STANDBY:
4872
- return { chipClass: "chip--alert", label: i18n.alert };
4873
4879
  case DeviceStatusType.MAINTENANCE:
4874
- return { chipClass: "chip--alert", label: i18n.alert };
4880
+ return { chipClass: "chip--alert", label: i18n.maintenance };
4881
+ case DeviceStatusType.NOT_INSTALLED:
4882
+ return { chipClass: "chip--offline", label: i18n.not_installed };
4875
4883
  case DeviceStatusType.NO_INFO:
4876
4884
  default:
4877
4885
  return { chipClass: "chip--offline", label: i18n.offline };
@@ -4887,9 +4895,11 @@ function getCardStateClass(deviceStatus) {
4887
4895
  case DeviceStatusType.STANDBY:
4888
4896
  case DeviceStatusType.MAINTENANCE:
4889
4897
  return "is-alert";
4890
- case DeviceStatusType.DANGER:
4898
+ case DeviceStatusType.FAILURE:
4891
4899
  case DeviceStatusType.POWER_OFF:
4892
4900
  return "is-failure";
4901
+ case DeviceStatusType.NOT_INSTALLED:
4902
+ return "is-offline";
4893
4903
  default:
4894
4904
  return "";
4895
4905
  }
@@ -5043,12 +5053,12 @@ function buildDOM(state) {
5043
5053
  function verifyOfflineStatus(entityObject) {
5044
5054
  const lastConnectionTime = new Date(entityObject.lastConnectTime || 0);
5045
5055
  const lastDisconnectTime = new Date(entityObject.lastDisconnectTime || 0);
5046
- if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
5047
- return false;
5048
- }
5049
5056
  const now = /* @__PURE__ */ new Date();
5050
5057
  const fifteenMinutesInMs = 15 * 60 * 1e3;
5051
5058
  const timeSinceConnection = now.getTime() - lastConnectionTime.getTime();
5059
+ if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
5060
+ return false;
5061
+ }
5052
5062
  if (timeSinceConnection < fifteenMinutesInMs) {
5053
5063
  return false;
5054
5064
  }
package/dist/index.js CHANGED
@@ -4651,15 +4651,21 @@ var ICON_MAP = {
4651
4651
 
4652
4652
  // src/thingsboard/main-dashboard-shopping/v-4.0.0/head-office/card-head-office.types.ts
4653
4653
  var DEFAULT_I18N = {
4654
- in_operation: "Em opera\xE7\xE3o",
4655
- alert: "Alerta",
4656
- failure: "Falha",
4657
- offline: "Offline",
4654
+ // Status labels with icons
4655
+ in_operation: "\u26A1 Em funcionamento",
4656
+ standby: "\u{1F4A4} Em standby",
4657
+ alert: "\u26A0\uFE0F Alerta",
4658
+ failure: "\u{1F6A8} Falha",
4659
+ maintenance: "\u{1F527} Manuten\xE7\xE3o",
4660
+ not_installed: "\u{1F4E6} N\xE3o instalado",
4661
+ offline: "\u{1F4E1} Offline",
4662
+ // Metric labels
4658
4663
  efficiency: "Efici\xEAncia",
4659
4664
  temperature: "Temperatura",
4660
4665
  operation_time: "Tempo em opera\xE7\xE3o",
4661
4666
  updated: "Atualizado",
4662
4667
  current_suffix: "Atual",
4668
+ // Menu labels
4663
4669
  menu_dashboard: "Dashboard",
4664
4670
  menu_report: "Relat\xF3rio",
4665
4671
  menu_settings: "Configura\xE7\xF5es"
@@ -4755,15 +4761,17 @@ function getStatusInfo(deviceStatus, i18n) {
4755
4761
  switch (deviceStatus) {
4756
4762
  case DeviceStatusType.POWER_ON:
4757
4763
  return { chipClass: "chip--ok", label: i18n.in_operation };
4764
+ case DeviceStatusType.STANDBY:
4765
+ return { chipClass: "chip--standby", label: i18n.standby };
4758
4766
  case DeviceStatusType.WARNING:
4759
4767
  return { chipClass: "chip--alert", label: i18n.alert };
4760
- case DeviceStatusType.DANGER:
4768
+ case DeviceStatusType.FAILURE:
4761
4769
  case DeviceStatusType.POWER_OFF:
4762
4770
  return { chipClass: "chip--failure", label: i18n.failure };
4763
- case DeviceStatusType.STANDBY:
4764
- return { chipClass: "chip--alert", label: i18n.alert };
4765
4771
  case DeviceStatusType.MAINTENANCE:
4766
- return { chipClass: "chip--alert", label: i18n.alert };
4772
+ return { chipClass: "chip--alert", label: i18n.maintenance };
4773
+ case DeviceStatusType.NOT_INSTALLED:
4774
+ return { chipClass: "chip--offline", label: i18n.not_installed };
4767
4775
  case DeviceStatusType.NO_INFO:
4768
4776
  default:
4769
4777
  return { chipClass: "chip--offline", label: i18n.offline };
@@ -4779,9 +4787,11 @@ function getCardStateClass(deviceStatus) {
4779
4787
  case DeviceStatusType.STANDBY:
4780
4788
  case DeviceStatusType.MAINTENANCE:
4781
4789
  return "is-alert";
4782
- case DeviceStatusType.DANGER:
4790
+ case DeviceStatusType.FAILURE:
4783
4791
  case DeviceStatusType.POWER_OFF:
4784
4792
  return "is-failure";
4793
+ case DeviceStatusType.NOT_INSTALLED:
4794
+ return "is-offline";
4785
4795
  default:
4786
4796
  return "";
4787
4797
  }
@@ -4935,12 +4945,12 @@ function buildDOM(state) {
4935
4945
  function verifyOfflineStatus(entityObject) {
4936
4946
  const lastConnectionTime = new Date(entityObject.lastConnectTime || 0);
4937
4947
  const lastDisconnectTime = new Date(entityObject.lastDisconnectTime || 0);
4938
- if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
4939
- return false;
4940
- }
4941
4948
  const now = /* @__PURE__ */ new Date();
4942
4949
  const fifteenMinutesInMs = 15 * 60 * 1e3;
4943
4950
  const timeSinceConnection = now.getTime() - lastConnectionTime.getTime();
4951
+ if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
4952
+ return false;
4953
+ }
4944
4954
  if (timeSinceConnection < fifteenMinutesInMs) {
4945
4955
  return false;
4946
4956
  }
@@ -4649,15 +4649,21 @@
4649
4649
 
4650
4650
  // src/thingsboard/main-dashboard-shopping/v-4.0.0/head-office/card-head-office.types.ts
4651
4651
  var DEFAULT_I18N = {
4652
- in_operation: "Em opera\xE7\xE3o",
4653
- alert: "Alerta",
4654
- failure: "Falha",
4655
- offline: "Offline",
4652
+ // Status labels with icons
4653
+ in_operation: "\u26A1 Em funcionamento",
4654
+ standby: "\u{1F4A4} Em standby",
4655
+ alert: "\u26A0\uFE0F Alerta",
4656
+ failure: "\u{1F6A8} Falha",
4657
+ maintenance: "\u{1F527} Manuten\xE7\xE3o",
4658
+ not_installed: "\u{1F4E6} N\xE3o instalado",
4659
+ offline: "\u{1F4E1} Offline",
4660
+ // Metric labels
4656
4661
  efficiency: "Efici\xEAncia",
4657
4662
  temperature: "Temperatura",
4658
4663
  operation_time: "Tempo em opera\xE7\xE3o",
4659
4664
  updated: "Atualizado",
4660
4665
  current_suffix: "Atual",
4666
+ // Menu labels
4661
4667
  menu_dashboard: "Dashboard",
4662
4668
  menu_report: "Relat\xF3rio",
4663
4669
  menu_settings: "Configura\xE7\xF5es"
@@ -4753,15 +4759,17 @@
4753
4759
  switch (deviceStatus) {
4754
4760
  case DeviceStatusType.POWER_ON:
4755
4761
  return { chipClass: "chip--ok", label: i18n.in_operation };
4762
+ case DeviceStatusType.STANDBY:
4763
+ return { chipClass: "chip--standby", label: i18n.standby };
4756
4764
  case DeviceStatusType.WARNING:
4757
4765
  return { chipClass: "chip--alert", label: i18n.alert };
4758
- case DeviceStatusType.DANGER:
4766
+ case DeviceStatusType.FAILURE:
4759
4767
  case DeviceStatusType.POWER_OFF:
4760
4768
  return { chipClass: "chip--failure", label: i18n.failure };
4761
- case DeviceStatusType.STANDBY:
4762
- return { chipClass: "chip--alert", label: i18n.alert };
4763
4769
  case DeviceStatusType.MAINTENANCE:
4764
- return { chipClass: "chip--alert", label: i18n.alert };
4770
+ return { chipClass: "chip--alert", label: i18n.maintenance };
4771
+ case DeviceStatusType.NOT_INSTALLED:
4772
+ return { chipClass: "chip--offline", label: i18n.not_installed };
4765
4773
  case DeviceStatusType.NO_INFO:
4766
4774
  default:
4767
4775
  return { chipClass: "chip--offline", label: i18n.offline };
@@ -4777,9 +4785,11 @@
4777
4785
  case DeviceStatusType.STANDBY:
4778
4786
  case DeviceStatusType.MAINTENANCE:
4779
4787
  return "is-alert";
4780
- case DeviceStatusType.DANGER:
4788
+ case DeviceStatusType.FAILURE:
4781
4789
  case DeviceStatusType.POWER_OFF:
4782
4790
  return "is-failure";
4791
+ case DeviceStatusType.NOT_INSTALLED:
4792
+ return "is-offline";
4783
4793
  default:
4784
4794
  return "";
4785
4795
  }
@@ -4933,12 +4943,12 @@
4933
4943
  function verifyOfflineStatus(entityObject) {
4934
4944
  const lastConnectionTime = new Date(entityObject.lastConnectTime || 0);
4935
4945
  const lastDisconnectTime = new Date(entityObject.lastDisconnectTime || 0);
4936
- if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
4937
- return false;
4938
- }
4939
4946
  const now = /* @__PURE__ */ new Date();
4940
4947
  const fifteenMinutesInMs = 15 * 60 * 1e3;
4941
4948
  const timeSinceConnection = now.getTime() - lastConnectionTime.getTime();
4949
+ if (lastDisconnectTime.getTime() > lastConnectionTime.getTime()) {
4950
+ return false;
4951
+ }
4942
4952
  if (timeSinceConnection < fifteenMinutesInMs) {
4943
4953
  return false;
4944
4954
  }