@fkui/logic 5.39.0 → 5.40.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
@@ -3066,6 +3066,18 @@ function formatPersonnummer(value) {
3066
3066
  }
3067
3067
  return value.substring(2);
3068
3068
  }
3069
+ /**
3070
+ * Formats personnummer to a 8-digit date.
3071
+ *
3072
+ * @public
3073
+ */
3074
+ function formatPersonnummerToDate(value) {
3075
+ const datePart = parseDate(parsePersonnummer(value)?.slice(0, 8) || "");
3076
+ if (!datePart) {
3077
+ return undefined;
3078
+ }
3079
+ return FDate.fromIso(datePart);
3080
+ }
3069
3081
 
3070
3082
  const PLUSGIRO_REGEXP = /^\d{1,7}[-]?\d{1}$/;
3071
3083
  function hyphenShouldBeAdded(value) {
@@ -4411,6 +4423,26 @@ const bankgiroValidator = {
4411
4423
  },
4412
4424
  };
4413
4425
 
4426
+ function toArray(value) {
4427
+ if (Array.isArray(value)) {
4428
+ return value;
4429
+ }
4430
+ else {
4431
+ return [value];
4432
+ }
4433
+ }
4434
+ const blacklistValidator = {
4435
+ name: "blacklist",
4436
+ validation(value, _element, config) {
4437
+ if (!config.values) {
4438
+ throw new Error("config.exclude must have values");
4439
+ }
4440
+ const values = toArray(config.values);
4441
+ const found = values.some((it) => String(it) === value);
4442
+ return !found;
4443
+ },
4444
+ };
4445
+
4414
4446
  const clearingNumberValidator = {
4415
4447
  name: "clearingNumber",
4416
4448
  validation(value) {
@@ -4418,6 +4450,13 @@ const clearingNumberValidator = {
4418
4450
  },
4419
4451
  };
4420
4452
 
4453
+ const currencyValidator = {
4454
+ name: "currency",
4455
+ validation(value) {
4456
+ return isEmpty(value) || isSet(parseNumber(value));
4457
+ },
4458
+ };
4459
+
4421
4460
  const dateValidator = {
4422
4461
  name: "date",
4423
4462
  validation(value) {
@@ -4471,26 +4510,6 @@ const decimalValidator = {
4471
4510
  },
4472
4511
  };
4473
4512
 
4474
- function toArray(value) {
4475
- if (Array.isArray(value)) {
4476
- return value;
4477
- }
4478
- else {
4479
- return [value];
4480
- }
4481
- }
4482
- const blacklistValidator = {
4483
- name: "blacklist",
4484
- validation(value, _element, config) {
4485
- if (!config.values) {
4486
- throw new Error("config.exclude must have values");
4487
- }
4488
- const values = toArray(config.values);
4489
- const found = values.some((it) => String(it) === value);
4490
- return !found;
4491
- },
4492
- };
4493
-
4494
4513
  const emailValidator = {
4495
4514
  name: "email",
4496
4515
  validation(value, _element, config) {
@@ -4500,6 +4519,35 @@ const emailValidator = {
4500
4519
  },
4501
4520
  };
4502
4521
 
4522
+ /**
4523
+ * @internal
4524
+ */
4525
+ function numberValidator$1(value, config, name, compare) {
4526
+ if (value === "") {
4527
+ return true;
4528
+ }
4529
+ const limit = config[name];
4530
+ if (!isSet(limit)) {
4531
+ return false;
4532
+ }
4533
+ const limitAsNumber = parseNumber(String(config[name]));
4534
+ if (limitAsNumber === undefined) {
4535
+ throw new Error(`config.${String(name)} must be a number`);
4536
+ }
4537
+ const valueAsNumber = parseNumber(value);
4538
+ if (valueAsNumber === undefined) {
4539
+ return false;
4540
+ }
4541
+ return compare(valueAsNumber, limitAsNumber);
4542
+ }
4543
+
4544
+ const greaterThanValidator = {
4545
+ name: "greaterThan",
4546
+ validation(value, _element, config) {
4547
+ return numberValidator$1(value, config, "limit", (value, limit) => value > limit);
4548
+ },
4549
+ };
4550
+
4503
4551
  const NUMBER_REGEXP = /^([-−]?[0-9]+)?$/;
4504
4552
  const integerValidator = {
4505
4553
  name: "integer",
@@ -4557,35 +4605,6 @@ const invalidWeekdaysValidator = {
4557
4605
  },
4558
4606
  };
4559
4607
 
4560
- /**
4561
- * @internal
4562
- */
4563
- function numberValidator$1(value, config, name, compare) {
4564
- if (value === "") {
4565
- return true;
4566
- }
4567
- const limit = config[name];
4568
- if (!isSet(limit)) {
4569
- return false;
4570
- }
4571
- const limitAsNumber = parseNumber(String(config[name]));
4572
- if (limitAsNumber === undefined) {
4573
- throw new Error(`config.${String(name)} must be a number`);
4574
- }
4575
- const valueAsNumber = parseNumber(value);
4576
- if (valueAsNumber === undefined) {
4577
- return false;
4578
- }
4579
- return compare(valueAsNumber, limitAsNumber);
4580
- }
4581
-
4582
- const greaterThanValidator = {
4583
- name: "greaterThan",
4584
- validation(value, _element, config) {
4585
- return numberValidator$1(value, config, "limit", (value, limit) => value > limit);
4586
- },
4587
- };
4588
-
4589
4608
  const lessThanValidator = {
4590
4609
  name: "lessThan",
4591
4610
  validation(value, _element, config) {
@@ -4606,6 +4625,22 @@ const matchesValidator = {
4606
4625
  },
4607
4626
  };
4608
4627
 
4628
+ const maxDateValidator = {
4629
+ name: "maxDate",
4630
+ validation(value, _element, config) {
4631
+ if (isEmpty(value)) {
4632
+ return true;
4633
+ }
4634
+ const normalizedValue = normalizeDateFormat(value);
4635
+ if (!normalizedValue) {
4636
+ return false;
4637
+ }
4638
+ const parsed = FDate.fromIso(normalizedValue);
4639
+ const limit = FDate.fromIso(validLimit(config.limit));
4640
+ return parsed.equals(limit) || parsed.isBefore(limit);
4641
+ },
4642
+ };
4643
+
4609
4644
  const maxLengthValidator = {
4610
4645
  name: "maxLength",
4611
4646
  validation(value, _element, config) {
@@ -4636,22 +4671,6 @@ const minDateValidator = {
4636
4671
  },
4637
4672
  };
4638
4673
 
4639
- const maxDateValidator = {
4640
- name: "maxDate",
4641
- validation(value, _element, config) {
4642
- if (isEmpty(value)) {
4643
- return true;
4644
- }
4645
- const normalizedValue = normalizeDateFormat(value);
4646
- if (!normalizedValue) {
4647
- return false;
4648
- }
4649
- const parsed = FDate.fromIso(normalizedValue);
4650
- const limit = FDate.fromIso(validLimit(config.limit));
4651
- return parsed.equals(limit) || parsed.isBefore(limit);
4652
- },
4653
- };
4654
-
4655
4674
  const minLengthValidator = {
4656
4675
  name: "minLength",
4657
4676
  validation(value, _element, config) {
@@ -4673,13 +4692,6 @@ const numberValidator = {
4673
4692
  },
4674
4693
  };
4675
4694
 
4676
- const currencyValidator = {
4677
- name: "currency",
4678
- validation(value) {
4679
- return isEmpty(value) || isSet(parseNumber(value));
4680
- },
4681
- };
4682
-
4683
4695
  const organisationsnummerValidator = {
4684
4696
  name: "organisationsnummer",
4685
4697
  validation(value) {
@@ -4713,6 +4725,48 @@ const personnummerLuhnValidator = {
4713
4725
  },
4714
4726
  };
4715
4727
 
4728
+ const personnummerNotSame = {
4729
+ name: "personnummerNotSame",
4730
+ validation(value, _element, config) {
4731
+ const valuePnr = parsePersonnummer(String(value));
4732
+ if (!valuePnr) {
4733
+ return true;
4734
+ }
4735
+ const otherFieldPnr = parsePersonnummer(String(config.otherField));
4736
+ if (!otherFieldPnr) {
4737
+ return true;
4738
+ }
4739
+ if (valuePnr === otherFieldPnr) {
4740
+ return false;
4741
+ }
4742
+ return true;
4743
+ },
4744
+ };
4745
+
4746
+ const personnummerOlder = {
4747
+ name: "personnummerOlder",
4748
+ validation(value, _element, config) {
4749
+ const valueAsDate = formatPersonnummerToDate(value);
4750
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4751
+ if (!valueAsDate || !otherAsDate) {
4752
+ return true;
4753
+ }
4754
+ return FDate.compare(valueAsDate, otherAsDate) !== 1;
4755
+ },
4756
+ };
4757
+
4758
+ const personnummerYounger = {
4759
+ name: "personnummerYounger",
4760
+ validation(value, _element, config) {
4761
+ const valueAsDate = formatPersonnummerToDate(value);
4762
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4763
+ if (!valueAsDate || !otherAsDate) {
4764
+ return true;
4765
+ }
4766
+ return FDate.compare(valueAsDate, otherAsDate) !== -1;
4767
+ },
4768
+ };
4769
+
4716
4770
  const PHONE_NUMBER_REGEXP = /^(\+?[-_/() ]*(\d[-_/() ]*?){3,17})$/;
4717
4771
  const phoneNumberValidator = {
4718
4772
  name: "phoneNumber",
@@ -4781,30 +4835,33 @@ const whitelistValidator = {
4781
4835
 
4782
4836
  ValidationService.registerValidator(bankAccountNumberValidator);
4783
4837
  ValidationService.registerValidator(bankgiroValidator);
4838
+ ValidationService.registerValidator(blacklistValidator);
4784
4839
  ValidationService.registerValidator(clearingNumberValidator);
4840
+ ValidationService.registerValidator(currencyValidator);
4785
4841
  ValidationService.registerValidator(dateFormatValidator);
4786
4842
  ValidationService.registerValidator(dateValidator);
4787
4843
  ValidationService.registerValidator(decimalValidator);
4788
- ValidationService.registerValidator(blacklistValidator);
4789
4844
  ValidationService.registerValidator(emailValidator);
4790
- ValidationService.registerValidator(integerValidator);
4791
4845
  ValidationService.registerValidator(greaterThanValidator);
4846
+ ValidationService.registerValidator(integerValidator);
4792
4847
  ValidationService.registerValidator(invalidDatesValidator);
4793
4848
  ValidationService.registerValidator(invalidWeekdaysValidator);
4794
4849
  ValidationService.registerValidator(lessThanValidator);
4795
- ValidationService.registerValidator(minLengthValidator);
4796
4850
  ValidationService.registerValidator(matchesValidator);
4851
+ ValidationService.registerValidator(maxDateValidator);
4797
4852
  ValidationService.registerValidator(maxLengthValidator);
4798
- ValidationService.registerValidator(minValueValidator);
4799
4853
  ValidationService.registerValidator(maxValueValidator);
4800
4854
  ValidationService.registerValidator(minDateValidator);
4801
- ValidationService.registerValidator(maxDateValidator);
4855
+ ValidationService.registerValidator(minLengthValidator);
4856
+ ValidationService.registerValidator(minValueValidator);
4802
4857
  ValidationService.registerValidator(numberValidator);
4803
- ValidationService.registerValidator(currencyValidator);
4804
4858
  ValidationService.registerValidator(organisationsnummerValidator);
4805
4859
  ValidationService.registerValidator(percentValidator);
4806
4860
  ValidationService.registerValidator(personnummerFormatValidator);
4807
4861
  ValidationService.registerValidator(personnummerLuhnValidator);
4862
+ ValidationService.registerValidator(personnummerNotSame);
4863
+ ValidationService.registerValidator(personnummerOlder);
4864
+ ValidationService.registerValidator(personnummerYounger);
4808
4865
  ValidationService.registerValidator(phoneNumberValidator);
4809
4866
  ValidationService.registerValidator(plusgiroValidator);
4810
4867
  ValidationService.registerValidator(postalCodeValidator);
@@ -5113,6 +5170,7 @@ exports.formatClearingNumberForBackend = formatClearingNumberForBackend;
5113
5170
  exports.formatNumber = formatNumber;
5114
5171
  exports.formatPercent = formatPercent;
5115
5172
  exports.formatPersonnummer = formatPersonnummer;
5173
+ exports.formatPersonnummerToDate = formatPersonnummerToDate;
5116
5174
  exports.formatPostalCode = formatPostalCode;
5117
5175
  exports.getErrorMessages = getErrorMessages;
5118
5176
  exports.handleTab = handleTab;
package/lib/esm/index.js CHANGED
@@ -3064,6 +3064,18 @@ function formatPersonnummer(value) {
3064
3064
  }
3065
3065
  return value.substring(2);
3066
3066
  }
3067
+ /**
3068
+ * Formats personnummer to a 8-digit date.
3069
+ *
3070
+ * @public
3071
+ */
3072
+ function formatPersonnummerToDate(value) {
3073
+ const datePart = parseDate(parsePersonnummer(value)?.slice(0, 8) || "");
3074
+ if (!datePart) {
3075
+ return undefined;
3076
+ }
3077
+ return FDate.fromIso(datePart);
3078
+ }
3067
3079
 
3068
3080
  const PLUSGIRO_REGEXP = /^\d{1,7}[-]?\d{1}$/;
3069
3081
  function hyphenShouldBeAdded(value) {
@@ -4409,6 +4421,26 @@ const bankgiroValidator = {
4409
4421
  },
4410
4422
  };
4411
4423
 
4424
+ function toArray(value) {
4425
+ if (Array.isArray(value)) {
4426
+ return value;
4427
+ }
4428
+ else {
4429
+ return [value];
4430
+ }
4431
+ }
4432
+ const blacklistValidator = {
4433
+ name: "blacklist",
4434
+ validation(value, _element, config) {
4435
+ if (!config.values) {
4436
+ throw new Error("config.exclude must have values");
4437
+ }
4438
+ const values = toArray(config.values);
4439
+ const found = values.some((it) => String(it) === value);
4440
+ return !found;
4441
+ },
4442
+ };
4443
+
4412
4444
  const clearingNumberValidator = {
4413
4445
  name: "clearingNumber",
4414
4446
  validation(value) {
@@ -4416,6 +4448,13 @@ const clearingNumberValidator = {
4416
4448
  },
4417
4449
  };
4418
4450
 
4451
+ const currencyValidator = {
4452
+ name: "currency",
4453
+ validation(value) {
4454
+ return isEmpty(value) || isSet(parseNumber(value));
4455
+ },
4456
+ };
4457
+
4419
4458
  const dateValidator = {
4420
4459
  name: "date",
4421
4460
  validation(value) {
@@ -4469,26 +4508,6 @@ const decimalValidator = {
4469
4508
  },
4470
4509
  };
4471
4510
 
4472
- function toArray(value) {
4473
- if (Array.isArray(value)) {
4474
- return value;
4475
- }
4476
- else {
4477
- return [value];
4478
- }
4479
- }
4480
- const blacklistValidator = {
4481
- name: "blacklist",
4482
- validation(value, _element, config) {
4483
- if (!config.values) {
4484
- throw new Error("config.exclude must have values");
4485
- }
4486
- const values = toArray(config.values);
4487
- const found = values.some((it) => String(it) === value);
4488
- return !found;
4489
- },
4490
- };
4491
-
4492
4511
  const emailValidator = {
4493
4512
  name: "email",
4494
4513
  validation(value, _element, config) {
@@ -4498,6 +4517,35 @@ const emailValidator = {
4498
4517
  },
4499
4518
  };
4500
4519
 
4520
+ /**
4521
+ * @internal
4522
+ */
4523
+ function numberValidator$1(value, config, name, compare) {
4524
+ if (value === "") {
4525
+ return true;
4526
+ }
4527
+ const limit = config[name];
4528
+ if (!isSet(limit)) {
4529
+ return false;
4530
+ }
4531
+ const limitAsNumber = parseNumber(String(config[name]));
4532
+ if (limitAsNumber === undefined) {
4533
+ throw new Error(`config.${String(name)} must be a number`);
4534
+ }
4535
+ const valueAsNumber = parseNumber(value);
4536
+ if (valueAsNumber === undefined) {
4537
+ return false;
4538
+ }
4539
+ return compare(valueAsNumber, limitAsNumber);
4540
+ }
4541
+
4542
+ const greaterThanValidator = {
4543
+ name: "greaterThan",
4544
+ validation(value, _element, config) {
4545
+ return numberValidator$1(value, config, "limit", (value, limit) => value > limit);
4546
+ },
4547
+ };
4548
+
4501
4549
  const NUMBER_REGEXP = /^([-−]?[0-9]+)?$/;
4502
4550
  const integerValidator = {
4503
4551
  name: "integer",
@@ -4555,35 +4603,6 @@ const invalidWeekdaysValidator = {
4555
4603
  },
4556
4604
  };
4557
4605
 
4558
- /**
4559
- * @internal
4560
- */
4561
- function numberValidator$1(value, config, name, compare) {
4562
- if (value === "") {
4563
- return true;
4564
- }
4565
- const limit = config[name];
4566
- if (!isSet(limit)) {
4567
- return false;
4568
- }
4569
- const limitAsNumber = parseNumber(String(config[name]));
4570
- if (limitAsNumber === undefined) {
4571
- throw new Error(`config.${String(name)} must be a number`);
4572
- }
4573
- const valueAsNumber = parseNumber(value);
4574
- if (valueAsNumber === undefined) {
4575
- return false;
4576
- }
4577
- return compare(valueAsNumber, limitAsNumber);
4578
- }
4579
-
4580
- const greaterThanValidator = {
4581
- name: "greaterThan",
4582
- validation(value, _element, config) {
4583
- return numberValidator$1(value, config, "limit", (value, limit) => value > limit);
4584
- },
4585
- };
4586
-
4587
4606
  const lessThanValidator = {
4588
4607
  name: "lessThan",
4589
4608
  validation(value, _element, config) {
@@ -4604,6 +4623,22 @@ const matchesValidator = {
4604
4623
  },
4605
4624
  };
4606
4625
 
4626
+ const maxDateValidator = {
4627
+ name: "maxDate",
4628
+ validation(value, _element, config) {
4629
+ if (isEmpty(value)) {
4630
+ return true;
4631
+ }
4632
+ const normalizedValue = normalizeDateFormat(value);
4633
+ if (!normalizedValue) {
4634
+ return false;
4635
+ }
4636
+ const parsed = FDate.fromIso(normalizedValue);
4637
+ const limit = FDate.fromIso(validLimit(config.limit));
4638
+ return parsed.equals(limit) || parsed.isBefore(limit);
4639
+ },
4640
+ };
4641
+
4607
4642
  const maxLengthValidator = {
4608
4643
  name: "maxLength",
4609
4644
  validation(value, _element, config) {
@@ -4634,22 +4669,6 @@ const minDateValidator = {
4634
4669
  },
4635
4670
  };
4636
4671
 
4637
- const maxDateValidator = {
4638
- name: "maxDate",
4639
- validation(value, _element, config) {
4640
- if (isEmpty(value)) {
4641
- return true;
4642
- }
4643
- const normalizedValue = normalizeDateFormat(value);
4644
- if (!normalizedValue) {
4645
- return false;
4646
- }
4647
- const parsed = FDate.fromIso(normalizedValue);
4648
- const limit = FDate.fromIso(validLimit(config.limit));
4649
- return parsed.equals(limit) || parsed.isBefore(limit);
4650
- },
4651
- };
4652
-
4653
4672
  const minLengthValidator = {
4654
4673
  name: "minLength",
4655
4674
  validation(value, _element, config) {
@@ -4671,13 +4690,6 @@ const numberValidator = {
4671
4690
  },
4672
4691
  };
4673
4692
 
4674
- const currencyValidator = {
4675
- name: "currency",
4676
- validation(value) {
4677
- return isEmpty(value) || isSet(parseNumber(value));
4678
- },
4679
- };
4680
-
4681
4693
  const organisationsnummerValidator = {
4682
4694
  name: "organisationsnummer",
4683
4695
  validation(value) {
@@ -4711,6 +4723,48 @@ const personnummerLuhnValidator = {
4711
4723
  },
4712
4724
  };
4713
4725
 
4726
+ const personnummerNotSame = {
4727
+ name: "personnummerNotSame",
4728
+ validation(value, _element, config) {
4729
+ const valuePnr = parsePersonnummer(String(value));
4730
+ if (!valuePnr) {
4731
+ return true;
4732
+ }
4733
+ const otherFieldPnr = parsePersonnummer(String(config.otherField));
4734
+ if (!otherFieldPnr) {
4735
+ return true;
4736
+ }
4737
+ if (valuePnr === otherFieldPnr) {
4738
+ return false;
4739
+ }
4740
+ return true;
4741
+ },
4742
+ };
4743
+
4744
+ const personnummerOlder = {
4745
+ name: "personnummerOlder",
4746
+ validation(value, _element, config) {
4747
+ const valueAsDate = formatPersonnummerToDate(value);
4748
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4749
+ if (!valueAsDate || !otherAsDate) {
4750
+ return true;
4751
+ }
4752
+ return FDate.compare(valueAsDate, otherAsDate) !== 1;
4753
+ },
4754
+ };
4755
+
4756
+ const personnummerYounger = {
4757
+ name: "personnummerYounger",
4758
+ validation(value, _element, config) {
4759
+ const valueAsDate = formatPersonnummerToDate(value);
4760
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4761
+ if (!valueAsDate || !otherAsDate) {
4762
+ return true;
4763
+ }
4764
+ return FDate.compare(valueAsDate, otherAsDate) !== -1;
4765
+ },
4766
+ };
4767
+
4714
4768
  const PHONE_NUMBER_REGEXP = /^(\+?[-_/() ]*(\d[-_/() ]*?){3,17})$/;
4715
4769
  const phoneNumberValidator = {
4716
4770
  name: "phoneNumber",
@@ -4779,30 +4833,33 @@ const whitelistValidator = {
4779
4833
 
4780
4834
  ValidationService.registerValidator(bankAccountNumberValidator);
4781
4835
  ValidationService.registerValidator(bankgiroValidator);
4836
+ ValidationService.registerValidator(blacklistValidator);
4782
4837
  ValidationService.registerValidator(clearingNumberValidator);
4838
+ ValidationService.registerValidator(currencyValidator);
4783
4839
  ValidationService.registerValidator(dateFormatValidator);
4784
4840
  ValidationService.registerValidator(dateValidator);
4785
4841
  ValidationService.registerValidator(decimalValidator);
4786
- ValidationService.registerValidator(blacklistValidator);
4787
4842
  ValidationService.registerValidator(emailValidator);
4788
- ValidationService.registerValidator(integerValidator);
4789
4843
  ValidationService.registerValidator(greaterThanValidator);
4844
+ ValidationService.registerValidator(integerValidator);
4790
4845
  ValidationService.registerValidator(invalidDatesValidator);
4791
4846
  ValidationService.registerValidator(invalidWeekdaysValidator);
4792
4847
  ValidationService.registerValidator(lessThanValidator);
4793
- ValidationService.registerValidator(minLengthValidator);
4794
4848
  ValidationService.registerValidator(matchesValidator);
4849
+ ValidationService.registerValidator(maxDateValidator);
4795
4850
  ValidationService.registerValidator(maxLengthValidator);
4796
- ValidationService.registerValidator(minValueValidator);
4797
4851
  ValidationService.registerValidator(maxValueValidator);
4798
4852
  ValidationService.registerValidator(minDateValidator);
4799
- ValidationService.registerValidator(maxDateValidator);
4853
+ ValidationService.registerValidator(minLengthValidator);
4854
+ ValidationService.registerValidator(minValueValidator);
4800
4855
  ValidationService.registerValidator(numberValidator);
4801
- ValidationService.registerValidator(currencyValidator);
4802
4856
  ValidationService.registerValidator(organisationsnummerValidator);
4803
4857
  ValidationService.registerValidator(percentValidator);
4804
4858
  ValidationService.registerValidator(personnummerFormatValidator);
4805
4859
  ValidationService.registerValidator(personnummerLuhnValidator);
4860
+ ValidationService.registerValidator(personnummerNotSame);
4861
+ ValidationService.registerValidator(personnummerOlder);
4862
+ ValidationService.registerValidator(personnummerYounger);
4806
4863
  ValidationService.registerValidator(phoneNumberValidator);
4807
4864
  ValidationService.registerValidator(plusgiroValidator);
4808
4865
  ValidationService.registerValidator(postalCodeValidator);
@@ -5077,5 +5134,5 @@ if (typeof document !== "undefined") {
5077
5134
  createScreenReaderWrapper({ assertive: false });
5078
5135
  }
5079
5136
 
5080
- 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, 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 };
5137
+ 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 };
5081
5138
  //# sourceMappingURL=index.js.map
@@ -437,6 +437,13 @@ export declare interface EmailValidatorConfig extends ValidatorOptions {
437
437
  */
438
438
  export declare function formatPersonnummer(value: PersonnummerString | null | undefined): string | undefined;
439
439
 
440
+ /**
441
+ * Formats personnummer to a 8-digit date.
442
+ *
443
+ * @public
444
+ */
445
+ export declare function formatPersonnummerToDate(value: PersonnummerString | undefined): FDate | undefined;
446
+
440
447
  /**
441
448
  * @public
442
449
  */
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.11"
8
+ "packageVersion": "7.48.0"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/logic",
3
- "version": "5.39.0",
3
+ "version": "5.40.0",
4
4
  "description": "Logic",
5
5
  "keywords": [
6
6
  "fkui",
@@ -42,7 +42,7 @@
42
42
  "types": "lib/types/index.d.ts",
43
43
  "files": [
44
44
  "lib",
45
- "!**/*.spec.{js,js.map,d.ts}"
45
+ "!**/*.js.map"
46
46
  ],
47
47
  "scripts": {
48
48
  "prebuild": "tsc",
@@ -67,5 +67,5 @@
67
67
  "node": ">= 20",
68
68
  "npm": ">= 7"
69
69
  },
70
- "gitHead": "ff0c8461456aab5ad3e9be930f09d047067dca51"
70
+ "gitHead": "6cd48f3625440d79dd0bb851e9c3875f772ce451"
71
71
  }