abmp-npm 10.0.61 → 10.0.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "10.0.61",
3
+ "version": "10.0.62",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "check-cycles": "madge --circular .",
@@ -2039,9 +2039,14 @@ async function personalDetailsOnReady({
2039
2039
  return;
2040
2040
  }
2041
2041
 
2042
+ const $item = _$w.at(event.context);
2042
2043
  const isChecked = event.target.checked;
2043
2044
  let updated;
2044
2045
  if (isChecked) {
2046
+ // Same pattern as #mainAddressCheckbox: clear every row, then select one (repeater
2047
+ // often does not refresh sibling items' controls when only `data` changes).
2048
+ _$w('#showPhoneCheckbox').checked = false;
2049
+ $item('#showPhoneCheckbox').checked = true;
2045
2050
  updated = data.map(item =>
2046
2051
  item._id === clickedItemData._id
2047
2052
  ? { ...item, showPhone: true }
@@ -2142,9 +2147,23 @@ async function personalDetailsOnReady({
2142
2147
  const repeater = _$w('#phoneNumbersList');
2143
2148
 
2144
2149
  repeater.data = phoneData;
2150
+ refreshPhoneShowCheckboxState(phoneData);
2145
2151
  updatePhoneAddButtonState();
2146
2152
  }
2147
2153
 
2154
+ /**
2155
+ * Repeater may not re-run onItemReady for sibling items when only showPhone flags change;
2156
+ * keep each #showPhoneCheckbox in sync with data (same idea as refreshAddressListIsMainState).
2157
+ */
2158
+ function refreshPhoneShowCheckboxState(phoneData) {
2159
+ const repeater = _$w('#phoneNumbersList');
2160
+ const data = phoneData || repeater.data || [];
2161
+ repeater.forEachItem(($item, _itemData, index) => {
2162
+ const show = index < data.length ? data[index].showPhone : false;
2163
+ $item('#showPhoneCheckbox').checked = Boolean(show);
2164
+ });
2165
+ }
2166
+
2148
2167
  function updatePhoneAddButtonState() {
2149
2168
  const currentData = _$w('#phoneNumbersList').data || [];
2150
2169
  const addPhoneButton = _$w('#addPhoneButton');