@wikicasa-dev/utilities 1.0.21 → 1.0.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-D0iZP-MN.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.f.SMALL,md:i.f.MEDIUM,lg:i.f.LARGE,xl:i.f.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,18 +1,19 @@
|
|
|
1
1
|
import { f as i } from "./types-B0dZ7OiV.js";
|
|
2
|
-
const
|
|
3
|
-
navigator
|
|
4
|
-
), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = (
|
|
2
|
+
const r = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window?.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
3
|
+
navigator?.userAgent
|
|
4
|
+
), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = () => navigator?.userAgent.includes("Windows"), d = (n = {
|
|
5
5
|
sm: i.SMALL,
|
|
6
6
|
md: i.MEDIUM,
|
|
7
7
|
lg: i.LARGE,
|
|
8
8
|
xl: i.EXTRA_LARGE
|
|
9
9
|
}) => {
|
|
10
|
-
const e =
|
|
11
|
-
return window
|
|
10
|
+
const e = n;
|
|
11
|
+
return window?.innerWidth < e.sm ? "mobile" : window?.innerWidth < e.lg ? "tablet" : "desktop";
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
d as getCurrentDeviceSize,
|
|
15
15
|
o as isMobile,
|
|
16
16
|
s as isSafari,
|
|
17
|
-
|
|
17
|
+
a as isWindows,
|
|
18
|
+
r as isiOSDevice
|
|
18
19
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./ArrayUtils.cjs"),p=require("./ColorUtils.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./ArrayUtils.cjs"),p=require("./ColorUtils.cjs"),s=require("./CookieUtils.cjs"),g=require("./CurrencyUtils.cjs"),l=require("./DateUtils.cjs"),i=require("./DeviceDetectionUtils.cjs"),a=require("./DOMUtils.cjs"),c=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),u=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),r=require("./ObjectUtils.cjs"),A=require("./ObserverUtils.cjs"),m=require("./PermissionUtils.cjs"),n=require("./RESB_UrlBuilder.cjs"),o=require("./StringUtils.cjs"),C=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),d=require("./GeolocationUtils.cjs"),b=require("./AdressUtils.cjs"),R=require("./GAutocompleteUtils.cjs"),S=require("./DownloadUtils.cjs");exports.isArrNullOrEmpty=O.isArrNullOrEmpty;exports.rgba=p.rgba;exports.decodeCookie=s.decodeCookie;exports.encodeCookie=s.encodeCookie;exports.getCookie=s.getCookie;exports.removeCookie=s.removeCookie;exports.formatCurrency=g.formatCurrency;exports.formatDate=l.formatDate;exports.formatDateToddMMYYYY=l.formatDateToddMMYYYY;exports.subtractDaysFromDate=l.subtractDaysFromDate;exports.getCurrentDeviceSize=i.getCurrentDeviceSize;exports.isMobile=i.isMobile;exports.isSafari=i.isSafari;exports.isWindows=i.isWindows;exports.isiOSDevice=i.isiOSDevice;exports.emptyElem=a.emptyElem;exports.getSingleElement=a.getSingleElement;exports.hideElem=a.hideElem;exports.showElem=a.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=r.deepCopy;exports.getOrNull=r.getOrNull;exports.invertFlatObject=r.invertFlatObject;exports.invertKeyToValue=r.invertKeyToValue;exports.isEmptyObject=r.isEmptyObject;exports.shallowCopyObjectTo=r.shallowCopyObjectTo;exports.observeOnce=A.observeOnce;exports.addPermissionStateListener=m.addPermissionStateListener;exports.onNotificationsPermissionChange=m.onNotificationsPermissionChange;exports.buildParams=n.buildParams;exports.buildParamsForAgency=n.buildParamsForAgency;exports.buildURL=n.buildURL;exports.capitalizeFirstLetter=o.capitalizeFirstLetter;exports.cleanASCII=o.cleanASCII;exports.decodeTextWithEntities=o.decodeTextWithEntities;exports.replaceAll=o.replaceAll;exports.replaceAllTokens=o.replaceAllTokens;exports.stringToHyphened=o.stringToHyphened;exports.appendQueryString=C.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=d.browserSupportGeolocation;exports.getUserPosition=d.getUserPosition;exports.formatAddress=b.formatAddress;exports.formattedAddress=b.formattedAddress;exports.googlePlaceConverter=R.googlePlaceConverter;exports.downloadFile=S.downloadFile;
|
package/dist/index.js
CHANGED
|
@@ -1,91 +1,92 @@
|
|
|
1
1
|
import { isArrNullOrEmpty as r } from "./ArrayUtils.js";
|
|
2
2
|
import { rgba as m } from "./ColorUtils.js";
|
|
3
|
-
import { decodeCookie as i, encodeCookie as p, getCookie as
|
|
3
|
+
import { decodeCookie as i, encodeCookie as p, getCookie as s, removeCookie as E } from "./CookieUtils.js";
|
|
4
4
|
import { formatCurrency as f } from "./CurrencyUtils.js";
|
|
5
5
|
import { formatDate as c, formatDateToddMMYYYY as d, subtractDaysFromDate as x } from "./DateUtils.js";
|
|
6
|
-
import { getCurrentDeviceSize as b, isMobile as O, isSafari as g,
|
|
7
|
-
import { emptyElem as
|
|
8
|
-
import { hash256 as
|
|
9
|
-
import { debounce as
|
|
10
|
-
import { awaitableSetTimeout as
|
|
11
|
-
import { formatFloat as
|
|
12
|
-
import { deepCopy as Q, getOrNull as
|
|
13
|
-
import { observeOnce as
|
|
14
|
-
import { addPermissionStateListener as
|
|
15
|
-
import { buildParams as
|
|
16
|
-
import { capitalizeFirstLetter as
|
|
17
|
-
import { appendQueryString as
|
|
18
|
-
import { COMPETITOR_REGEX as
|
|
19
|
-
import { browserSupportGeolocation as
|
|
20
|
-
import { formatAddress as
|
|
21
|
-
import { googlePlaceConverter as
|
|
22
|
-
import { downloadFile as
|
|
6
|
+
import { getCurrentDeviceSize as b, isMobile as O, isSafari as g, isWindows as A, isiOSDevice as C } from "./DeviceDetectionUtils.js";
|
|
7
|
+
import { emptyElem as S, getSingleElement as T, hideElem as _, showElem as G } from "./DOMUtils.js";
|
|
8
|
+
import { hash256 as N, hashEmail as X } from "./EmailUtils.js";
|
|
9
|
+
import { debounce as P, isPromise as h } from "./FunctionUtils.js";
|
|
10
|
+
import { awaitableSetTimeout as v, createCustomEvent as M } from "./GenericUtils.js";
|
|
11
|
+
import { formatFloat as w, formatInteger as F, formatLocaleNumber as k, formatLocaleNumberAuto as j, formatNumber as Y, formatterNumberObj as H, parseLocaleNumber as U, parseLocaleNumberAuto as W } from "./NumberUtils.js";
|
|
12
|
+
import { deepCopy as Q, getOrNull as B, invertFlatObject as K, invertKeyToValue as V, isEmptyObject as q, shallowCopyObjectTo as J } from "./ObjectUtils.js";
|
|
13
|
+
import { observeOnce as $ } from "./ObserverUtils.js";
|
|
14
|
+
import { addPermissionStateListener as oe, onNotificationsPermissionChange as re } from "./PermissionUtils.js";
|
|
15
|
+
import { buildParams as me, buildParamsForAgency as ae, buildURL as ie } from "./RESB_UrlBuilder.js";
|
|
16
|
+
import { capitalizeFirstLetter as se, cleanASCII as Ee, decodeTextWithEntities as le, replaceAll as fe, replaceAllTokens as ne, stringToHyphened as ce } from "./StringUtils.js";
|
|
17
|
+
import { appendQueryString as xe } from "./URLBuilderUtils.js";
|
|
18
|
+
import { COMPETITOR_REGEX as be, DATE_REGEX as Oe, EMAIL_REGEX as ge, EMAIL_REGEX_INTO_TEXT as Ae, EXCLUDED_REGEX as Ce, GLOBAL_PHONE_REGEX as Re, PASSWORD_REGEX as Se, PHONE_REGEX as Te, ROOMS_REGEX as _e, SQM_REGEX as Ge } from "./RegexUtils.js";
|
|
19
|
+
import { browserSupportGeolocation as Ne, getUserPosition as Xe } from "./GeolocationUtils.js";
|
|
20
|
+
import { formatAddress as Pe, formattedAddress as he } from "./AdressUtils.js";
|
|
21
|
+
import { googlePlaceConverter as ve } from "./GAutocompleteUtils.js";
|
|
22
|
+
import { downloadFile as Ie } from "./DownloadUtils.js";
|
|
23
23
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
be as COMPETITOR_REGEX,
|
|
25
|
+
Oe as DATE_REGEX,
|
|
26
|
+
ge as EMAIL_REGEX,
|
|
27
|
+
Ae as EMAIL_REGEX_INTO_TEXT,
|
|
28
|
+
Ce as EXCLUDED_REGEX,
|
|
29
|
+
Re as GLOBAL_PHONE_REGEX,
|
|
30
|
+
Se as PASSWORD_REGEX,
|
|
31
|
+
Te as PHONE_REGEX,
|
|
32
|
+
_e as ROOMS_REGEX,
|
|
33
|
+
Ge as SQM_REGEX,
|
|
34
|
+
oe as addPermissionStateListener,
|
|
35
|
+
xe as appendQueryString,
|
|
36
|
+
v as awaitableSetTimeout,
|
|
37
|
+
Ne as browserSupportGeolocation,
|
|
38
|
+
me as buildParams,
|
|
39
|
+
ae as buildParamsForAgency,
|
|
40
|
+
ie as buildURL,
|
|
41
|
+
se as capitalizeFirstLetter,
|
|
42
42
|
Ee as cleanASCII,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
M as createCustomEvent,
|
|
44
|
+
P as debounce,
|
|
45
45
|
i as decodeCookie,
|
|
46
46
|
le as decodeTextWithEntities,
|
|
47
47
|
Q as deepCopy,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Ie as downloadFile,
|
|
49
|
+
S as emptyElem,
|
|
50
50
|
p as encodeCookie,
|
|
51
|
-
|
|
51
|
+
Pe as formatAddress,
|
|
52
52
|
f as formatCurrency,
|
|
53
53
|
c as formatDate,
|
|
54
54
|
d as formatDateToddMMYYYY,
|
|
55
|
-
|
|
55
|
+
w as formatFloat,
|
|
56
56
|
F as formatInteger,
|
|
57
57
|
k as formatLocaleNumber,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
j as formatLocaleNumberAuto,
|
|
59
|
+
Y as formatNumber,
|
|
60
|
+
he as formattedAddress,
|
|
61
|
+
H as formatterNumberObj,
|
|
62
|
+
s as getCookie,
|
|
63
63
|
b as getCurrentDeviceSize,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
B as getOrNull,
|
|
65
|
+
T as getSingleElement,
|
|
66
|
+
Xe as getUserPosition,
|
|
67
|
+
ve as googlePlaceConverter,
|
|
68
|
+
N as hash256,
|
|
69
|
+
X as hashEmail,
|
|
70
|
+
_ as hideElem,
|
|
71
|
+
K as invertFlatObject,
|
|
72
|
+
V as invertKeyToValue,
|
|
73
73
|
r as isArrNullOrEmpty,
|
|
74
|
-
|
|
74
|
+
q as isEmptyObject,
|
|
75
75
|
O as isMobile,
|
|
76
|
-
|
|
76
|
+
h as isPromise,
|
|
77
77
|
g as isSafari,
|
|
78
|
-
A as
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
U as
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
fe as
|
|
78
|
+
A as isWindows,
|
|
79
|
+
C as isiOSDevice,
|
|
80
|
+
$ as observeOnce,
|
|
81
|
+
re as onNotificationsPermissionChange,
|
|
82
|
+
U as parseLocaleNumber,
|
|
83
|
+
W as parseLocaleNumberAuto,
|
|
84
|
+
E as removeCookie,
|
|
85
|
+
fe as replaceAll,
|
|
86
|
+
ne as replaceAllTokens,
|
|
86
87
|
m as rgba,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
J as shallowCopyObjectTo,
|
|
89
|
+
G as showElem,
|
|
90
|
+
ce as stringToHyphened,
|
|
90
91
|
x as subtractDaysFromDate
|
|
91
92
|
};
|
|
@@ -16,6 +16,7 @@ export declare const isMobile: () => boolean;
|
|
|
16
16
|
* @returns {boolean} Returns true if the browser is Safari, false otherwise.
|
|
17
17
|
*/
|
|
18
18
|
export declare const isSafari: () => boolean;
|
|
19
|
+
export declare const isWindows: () => boolean;
|
|
19
20
|
type BreakpointType = {
|
|
20
21
|
sm: number;
|
|
21
22
|
md: number;
|