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

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 +27 -11
  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,7 @@ 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) => form.get(FederalFormationFormControl.SignificantControlType)?.value === ISCOptions.ListISC
83546
83552
  }
83547
83553
  ];
83548
83554
  FEDERAL_FORMATION_FORM_ADDITIONAL_INFORMATION = [
@@ -84753,7 +84759,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84753
84759
  if (!task) {
84754
84760
  return false;
84755
84761
  }
84756
- const individualWithSignificantControl = getIndividualWithSignificantControl(task.entity.affiliations);
84762
+ const individualWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(task.entity.affiliations);
84757
84763
  return Boolean(individualWithSignificantControl.length) && isListISC;
84758
84764
  });
84759
84765
  isAddIndividualWithSignificantControlDisabled = computed(() => {
@@ -84761,7 +84767,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84761
84767
  if (!task) {
84762
84768
  return false;
84763
84769
  }
84764
- const individualWithSignificantControl = getIndividualWithSignificantControl(task.entity.affiliations);
84770
+ const individualWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(task.entity.affiliations);
84765
84771
  return individualWithSignificantControl.length === this.selectedIndividualWithSignificant().length;
84766
84772
  });
84767
84773
  constructor() {
@@ -84775,7 +84781,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84775
84781
  this.registeredOfficeAddressFields = generateFederalFormationFormRegisteredOfficeAddressControl(mailingOptions);
84776
84782
  this.extraProvincialLicensesFields = this.generateEPLFields(eplRegistrations);
84777
84783
  this.contactControl = generateFederalFormationFormContactControl(contacts);
84778
- this.individualsWithSignificantControlFields = federalFormationFormIndividualsWithSignificantControl(this.generateISCAddressesMap(getIndividualWithSignificantControl(task.entity.affiliations)));
84784
+ this.individualsWithSignificantControlFields = federalFormationFormIndividualsWithSignificantControl(this.generateISCAddressesMap(this.getSelectableIndividualsWithSignificantControl(task.entity.affiliations)));
84779
84785
  }
84780
84786
  });
84781
84787
  effect(() => {
@@ -84789,11 +84795,11 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84789
84795
  const formRawValue = form.getRawValue();
84790
84796
  this.isNonPreapprovedNameType.set(formRawValue[this.groups.CorporateName]?.[this.controls.NameType] === NameType2.NonPreapproved);
84791
84797
  const individualsWithSignificantControl = formRawValue[this.groups.IndividualsWithSignificantControl];
84792
- const selectedIndividualWithSignificant = individualsWithSignificantControl?.map((i) => i[this.controls.EntityName]) ?? [];
84798
+ const selectedIndividualWithSignificant = individualsWithSignificantControl?.map((i) => i[FormationFormControls.AffiliationName]) ?? [];
84793
84799
  this.selectedIndividualWithSignificant.set(selectedIndividualWithSignificant);
84794
- this.isListISC.set(formRawValue[this.groups.SignificantControl]?.[this.controls.SignificantControlType]);
84800
+ this.isListISC.set(this.isListIndividualsWithSignificantControl(formRawValue[this.groups.SignificantControl]?.[this.controls.SignificantControlType]));
84795
84801
  form?.valueChanges.pipe(takeUntilDestroyed(this.dr)).subscribe((val) => {
84796
- this.isListISC.set(val[this.groups.SignificantControl]?.[this.controls.SignificantControlType] === ISCOptions.ListISC);
84802
+ this.isListISC.set(this.isListIndividualsWithSignificantControl(val[this.groups.SignificantControl]?.[this.controls.SignificantControlType]));
84797
84803
  this.isNonPreapprovedNameType.set(val[this.groups.CorporateName]?.[this.controls.NameType] === NameType2.NonPreapproved);
84798
84804
  });
84799
84805
  }
@@ -84801,7 +84807,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84801
84807
  }
84802
84808
  addIndividualWithSignificantControl() {
84803
84809
  const alreadySelected = new Set(this.selectedIndividualWithSignificant());
84804
- const individualWithSignificantControl = getIndividualWithSignificantControl(this.task()?.entity.affiliations ?? []);
84810
+ const individualWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(this.task()?.entity.affiliations ?? []);
84805
84811
  const available = [];
84806
84812
  const itemsMap = /* @__PURE__ */ new Map();
84807
84813
  for (let individual of individualWithSignificantControl) {
@@ -84884,7 +84890,7 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84884
84890
  }
84885
84891
  generateISCAddressesMap(affiliations) {
84886
84892
  const map2 = /* @__PURE__ */ new Map();
84887
- const individualsWithSignificantControl = getIndividualWithSignificantControl(affiliations);
84893
+ const individualsWithSignificantControl = this.getSelectableIndividualsWithSignificantControl(affiliations);
84888
84894
  for (const individual of individualsWithSignificantControl) {
84889
84895
  const addressOptions = individual.addresses.map((address) => ({
84890
84896
  label: this.formatAddressLabel(address),
@@ -84912,6 +84918,16 @@ Note: Recommended intrinsic image size is calculated assuming a maximum DPR of $
84912
84918
  getFormGroup(key) {
84913
84919
  return this.form().get(key);
84914
84920
  }
84921
+ isListIndividualsWithSignificantControl(value) {
84922
+ return Number(value) === ISCOptions.ListISC;
84923
+ }
84924
+ getSelectableIndividualsWithSignificantControl(affiliations) {
84925
+ const significantControlAffiliations = getIndividualWithSignificantControl(affiliations);
84926
+ if (significantControlAffiliations.length) {
84927
+ return significantControlAffiliations;
84928
+ }
84929
+ return affiliations.filter((a) => isPrincipalAffiliation2(a) && a._participant.participant_type === "person" && !["Contact", "Agent", "Responsible"].includes(a.role?.role_name ?? ""));
84930
+ }
84915
84931
  getFormArray(key) {
84916
84932
  return this.form().get(key);
84917
84933
  }
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.7",
4
4
  "description": "",
5
5
  "main": "dnd-filing-shell.js",
6
6
  "scripts": {