@dyedurham/search-and-file-widget 2.0.6 → 2.0.8

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.
Files changed (2) hide show
  1. package/dnd-filing-shell.js +45 -13
  2. package/package.json +1 -1
@@ -58116,7 +58116,13 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
58116
58116
  return incorporator.type?.toLowerCase() === "entity" ? `${incorporator.signatory_first_name} ${incorporator.signatory_last_name} (${incorporator.signatory_title}, ${incorporator.incorporator_name})` : `${incorporator.firstName} ${incorporator.middleName} ${incorporator.lastName}`;
58117
58117
  }
58118
58118
  function getIndividualWithSignificantControl(affiliations) {
58119
- return affiliations.filter((a) => a.kind === "ShareholderAffiliationV3" && a._participant.participant_type === "person");
58119
+ return affiliations.filter((a) => {
58120
+ const isPerson = a._participant.participant_type === "person";
58121
+ const roleName = a.role?.role_name;
58122
+ const staticTitle = a.role?.static_title;
58123
+ const isSignificantControl = a.kind === "ShareholderAffiliationV3" || a.is_beneficial_owner || roleName === "Ultimate Beneficial Owner" || staticTitle === "Ultimate Beneficial Owner";
58124
+ return isPerson && isSignificantControl;
58125
+ });
58120
58126
  }
58121
58127
  function getPersonName(person) {
58122
58128
  const firstName = person._profile.firstName || "";
@@ -83525,7 +83531,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
83525
83531
  FEDERAL_FORMATION_FORM_SIGNIFICANT_CONTROL = [
83526
83532
  {
83527
83533
  type: FormType.Select,
83528
- label: "Significant Control Type",
83534
+ label: "Select an Option",
83529
83535
  formControlName: FederalFormationFormControl.SignificantControlType,
83530
83536
  options: FEDERAL_SIGNIFICANT_CONTROL_TYPE_OPTIONS,
83531
83537
  required: true,
@@ -83542,7 +83548,10 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
83542
83548
  options: FEDERAL_EXCLUSION_REASON_OPTIONS,
83543
83549
  required: true,
83544
83550
  class: "span-12",
83545
- isVisible: (form) => form.get(FederalFormationFormControl.SignificantControlType)?.value === ISCOptions.Excluded
83551
+ isVisible: (form) => [
83552
+ ISCOptions.ListISC,
83553
+ ISCOptions.Excluded
83554
+ ].includes(Number(form.get(FederalFormationFormControl.SignificantControlType)?.value))
83546
83555
  }
83547
83556
  ];
83548
83557
  FEDERAL_FORMATION_FORM_ADDITIONAL_INFORMATION = [
@@ -83659,7 +83668,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
83659
83668
  return [
83660
83669
  {
83661
83670
  type: FormType.Text,
83662
- dynamicLabel: (form, t) => `${t("Date Of Birth")}: ${form.get(FederalFormationFormControl.DateOfBirth)?.value}`,
83671
+ dynamicLabel: (form, t) => `${t("Date Of Birth")}: ${form.get(FederalFormationFormControl.DateOfBirth)?.value ?? ""}`,
83663
83672
  formControlName: FederalFormationFormControl.DateOfBirth,
83664
83673
  class: "span-12"
83665
83674
  },
@@ -84324,7 +84333,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84324
84333
  [FormationFormControls.AffiliationName]: new FormControl({ value: name, disabled: true }),
84325
84334
  [FormationFormControls.Id]: new FormControl({ value: id, disabled: true }),
84326
84335
  [FederalFormationFormControl.AddressForService]: new FormControl(deltaData?.addressForService ?? "", Validators.required),
84327
- [FederalFormationFormControl.DateOfBirth]: new FormControl(isc.participant._profile.date_of_birth, Validators.required),
84336
+ [FederalFormationFormControl.DateOfBirth]: new FormControl(isc.participant._profile.date_of_birth),
84328
84337
  [FederalFormationFormControl.CountriesOfCitizenship]: new FormControl(countriesOfCitizenship),
84329
84338
  [FederalFormationFormControl.CountriesOfResidence]: new FormControl(countriesOfResidence),
84330
84339
  [FederalFormationFormControl.ISCTypeOfInterest]: new FormControl(deltaData?.typeOfInterest ?? null, Validators.required),
@@ -84753,7 +84762,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84753
84762
  if (!task) {
84754
84763
  return false;
84755
84764
  }
84756
- const individualWithSignificantControl = getIndividualWithSignificantControl(task.entity.affiliations);
84765
+ const individualWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(task.entity.affiliations);
84757
84766
  return Boolean(individualWithSignificantControl.length) && isListISC;
84758
84767
  });
84759
84768
  isAddIndividualWithSignificantControlDisabled = computed(() => {
@@ -84761,7 +84770,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84761
84770
  if (!task) {
84762
84771
  return false;
84763
84772
  }
84764
- const individualWithSignificantControl = getIndividualWithSignificantControl(task.entity.affiliations);
84773
+ const individualWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(task.entity.affiliations);
84765
84774
  return individualWithSignificantControl.length === this.selectedIndividualWithSignificant().length;
84766
84775
  });
84767
84776
  constructor() {
@@ -84775,7 +84784,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84775
84784
  this.registeredOfficeAddressFields = generateFederalFormationFormRegisteredOfficeAddressControl(mailingOptions);
84776
84785
  this.extraProvincialLicensesFields = this.generateEPLFields(eplRegistrations);
84777
84786
  this.contactControl = generateFederalFormationFormContactControl(contacts);
84778
- this.individualsWithSignificantControlFields = federalFormationFormIndividualsWithSignificantControl(this.generateISCAddressesMap(getIndividualWithSignificantControl(task.entity.affiliations)));
84787
+ this.individualsWithSignificantControlFields = federalFormationFormIndividualsWithSignificantControl(this.generateISCAddressesMap(this.getSelectableIndividualsWithSignificantControl(task.entity.affiliations)));
84779
84788
  }
84780
84789
  });
