coer-elements 0.0.129 → 0.0.131

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.
Files changed (39) hide show
  1. package/components/lib/coer-accordion/coer-accordion.component.d.ts +3 -3
  2. package/components/lib/coer-button/coer-button.component.d.ts +3 -2
  3. package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +2 -2
  4. package/components/lib/coer-datebox/coer-datebox.component.d.ts +8 -7
  5. package/components/lib/coer-filebox/coer-filebox.component.d.ts +3 -3
  6. package/components/lib/coer-modal/coer-modal.component.d.ts +2 -2
  7. package/extensions/lib/object.extension.d.ts +1 -0
  8. package/extensions/lib/string.extension.d.ts +8 -0
  9. package/extensions/public-api.d.ts +1 -0
  10. package/fesm2022/coer-elements-components.mjs +25 -23
  11. package/fesm2022/coer-elements-components.mjs.map +1 -1
  12. package/fesm2022/coer-elements-extensions.mjs +40 -20
  13. package/fesm2022/coer-elements-extensions.mjs.map +1 -1
  14. package/fesm2022/coer-elements-guards.mjs +29 -0
  15. package/fesm2022/coer-elements-guards.mjs.map +1 -0
  16. package/fesm2022/coer-elements-interceptors.mjs +64 -0
  17. package/fesm2022/coer-elements-interceptors.mjs.map +1 -0
  18. package/fesm2022/coer-elements-pages.mjs +2 -2
  19. package/fesm2022/coer-elements-pages.mjs.map +1 -1
  20. package/fesm2022/coer-elements-tools.mjs +7 -27
  21. package/fesm2022/coer-elements-tools.mjs.map +1 -1
  22. package/fesm2022/coer-elements.mjs +1 -0
  23. package/fesm2022/coer-elements.mjs.map +1 -1
  24. package/guards/index.d.ts +5 -0
  25. package/guards/lib/login.guard.d.ts +2 -0
  26. package/guards/lib/page.guard.d.ts +2 -0
  27. package/guards/public-api.d.ts +2 -0
  28. package/index.d.ts +1 -0
  29. package/interceptors/index.d.ts +5 -0
  30. package/interceptors/lib/user.interceptor.d.ts +8 -0
  31. package/interceptors/lib/utc-offset.interceptor.d.ts +8 -0
  32. package/interceptors/public-api.d.ts +1 -0
  33. package/interfaces/lib/coer-menu/menu.interface.d.ts +3 -1
  34. package/package.json +10 -2
  35. package/pages/lib/coer-system/coer-system.component.d.ts +2 -2
  36. package/pages/lib/coer-system/login/login.component.d.ts +1 -1
  37. package/tools/lib/page.class.d.ts +4 -4
  38. package/tools/lib/section.class.d.ts +4 -4
  39. package/tools/lib/tools.d.ts +6 -6
@@ -23,39 +23,19 @@ const Tools = {
23
23
  },
24
24
  /** Returns true if the value is null or undefined, false otherwise */
25
25
  IsNull: (value) => {
26
- if (value === undefined)
27
- return true;
28
- if (value === null)
29
- return true;
30
- return false;
26
+ return (value === undefined || value === null);
31
27
  },
32
28
  /** Returns true if the value is not null or undefined, false otherwise */
33
29
  IsNotNull: (value) => {
34
- if (value === undefined)
35
- return false;
36
- if (value === null)
37
- return false;
38
- return true;
30
+ return !Tools.IsNull(value);
39
31
  },
40
32
  /** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
41
33
  IsOnlyWhiteSpace: (value) => {
42
- if (value === undefined)
43
- return true;
44
- if (value === null)
45
- return true;
46
- if (typeof value === 'string' && value.trim() === '')
47
- return true;
48
- return false;
34
+ return Tools.IsNull(value) || (typeof value === 'string' && value.trim() === '');
49
35
  },
50
36
  /** Returns true if has string value and is not only whitespace, false otherwise */
51
37
  IsNotOnlyWhiteSpace: (value) => {
52
- if (value === undefined)
53
- return false;
54
- if (value === null)
55
- return false;
56
- if (typeof value === 'string' && value.trim() === '')
57
- return false;
58
- return true;
38
+ return Tools.IsNotNull(value) && !Tools.IsOnlyWhiteSpace(value);
59
39
  },
60
40
  /** Avoid Null value */
61
41
  AvoidNull: (value, type = null) => {
@@ -99,7 +79,7 @@ const Tools = {
99
79
  default: return '';
100
80
  }
101
81
  },
102
- /** Avoid Null value */
82
+ /** */
103
83
  RemoveAccents: (value) => {
104
84
  if (Tools.IsOnlyWhiteSpace(value))
105
85
  return '';
@@ -129,7 +109,7 @@ const Tools = {
129
109
  return words.join(' ');
130
110
  },
131
111
  /** Get properties of an object */
132
- GetObjectProperties: (obj) => {
112
+ GetPropertyList: (obj) => {
133
113
  const properties = [];
134
114
  if (obj === null)
135
115
  return properties;
@@ -822,7 +802,7 @@ const ElementsHTML = {
822
802
  let isInvalid = true;
823
803
  if (Tools.IsNotNull(element)) {
824
804
  if (typeof element == 'object') {
825
- const properties = Tools.GetObjectProperties(element);
805
+ const properties = Tools.GetPropertyList(element);
826
806
  if (properties.includes('_isTouched') && properties.includes('_value')) {
827
807
  isInvalid = element.isTouched && Tools.IsOnlyWhiteSpace(element.value);
828
808
  }