@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.
- package/dist/ichigo.cjs +35 -2
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +35 -2
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +35 -2
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/ichigo.cjs
CHANGED
|
@@ -7581,9 +7581,17 @@
|
|
|
7581
7581
|
#updateProperty(element, name, value) {
|
|
7582
7582
|
if (value == null && (name === 'value' || name === 'textContent' || name === 'innerHTML')) {
|
|
7583
7583
|
element[name] = '';
|
|
7584
|
+
if (name === 'value') {
|
|
7585
|
+
element._value = null;
|
|
7586
|
+
}
|
|
7584
7587
|
}
|
|
7585
7588
|
else {
|
|
7586
7589
|
element[name] = value;
|
|
7590
|
+
if (name === 'value') {
|
|
7591
|
+
// Store the original typed value so that v-model on radio buttons
|
|
7592
|
+
// can preserve the type (e.g., boolean false instead of string "false").
|
|
7593
|
+
element._value = value;
|
|
7594
|
+
}
|
|
7587
7595
|
}
|
|
7588
7596
|
}
|
|
7589
7597
|
/**
|
|
@@ -10700,6 +10708,14 @@
|
|
|
10700
10708
|
* @inheritdoc
|
|
10701
10709
|
*/
|
|
10702
10710
|
get onMounted() {
|
|
10711
|
+
const element = this.#vNode.node;
|
|
10712
|
+
// For select elements, re-apply value after mount to ensure
|
|
10713
|
+
// options (e.g., generated by v-for) are present in the DOM.
|
|
10714
|
+
if (element instanceof HTMLSelectElement) {
|
|
10715
|
+
return () => {
|
|
10716
|
+
this.#render();
|
|
10717
|
+
};
|
|
10718
|
+
}
|
|
10703
10719
|
return undefined;
|
|
10704
10720
|
}
|
|
10705
10721
|
/**
|
|
@@ -10712,6 +10728,14 @@
|
|
|
10712
10728
|
* @inheritdoc
|
|
10713
10729
|
*/
|
|
10714
10730
|
get onUpdated() {
|
|
10731
|
+
const element = this.#vNode.node;
|
|
10732
|
+
// For select elements, re-apply value after children are updated
|
|
10733
|
+
// to ensure dynamically generated options are available.
|
|
10734
|
+
if (element instanceof HTMLSelectElement) {
|
|
10735
|
+
return () => {
|
|
10736
|
+
this.#render();
|
|
10737
|
+
};
|
|
10738
|
+
}
|
|
10715
10739
|
return undefined;
|
|
10716
10740
|
}
|
|
10717
10741
|
/**
|
|
@@ -10755,7 +10779,12 @@
|
|
|
10755
10779
|
element.checked = !!value;
|
|
10756
10780
|
}
|
|
10757
10781
|
else if (element.type === 'radio') {
|
|
10758
|
-
|
|
10782
|
+
// Prefer the original typed value stored by VBindDirective (:value binding)
|
|
10783
|
+
// to avoid type coercion issues (e.g., boolean false vs string "false").
|
|
10784
|
+
const radioValue = element._value !== undefined
|
|
10785
|
+
? element._value
|
|
10786
|
+
: element.value;
|
|
10787
|
+
element.checked = radioValue === value;
|
|
10759
10788
|
}
|
|
10760
10789
|
else {
|
|
10761
10790
|
element.value = value ?? '';
|
|
@@ -10783,7 +10812,11 @@
|
|
|
10783
10812
|
newValue = target.checked;
|
|
10784
10813
|
}
|
|
10785
10814
|
else if (target.type === 'radio') {
|
|
10786
|
-
|
|
10815
|
+
// Prefer the original typed value stored by VBindDirective (:value binding)
|
|
10816
|
+
// to preserve the type on write-back (e.g., boolean false, number 0).
|
|
10817
|
+
newValue = target._value !== undefined
|
|
10818
|
+
? target._value
|
|
10819
|
+
: target.value;
|
|
10787
10820
|
}
|
|
10788
10821
|
else {
|
|
10789
10822
|
newValue = target.value;
|