84781
84790
  effect(() => {
@@ -84789,11 +84798,15 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84789
84798
  const formRawValue = form.getRawValue();
84790
84799
  this.isNonPreapprovedNameType.set(formRawValue[this.groups.CorporateName]?.[this.controls.NameType] === NameType2.NonPreapproved);
84791
84800
  const individualsWithSignificantControl = formRawValue[this.groups.IndividualsWithSignificantControl];
84792
- const selectedIndividualWithSignificant = individualsWithSignificantControl?.map((i) => i[this.controls.EntityName]) ?? [];
84801
+ const selectedIndividualWithSignificant = individualsWithSignificantControl?.map((i) => i[FormationFormControls.AffiliationName]) ?? [];
84793
84802
  this.selectedIndividualWithSignificant.set(selectedIndividualWithSignificant);
84794
- this.isListISC.set(formRawValue[this.groups.SignificantControl]?.[this.controls.SignificantControlType]);
84803
+ this.isListISC.set(this.isListIndividualsWithSignificantControl(formRawValue[this.groups.SignificantControl]?.[this.controls.SignificantControlType]));
84795
84804
  form?.valueChanges.pipe(takeUntilDestroyed(this.dr)).subscribe((val) => {
84796
- this.isListISC.set(val[this.groups.SignificantControl]?.[this.controls.SignificantControlType] === ISCOptions.ListISC);
84805
+ const isListIndividualsWithSignificantControl = this.isListIndividualsWithSignificantControl(val[this.groups.SignificantControl]?.[this.controls.SignificantControlType]);
84806
+ this.isListISC.set(isListIndividualsWithSignificantControl);
84807
+ if (!isListIndividualsWithSignificantControl) {
84808
+ this.clearIndividualsWithSignificantControl();
84809
+ }
84797
84810
  this.isNonPreapprovedNameType.set(val[this.groups.CorporateName]?.[this.controls.NameType] === NameType2.NonPreapproved);
84798
84811
  });
84799
84812
  }
@@ -84801,7 +84814,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84801
84814
  }
84802
84815
  addIndividualWithSignificantControl() {
84803
84816
  const alreadySelected = new Set(this.selectedIndividualWithSignificant());
84804
- const individualWithSignificantControl = getIndividualWithSignificantControl(this.task()?.entity.affiliations ?? []);
84817
+ const individualWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(this.task()?.entity.affiliations ?? []);
84805
84818
  const available = [];
84806
84819
  const itemsMap = /* @__PURE__ */ new Map();
84807
84820
  for (let individual of individualWithSignificantControl) {
@@ -84837,6 +84850,15 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84837
84850
  this.selectedIndividualWithSignificant.update((individuals) => individuals.filter((i) => i !== affiliationName));
84838
84851
  formArray.removeAt(index);
84839
84852
  }
84853
+ clearIndividualsWithSignificantControl() {
84854
+ const formArray = this.getFormArray(FederalFormationFormGroups.IndividualsWithSignificantControl);
84855
+ if (!formArray.length) {
84856
+ return;
84857
+ }
84858
+ formArray.clear();
84859
+ this.selectedIndividualWithSignificant.set([]);
84860
+ this.cdr.detectChanges();
84861
+ }
84840
84862
  directorsSubtitle = computed(() => {
84841
84863
  const articles = this.task()?.entity._articles;
84842
84864
  if (!articles?.min_directors && !articles?.max_directors) {
@@ -84884,7 +84906,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84884
84906
  }
84885
84907
  generateISCAddressesMap(affiliations) {
84886
84908
  const map2 = /* @__PURE__ */ new Map();
84887
- const individualsWithSignificantControl = getIndividualWithSignificantControl(affiliations);
84909
+ const individualsWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(affiliations);
84888
84910
  for (const individual of individualsWithSignificantControl) {
84889
84911
  const addressOptions = individual.addresses.map((address) => ({
84890
84912
  label: this.formatAddressLabel(address),
@@ -84912,6 +84934,16 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84912
84934
  getFormGroup(key) {
84913
84935
  return this.form().get(key);
84914
84936
  }
84937
+ isListIndividualsWithSignificantControl(value) {
84938
+ return Number(value) === ISCOptions.ListISC;
84939
+ }
84940
+ getSelectableIndividualsWithSignificantControl(affiliations) {
84941
+ const significantControlAffiliations = getIndividualWithSignificantControl(affiliations);
84942
+ if (significantControlAffiliations.length) {
84943
+ return significantControlAffiliations;
84944
+ }
84945
+ return affiliations.filter((a) => isPrincipalAffiliation2(a) && a._participant.participant_type === "person" && !["Contact", "Agent", "Responsible"].includes(a.role?.role_name ?? ""));
84946
+ }
84915
84947
  getFormArray(key) {
84916
84948
  return this.form().get(key);
84917
84949
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyedurham/search-and-file-widget",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "",
5
5
  "main": "dnd-filing-shell.js",
6
6
  "scripts": {