@wikicasa-dev/utilities 0.2.0 → 1.0.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.
Files changed (112) hide show
  1. package/dist/ArrayUtils.cjs +1 -0
  2. package/dist/ArrayUtils.js +4 -0
  3. package/dist/ColorUtils.cjs +1 -0
  4. package/dist/ColorUtils.js +8 -0
  5. package/dist/CookieUtils.cjs +1 -0
  6. package/dist/CookieUtils.js +32 -0
  7. package/dist/CurrencyUtils.cjs +1 -0
  8. package/dist/CurrencyUtils.js +14 -0
  9. package/dist/DOMUtils.cjs +1 -0
  10. package/dist/DOMUtils.js +18 -0
  11. package/dist/DateUtils.cjs +1 -0
  12. package/dist/DateUtils.js +7 -0
  13. package/dist/DeviceDetectionUtils.cjs +1 -0
  14. package/dist/DeviceDetectionUtils.js +8 -0
  15. package/dist/EmailUtils.cjs +1 -0
  16. package/dist/EmailUtils.js +27 -0
  17. package/dist/FunctionUtils.cjs +1 -0
  18. package/dist/FunctionUtils.js +21 -0
  19. package/dist/GenericUtils.cjs +1 -0
  20. package/dist/GenericUtils.js +25 -0
  21. package/dist/LazyLoadingBg.cjs +1 -0
  22. package/dist/LazyLoadingBg.js +13 -0
  23. package/dist/NumberUtils.cjs +1 -0
  24. package/dist/NumberUtils.js +50 -0
  25. package/dist/ObjectUtils.cjs +1 -0
  26. package/dist/ObjectUtils.js +23 -0
  27. package/dist/ObserverUtils.cjs +1 -0
  28. package/dist/ObserverUtils.js +20 -0
  29. package/dist/PermissionUtils.cjs +1 -0
  30. package/dist/PermissionUtils.js +18 -0
  31. package/dist/RESB_UrlBuilder.cjs +1 -0
  32. package/dist/RESB_UrlBuilder.js +80 -0
  33. package/dist/StringUtils.cjs +1 -0
  34. package/dist/StringUtils.js +40 -0
  35. package/dist/URLBuilderUtils.cjs +1 -0
  36. package/dist/URLBuilderUtils.js +11 -0
  37. package/dist/index.cjs +1 -0
  38. package/dist/index.d.ts +17 -34
  39. package/dist/index.js +62 -0
  40. package/dist/main.cjs +1 -0
  41. package/dist/vite-env.cjs +1 -0
  42. package/dist/vite-env.js +1 -0
  43. package/package.json +17 -13
  44. package/dist/custom/constants.d.ts +0 -2
  45. package/dist/custom/icons.d.ts +0 -5
  46. package/dist/custom/leaflet_map.d.ts +0 -99
  47. package/dist/services/agencyAPI.d.ts +0 -19
  48. package/dist/services/geographyAPI.d.ts +0 -9
  49. package/dist/services/insightsAPI.d.ts +0 -2
  50. package/dist/services/mailAPI.d.ts +0 -24
  51. package/dist/services/placesAPI.d.ts +0 -5
  52. package/dist/services/portfolioCustomerAPI.d.ts +0 -1
  53. package/dist/services/publicUserAPI.d.ts +0 -20
  54. package/dist/services/realEstateAPI.d.ts +0 -14
  55. package/dist/services/requestAPI.d.ts +0 -16
  56. package/dist/services/servicesUtils.d.ts +0 -8
  57. package/dist/services/statisticsAPI.d.ts +0 -9
  58. package/dist/services/valuationAPI.d.ts +0 -11
  59. package/dist/services/wikicasaPro.d.ts +0 -2
  60. package/dist/utilities.cjs +0 -5
  61. package/dist/utilities.iife.js +0 -5
  62. package/dist/utilities.mjs +0 -2437
  63. package/dist/utils/FavoriteUtils.d.ts +0 -2
  64. package/dist/utils/GAutocompleteUtils.d.ts +0 -6
  65. package/dist/utils/MapUtils.d.ts +0 -23
  66. package/dist/utils/RequestUtils.d.ts +0 -2
  67. package/dist/utils/URLPagesFactory.d.ts +0 -9
  68. package/index.html +0 -13
  69. package/src/custom/constants.ts +0 -3
  70. package/src/custom/icons.ts +0 -63
  71. package/src/custom/leaflet_map.ts +0 -946
  72. package/src/index.ts +0 -171
  73. package/src/services/agencyAPI.ts +0 -105
  74. package/src/services/geographyAPI.ts +0 -129
  75. package/src/services/insightsAPI.ts +0 -20
  76. package/src/services/mailAPI.ts +0 -89
  77. package/src/services/placesAPI.ts +0 -72
  78. package/src/services/portfolioCustomerAPI.ts +0 -16
  79. package/src/services/publicUserAPI.ts +0 -216
  80. package/src/services/realEstateAPI.ts +0 -133
  81. package/src/services/requestAPI.ts +0 -40
  82. package/src/services/servicesUtils.ts +0 -27
  83. package/src/services/statisticsAPI.ts +0 -84
  84. package/src/services/valuationAPI.ts +0 -45
  85. package/src/services/wikicasaPro.ts +0 -25
  86. package/src/utils/ArrayUtils.ts +0 -2
  87. package/src/utils/ColorUtils.ts +0 -11
  88. package/src/utils/CookieUtils.ts +0 -43
  89. package/src/utils/CurrencyUtils.ts +0 -18
  90. package/src/utils/DOMUtils.ts +0 -28
  91. package/src/utils/DateUtils.ts +0 -9
  92. package/src/utils/DeviceDetectionUtils.ts +0 -17
  93. package/src/utils/EmailUtils.ts +0 -45
  94. package/src/utils/FavoriteUtils.ts +0 -19
  95. package/src/utils/FunctionUtils.ts +0 -29
  96. package/src/utils/GAutocompleteUtils.ts +0 -70
  97. package/src/utils/GenericUtils.ts +0 -37
  98. package/src/utils/LazyLoadingBg.ts +0 -18
  99. package/src/utils/MapUtils.ts +0 -118
  100. package/src/utils/NumberUtils.ts +0 -90
  101. package/src/utils/ObjectUtils.ts +0 -34
  102. package/src/utils/ObserverUtils.ts +0 -32
  103. package/src/utils/PermissionUtils.ts +0 -41
  104. package/src/utils/RESB_UrlBuilder.ts +0 -99
  105. package/src/utils/RequestUtils.ts +0 -20
  106. package/src/utils/StringUtils.ts +0 -75
  107. package/src/utils/URLBuilderUtils.ts +0 -21
  108. package/src/utils/URLPagesFactory.ts +0 -20
  109. package/src/vite-env.d.ts +0 -1
  110. package/tsconfig.json +0 -38
  111. package/vite.config.ts +0 -42
  112. /package/{src/main.ts → dist/main.js} +0 -0
