@wikicasa-dev/utilities 1.0.6 → 1.0.7

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 e=require("./types-BwcfOdWy.cjs"),r=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,n=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=(t={sm:e.u.SMALL,md:e.u.MEDIUM,lg:e.u.LARGE,xl:e.u.EXTRA_LARGE})=>{const i=t;return window.innerWidth<i.sm?"mobile":window.innerWidth<i.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=s;exports.isMobile=n;exports.isSafari=o;exports.isiOSDevice=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./types-TxQzMZqL.cjs"),t=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,n=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=(r={sm:e.r.SMALL,md:e.r.MEDIUM,lg:e.r.LARGE,xl:e.r.EXTRA_LARGE})=>{const i=r;return window.innerWidth<i.sm?"mobile":window.innerWidth<i.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=s;exports.isMobile=n;exports.isSafari=o;exports.isiOSDevice=t;
@@ -1,13 +1,13 @@
1
- import { u as i } from "./types-CTdZJ5hY.js";
1
+ import { r as i } from "./types-9fLIjwrJ.js";
2
2
  const n = () => /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
- ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = (t = {
4
+ ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = (r = {
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 = t;
10
+ const e = r;
11
11
  return window.innerWidth < e.sm ? "mobile" : window.innerWidth < e.lg ? "tablet" : "desktop";
12
12
  };
13
13
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-BwcfOdWy.cjs");function d(n,l,e,t,a,u,o){let r="/";return e&&(r+=(e==i.r.AUCTION?window._auctionLabel:e==i.r.RENT?window._rentLabel:window._saleLabel)+"-"),r+=`${l}/`,u&&(r+=`${u}/`),n&&(r+=`${n.replace(/^-+|-+$/g,"")}/`),t&&(r+=`${t.replace(/^_+|_+$/g,"")}/`),!t&&o&&(r+=`${o.replace(/^_+|_+$/g,"")}/`),a&&(r+=`${a.replace(/^_+|_+$/g,"")}/`),r}function f(n){const l=Object.keys(i.X).map(e=>n[e]?encodeURIComponent(i.X[e])+"="+encodeURIComponent(n[e]):null).filter(e=>e!==null);return l.length?`?${l.join("&")}`:""}function m(n){const l=Object.keys(i.J).map(e=>{if(n[e])if(Array.isArray(n[e])){const t=n[e],a=i.J[e];let u="";for(let o=0;o<t.length;o++)u+=encodeURIComponent(a)+"="+encodeURIComponent(t[o]),u+=o<t.length-1?"&":"";return u}else return encodeURIComponent(i.J[e])+"="+encodeURIComponent(n[e]);else return null}).filter(e=>e!==null);return l.length?`?${l.join("&")}`:""}exports.buildParams=f;exports.buildParamsForAgency=m;exports.buildURL=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-TxQzMZqL.cjs");function a(n,l,e,t,s,u,o){let r="/";return e&&(r+=(e==i.s.AUCTION?window._auctionLabel:e==i.s.RENT?window._rentLabel:window._saleLabel)+"-"),r+=`${l}/`,u&&(r+=`${u}/`),n&&(r+=`${n.replace(/^-+|-+$/g,"")}/`),t&&(r+=`${t.replace(/^_+|_+$/g,"")}/`),!t&&o&&(r+=`${o.replace(/^_+|_+$/g,"")}/`),s&&(r+=`${s.replace(/^_+|_+$/g,"")}/`),r}function d(n){const l=Object.keys(i.j).map(e=>n[e]?encodeURIComponent(i.j[e])+"="+encodeURIComponent(n[e]):null).filter(e=>e!==null);return l.length?`?${l.join("&")}`:""}function f(n){const l=Object.keys(i.K).map(e=>{if(n[e])if(Array.isArray(n[e])){const t=n[e],s=i.K[e];let u="";for(let o=0;o<t.length;o++)u+=encodeURIComponent(s)+"="+encodeURIComponent(t[o]),u+=o<t.length-1?"&":"";return u}else return encodeURIComponent(i.K[e])+"="+encodeURIComponent(n[e]);else return null}).filter(e=>e!==null);return l.length?`?${l.join("&")}`:""}exports.buildParams=d;exports.buildParamsForAgency=f;exports.buildURL=a;
@@ -1,14 +1,14 @@
1
- import { r as m, X as p, J as f } from "./types-CTdZJ5hY.js";
2
- function a(e, o, n, l, u, i, t) {
3
- let r = "/";
4
- return n && (r += (n == m.AUCTION ? window._auctionLabel : n == m.RENT ? window._rentLabel : window._saleLabel) + "-"), r += `${o}/`, i && (r += `${i}/`), e && (r += `${e.replace(/^-+|-+$/g, "")}/`), l && (r += `${l.replace(/^_+|_+$/g, "")}/`), !l && t && (r += `${t.replace(/^_+|_+$/g, "")}/`), u && (r += `${u.replace(/^_+|_+$/g, "")}/`), r;
1
+ import { s as m, j as p, K as f } from "./types-9fLIjwrJ.js";
2
+ function a(e, r, n, l, u, i, t) {
3
+ let o = "/";
4
+ return n && (o += (n == m.AUCTION ? window._auctionLabel : n == m.RENT ? window._rentLabel : window._saleLabel) + "-"), o += `${r}/`, i && (o += `${i}/`), e && (o += `${e.replace(/^-+|-+$/g, "")}/`), l && (o += `${l.replace(/^_+|_+$/g, "")}/`), !l && t && (o += `${t.replace(/^_+|_+$/g, "")}/`), u && (o += `${u.replace(/^_+|_+$/g, "")}/`), o;
5
5
  }
6
6
  function d(e) {
7
- const o = Object.keys(p).map((n) => e[n] ? encodeURIComponent(p[n]) + "=" + encodeURIComponent(e[n]) : null).filter((n) => n !== null);
8
- return o.length ? `?${o.join("&")}` : "";
7
+ const r = Object.keys(p).map((n) => e[n] ? encodeURIComponent(p[n]) + "=" + encodeURIComponent(e[n]) : null).filter((n) => n !== null);
8
+ return r.length ? `?${r.join("&")}` : "";
9
9
  }
10
10
  function s(e) {
11
- const o = Object.keys(f).map((n) => {
11
+ const r = Object.keys(f).map((n) => {
12
12
  if (e[n])
13
13
  if (Array.isArray(e[n])) {
14
14
  const l = e[n], u = f[n];
@@ -21,7 +21,7 @@ function s(e) {
21
21
  else
22
22
  return null;
23
23
  }).filter((n) => n !== null);
24
- return o.length ? `?${o.join("&")}` : "";
24
+ return r.length ? `?${r.join("&")}` : "";
25
25
  }
26
26
  export {
27
27
  d as buildParams,
@@ -50,8 +50,8 @@ const a = {
50
50
  filterOrderId: "Ordinamento"
51
51
  };
52
52
  export {
53
- e as J,
54
- a as X,
55
- r,
56
- i as u
53
+ e as K,
54
+ a as j,
55
+ i as r,
56
+ r as s
57
57
  };
@@ -1 +1 @@
1
- "use strict";var i=(o=>(o[o.SMALL=576]="SMALL",o[o.MEDIUM=768]="MEDIUM",o[o.LARGE=992]="LARGE",o[o.EXTRA_LARGE=1200]="EXTRA_LARGE",o))(i||{}),r=(o=>(o[o.SELLING=0]="SELLING",o[o.SALE=1]="SALE",o[o.RENT=2]="RENT",o[o.AUCTION=3]="AUCTION",o))(r||{});const a={priceFrom:"PrezzoMinimo",priceTo:"PrezzoMassimo",sqMfrom:"SuperficieMinima",sqMto:"SuperficieMassima",roomsFrom:"NumeroMinimoLocali",roomsTo:"NumeroMassimoLocali",bathroomsFrom:"NumeroMinimoBagni",bathroomsTo:"NumeroMassimoBagni",conditionType:"StatoImmobile",energyClassFilter:"ClasseEnergetica",floor:"Piano",excludeAuctions:"EscludiAste",shortRentOnly:"SoloAffittiBrevi",excludeBareOwnership:"EscludiNudaProprieta",onlyPublicUser:"DaPrivato",balcony:"Balcone",terrace:"Terrazzo",balconyTerrace:"BalconeTerrazzo",boxCarSpot:"BoxPostoAuto",carSpot:"PostoAuto",box:"Box",lift:"Ascensore",privateGarden:"GiardinoPrivato",publicGarden:"GiardinoPubblico",cellar:"Cantina",airConditioning:"AriaCondizionata",furnished:"Arredato",publicTransport:"Trasporti",school:"Istruzione",market:"Supermercati",hospital:"Ospedali",pharmacy:"Farmacie",charging:"Ricarica",post:"UfficioPostale",bank:"Banche",swimmingPoolPrivate:"PiscinaPrivata",swimmingPoolPublic:"PiscinaCondominiale",luxury:"Lusso",discounted:"Sconto",filterOrderId:"Ordinamento"},e={sale:"Vendita",rent:"Affitto",auctionType:"Asta",bareOwnershipType:"NudaProprieta",typologyIdList:"Tipologia",filterOrderId:"Ordinamento"};exports.J=e;exports.X=a;exports.r=r;exports.u=i;
1
+ "use strict";var i=(o=>(o[o.SMALL=576]="SMALL",o[o.MEDIUM=768]="MEDIUM",o[o.LARGE=992]="LARGE",o[o.EXTRA_LARGE=1200]="EXTRA_LARGE",o))(i||{}),r=(o=>(o[o.SELLING=0]="SELLING",o[o.SALE=1]="SALE",o[o.RENT=2]="RENT",o[o.AUCTION=3]="AUCTION",o))(r||{});const a={priceFrom:"PrezzoMinimo",priceTo:"PrezzoMassimo",sqMfrom:"SuperficieMinima",sqMto:"SuperficieMassima",roomsFrom:"NumeroMinimoLocali",roomsTo:"NumeroMassimoLocali",bathroomsFrom:"NumeroMinimoBagni",bathroomsTo:"NumeroMassimoBagni",conditionType:"StatoImmobile",energyClassFilter:"ClasseEnergetica",floor:"Piano",excludeAuctions:"EscludiAste",shortRentOnly:"SoloAffittiBrevi",excludeBareOwnership:"EscludiNudaProprieta",onlyPublicUser:"DaPrivato",balcony:"Balcone",terrace:"Terrazzo",balconyTerrace:"BalconeTerrazzo",boxCarSpot:"BoxPostoAuto",carSpot:"PostoAuto",box:"Box",lift:"Ascensore",privateGarden:"GiardinoPrivato",publicGarden:"GiardinoPubblico",cellar:"Cantina",airConditioning:"AriaCondizionata",furnished:"Arredato",publicTransport:"Trasporti",school:"Istruzione",market:"Supermercati",hospital:"Ospedali",pharmacy:"Farmacie",charging:"Ricarica",post:"UfficioPostale",bank:"Banche",swimmingPoolPrivate:"PiscinaPrivata",swimmingPoolPublic:"PiscinaCondominiale",luxury:"Lusso",discounted:"Sconto",filterOrderId:"Ordinamento"},e={sale:"Vendita",rent:"Affitto",auctionType:"Asta",bareOwnershipType:"NudaProprieta",typologyIdList:"Tipologia",filterOrderId:"Ordinamento"};exports.K=e;exports.j=a;exports.r=i;exports.s=r;
@@ -1,4 +1,5 @@
1
- import type { Nullable } from "@wikicasa-dev/types";
1
+ import { Nullable } from '@wikicasa-dev/types';
2
+
2
3
  export declare const getSingleElement: (selector: string) => HTMLElement;
3
4
  export declare const emptyElem: (selectorOrElem: string | Element) => void;
4
5
  export declare const showElem: (elem: Nullable<HTMLElement>, displayValue?: "block" | "d-flex") => void;
@@ -1,4 +1,5 @@
1
- import type { Nullable } from "@wikicasa-dev/types";
1
+ import { Nullable } from '@wikicasa-dev/types';
2
+
2
3
  /**
3
4
  * Calculates the SHA-256 hash of the input string.
4
5
  *
@@ -1,2 +1,3 @@
1
- import type { GPlaceDetails, Place } from "@wikicasa-dev/types";
1
+ import { GPlaceDetails, Place } from '@wikicasa-dev/types';
2
+
2
3
  export declare const googlePlaceConverter: (gPlace: GPlaceDetails, address: string, place: Place) => Promise<Place>;
@@ -3,7 +3,7 @@
3
3
  * @param stringNumber - the localized number
4
4
  * @param locale - [optional] the locale that the number is represented in. Omit this parameter to use the current locale.
5
5
  */
6
- export declare const parseLocaleNumber: (stringNumber: string | number, locale?: string) => number | string;
6
+ export declare const parseLocaleNumber: (stringNumber: string, locale?: string) => number | string | null;
7
7
  export declare const formatLocaleNumber: (numberToFormat?: number | string, props?: {
8
8
  currency: boolean;
9
9
  }) => string | undefined | null;
@@ -14,5 +14,5 @@ export declare const formatterNumberObj: {
14
14
  formatFn: (numberToFormat?: number | string, props?: {
15
15
  currency: boolean;
16
16
  }) => string | undefined | null;
17
- unFormatFn: (stringNumber: string | number, locale?: string) => number | string;
17
+ unFormatFn: (stringNumber: string, locale?: string) => number | string | null;
18
18
  };
@@ -1,4 +1,5 @@
1
- import type { RealEstateSearchBean } from "@wikicasa-dev/types";
1
+ import { RealEstateSearchBean } from '@wikicasa-dev/types';
2
+
2
3
  declare global {
3
4
  interface Window {
4
5
  _auctionLabel: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/utilities",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Wikicasa frontend utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,11 +34,11 @@
34
34
  "@types/leaflet.markercluster": "^1.5.1",
35
35
  "@types/node": "^20.5.0",
36
36
  "@types/uuid": "^9.0.2",
37
+ "@wikicasa-dev/types": "^1.2.14",
37
38
  "glob": "^10.3.10",
38
39
  "typescript": "^5.4.3",
39
40
  "vite": "^5.2.3",
40
- "vite-plugin-dts": "^3.7.3",
41
- "@wikicasa-dev/types": "^1.2.2"
41
+ "vite-plugin-dts": "^3.7.3"
42
42
  },
43
43
  "dependencies": {
44
44
  "axios": "^1.4.0",