@wikicasa-dev/utilities 1.0.18 → 1.0.19

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-sG1fVLsL.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._.SMALL,md:e._.MEDIUM,lg:e._.LARGE,xl:e._.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-D0iZP-MN.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.f.SMALL,md:e.f.MEDIUM,lg:e.f.LARGE,xl:e.f.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,4 +1,4 @@
1
- import { _ as i } from "./types-DvS4I6fS.js";
1
+ import { f as i } from "./types-B0dZ7OiV.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
4
  ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = (t = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(r,t)=>{t||(t=navigator.language);const n=Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu,""),o=Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu,""),e=parseFloat(`${r}`.replace(new RegExp("\\"+n,"g"),"").replace(new RegExp("\\"+o),"."));return isNaN(e)?"":e},i=(r,t)=>{if(r==null)return;if(r=parseFloat(`${r}`),isNaN(r))return"";const n={style:"currency",currency:"EUR"};let e={...{maximumFractionDigits:0}};return t?.currency&&(e={...e,...n}),new Intl.NumberFormat(navigator.language,{...e}).format(r)};function m(r,t=!1){return r==null?"":a(t?Math.round(r):Math.floor(r),0)}function a(r,t){return!r&&r!==0?"":r.toLocaleString("it-IT",{minimumFractionDigits:t,maximumFractionDigits:t})}function c(r,t=2){return a(r,t)}const f={formatFn:i,unFormatFn:u};exports.formatFloat=c;exports.formatInteger=m;exports.formatLocaleNumber=i;exports.formatNumber=a;exports.formatterNumberObj=f;exports.parseLocaleNumber=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(r,t)=>{t||(t=navigator.language);const n=Intl.NumberFormat(t).format(1111).replace(/\p{Number}/gu,""),o=Intl.NumberFormat(t).format(1.1).replace(/\p{Number}/gu,""),e=parseFloat(`${r}`.replace(new RegExp("\\"+n,"g"),"").replace(new RegExp("\\"+o),"."));return isNaN(e)?"":e},i=(r,t)=>{if(r==null)return;if(r=parseFloat(`${r}`),isNaN(r))return"";const n={style:"currency",currency:"EUR"};let e={...{maximumFractionDigits:0}};return t?.currency&&(e={...e,...n}),new Intl.NumberFormat(navigator.language,{...e}).format(r)};function m(r,t=!1){return r==null?"":a(t?Math.round(r):Math.floor(r),0)}function a(r,t){return!r&&r!==0?"":r.toLocaleString("it-IT",{minimumFractionDigits:t,maximumFractionDigits:t})}function c(r,t=2){return a(r,t)}const f={formatFn:r=>i(r)??"",unFormatFn:r=>u(r)};exports.formatFloat=c;exports.formatInteger=m;exports.formatLocaleNumber=i;exports.formatNumber=a;exports.formatterNumberObj=f;exports.parseLocaleNumber=u;
@@ -37,8 +37,8 @@ function f(r, t = 2) {
37
37
  return o(r, t);
38
38
  }
39
39
  const m = {
40
- formatFn: u,
41
- unFormatFn: i
40
+ formatFn: (r) => u(r) ?? "",
41
+ unFormatFn: (r) => i(r)
42
42
  };
43
43
  export {
44
44
  f as formatFloat,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-sG1fVLsL.cjs");function d(n,r,e,t,a,u,o){let l="/";return e&&(l+=(e==i.S.AUCTION?window._auctionLabel:e==i.S.RENT?window._rentLabel:window._saleLabel)+"-"),l+=`${r}/`,u&&(l+=`${u}/`),n&&(l+=`${n.replace(/^-+|-+$/g,"")}/`),t&&(l+=`${t.replace(/^_+|_+$/g,"")}/`),!t&&o&&(l+=`${o.replace(/^_+|_+$/g,"")}/`),a&&(l+=`${a.replace(/^_+|_+$/g,"")}/`),l}function f(n){const r=Object.keys(i.II).map(e=>n[e]?encodeURIComponent(i.II[e])+"="+encodeURIComponent(n[e]):null).filter(e=>e!==null);return r.length?`?${r.join("&")}`:""}function m(n){const r=Object.keys(i.lI).map(e=>{if(n[e])if(Array.isArray(n[e])){const t=n[e],a=i.lI[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.lI[e])+"="+encodeURIComponent(n[e]);else return null}).filter(e=>e!==null);return r.length?`?${r.join("&")}`:""}exports.buildParams=f;exports.buildParamsForAgency=m;exports.buildURL=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-D0iZP-MN.cjs");function d(n,l,e,t,a,u,o){let r="/";return e&&(r+=(e==i.T.AUCTION?window._auctionLabel:e==i.T.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.xE).map(e=>n[e]?encodeURIComponent(i.xE[e])+"="+encodeURIComponent(n[e]):null).filter(e=>e!==null);return l.length?`?${l.join("&")}`:""}function m(n){const l=Object.keys(i.qE).map(e=>{if(n[e])if(Array.isArray(n[e])){const t=n[e],a=i.qE[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.qE[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,27 +1,27 @@
1
- import { S as m, I as p, l as f } from "./types-DvS4I6fS.js";
2
- function s(e, o, n, r, u, i, t) {
3
- let l = "/";
4
- return n && (l += (n == m.AUCTION ? window._auctionLabel : n == m.RENT ? window._rentLabel : window._saleLabel) + "-"), l += `${o}/`, i && (l += `${i}/`), e && (l += `${e.replace(/^-+|-+$/g, "")}/`), r && (l += `${r.replace(/^_+|_+$/g, "")}/`), !r && t && (l += `${t.replace(/^_+|_+$/g, "")}/`), u && (l += `${u.replace(/^_+|_+$/g, "")}/`), l;
1
+ import { x as m, q as f, T as p } from "./types-B0dZ7OiV.js";
2
+ function s(e, r, n, l, u, i, t) {
3
+ let o = "/";
4
+ return n && (o += (n == p.AUCTION ? window._auctionLabel : n == p.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 $(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(m).map((n) => e[n] ? encodeURIComponent(m[n]) + "=" + encodeURIComponent(e[n]) : null).filter((n) => n !== null);
8
+ return r.length ? `?${r.join("&")}` : "";
9
9
  }
10
10
  function d(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
- const r = e[n], u = f[n];
14
+ const l = e[n], u = f[n];
15
15
  let i = "";
16
- for (let t = 0; t < r.length; t++)
17
- i += encodeURIComponent(u) + "=" + encodeURIComponent(r[t]), i += t < r.length - 1 ? "&" : "";
16
+ for (let t = 0; t < l.length; t++)
17
+ i += encodeURIComponent(u) + "=" + encodeURIComponent(l[t]), i += t < l.length - 1 ? "&" : "";
18
18
  return i;
19
19
  } else
20
20
  return encodeURIComponent(f[n]) + "=" + encodeURIComponent(e[n]);
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
  $ as buildParams,