@@ -1,2 +0,0 @@
1
- export declare const showRemoveFavoritesIcons: (id: number) => void;
2
- export declare const showAddFavoritesIcon: (id: number) => void;
@@ -1,6 +0,0 @@
1
- import type { Place, GPlaceDetails } from "@wikicasa-dev/types";
2
- export declare const googlePlaceConverter: (gPlace: GPlaceDetails, address: string) => Promise<Place>;
3
- export declare const getPlaceFromGAutocomplete: (placeId: string, label: string) => Promise<{
4
- place: Place;
5
- address: string;
6
- }>;
@@ -1,23 +0,0 @@
1
- import type { LatLng } from "leaflet";
2
- import Leaflet_map from "../custom/leaflet_map";
3
- declare global {
4
- interface Window {
5
- _mapRange?: number;
6
- }
7
- }
8
- export declare function parsePoints(polygonFromMap: string): Array<LatLng> | undefined;
9
- /**
10
- * @param polygon An array of latitude and polygon that will be used to design an area in a map
11
- * @param forUrl If true, the output string will be encoded as a URI so respecting the UTF-8 encoding
12
- * */
13
- export declare function encodePolygon(polygon: Array<LatLng>, forUrl?: boolean): string;
14
- export declare function getMinMaxLatLng(polygon: Array<LatLng>): {
15
- miny: number;
16
- maxy: number;
17
- minx: number;
18
- maxx: number;
19
- };
20
- export declare function removeDuplicatePoints(latLngs: Array<LatLng>): Array<LatLng>;
21
- export declare function calcPolygonCenter(points: Array<LatLng>): LatLng;
22
- export declare function validateMap(map: Leaflet_map): boolean;
23
- export declare function getPolygonString(shapePoints: Array<LatLng>): string;
@@ -1,2 +0,0 @@
1
- import type { RequestGeneric } from "@wikicasa-dev/types";
2
- export declare function sendRequestGeneric(rg: RequestGeneric): Promise<unknown>;
@@ -1,9 +0,0 @@
1
- import type { PAGES } from "@wikicasa-dev/types";
2
- declare global {
3
- interface Window {
4
- _baseURL: string;
5
- _privateURL: string;
6
- _saveSearchesURL: string;
7
- }
8
- }
9
- export declare const getURLPage: (page: PAGES) => string;
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Utilities</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/main.ts"></script>
12
- </body>
13
- </html>
@@ -1,3 +0,0 @@
1
- export const MAP_TILER_STYLE = "ac216796-6d5d-4f21-a7ce-d80a4b3a45e4";
2
- export const MAP_TILER_TOKEN =
3
- "pk.eyJ1Ijoid2lraWNhc2EiLCJhIjoiY2pqZnVlNXFrMHRzMTNwcGF4aXd2a3N5ZiJ9.BctgdXWxGJ9JRMp2U-SyRw";
@@ -1,63 +0,0 @@
1
- // eslint-disable-next-line max-len
2
- export const SVG = `<svg viewBox="0 0 128 128" class="icon-spin"><circle class="path" cx="64" cy="64" r="42" fill="none" stroke-width="9"></circle></svg>`;
3
-
4
- export function addSpinner(btn: HTMLElement | JQuery, append: boolean = false): void {
5
-
6
- if (!btn)
7
- return;
8
-
9
- const $btn: JQuery = $(btn);
10
- const $svg: JQuery = $(SVG);
11
-
12
- $btn.attr("disabled", "disabled");
13
-
14
- const $icon: JQuery = $btn.find(".icon");
15
-
16
- if (!$icon.length) {
17
- $svg.addClass(`icon icon-md ${append ? "ml-5" : "mr-5"}`);
18
- append ? $btn.append($svg): $btn.prepend($svg);
19
- } else {
20
- $btn.data("icon-prev", $icon);
21
- $svg.addClass($icon.attr("class") || "");
22
- $icon.replaceWith($svg);
23
- }
24
- }
25
-
26
- export function removeSpinner(btn: HTMLElement | JQuery): void {
27
-
28
- if (!btn)
29
- return;
30
-
31
- const $btn: JQuery = $(btn);
32
-
33
- $btn.removeAttr("disabled");
34
-
35
- const $svg: JQuery = $btn.find(".icon-spin");
36
-
37
- const prev = $btn.data("icon-prev");
38
-
39
- if (prev) {
40
- $svg.replaceWith(prev);
41
- } else
42
- $svg.remove();
43
- }
44
-
45
- $(() => {
46
- const dataSpinners = [].slice.call(document.querySelectorAll("[data-spinner]"));
47
-
48
- dataSpinners.forEach((entry: HTMLElement) => {
49
- const $entry: JQuery = $(entry);
50
-
51
- $entry.on("click", () => {
52
-
53
- if ($entry[0].hasAttribute("disabled"))
54
- return;
55
-
56
- addSpinner($entry);
57
-
58
- setTimeout(() => {
59
- removeSpinner($entry);
60
- }, 30000);
61
- });
62
- });
63
- });