@fkui/logic 5.46.0 → 6.0.1

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/lib/cjs/index.js CHANGED
@@ -41,19 +41,6 @@ function isString(value) {
41
41
  return typeof value === "string" || value instanceof String;
42
42
  }
43
43
 
44
- /**
45
- * Matches a single whitespace globally.
46
- *
47
- * @public
48
- * @deprecated Use {@link stripWhitespace} instead
49
- */
50
- const WHITESPACE_PATTERN = /\s/g;
51
- /**
52
- * @public
53
- * @deprecated Use {@link formatNumber} instead.
54
- */
55
- const FORMAT_3_DIGITS_GROUPS = /\B(?=(\d{3})+(?!\d))/g;
56
-
57
44
  /**
58
45
  * Implementation of Object.fromEntries() until we run a recent enough version
59
46
  * of NodeJS.
@@ -140,10 +127,6 @@ class DecoratedError extends Error {
140
127
  }
141
128
  }
142
129
 
143
- /**
144
- * @public
145
- * @deprecated Use `FDate` instead.
146
- */
147
130
  const DATE_REGEXP_WITH_DASH = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
148
131
  /**
149
132
  * @public
@@ -2143,16 +2126,13 @@ const TWELVE_HOURS = 12 * 60 * 60;
2143
2126
  * @public
2144
2127
  */
