@fkui/logic 5.39.0 → 5.41.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) {
@@ -3739,6 +3751,7 @@ function getErrorMessages() {
3739
3751
  .map("invalidDates", "Du kan inte välja det här datumet.")
3740
3752
  .map("invalidWeekdays", "Du kan inte välja det här datumet.")
3741
3753
  .map("whitelist", 'Fältet innehåller otillåtna tecken. Exempel på ogiltiga tecken är /, % och ".')
3754
+ .map("allowList", "Ange ett av alternativen i listan.")
3742
3755
  .build();
3743
3756
  }
3744
3757
 
@@ -4397,6 +4410,21 @@ class ValidationServiceImpl {
4397
4410
  */
4398
4411
  const ValidationService = new ValidationServiceImpl();
4399
4412
 
4413
+ /**
4414
+ * @public
4415
+ */
4416
+ const allowListValidator = {
4417
+ name: "allowList",
4418
+ validation(value, element, config) {
4419
+ if (isEmpty(value) ||
4420
+ config.list === undefined ||
4421
+ config.list.length === 0) {
4422
+ return true;
4423
+ }
4424
+ return config.list.includes(value);
4425
+ },
4426
+ };
4427
+
4400
4428
  const bankAccountNumberValidator = {
4401
4429
  name: "bankAccountNumber",
4402
4430
  validation(value) {
@@ -4411,6 +4439,26 @@ const bankgiroValidator = {
4411
4439
  },
4412
4440
  };
4413
4441
 
4442
+ function toArray(value) {
4443
+ if (Array.isArray(value)) {
4444
+ return value;
4445
+ }
4446
+ else {
4447
+ return [value];
4448
+ }
4449
+ }
4450
+ const blacklistValidator = {
4451
+ name: "blacklist",
4452
+ validation(value, _element, config) {
4453
+ if (!config.values) {
4454
+ throw new Error("config.exclude must have values");
4455
+ }
4456
+ const values = toArray(config.values);
4457
+ const found = values.some((it) => String(it) === value);
4458
+ return !found;
4459
+ },
4460
+ };
4461
+
4414
4462
  const clearingNumberValidator = {
4415
4463
  name: "clearingNumber",
4416
4464
  validation(value) {
@@ -4418,6 +4466,13 @@ const clearingNumberValidator = {
4418
4466
  },
4419
4467
  };
4420
4468
 
4469
+ const currencyValidator = {
4470
+ name: "currency",
4471
+ validation(value) {
4472
+ return isEmpty(value) || isSet(parseNumber(value));
4473
+ },
4474
+ };
4475
+
4421
4476
  const dateValidator = {
4422
4477
  name: "date",
4423
4478
  validation(value) {
@@ -4471,26 +4526,6 @@ const decimalValidator = {
4471
4526
  },
4472
4527
  };
4473
4528
 
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
4529
  const emailValidator = {
4495
4530
  name: "email",
4496
4531
  validation(value, _element, config) {
@@ -4500,6 +4535,35 @@ const emailValidator = {
4500
4535
  },
4501
4536
  };
4502
4537
 
4538
+ /**
4539
+ * @internal
4540
+ */
4541
+ function numberValidator$1(value, config, name, compare) {
4542
+ if (value === "") {
4543
+ return true;
4544
+ }
4545
+ const limit = config[name];
4546
+ if (!isSet(limit)) {
4547
+ return false;
4548
+ }
4549
+ const limitAsNumber = parseNumber(String(config[name]));
4550
+ if (limitAsNumber === undefined) {
4551
+ throw new Error(`config.${String(name)} must be a number`);
4552
+ }
4553
+ const valueAsNumber = parseNumber(value);
4554
+ if (valueAsNumber === undefined) {
4555
+ return false;
4556
+ }
4557
+ return compare(valueAsNumber, limitAsNumber);
4558
+ }
4559
+
4560
+ const greaterThanValidator = {
4561
+ name: "greaterThan",
4562
+ validation(value, _element, config) {
4563
+ return numberValidator$1(value, config, "limit", (value, limit) => value > limit);
4564
+ },
4565
+ };
4566
+
4503
4567
  const NUMBER_REGEXP = /^([-−]?[0-9]+)?$/;
4504
4568
  const integerValidator = {
4505
4569
  name: "integer",
@@ -4557,35 +4621,6 @@ const invalidWeekdaysValidator = {
4557
4621
  },
4558
4622
  };
4559
4623
 
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
4624
  const lessThanValidator = {
4590
4625
  name: "lessThan",
4591
4626
  validation(value, _element, config) {
@@ -4606,6 +4641,22 @@ const matchesValidator = {
4606
4641
  },
4607
4642
  };
4608
4643
 
4644
+ const maxDateValidator = {
4645
+ name: "maxDate",
4646
+ validation(value, _element, config) {
4647
+ if (isEmpty(value)) {
4648
+ return true;
4649
+ }
4650
+ const normalizedValue = normalizeDateFormat(value);
4651
+ if (!normalizedValue) {
4652
+ return false;
4653
+ }
4654
+ const parsed = FDate.fromIso(normalizedValue);
4655
+ const limit = FDate.fromIso(validLimit(config.limit));
4656
+ return parsed.equals(limit) || parsed.isBefore(limit);
4657
+ },
4658
+ };
4659
+
4609
4660
  const maxLengthValidator = {
4610
4661
  name: "maxLength",
4611
4662
  validation(value, _element, config) {
@@ -4636,22 +4687,6 @@ const minDateValidator = {
4636
4687
  },
4637
4688
  };
4638
4689
 
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
4690
  const minLengthValidator = {
4656
4691
  name: "minLength",
4657
4692
  validation(value, _element, config) {
@@ -4673,13 +4708,6 @@ const numberValidator = {
4673
4708
  },
4674
4709
  };
4675
4710
 
4676
- const currencyValidator = {
4677
- name: "currency",
4678
- validation(value) {
4679
- return isEmpty(value) || isSet(parseNumber(value));
4680
- },
4681
- };
4682
-
4683
4711
  const organisationsnummerValidator = {
4684
4712
  name: "organisationsnummer",
4685
4713
  validation(value) {
@@ -4713,6 +4741,48 @@ const personnummerLuhnValidator = {
4713
4741
  },
4714
4742
  };
4715
4743
 
4744
+ const personnummerNotSame = {
4745
+ name: "personnummerNotSame",
4746
+ validation(value, _element, config) {
4747
+ const valuePnr = parsePersonnummer(String(value));
4748
+ if (!valuePnr) {
4749
+ return true;
4750
+ }
4751
+ const otherFieldPnr = parsePersonnummer(String(config.otherField));
4752
+ if (!otherFieldPnr) {
4753
+ return true;
4754
+ }
4755
+ if (valuePnr === otherFieldPnr) {
4756
+ return false;
4757
+ }
4758
+ return true;
4759
+ },
4760
+ };
4761
+
4762
+ const personnummerOlder = {
4763
+ name: "personnummerOlder",
4764
+ validation(value, _element, config) {
4765
+ const valueAsDate = formatPersonnummerToDate(value);
4766
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4767
+ if (!valueAsDate || !otherAsDate) {
4768
+ return true;
4769
+ }
4770
+ return FDate.compare(valueAsDate, otherAsDate) !== 1;
4771
+ },
4772
+ };
4773
+
4774
+ const personnummerYounger = {
4775
+ name: "personnummerYounger",
4776
+ validation(value, _element, config) {
4777
+ const valueAsDate = formatPersonnummerToDate(value);
4778
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4779
+ if (!valueAsDate || !otherAsDate) {
4780
+ return true;
4781
+ }
4782
+ return FDate.compare(valueAsDate, otherAsDate) !== -1;
4783
+ },
4784
+ };
4785
+
4716
4786
  const PHONE_NUMBER_REGEXP = /^(\+?[-_/() ]*(\d[-_/() ]*?){3,17})$/;
4717
4787
  const phoneNumberValidator = {
4718
4788
  name: "phoneNumber",
@@ -4779,32 +4849,36 @@ const whitelistValidator = {
4779
4849
  },
4780
4850
  };
4781
4851
 
4852
+ ValidationService.registerValidator(allowListValidator);
4782
4853
  ValidationService.registerValidator(bankAccountNumberValidator);
4783
4854
  ValidationService.registerValidator(bankgiroValidator);
4855
+ ValidationService.registerValidator(blacklistValidator);
4784
4856
  ValidationService.registerValidator(clearingNumberValidator);
4857
+ ValidationService.registerValidator(currencyValidator);
4785
4858
  ValidationService.registerValidator(dateFormatValidator);
4786
4859
  ValidationService.registerValidator(dateValidator);
4787
4860
  ValidationService.registerValidator(decimalValidator);
4788
- ValidationService.registerValidator(blacklistValidator);
4789
4861
  ValidationService.registerValidator(emailValidator);
4790
- ValidationService.registerValidator(integerValidator);
4791
4862
  ValidationService.registerValidator(greaterThanValidator);
4863
+ ValidationService.registerValidator(integerValidator);
4792
4864
  ValidationService.registerValidator(invalidDatesValidator);
4793
4865
  ValidationService.registerValidator(invalidWeekdaysValidator);
4794
4866
  ValidationService.registerValidator(lessThanValidator);
4795
- ValidationService.registerValidator(minLengthValidator);
4796
4867
  ValidationService.registerValidator(matchesValidator);
4868
+ ValidationService.registerValidator(maxDateValidator);
4797
4869
  ValidationService.registerValidator(maxLengthValidator);
4798
- ValidationService.registerValidator(minValueValidator);
4799
4870
  ValidationService.registerValidator(maxValueValidator);
4800
4871
  ValidationService.registerValidator(minDateValidator);
4801
- ValidationService.registerValidator(maxDateValidator);
4872
+ ValidationService.registerValidator(minLengthValidator);
4873
+ ValidationService.registerValidator(minValueValidator);
4802
4874
  ValidationService.registerValidator(numberValidator);
4803
- ValidationService.registerValidator(currencyValidator);
4804
4875
  ValidationService.registerValidator(organisationsnummerValidator);
4805
4876
  ValidationService.registerValidator(percentValidator);
4806
4877
  ValidationService.registerValidator(personnummerFormatValidator);
4807
4878
  ValidationService.registerValidator(personnummerLuhnValidator);
4879
+ ValidationService.registerValidator(personnummerNotSame);
4880
+ ValidationService.registerValidator(personnummerOlder);
4881
+ ValidationService.registerValidator(personnummerYounger);
4808
4882
  ValidationService.registerValidator(phoneNumberValidator);
4809
4883
  ValidationService.registerValidator(plusgiroValidator);
4810
4884
  ValidationService.registerValidator(postalCodeValidator);
@@ -5113,6 +5187,7 @@ exports.formatClearingNumberForBackend = formatClearingNumberForBackend;
5113
5187
  exports.formatNumber = formatNumber;
5114
5188
  exports.formatPercent = formatPercent;
5115
5189
  exports.formatPersonnummer = formatPersonnummer;
5190
+ exports.formatPersonnummerToDate = formatPersonnummerToDate;
5116
5191
  exports.formatPostalCode = formatPostalCode;
5117
5192
  exports.getErrorMessages = getErrorMessages;
5118
5193
  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) {
@@ -3737,6 +3749,7 @@ function getErrorMessages() {
3737
3749
  .map("invalidDates", "Du kan inte välja det här datumet.")
3738
3750
  .map("invalidWeekdays", "Du kan inte välja det här datumet.")
3739
3751
  .map("whitelist", 'Fältet innehåller otillåtna tecken. Exempel på ogiltiga tecken är /, % och ".')
3752
+ .map("allowList", "Ange ett av alternativen i listan.")
3740
3753
  .build();
3741
3754
  }
3742
3755
 
@@ -4395,6 +4408,21 @@ class ValidationServiceImpl {
4395
4408
  */
4396
4409
  const ValidationService = new ValidationServiceImpl();
4397
4410
 
4411
+ /**
4412
+ * @public
4413
+ */
4414
+ const allowListValidator = {
4415
+ name: "allowList",
4416
+ validation(value, element, config) {
4417
+ if (isEmpty(value) ||
4418
+ config.list === undefined ||
4419
+ config.list.length === 0) {
4420
+ return true;
4421
+ }
4422
+ return config.list.includes(value);
4423
+ },
4424
+ };
4425
+
4398
4426
  const bankAccountNumberValidator = {
4399
4427
  name: "bankAccountNumber",
4400
4428
  validation(value) {
@@ -4409,6 +4437,26 @@ const bankgiroValidator = {
4409
4437
  },
4410
4438
  };
4411
4439
 
4440
+ function toArray(value) {
4441
+ if (Array.isArray(value)) {
4442
+ return value;
4443
+ }
4444
+ else {
4445
+ return [value];
4446
+ }
4447
+ }
4448
+ const blacklistValidator = {
4449
+ name: "blacklist",
4450
+ validation(value, _element, config) {
4451
+ if (!config.values) {
4452
+ throw new Error("config.exclude must have values");
4453
+ }
4454
+ const values = toArray(config.values);
4455
+ const found = values.some((it) => String(it) === value);
4456
+ return !found;
4457
+ },
4458
+ };
4459
+
4412
4460
  const clearingNumberValidator = {
4413
4461
  name: "clearingNumber",
4414
4462
  validation(value) {
@@ -4416,6 +4464,13 @@ const clearingNumberValidator = {
4416
4464
  },
4417
4465
  };
4418
4466
 
4467
+ const currencyValidator = {
4468
+ name: "currency",
4469
+ validation(value) {
4470
+ return isEmpty(value) || isSet(parseNumber(value));
4471
+ },
4472
+ };
4473
+
4419
4474
  const dateValidator = {
4420
4475
  name: "date",
4421
4476
  validation(value) {
@@ -4469,26 +4524,6 @@ const decimalValidator = {
4469
4524
  },
4470
4525
  };
4471
4526
 
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
4527
  const emailValidator = {
4493
4528
  name: "email",
4494
4529
  validation(value, _element, config) {
@@ -4498,6 +4533,35 @@ const emailValidator = {
4498
4533
  },
4499
4534
  };
4500
4535
 
4536
+ /**
4537
+ * @internal
4538
+ */
4539
+ function numberValidator$1(value, config, name, compare) {
4540
+ if (value === "") {
4541
+ return true;
4542
+ }
4543
+ const limit = config[name];
4544
+ if (!isSet(limit)) {
4545
+ return false;
4546
+ }
4547
+ const limitAsNumber = parseNumber(String(config[name]));
4548
+ if (limitAsNumber === undefined) {
4549
+ throw new Error(`config.${String(name)} must be a number`);
4550
+ }
4551
+ const valueAsNumber = parseNumber(value);
4552
+ if (valueAsNumber === undefined) {
4553
+ return false;
4554
+ }
4555
+ return compare(valueAsNumber, limitAsNumber);
4556
+ }
4557
+
4558
+ const greaterThanValidator = {
4559
+ name: "greaterThan",
4560
+ validation(value, _element, config) {
4561
+ return numberValidator$1(value, config, "limit", (value, limit) => value > limit);
4562
+ },
4563
+ };
4564
+
4501
4565
  const NUMBER_REGEXP = /^([-−]?[0-9]+)?$/;
4502
4566
  const integerValidator = {
4503
4567
  name: "integer",
@@ -4555,35 +4619,6 @@ const invalidWeekdaysValidator = {
4555
4619
  },
4556
4620
  };
4557
4621
 
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
4622
  const lessThanValidator = {
4588
4623
  name: "lessThan",
4589
4624
  validation(value, _element, config) {
@@ -4604,6 +4639,22 @@ const matchesValidator = {
4604
4639
  },
4605
4640
  };
4606
4641
 
4642
+ const maxDateValidator = {
4643
+ name: "maxDate",
4644
+ validation(value, _element, config) {
4645
+ if (isEmpty(value)) {
4646
+ return true;
4647
+ }
4648
+ const normalizedValue = normalizeDateFormat(value);
4649
+ if (!normalizedValue) {
4650
+ return false;
4651
+ }
4652
+ const parsed = FDate.fromIso(normalizedValue);
4653
+ const limit = FDate.fromIso(validLimit(config.limit));
4654
+ return parsed.equals(limit) || parsed.isBefore(limit);
4655
+ },
4656
+ };
4657
+
4607
4658
  const maxLengthValidator = {
4608
4659
  name: "maxLength",
4609
4660
  validation(value, _element, config) {
@@ -4634,22 +4685,6 @@ const minDateValidator = {
4634
4685
  },
4635
4686
  };
4636
4687
 
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
4688
  const minLengthValidator = {
4654
4689
  name: "minLength",
4655
4690
  validation(value, _element, config) {
@@ -4671,13 +4706,6 @@ const numberValidator = {
4671
4706
  },
4672
4707
  };
4673
4708
 
4674
- const currencyValidator = {
4675
- name: "currency",
4676
- validation(value) {
4677
- return isEmpty(value) || isSet(parseNumber(value));
4678
- },
4679
- };
4680
-
4681
4709
  const organisationsnummerValidator = {
4682
4710
  name: "organisationsnummer",
4683
4711
  validation(value) {
@@ -4711,6 +4739,48 @@ const personnummerLuhnValidator = {
4711
4739
  },
4712
4740
  };
4713
4741
 
4742
+ const personnummerNotSame = {
4743
+ name: "personnummerNotSame",
4744
+ validation(value, _element, config) {
4745
+ const valuePnr = parsePersonnummer(String(value));
4746
+ if (!valuePnr) {
4747
+ return true;
4748
+ }
4749
+ const otherFieldPnr = parsePersonnummer(String(config.otherField));
4750
+ if (!otherFieldPnr) {
4751
+ return true;
4752
+ }
4753
+ if (valuePnr === otherFieldPnr) {
4754
+ return false;
4755
+ }
4756
+ return true;
4757
+ },
4758
+ };
4759
+
4760
+ const personnummerOlder = {
4761
+ name: "personnummerOlder",
4762
+ validation(value, _element, config) {
4763
+ const valueAsDate = formatPersonnummerToDate(value);
4764
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4765
+ if (!valueAsDate || !otherAsDate) {
4766
+ return true;
4767
+ }
4768
+ return FDate.compare(valueAsDate, otherAsDate) !== 1;
4769
+ },
4770
+ };
4771
+
4772
+ const personnummerYounger = {
4773
+ name: "personnummerYounger",
4774
+ validation(value, _element, config) {
4775
+ const valueAsDate = formatPersonnummerToDate(value);
4776
+ const otherAsDate = formatPersonnummerToDate(String(config.otherField));
4777
+ if (!valueAsDate || !otherAsDate) {
4778
+ return true;
4779
+ }
4780
+ return FDate.compare(valueAsDate, otherAsDate) !== -1;
4781
+ },
4782
+ };
4783
+
4714
4784
  const PHONE_NUMBER_REGEXP = /^(\+?[-_/() ]*(\d[-_/() ]*?){3,17})$/;
4715
4785
  const phoneNumberValidator = {
4716
4786
  name: "phoneNumber",
@@ -4777,32 +4847,36 @@ const whitelistValidator = {
4777
4847
  },
4778
4848
  };
4779
4849
 
4850
+ ValidationService.registerValidator(allowListValidator);
4780
4851
  ValidationService.registerValidator(bankAccountNumberValidator);
4781
4852
  ValidationService.registerValidator(bankgiroValidator);
4853
+ ValidationService.registerValidator(blacklistValidator);
4782
4854
  ValidationService.registerValidator(clearingNumberValidator);
4855
+ ValidationService.registerValidator(currencyValidator);
4783
4856
  ValidationService.registerValidator(dateFormatValidator);
4784
4857
  ValidationService.registerValidator(dateValidator);
4785
4858
  ValidationService.registerValidator(decimalValidator);
4786
- ValidationService.registerValidator(blacklistValidator);
4787
4859
  ValidationService.registerValidator(emailValidator);
4788
- ValidationService.registerValidator(integerValidator);
4789
4860
  ValidationService.registerValidator(greaterThanValidator);
4861
+ ValidationService.registerValidator(integerValidator);
4790
4862
  ValidationService.registerValidator(invalidDatesValidator);
4791
4863
  ValidationService.registerValidator(invalidWeekdaysValidator);
4792
4864
  ValidationService.registerValidator(lessThanValidator);
4793
- ValidationService.registerValidator(minLengthValidator);
4794
4865
  ValidationService.registerValidator(matchesValidator);
4866
+ ValidationService.registerValidator(maxDateValidator);
4795
4867
  ValidationService.registerValidator(maxLengthValidator);
4796
- ValidationService.registerValidator(minValueValidator);
4797
4868
  ValidationService.registerValidator(maxValueValidator);
4798
4869
  ValidationService.registerValidator(minDateValidator);
4799
- ValidationService.registerValidator(maxDateValidator);
4870
+ ValidationService.registerValidator(minLengthValidator);
4871
+ ValidationService.registerValidator(minValueValidator);
4800
4872
  ValidationService.registerValidator(numberValidator);
4801
- ValidationService.registerValidator(currencyValidator);
4802
4873
  ValidationService.registerValidator(organisationsnummerValidator);
4803
4874
  ValidationService.registerValidator(percentValidator);
4804
4875
  ValidationService.registerValidator(personnummerFormatValidator);
4805
4876
  ValidationService.registerValidator(personnummerLuhnValidator);
4877
+ ValidationService.registerValidator(personnummerNotSame);
4878
+ ValidationService.registerValidator(personnummerOlder);
4879
+ ValidationService.registerValidator(personnummerYounger);
4806
4880
  ValidationService.registerValidator(phoneNumberValidator);
4807
4881
  ValidationService.registerValidator(plusgiroValidator);
4808
4882
  ValidationService.registerValidator(postalCodeValidator);
@@ -5077,5 +5151,5 @@ if (typeof document !== "undefined") {
5077
5151
  createScreenReaderWrapper({ assertive: false });
5078
5152
  }
5079
5153
 
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 };
5154
+ 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
5155
  //# sourceMappingURL=index.js.map