@wikicasa-dev/utilities 1.0.24 → 1.1.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/dist/CurrencyUtils.js +1 -2
- package/dist/DOMUtils.js +1 -2
- package/dist/DateUtils.cjs +1 -1
- package/dist/DateUtils.js +1925 -479
- package/dist/DeviceDetectionUtils.cjs +1 -1
- package/dist/DeviceDetectionUtils.js +1 -1
- package/dist/DownloadUtils.js +1 -2
- package/dist/EmailUtils.js +1 -2
- package/dist/MapUtils.js +3 -6
- package/dist/NumberUtils.js +2 -4
- package/dist/ObjectUtils.js +1 -2
- package/dist/RESB_UrlBuilder.cjs +1 -1
- package/dist/RESB_UrlBuilder.js +11 -26
- package/dist/StringUtils.js +1 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +62 -62
- package/dist/{types-OLDY2KA_.js → types-DvDE84zi.js} +128 -79
- package/dist/types-zCVogBEy.cjs +1 -0
- package/dist/utils/DateUtils.d.ts +20 -0
- package/dist/utils/RESB_UrlBuilder.d.ts +1 -2
- package/package.json +2 -2
- package/dist/types-PYNmQk37.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-zCVogBEy.cjs"),n=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window?.MSStream,r=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator?.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=()=>navigator?.userAgent.includes("Windows"),a=(t={sm:i.U.SMALL,md:i.U.MEDIUM,lg:i.U.LARGE,xl:i.U.EXTRA_LARGE})=>{const e=t;return window?.innerWidth<e.sm?"mobile":window?.innerWidth<e.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=a;exports.isMobile=r;exports.isSafari=o;exports.isWindows=s;exports.isiOSDevice=n;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as i } from "./types-DvDE84zi.js";
|
|
2
2
|
const r = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window?.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
3
3
|
navigator?.userAgent
|
|
4
4
|
), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = () => navigator?.userAgent.includes("Windows"), d = (n = {
|
package/dist/DownloadUtils.js
CHANGED
package/dist/EmailUtils.js
CHANGED
package/dist/MapUtils.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { encode as o } from "google-polyline";
|
|
2
2
|
function c(t) {
|
|
3
|
-
if (!t)
|
|
4
|
-
return;
|
|
3
|
+
if (!t) return;
|
|
5
4
|
const n = t.match(/[-]?[\d]*[.]?[\d]+/g);
|
|
6
|
-
if (!n)
|
|
7
|
-
return;
|
|
5
|
+
if (!n) return;
|
|
8
6
|
const e = [];
|
|
9
7
|
for (let l = 0; l < n.length; l++)
|
|
10
8
|
e.push({
|
|
@@ -33,8 +31,7 @@ function g(t) {
|
|
|
33
31
|
}), n;
|
|
34
32
|
}
|
|
35
33
|
function m(t) {
|
|
36
|
-
if (t.length <= 0)
|
|
37
|
-
return [];
|
|
34
|
+
if (t.length <= 0) return [];
|
|
38
35
|
const n = /* @__PURE__ */ new Set();
|
|
39
36
|
return t.filter((l) => {
|
|
40
37
|
const a = n.has(l.lat + l.lng), r = l.lat + l.lng;
|
package/dist/NumberUtils.js
CHANGED
|
@@ -4,10 +4,8 @@ const u = (r, t = "it-IT") => {
|
|
|
4
4
|
);
|
|
5
5
|
return isNaN(a) ? "" : a;
|
|
6
6
|
}, m = (r) => u(r, navigator.language), i = (r, t, e = "it-IT") => {
|
|
7
|
-
if (r == null)
|
|
8
|
-
|
|
9
|
-
if (r = parseFloat(`${r}`), isNaN(r))
|
|
10
|
-
return "";
|
|
7
|
+
if (r == null) return;
|
|
8
|
+
if (r = parseFloat(`${r}`), isNaN(r)) return "";
|
|
11
9
|
const n = {
|
|
12
10
|
style: "currency",
|
|
13
11
|
currency: "EUR"
|
package/dist/ObjectUtils.js
CHANGED
package/dist/RESB_UrlBuilder.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./types-zCVogBEy.cjs");function a(o,f,t,e,n,i,p){let r="/";return t&&(r+=t+"-"),r+=`${f}/`,i&&(r+=`${i}/`),o&&(r+=`${o.replace(/^-+|-+$/g,"")}/`),e&&(r+=`${e.replace(/^_+|_+$/g,"")}/`),!e&&p&&(r+=`${p.replace(/^_+|_+$/g,"")}/`),n&&(r+=`${n.replace(/^_+|_+$/g,"")}/`),r}function l(o,f=!1){const t=f?$.ne:$.Oe;return Object.entries(o).filter(([,e])=>e!=null).flatMap(([e,n])=>Array.isArray(n)?n.map(i=>`${encodeURIComponent(t[e])}=${encodeURIComponent(i)}`):`${encodeURIComponent(t[e])}=${n instanceof Date?encodeURIComponent(n.toISOString()):encodeURIComponent(n)}`).join("&")}exports.buildParams=l;exports.buildURL=a;
|
package/dist/RESB_UrlBuilder.js
CHANGED
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
let
|
|
4
|
-
return
|
|
1
|
+
import { n as $, O as a } from "./types-DvDE84zi.js";
|
|
2
|
+
function c(t, i, r, e, n, f, p) {
|
|
3
|
+
let o = "/";
|
|
4
|
+
return r && (o += r + "-"), o += `${i}/`, f && (o += `${f}/`), t && (o += `${t.replace(/^-+|-+$/g, "")}/`), e && (o += `${e.replace(/^_+|_+$/g, "")}/`), !e && p && (o += `${p.replace(/^_+|_+$/g, "")}/`), n && (o += `${n.replace(/^_+|_+$/g, "")}/`), o;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return t.
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const t = Object.keys(f).map((n) => {
|
|
12
|
-
if (e[n])
|
|
13
|
-
if (Array.isArray(e[n])) {
|
|
14
|
-
const o = e[n], u = f[n];
|
|
15
|
-
let i = "";
|
|
16
|
-
for (let l = 0; l < o.length; l++)
|
|
17
|
-
i += encodeURIComponent(u) + "=" + encodeURIComponent(o[l]), i += l < o.length - 1 ? "&" : "";
|
|
18
|
-
return i;
|
|
19
|
-
} else
|
|
20
|
-
return encodeURIComponent(f[n]) + "=" + encodeURIComponent(e[n]);
|
|
21
|
-
else
|
|
22
|
-
return null;
|
|
23
|
-
}).filter((n) => n !== null);
|
|
24
|
-
return t.length ? `?${t.join("&")}` : "";
|
|
6
|
+
function l(t, i = !1) {
|
|
7
|
+
const r = i ? $ : a;
|
|
8
|
+
return Object.entries(t).filter(([, e]) => e != null).flatMap(([e, n]) => Array.isArray(n) ? n.map(
|
|
9
|
+
(f) => `${encodeURIComponent(r[e])}=${encodeURIComponent(f)}`
|
|
10
|
+
) : `${encodeURIComponent(r[e])}=${n instanceof Date ? encodeURIComponent(n.toISOString()) : encodeURIComponent(n)}`).join("&");
|
|
25
11
|
}
|
|
26
12
|
export {
|
|
27
|
-
|
|
28
|
-
c as
|
|
29
|
-
$ as buildURL
|
|
13
|
+
l as buildParams,
|
|
14
|
+
c as buildURL
|
|
30
15
|
};
|
package/dist/StringUtils.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./ArrayUtils.cjs"),O=require("./ColorUtils.cjs"),a=require("./CookieUtils.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./ArrayUtils.cjs"),O=require("./ColorUtils.cjs"),a=require("./CookieUtils.cjs"),C=require("./CurrencyUtils.cjs"),l=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),n=require("./DOMUtils.cjs"),c=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),u=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),o=require("./ObjectUtils.cjs"),P=require("./ObserverUtils.cjs"),m=require("./PermissionUtils.cjs"),d=require("./RESB_UrlBuilder.cjs"),r=require("./StringUtils.cjs"),S=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),g=require("./GeolocationUtils.cjs"),b=require("./AdressUtils.cjs"),R=require("./GAutocompleteUtils.cjs"),y=require("./DownloadUtils.cjs"),i=require("./MapUtils.cjs");exports.isArrNullOrEmpty=p.isArrNullOrEmpty;exports.rgba=O.rgba;exports.decodeCookie=a.decodeCookie;exports.encodeCookie=a.encodeCookie;exports.getCookie=a.getCookie;exports.removeCookie=a.removeCookie;exports.formatCurrency=C.formatCurrency;exports.formatDate=l.formatDate;exports.formatDateToddMMYYYY=l.formatDateToddMMYYYY;exports.normalizeDate=l.normalizeDate;exports.subtractDaysFromDate=l.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isWindows=s.isWindows;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=n.emptyElem;exports.getSingleElement=n.getSingleElement;exports.hideElem=n.hideElem;exports.showElem=n.showElem;exports.hash256=c.hash256;exports.hashEmail=c.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=u.awaitableSetTimeout;exports.createCustomEvent=u.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.parseLocaleNumberAuto=t.parseLocaleNumberAuto;exports.deepCopy=o.deepCopy;exports.getOrNull=o.getOrNull;exports.invertFlatObject=o.invertFlatObject;exports.invertKeyToValue=o.invertKeyToValue;exports.isEmptyObject=o.isEmptyObject;exports.shallowCopyObjectTo=o.shallowCopyObjectTo;exports.observeOnce=P.observeOnce;exports.addPermissionStateListener=m.addPermissionStateListener;exports.onNotificationsPermissionChange=m.onNotificationsPermissionChange;exports.buildParams=d.buildParams;exports.buildURL=d.buildURL;exports.capitalizeFirstLetter=r.capitalizeFirstLetter;exports.cleanASCII=r.cleanASCII;exports.decodeTextWithEntities=r.decodeTextWithEntities;exports.replaceAll=r.replaceAll;exports.replaceAllTokens=r.replaceAllTokens;exports.stringToHyphened=r.stringToHyphened;exports.appendQueryString=S.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=g.browserSupportGeolocation;exports.getUserPosition=g.getUserPosition;exports.formatAddress=b.formatAddress;exports.formattedAddress=b.formattedAddress;exports.googlePlaceConverter=R.googlePlaceConverter;exports.downloadFile=y.downloadFile;exports.calcPolygonCenter=i.calcPolygonCenter;exports.encodePolygon=i.encodePolygon;exports.getMinMaxLatLng=i.getMinMaxLatLng;exports.getPolygonString=i.getPolygonString;exports.parsePoints=i.parsePoints;exports.removeDuplicatePoints=i.removeDuplicatePoints;
|
package/dist/index.js
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
import { isArrNullOrEmpty as r } from "./ArrayUtils.js";
|
|
2
2
|
import { rgba as a } from "./ColorUtils.js";
|
|
3
|
-
import { decodeCookie as i, encodeCookie as l, getCookie as p, removeCookie as
|
|
3
|
+
import { decodeCookie as i, encodeCookie as l, getCookie as p, removeCookie as n } from "./CookieUtils.js";
|
|
4
4
|
import { formatCurrency as E } from "./CurrencyUtils.js";
|
|
5
|
-
import { formatDate as c, formatDateToddMMYYYY as d,
|
|
6
|
-
import { getCurrentDeviceSize as
|
|
7
|
-
import { emptyElem as
|
|
8
|
-
import { hash256 as
|
|
9
|
-
import { debounce as X, isPromise as
|
|
10
|
-
import { awaitableSetTimeout as
|
|
11
|
-
import { formatFloat as
|
|
12
|
-
import { deepCopy as
|
|
13
|
-
import { observeOnce as
|
|
14
|
-
import { addPermissionStateListener as
|
|
15
|
-
import { buildParams as
|
|
16
|
-
import { capitalizeFirstLetter as pe, cleanASCII as
|
|
5
|
+
import { formatDate as c, formatDateToddMMYYYY as d, normalizeDate as x, subtractDaysFromDate as u } from "./DateUtils.js";
|
|
6
|
+
import { getCurrentDeviceSize as b, isMobile as O, isSafari as C, isWindows as P, isiOSDevice as L } from "./DeviceDetectionUtils.js";
|
|
7
|
+
import { emptyElem as S, getSingleElement as y, hideElem as A, showElem as T } from "./DOMUtils.js";
|
|
8
|
+
import { hash256 as D, hashEmail as G } from "./EmailUtils.js";
|
|
9
|
+
import { debounce as X, isPromise as h } from "./FunctionUtils.js";
|
|
10
|
+
import { awaitableSetTimeout as v, createCustomEvent as I } from "./GenericUtils.js";
|
|
11
|
+
import { formatFloat as k, formatInteger as F, formatLocaleNumber as j, formatLocaleNumberAuto as Y, formatNumber as z, formatterNumberObj as H, parseLocaleNumber as U, parseLocaleNumberAuto as W } from "./NumberUtils.js";
|
|
12
|
+
import { deepCopy as B, getOrNull as K, invertFlatObject as V, invertKeyToValue as q, isEmptyObject as J, shallowCopyObjectTo as Z } from "./ObjectUtils.js";
|
|
13
|
+
import { observeOnce as ee } from "./ObserverUtils.js";
|
|
14
|
+
import { addPermissionStateListener as re, onNotificationsPermissionChange as te } from "./PermissionUtils.js";
|
|
15
|
+
import { buildParams as me, buildURL as ie } from "./RESB_UrlBuilder.js";
|
|
16
|
+
import { capitalizeFirstLetter as pe, cleanASCII as ne, decodeTextWithEntities as se, replaceAll as Ee, replaceAllTokens as fe, stringToHyphened as ce } from "./StringUtils.js";
|
|
17
17
|
import { appendQueryString as xe } from "./URLBuilderUtils.js";
|
|
18
|
-
import { COMPETITOR_REGEX as ge, DATE_REGEX as be, EMAIL_REGEX as Oe, EMAIL_REGEX_INTO_TEXT as
|
|
19
|
-
import { browserSupportGeolocation as _e, getUserPosition as
|
|
20
|
-
import { formatAddress as
|
|
18
|
+
import { COMPETITOR_REGEX as ge, DATE_REGEX as be, EMAIL_REGEX as Oe, EMAIL_REGEX_INTO_TEXT as Ce, EXCLUDED_REGEX as Pe, GLOBAL_PHONE_REGEX as Le, PASSWORD_REGEX as Re, PHONE_REGEX as Se, ROOMS_REGEX as ye, SQM_REGEX as Ae } from "./RegexUtils.js";
|
|
19
|
+
import { browserSupportGeolocation as _e, getUserPosition as De } from "./GeolocationUtils.js";
|
|
20
|
+
import { formatAddress as Ne, formattedAddress as Xe } from "./AdressUtils.js";
|
|
21
21
|
import { googlePlaceConverter as Me } from "./GAutocompleteUtils.js";
|
|
22
22
|
import { downloadFile as Ie } from "./DownloadUtils.js";
|
|
23
|
-
import { calcPolygonCenter as
|
|
23
|
+
import { calcPolygonCenter as ke, encodePolygon as Fe, getMinMaxLatLng as je, getPolygonString as Ye, parsePoints as ze, removeDuplicatePoints as He } from "./MapUtils.js";
|
|
24
24
|
export {
|
|
25
25
|
ge as COMPETITOR_REGEX,
|
|
26
26
|
be as DATE_REGEX,
|
|
27
27
|
Oe as EMAIL_REGEX,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
Ce as EMAIL_REGEX_INTO_TEXT,
|
|
29
|
+
Pe as EXCLUDED_REGEX,
|
|
30
|
+
Le as GLOBAL_PHONE_REGEX,
|
|
31
|
+
Re as PASSWORD_REGEX,
|
|
32
|
+
Se as PHONE_REGEX,
|
|
33
|
+
ye as ROOMS_REGEX,
|
|
34
|
+
Ae as SQM_REGEX,
|
|
35
|
+
re as addPermissionStateListener,
|
|
36
36
|
xe as appendQueryString,
|
|
37
|
-
|
|
37
|
+
v as awaitableSetTimeout,
|
|
38
38
|
_e as browserSupportGeolocation,
|
|
39
|
-
|
|
40
|
-
me as buildParamsForAgency,
|
|
39
|
+
me as buildParams,
|
|
41
40
|
ie as buildURL,
|
|
42
|
-
|
|
41
|
+
ke as calcPolygonCenter,
|
|
43
42
|
pe as capitalizeFirstLetter,
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
ne as cleanASCII,
|
|
44
|
+
I as createCustomEvent,
|
|
46
45
|
X as debounce,
|
|
47
46
|
i as decodeCookie,
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
se as decodeTextWithEntities,
|
|
48
|
+
B as deepCopy,
|
|
50
49
|
Ie as downloadFile,
|
|
51
|
-
|
|
50
|
+
S as emptyElem,
|
|
52
51
|
l as encodeCookie,
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
Fe as encodePolygon,
|
|
53
|
+
Ne as formatAddress,
|
|
55
54
|
E as formatCurrency,
|
|
56
55
|
c as formatDate,
|
|
57
56
|
d as formatDateToddMMYYYY,
|
|
58
|
-
|
|
57
|
+
k as formatFloat,
|
|
59
58
|
F as formatInteger,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
j as formatLocaleNumber,
|
|
60
|
+
Y as formatLocaleNumberAuto,
|
|
61
|
+
z as formatNumber,
|
|
62
|
+
Xe as formattedAddress,
|
|
64
63
|
H as formatterNumberObj,
|
|
65
64
|
p as getCookie,
|
|
66
|
-
|
|
65
|
+
b as getCurrentDeviceSize,
|
|
67
66
|
je as getMinMaxLatLng,
|
|
68
|
-
|
|
67
|
+
K as getOrNull,
|
|
69
68
|
Ye as getPolygonString,
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
y as getSingleElement,
|
|
70
|
+
De as getUserPosition,
|
|
72
71
|
Me as googlePlaceConverter,
|
|
73
|
-
|
|
72
|
+
D as hash256,
|
|
74
73
|
G as hashEmail,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
A as hideElem,
|
|
75
|
+
V as invertFlatObject,
|
|
76
|
+
q as invertKeyToValue,
|
|
78
77
|
r as isArrNullOrEmpty,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
J as isEmptyObject,
|
|
79
|
+
O as isMobile,
|
|
80
|
+
h as isPromise,
|
|
81
|
+
C as isSafari,
|
|
83
82
|
P as isWindows,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
L as isiOSDevice,
|
|
84
|
+
x as normalizeDate,
|
|
85
|
+
ee as observeOnce,
|
|
86
|
+
te as onNotificationsPermissionChange,
|
|
87
87
|
U as parseLocaleNumber,
|
|
88
88
|
W as parseLocaleNumberAuto,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
ze as parsePoints,
|
|
90
|
+
n as removeCookie,
|
|
91
|
+
He as removeDuplicatePoints,
|
|
92
92
|
Ee as replaceAll,
|
|
93
93
|
fe as replaceAllTokens,
|
|
94
94
|
a as rgba,
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
Z as shallowCopyObjectTo,
|
|
96
|
+
T as showElem,
|
|
97
97
|
ce as stringToHyphened,
|
|
98
|
-
|
|
98
|
+
u as subtractDaysFromDate
|
|
99
99
|
};
|