@ieeesa-npm/groups 0.15.13 → 0.15.14

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.
@@ -164,6 +164,31 @@ export declare class OrgMultiSelectComponent implements OnInit, OnDestroy {
164
164
  * @memberof OrgMultiSelectComponent
165
165
  */
166
166
  isSelected(option: SelectOption): boolean;
167
+ /**
168
+ * Identity check shared by isSelected / toggleOption / removeOption so all
169
+ * three agree on what "the same option" means.
170
+ *
171
+ * Why not a strict id === id && name === name match: SelectOption.id is
172
+ * `number | string`, and the two sides being compared do not always carry the
173
+ * same representation of the same organization. A freshly searched API result
174
+ * can arrive with a numeric id while the already-selected value (from edit
175
+ * prefill, or a previous search) holds the string form of that same id, so a
176
+ * strict === misses them. Free-text chips are added with an empty id
177
+ * (see addTypedValue), so when the same name later comes back from the API
178
+ * with a real id there is no id to match on at all. Both cases made the
179
+ * dropdown checkbox render unchecked for an option that is in fact selected.
180
+ *
181
+ * Rule:
182
+ * - If BOTH sides have a non-empty id, match by String(id) === String(id)
183
+ * (number-vs-string safe).
184
+ * - Otherwise (either side is a free-text chip with no id) fall back to a
185
+ * trimmed, case-insensitive name match.
186
+ * @param {SelectOption} a -first option.
187
+ * @param {SelectOption} b -second option.
188
+ * @return {boolean} true when both refer to the same organization.
189
+ * @memberof OrgMultiSelectComponent
190
+ */
191
+ private isSameOption;
167
192
  /**
168
193
  * Removes a selected chip.
169
194
  * @param {SelectOption} option -the option to remove.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/groups",
3
- "version": "0.15.13",
3
+ "version": "0.15.14",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0"