@fkui/logic 6.45.0 → 6.46.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/lib/cjs/index.js CHANGED
@@ -316,7 +316,7 @@ var hasRequiredLodash_clonedeep;
316
316
  function requireLodash_clonedeep () {
317
317
  if (hasRequiredLodash_clonedeep) return lodash_clonedeep.exports;
318
318
  hasRequiredLodash_clonedeep = 1;
319
- (function (module, exports$1) {
319
+ (function (module, exports) {
320
320
  /** Used as the size to enable large array optimizations. */
321
321
  var LARGE_ARRAY_SIZE = 200;
322
322
 
@@ -397,7 +397,7 @@ function requireLodash_clonedeep () {
397
397
  var root = freeGlobal || freeSelf || Function('return this')();
398
398
 
399
399
  /** Detect free variable `exports`. */
400
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
400
+ var freeExports = exports && !exports.nodeType && exports;
401
401
 
402
402
  /** Detect free variable `module`. */
403
403
  var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
@@ -2304,7 +2304,7 @@ var hasRequiredDayjs_min;
2304
2304
  function requireDayjs_min () {
2305
2305
  if (hasRequiredDayjs_min) return dayjs_min$1.exports;
2306
2306
  hasRequiredDayjs_min = 1;
2307
- (function (module, exports$1) {
2307
+ (function (module, exports) {
2308
2308
  !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}));
2309
2309
  } (dayjs_min$1));
2310
2310
  return dayjs_min$1.exports;
@@ -2322,7 +2322,7 @@ var hasRequiredSv;
2322
2322
  function requireSv () {
2323
2323
  if (hasRequiredSv) return sv$1.exports;
2324
2324
  hasRequiredSv = 1;
2325
- (function (module, exports$1) {
2325
+ (function (module, exports) {
2326
2326
  !function(e,t){module.exports=t(requireDayjs_min());}(sv,(function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),d={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){var t=e%10;return "["+e+(1===t||2===t?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return a.default.locale(d,null,true),d}));
2327
2327
  } (sv$1));
2328
2328
  return sv$1.exports;
@@ -2339,7 +2339,7 @@ var hasRequiredWeekOfYear;
2339
2339
  function requireWeekOfYear () {
2340
2340
  if (hasRequiredWeekOfYear) return weekOfYear$2.exports;
2341
2341
  hasRequiredWeekOfYear = 1;
2342
- (function (module, exports$1) {
2342
+ (function (module, exports) {
2343
2343
  !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)};}}));
2344
2344
  } (weekOfYear$2));
2345
2345
  return weekOfYear$2.exports;
@@ -4814,6 +4814,7 @@ function numberValidator$1(value, config, name, compare) {
4814
4814
  if (!isSet(limit)) {
4815
4815
  return false;
4816
4816
  }
4817
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
4817
4818
  const limitAsNumber = parseNumber(String(config[name]));
4818
4819
  if (limitAsNumber === undefined) {
4819
4820
  throw new Error(`config.${String(name)} must be a number`);
@@ -5022,6 +5023,7 @@ const personnummerNotSame = {
5022
5023
  if (!valuePnr) {
5023
5024
  return true;
5024
5025
  }
5026
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
5025
5027
  const otherFieldPnr = parsePersonnummer(String(config.otherField));
5026
5028
  if (!otherFieldPnr) {
5027
5029
  return true;
@@ -5037,6 +5039,7 @@ const personnummerOlder = {
5037
5039
  name: "personnummerOlder",
5038
5040
  validation(value, _element, config) {
5039
5041
  const valueAsDate = formatPersonnummerToDate(value);
5042
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
5040
5043
  const otherAsDate = formatPersonnummerToDate(String(config.otherField));
5041
5044
  if (!valueAsDate || !otherAsDate) {
5042
5045
  return true;
@@ -5049,6 +5052,7 @@ const personnummerYounger = {
5049
5052
  name: "personnummerYounger",
5050
5053
  validation(value, _element, config) {
5051
5054
  const valueAsDate = formatPersonnummerToDate(value);
5055
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
5052
5056
  const otherAsDate = formatPersonnummerToDate(String(config.otherField));
5053
5057
  if (!valueAsDate || !otherAsDate) {
5054
5058
  return true;
package/lib/esm/index.js CHANGED
@@ -314,7 +314,7 @@ var hasRequiredLodash_clonedeep;
314
314
  function requireLodash_clonedeep () {
315
315
  if (hasRequiredLodash_clonedeep) return lodash_clonedeep.exports;
316
316
  hasRequiredLodash_clonedeep = 1;
317
- (function (module, exports$1) {
317
+ (function (module, exports) {
318
318
  /** Used as the size to enable large array optimizations. */
319
319
  var LARGE_ARRAY_SIZE = 200;
320
320
 
@@ -395,7 +395,7 @@ function requireLodash_clonedeep () {
395
395
  var root = freeGlobal || freeSelf || Function('return this')();
396
396
 
397
397
  /** Detect free variable `exports`. */
398
- var freeExports = exports$1 && !exports$1.nodeType && exports$1;
398
+ var freeExports = exports && !exports.nodeType && exports;
399
399
 
400
400
  /** Detect free variable `module`. */
401
401
  var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
@@ -2302,7 +2302,7 @@ var hasRequiredDayjs_min;
2302
2302
  function requireDayjs_min () {
2303
2303
  if (hasRequiredDayjs_min) return dayjs_min$1.exports;
2304
2304
  hasRequiredDayjs_min = 1;
2305
- (function (module, exports$1) {
2305
+ (function (module, exports) {
2306
2306
  !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}));
2307
2307
  } (dayjs_min$1));
2308
2308
  return dayjs_min$1.exports;
@@ -2320,7 +2320,7 @@ var hasRequiredSv;
2320
2320
  function requireSv () {
2321
2321
  if (hasRequiredSv) return sv$1.exports;
2322
2322
  hasRequiredSv = 1;
2323
- (function (module, exports$1) {
2323
+ (function (module, exports) {
2324
2324
  !function(e,t){module.exports=t(requireDayjs_min());}(sv,(function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),d={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(e){var t=e%10;return "["+e+(1===t||2===t?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return a.default.locale(d,null,true),d}));
2325
2325
  } (sv$1));
2326
2326
  return sv$1.exports;
@@ -2337,7 +2337,7 @@ var hasRequiredWeekOfYear;
2337
2337
  function requireWeekOfYear () {
2338
2338
  if (hasRequiredWeekOfYear) return weekOfYear$2.exports;
2339
2339
  hasRequiredWeekOfYear = 1;
2340
- (function (module, exports$1) {
2340
+ (function (module, exports) {
2341
2341
  !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)};}}));
2342
2342
  } (weekOfYear$2));
2343
2343
  return weekOfYear$2.exports;
@@ -4812,6 +4812,7 @@ function numberValidator$1(value, config, name, compare) {
4812
4812
  if (!isSet(limit)) {
4813
4813
  return false;
4814
4814
  }
4815
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
4815
4816
  const limitAsNumber = parseNumber(String(config[name]));
4816
4817
  if (limitAsNumber === undefined) {
4817
4818
  throw new Error(`config.${String(name)} must be a number`);
@@ -5020,6 +5021,7 @@ const personnummerNotSame = {
5020
5021
  if (!valuePnr) {
5021
5022
  return true;
5022
5023
  }
5024
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
5023
5025
  const otherFieldPnr = parsePersonnummer(String(config.otherField));
5024
5026
  if (!otherFieldPnr) {
5025
5027
  return true;
@@ -5035,6 +5037,7 @@ const personnummerOlder = {
5035
5037
  name: "personnummerOlder",
5036
5038
  validation(value, _element, config) {
5037
5039
  const valueAsDate = formatPersonnummerToDate(value);
5040
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
5038
5041
  const otherAsDate = formatPersonnummerToDate(String(config.otherField));
5039
5042
  if (!valueAsDate || !otherAsDate) {
5040
5043
  return true;
@@ -5047,6 +5050,7 @@ const personnummerYounger = {
5047
5050
  name: "personnummerYounger",
5048
5051
  validation(value, _element, config) {
5049
5052
  const valueAsDate = formatPersonnummerToDate(value);
5053
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string -- Config may contain objects
5050
5054
  const otherAsDate = formatPersonnummerToDate(String(config.otherField));
5051
5055
  if (!valueAsDate || !otherAsDate) {
5052
5056
  return true;
@@ -1444,7 +1444,7 @@ export declare interface AllowListValidatorConfig extends ValidatorOptions {
1444
1444
  *
1445
1445
  * @public
1446
1446
  */
1447
- export declare type ValidatorConfig = Record<string, string | number | boolean | string[] | unknown[]> & ValidatorOptions;
1447
+ export declare type ValidatorConfig = Record<string, string | number | boolean | string[] | unknown[] | ValidatorObjectType> & ValidatorOptions;
1448
1448
 
1449
1449
  /**
1450
1450
  * Describes the configuration of several validators,
@@ -1461,6 +1461,14 @@ export declare interface AllowListValidatorConfig extends ValidatorOptions {
1461
1461
  */
1462
1462
  export declare type ValidatorName = string;
1463
1463
 
1464
+ /**
1465
+ * Describes a shallow object for using objects as validator config values,
1466
+ * e.g YearMonth objects such as `{ year: 2025, month: 8 }`
1467
+ *
1468
+ * @public
1469
+ */
1470
+ export declare type ValidatorObjectType = Record<string, string | number | boolean>;
1471
+
1464
1472
  /**
1465
1473
  * @public
1466
1474
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/logic",
3
- "version": "6.45.0",
3
+ "version": "6.46.0",
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": "^6.45.0"
64
+ "@fkui/date": "^6.46.0"
65
65
  },
66
66
  "engines": {
67
67
  "node": ">= 20",
68
68
  "npm": ">= 7"
69
69
  },
70
- "gitHead": "afd99cb8718a37a1440a2f4861adc563db42c36e"
70
+ "gitHead": "f069787aa2e35d7e36a5cf819f18a2defd9f9f47"
71
71
  }