@mintjamsinc/ichigojs 0.1.48 → 0.1.50

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.
@@ -7575,9 +7575,17 @@ class VBindDirective {
7575
7575
  #updateProperty(element, name, value) {
7576
7576
  if (value == null && (name === 'value' || name === 'textContent' || name === 'innerHTML')) {
7577
7577
  element[name] = '';
7578
+ if (name === 'value') {
7579
+ element._value = null;
7580
+ }
7578
7581
  }
7579
7582
  else {
7580
7583
  element[name] = value;
7584
+ if (name === 'value') {
7585
+ // Store the original typed value so that v-model on radio buttons
7586
+ // can preserve the type (e.g., boolean false instead of string "false").
7587
+ element._value = value;
7588
+ }
7581
7589
  }
7582
7590
  }
7583
7591
  /**
@@ -10694,6 +10702,14 @@ class VModelDirective {
10694
10702
  * @inheritdoc
10695
10703
  */
10696
10704
  get onMounted() {
10705
+ const element = this.#vNode.node;
10706
+ // For select elements, re-apply value after mount to ensure
10707
+ // options (e.g., generated by v-for) are present in the DOM.
10708
+ if (element instanceof HTMLSelectElement) {
10709
+ return () => {
10710
+ this.#render();
10711
+ };
10712
+ }
10697
10713
  return undefined;
10698
10714
  }
10699
10715
  /**
@@ -10706,6 +10722,14 @@ class VModelDirective {
10706
10722
  * @inheritdoc
10707
10723
  */
10708
10724
  get onUpdated() {
10725
+ const element = this.#vNode.node;
10726
+ // For select elements, re-apply value after children are updated
10727
+ // to ensure dynamically generated options are available.
10728
+ if (element instanceof HTMLSelectElement) {
10729
+ return () => {
10730
+ this.#render();
10731
+ };
10732
+ }
10709
10733
  return undefined;
10710
10734
  }
10711
10735
  /**
@@ -10749,7 +10773,12 @@ class VModelDirective {
10749
10773
  element.checked = !!value;
10750
10774
  }
10751
10775
  else if (element.type === 'radio') {
10752
- element.checked = element.value === String(value);
10776
+ // Prefer the original typed value stored by VBindDirective (:value binding)
10777
+ // to avoid type coercion issues (e.g., boolean false vs string "false").
10778
+ const radioValue = element._value !== undefined
10779
+ ? element._value
10780
+ : element.value;
10781
+ element.checked = radioValue === value;
10753
10782
  }
10754
10783
  else {
10755
10784
  element.value = value ?? '';
@@ -10777,7 +10806,11 @@ class VModelDirective {
10777
10806
  newValue = target.checked;
10778
10807
  }
10779
10808
  else if (target.type === 'radio') {
10780
- newValue = target.value;
10809
+ // Prefer the original typed value stored by VBindDirective (:value binding)
10810
+ // to preserve the type on write-back (e.g., boolean false, number 0).
10811
+ newValue = target._value !== undefined
10812
+ ? target._value
10813
+ : target.value;
10781
10814
  }
10782
10815
  else {
10783
10816
  newValue = target.value;