2145
2128
  function setCookie(options) {
2146
- const shouldKeepTheExistingCookie = options.keepAnyExistingCookie && findCookie(options.name);
2129
+ const { name, value, keepAnyExistingCookie, timeLimitSeconds } = options;
2130
+ const shouldKeepTheExistingCookie = keepAnyExistingCookie && findCookie(name);
2147
2131
  if (shouldKeepTheExistingCookie) {
2148
2132
  return;
2149
2133
  }
2150
- let cookieString = `${options.name}=${encodeURIComponent(options.value)}; path=/;`;
2151
- const timeLimitSeconds = options.timeLimitMillis
2152
- ? Math.round(options.timeLimitMillis / 1000)
2153
- : options.timeLimitSeconds;
2154
2134
  const timeout = timeLimitSeconds ?? TWELVE_HOURS;
2155
- cookieString += `max-age=${timeout};`;
2135
+ const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${timeout};`;
2156
2136
  document.cookie = cookieString;
2157
2137
  }
2158
2138
  /**
@@ -2254,7 +2234,7 @@ function requireDayjs_min () {
2254
2234
  if (hasRequiredDayjs_min) return dayjs_min$1.exports;
2255
2235
  hasRequiredDayjs_min = 1;
2256
2236
  (function (module, exports) {
2257
- !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return undefined===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
2237
+ !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
2258
2238
  } (dayjs_min$1));
2259
2239
  return dayjs_min$1.exports;
2260
2240
  }
@@ -2289,7 +2269,7 @@ function requireWeekOfYear () {
2289
2269
  if (hasRequiredWeekOfYear) return weekOfYear$2.exports;
2290
2270
  hasRequiredWeekOfYear = 1;
2291
2271
  (function (module, exports) {
2292
- !function(e,t){module.exports=t();}(weekOfYear$1,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(undefined===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,true);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return undefined===e&&(e=null),this.week(e)};}}));
2272
+ !function(e,t){module.exports=t();}(weekOfYear$1,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,true);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
2293
2273
  } (weekOfYear$2));
2294
2274
  return weekOfYear$2.exports;
2295
2275
  }
@@ -3523,7 +3503,7 @@ function handleTab(event, container) {
3523
3503
  /**
3524
3504
  * Check if element is of type radiobutton or checkbox
3525
3505
  *
3526
- * @public
3506
+ * @internal
3527
3507
  */
3528
3508
  function isRadiobuttonOrCheckbox(element) {
3529
3509
  return (element instanceof HTMLInputElement &&
@@ -3900,12 +3880,6 @@ function isValidatableHTMLElement(element) {
3900
3880
  element instanceof HTMLSelectElement ||
3901
3881
  element instanceof HTMLFieldSetElement);
3902
3882
  }
3903
- /**
3904
- * @internal
3905
- */
3906
- function isFieldset(element) {
3907
- return element instanceof HTMLFieldSetElement;
3908
- }
3909
3883
  function hasValidators(element) {
3910
3884
  return typeof element.dataset.validation === "string";
3911
3885
  }
@@ -3981,14 +3955,6 @@ class ValidationServiceImpl {
3981
3955
  createFieldsetValidator(element, this);
3982
3956
  }
3983
3957
  this.setRequiredAttribute(element, validatorConfigs);
3984
- // Deprecated: SFKUI-4412 personnummerValidator is deprecated. Replace with personnummerFormat and personnummerLuhn
3985
- // Legacy compability tests cant be found here: @fkui/vue:src\components\FTextField\FTextField.cy.ts
3986
- if (validatorConfigs["personnummer"] !== undefined) {
3987
- const oldConfig = validatorConfigs["personnummer"];
3988
- validatorConfigs["personnummerFormat"] = oldConfig;
3989
- validatorConfigs["personnummerLuhn"] = oldConfig;
3990
- delete validatorConfigs.personnummer;
3991
- }
3992
3958
  const foundValidators = this.getValidators(validatorConfigs);
3993
3959
  // set data-validation attribute to indicate that validation is activated on the element
3994
3960
  if (foundValidators.length > 0) {
@@ -4896,16 +4862,6 @@ ValidationService.registerValidator(postalCodeValidator);
4896
4862
  ValidationService.registerValidator(requiredValidator);
4897
4863
  ValidationService.registerValidator(whitelistValidator);
4898
4864
 
4899
- /**
4900
- * This function does nothing and should not be used.
4901
- *
4902
- * @public
4903
- * @deprecated This function does nothing.
4904
- */
4905
- function applyValidationMessages() {
4906
- /* do nothing */
4907
- }
4908
-
4909
4865
  class ElementIdServiceImpl {
4910
4866
  elementIdMap = new Map();
4911
4867
  generateElementId(prefix = "fkui") {
@@ -5048,17 +5004,6 @@ class SimplePersistenceService {
5048
5004
  }
5049
5005
  }
5050
5006
 
5051
- /**
5052
- * @public
5053
- */
5054
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt
5055
- class Reference {
5056
- ref = {};
5057
- constructor(ref) {
5058
- Object.assign(this.ref, ref);
5059
- }
5060
- }
5061
-
5062
5007
  /**
5063
5008
  * Default delay in milliseconds for {@link waitForScreenReader}
5064
5009
  *
@@ -5164,24 +5109,18 @@ if (typeof document !== "undefined") {
5164
5109
  createScreenReaderWrapper({ assertive: false });
5165
5110
  }
5166
5111
 
5167
- exports.DATE_REGEXP_WITH_DASH = DATE_REGEXP_WITH_DASH;
5168
5112
  exports.DecoratedError = DecoratedError;
5169
5113
  exports.DomUtils = index;
5170
5114
  exports.ElementIdService = ElementIdService;
5171
- exports.FORMAT_3_DIGITS_GROUPS = FORMAT_3_DIGITS_GROUPS;
5172
5115
  exports.MissingValueError = MissingValueError;
5173
- exports.POSTAL_CODE_REGEXP = POSTAL_CODE_REGEXP;
5174
5116
  exports.PersistenceService = PersistenceService;
5175
- exports.Reference = Reference;
5176
5117
  exports.SCREEN_READER_DELAY = SCREEN_READER_DELAY;
5177
5118
  exports.SimplePersistenceService = SimplePersistenceService;
5178
5119
  exports.TranslationService = TranslationService;
5179
5120
  exports.ValidationErrorMessageBuilder = ValidationErrorMessageBuilder;
5180
5121
  exports.ValidationService = ValidationService;
5181
- exports.WHITESPACE_PATTERN = WHITESPACE_PATTERN;
5182
5122
  exports.addFocusListener = addFocusListener;
5183
5123
  exports.alertScreenReader = alertScreenReader;
5184
- exports.applyValidationMessages = applyValidationMessages;
5185
5124
  exports.configLogic = configLogic;
5186
5125
  exports.debounce = debounce;
5187
5126
  exports.deepClone = deepClone;
@@ -5203,7 +5142,6 @@ exports.formatPostalCode = formatPostalCode;
5203
5142
  exports.getErrorMessages = getErrorMessages;
5204
5143
  exports.handleTab = handleTab;
5205
5144
  exports.isEmpty = isEmpty;
5206
- exports.isFieldset = isFieldset;
5207
5145
  exports.isFocusable = isFocusable;
5208
5146
  exports.isInvalidDatesConfig = isInvalidDatesConfig;
5209
5147
  exports.isInvalidWeekdaysConfig = isInvalidWeekdaysConfig;
@@ -5211,7 +5149,6 @@ exports.isRadiobuttonOrCheckbox = isRadiobuttonOrCheckbox;
5211
5149
  exports.isSet = isSet;
5212
5150
  exports.isString = isString;
5213
5151
  exports.isTabbable = isTabbable;
5214
- exports.isValidDate = isValidDate;
5215
5152
  exports.isValidatableFormElement = isValidatableFormElement;
5216
5153
  exports.isValidatableHTMLElement = isValidatableHTMLElement;
5217
5154
  exports.isVisible = isVisible;
package/lib/esm/index.js CHANGED
@@ -39,19 +39,6 @@ function isString(value) {
39
39
  return typeof value === "string" || value instanceof String;
40
40
  }
41
41
 
42
- /**
43
- * Matches a single whitespace globally.
44
- *
45
- * @public
46
- * @deprecated Use {@link stripWhitespace} instead
47
- */
48
- const WHITESPACE_PATTERN = /\s/g;
49
- /**
50
- * @public
51
- * @deprecated Use {@link formatNumber} instead.
52
- */
53
- const FORMAT_3_DIGITS_GROUPS = /\B(?=(\d{3})+(?!\d))/g;
54
-
55
42
  /**
56
43
  * Implementation of Object.fromEntries() until we run a recent enough version
57
44
  * of NodeJS.
@@ -138,10 +125,6 @@ class DecoratedError extends Error {
138
125
  }
139
126
  }
140
127
 
141
- /**
142
- * @public
143
- * @deprecated Use `FDate` instead.
144
- */
145
128
  const DATE_REGEXP_WITH_DASH = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
146
129
  /**
147
130
  * @public
@@ -2141,16 +2124,13 @@ const TWELVE_HOURS = 12 * 60 * 60;
2141
2124
  * @public
2142
2125
  */
2143
2126
  function setCookie(options) {
2144
- const shouldKeepTheExistingCookie = options.keepAnyExistingCookie && findCookie(options.name);
2127
+ const { name, value, keepAnyExistingCookie, timeLimitSeconds } = options;
2128
+ const shouldKeepTheExistingCookie = keepAnyExistingCookie && findCookie(name);
2145
2129
  if (shouldKeepTheExistingCookie) {
2146
2130
  return;
2147
2131
  }
2148
- let cookieString = `${options.name}=${encodeURIComponent(options.value)}; path=/;`;
2149
- const timeLimitSeconds = options.timeLimitMillis
2150
- ? Math.round(options.timeLimitMillis / 1000)
2151
- : options.timeLimitSeconds;
2152
2132
  const timeout = timeLimitSeconds ?? TWELVE_HOURS;
2153
- cookieString += `max-age=${timeout};`;
2133
+ const cookieString = `${name}=${encodeURIComponent(value)}; path=/; max-age=${timeout};`;
2154
2134
  document.cookie = cookieString;
2155
2135
  }
2156
2136
  /**
@@ -2252,7 +2232,7 @@ function requireDayjs_min () {
2252
2232
  if (hasRequiredDayjs_min) return dayjs_min$1.exports;
2253
2233
  hasRequiredDayjs_min = 1;
2254
2234
  (function (module, exports) {
2255
- !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return undefined===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
2235
+ !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
2256
2236
  } (dayjs_min$1));
2257
2237
  return dayjs_min$1.exports;
2258
2238
  }
@@ -2287,7 +2267,7 @@ function requireWeekOfYear () {
2287
2267
  if (hasRequiredWeekOfYear) return weekOfYear$2.exports;
2288
2268
  hasRequiredWeekOfYear = 1;
2289
2269
  (function (module, exports) {
2290
- !function(e,t){module.exports=t();}(weekOfYear$1,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(undefined===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,true);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return undefined===e&&(e=null),this.week(e)};}}));
2270
+ !function(e,t){module.exports=t();}(weekOfYear$1,(function(){var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,true);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e){return void 0===e&&(e=null),this.week(e)};}}));
2291
2271
  } (weekOfYear$2));
2292
2272
  return weekOfYear$2.exports;
2293
2273
  }
@@ -3521,7 +3501,7 @@ function handleTab(event, container) {
3521
3501
  /**
3522
3502
  * Check if element is of type radiobutton or checkbox
3523
3503
  *
3524
- * @public
3504
+ * @internal
3525
3505
  */
3526
3506
  function isRadiobuttonOrCheckbox(element) {
3527
3507
  return (element instanceof HTMLInputElement &&
@@ -3898,12 +3878,6 @@ function isValidatableHTMLElement(element) {
3898
3878
  element instanceof HTMLSelectElement ||
3899
3879
  element instanceof HTMLFieldSetElement);
3900
3880
  }
3901
- /**
3902
- * @internal
3903
- */
3904
- function isFieldset(element) {
3905
- return element instanceof HTMLFieldSetElement;
3906
- }
3907
3881
  function hasValidators(element) {
3908
3882
  return typeof element.dataset.validation === "string";
3909
3883
  }
@@ -3979,14 +3953,6 @@ class ValidationServiceImpl {
3979
3953
  createFieldsetValidator(element, this);
3980
3954
  }
3981
3955
  this.setRequiredAttribute(element, validatorConfigs);
3982
- // Deprecated: SFKUI-4412 personnummerValidator is deprecated. Replace with personnummerFormat and personnummerLuhn
3983
- // Legacy compability tests cant be found here: @fkui/vue:src\components\FTextField\FTextField.cy.ts
3984
- if (validatorConfigs["personnummer"] !== undefined) {
3985
- const oldConfig = validatorConfigs["personnummer"];
3986
- validatorConfigs["personnummerFormat"] = oldConfig;
3987
- validatorConfigs["personnummerLuhn"] = oldConfig;
3988
- delete validatorConfigs.personnummer;
3989
- }
3990
3956
  const foundValidators = this.getValidators(validatorConfigs);
3991
3957
  // set data-validation attribute to indicate that validation is activated on the element
3992
3958
  if (foundValidators.length > 0) {
@@ -4894,16 +4860,6 @@ ValidationService.registerValidator(postalCodeValidator);
4894
4860
  ValidationService.registerValidator(requiredValidator);
4895
4861
  ValidationService.registerValidator(whitelistValidator);
4896
4862
 
4897
- /**
4898
- * This function does nothing and should not be used.
4899
- *
4900
- * @public
4901
- * @deprecated This function does nothing.
4902
- */
4903
- function applyValidationMessages() {
4904
- /* do nothing */
4905
- }
4906
-
4907
4863
  class ElementIdServiceImpl {
4908
4864
  elementIdMap = new Map();
4909
4865
  generateElementId(prefix = "fkui") {
@@ -5046,17 +5002,6 @@ class SimplePersistenceService {
5046
5002
  }
5047
5003
  }
5048
5004
 
5049
- /**
5050
- * @public
5051
- */
5052
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- technical debt
5053
- class Reference {
5054
- ref = {};
5055
- constructor(ref) {
5056
- Object.assign(this.ref, ref);
5057
- }
5058
- }
5059
-
5060
5005
  /**
5061
5006
  * Default delay in milliseconds for {@link waitForScreenReader}
5062
5007
  *
@@ -5162,5 +5107,5 @@ if (typeof document !== "undefined") {
5162
5107
  createScreenReaderWrapper({ assertive: false });
5163
5108
  }
5164
5109
 
5165
- export { DATE_REGEXP_WITH_DASH, DecoratedError, index as DomUtils, ElementIdService, FORMAT_3_DIGITS_GROUPS, MissingValueError, POSTAL_CODE_REGEXP, PersistenceService, Reference, SCREEN_READER_DELAY, SimplePersistenceService, TranslationService, ValidationErrorMessageBuilder, ValidationService, WHITESPACE_PATTERN, addFocusListener, alertScreenReader, applyValidationMessages, configLogic, debounce, deepClone, deleteCookie, documentOrderComparator, ensureSet, findCookie, findTabbableElements, flatten, focus, focusFirst, focusLast, formatClearingNumberForBackend, formatNumber, formatPercent, formatPersonnummer, formatPersonnummerToDate, formatPostalCode, getErrorMessages, handleTab, isEmpty, isFieldset, isFocusable, isInvalidDatesConfig, isInvalidWeekdaysConfig, isRadiobuttonOrCheckbox, isSet, isString, isTabbable, isValidDate, isValidatableFormElement, isValidatableHTMLElement, isVisible, isVisibleInViewport, normalizeDateFormat, parseBankAccountNumber, parseBankgiro, parseClearingNumber, parseDate, parseNumber, parseOrganisationsnummer, parsePercent, parsePersonnummer, parsePersonnummerLuhn, parsePlusgiro, parsePostalCode, popFocus, pushFocus, removeFocusListener, restoreFocus, saveFocus, scrollTo, setCookie, stripNull, stripWhitespace, testLuhnChecksum, validChecksum, validLimit, waitForScreenReader };
5110
+ export { DecoratedError, index as DomUtils, ElementIdService, MissingValueError, PersistenceService, SCREEN_READER_DELAY, SimplePersistenceService, TranslationService, ValidationErrorMessageBuilder, ValidationService, addFocusListener, alertScreenReader, configLogic, debounce, deepClone, deleteCookie, documentOrderComparator, ensureSet, findCookie, findTabbableElements, flatten, focus, focusFirst, focusLast, formatClearingNumberForBackend, formatNumber, formatPercent, formatPersonnummer, formatPersonnummerToDate, formatPostalCode, getErrorMessages, handleTab, isEmpty, isFocusable, isInvalidDatesConfig, isInvalidWeekdaysConfig, isRadiobuttonOrCheckbox, isSet, isString, isTabbable, isValidatableFormElement, isValidatableHTMLElement, isVisible, isVisibleInViewport, normalizeDateFormat, parseBankAccountNumber, parseBankgiro, parseClearingNumber, parseDate, parseNumber, parseOrganisationsnummer, parsePercent, parsePersonnummer, parsePersonnummerLuhn, parsePlusgiro, parsePostalCode, popFocus, pushFocus, removeFocusListener, restoreFocus, saveFocus, scrollTo, setCookie, stripNull, stripWhitespace, testLuhnChecksum, validChecksum, validLimit, waitForScreenReader };
5166
5111
  //# sourceMappingURL=index.js.map
@@ -35,14 +35,6 @@ export declare interface AllowListValidatorConfig extends ValidatorOptions {
35
35
  list: string[];
36
36
  }
37
37
 
38
- /**
39
- * This function does nothing and should not be used.
40
- *
41
- * @public
42
- * @deprecated This function does nothing.
43
- */
44
- export declare function applyValidationMessages(): void;
45
-
46
38
  /**
47
39
  * A string with 3-16 digits, for example "0123456789"
48
40
  *
@@ -80,33 +72,13 @@ export declare const configLogic: FKUIConfigLogic;
80
72
  /**
81
73
  * @public
82
74
  */
83
- export declare type CookieLifetimeOption = {
84
- /**
85
- * @deprecated Use timeLimitSeconds instead. Will be rounded to nearest second.
86
- */
87
- timeLimitMillis?: number;
88
- timeLimitSeconds?: never;
89
- } | {
90
- timeLimitMillis?: never;
91
- timeLimitSeconds?: number;
92
- };
93
-
94
- /**
95
- * @public
96
- */
97
- export declare type CookieOptions = {
75
+ export declare interface CookieOptions {
98
76
  name: string;
99
77
  value: string;
100
78
  keepAnyExistingCookie?: boolean;
101
- } & CookieLifetimeOption;
102
-
103
- /**
104
- * @public
105
- * @deprecated Use `FDate` instead.
106
- */
107
- export declare const DATE_REGEXP_WITH_DASH: RegExp;
108
-
109
- /* Excluded from this release type: DateFormat */
79
+ /** `max-age` parameter, default: 12h */
80
+ timeLimitSeconds?: number;
81
+ }
110
82
 
111
83
  /**
112
84
  * A string in format YYYY-MM-DD, for example 2021-02-03
@@ -242,7 +214,6 @@ declare namespace DomUtils {
242
214
  pushFocus,
243
215
  StackHandle,
244
216
  handleTab,
245
- isRadiobuttonOrCheckbox,
246
217
  isValidatableFormElement,
247
218
  isVisible,
248
219
  isVisibleInViewport,
@@ -414,12 +385,6 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
414
385
  }
415
386
  export { FocusOptions_2 as FocusOptions }
416
387
 
417
- /**
418
- * @public
419
- * @deprecated Use {@link formatNumber} instead.
420
- */
421
- export declare const FORMAT_3_DIGITS_GROUPS: RegExp;
422
-
423
388
  /**
424
389
  * @public
425
390
  */
@@ -498,8 +463,6 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
498
463
  */
499
464
  export declare function isEmpty(value: string | undefined | null): value is "" | undefined | null;
500
465
 
501
- /* Excluded from this release type: isFieldset */
502
-
503
466
  /**
504
467
  * Check if an element is focusable (visible and either interactive or with
505
468
  * tabindex). This includes programatically focusable elements.
@@ -520,12 +483,7 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
520
483
  */
521
484
  export declare function isInvalidWeekdaysConfig(value: Partial<InvalidWeekdaysValidatorConfig>): value is InvalidWeekdaysValidatorConfig;
522
485
 
523
- /**
524
- * Check if element is of type radiobutton or checkbox
525
- *
526
- * @public
527
- */
528
- export declare function isRadiobuttonOrCheckbox(element: Element): element is HTMLInputElement;
486
+ /* Excluded from this release type: isRadiobuttonOrCheckbox */
529
487
 
530
488
  /**
531
489
  * Determine if a value is set. If it is undefined or null, this function
@@ -574,8 +532,6 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
574
532
  */
575
533
  export declare function isValidatableHTMLElement(element: Element): element is ValidatableHTMLElement;
576
534
 
577
- /* Excluded from this release type: isValidDate */
578
-
579
535
  /**
580
536
  * Check if an element is visible in the dom
581
537
  *
@@ -774,8 +730,6 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
774
730
  */
775
731
  export declare function popFocus(handle: StackHandle): void;
776
732
 
777
- /* Excluded from this release type: POSTAL_CODE_REGEXP */
778
-
779
733
  /**
780
734
  * A 5-digit string with space separator, for example "932 22"
781
735
  *
@@ -791,14 +745,6 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
791
745
  */
792
746
  export declare function pushFocus(element?: Element | null): StackHandle;
793
747
 
794
- /**
795
- * @public
796
- */
797
- export declare class Reference<T extends Record<string, any>> {
798
- readonly ref: T;
799
- constructor(ref: T);
800
- }
801
-
802
748
  /**
803
749
  * Remove listener for each item in the list of elements
804
750
  *
@@ -1333,12 +1279,4 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
1333
1279
  */
1334
1280
  export declare function waitForScreenReader<TReturn = void>(callback: () => TReturn, delay?: number): Promise<TReturn>;
1335
1281
 
1336
- /**
1337
- * Matches a single whitespace globally.
1338
- *
1339
- * @public
1340
- * @deprecated Use {@link stripWhitespace} instead
1341
- */
1342
- export declare const WHITESPACE_PATTERN: RegExp;
1343
-
1344
1282
  export { }
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.49.1"
8
+ "packageVersion": "7.49.2"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/logic",
3
- "version": "5.46.0",
3
+ "version": "6.0.1",
4
4
  "description": "Logic",
5
5
  "keywords": [
6
6
  "fkui",
@@ -61,11 +61,11 @@
61
61
  "watch": "rollup --config --watch"
62
62
  },
63
63
  "peerDependencies": {
64
- "@fkui/date": "^5.36.0"
64
+ "@fkui/date": "^6.0.1"
65
65
  },
66
66
  "engines": {
67
67
  "node": ">= 20",
68
68
  "npm": ">= 7"
69
69
  },
70
- "gitHead": "fd747e9381e19ec80ac01f58fba96c10e4eda7c3"
70
+ "gitHead": "57374ff76f56c2587a9290facb0894c89bbe7ea6"
71
71
  }
package/lib/polyfills.js DELETED
@@ -1,3 +0,0 @@
1
- /* @deprecated backwards compatibility, import "@fkui/logic/polyfills" with a
2
- * modern tool chain instead */
3
- module.exports = require("./cjs/polyfills.js");