@marko/runtime-tags 6.1.10 → 6.1.11

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.
@@ -7,5 +7,6 @@ export declare const toDelimitedString: (val: unknown, delimiter: string, string
7
7
  export declare function isEventHandler(name: string): name is `on${string}`;
8
8
  export declare function getEventHandlerName(name: `on${string}`): string;
9
9
  export declare function isVoid(value: unknown): value is false | null | undefined;
10
+ export declare function isNotVoid(value: unknown): boolean;
10
11
  export declare function normalizeDynamicRenderer<Renderer>(value: any): Renderer | string | undefined;
11
12
  export declare const decodeAccessor: (num: number) => string;
package/dist/debug/dom.js CHANGED
@@ -125,6 +125,9 @@ function isEventHandler(name) {
125
125
  function getEventHandlerName(name) {
126
126
  return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
127
127
  }
128
+ function isNotVoid(value) {
129
+ return value != null && value !== false;
130
+ }
128
131
  function normalizeDynamicRenderer(value) {
129
132
  if (value) {
130
133
  if (typeof value === "string") return value;
@@ -765,7 +768,7 @@ let inputType = "";
765
768
  const controllableDelegate = /* @__PURE__ */ createDelegator();
766
769
  function _attr_input_checked_default(scope, nodeAccessor, checked) {
767
770
  const el = scope[nodeAccessor];
768
- const normalizedChecked = normalizeBoolProp(checked);
771
+ const normalizedChecked = isNotVoid(checked);
769
772
  if (el.defaultChecked !== normalizedChecked) {
770
773
  const restoreValue = scope["#Creating"] ? normalizedChecked : el.checked;
771
774
  el.defaultChecked = normalizedChecked;
@@ -774,7 +777,7 @@ function _attr_input_checked_default(scope, nodeAccessor, checked) {
774
777
  }
775
778
  function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
776
779
  const el = scope[nodeAccessor];
777
- const normalizedChecked = normalizeBoolProp(checked);
780
+ const normalizedChecked = isNotVoid(checked);
778
781
  scope["ControlledHandler:" + nodeAccessor] = checkedChange;
779
782
  scope["ControlledType:" + nodeAccessor] = checkedChange ? 0 : 5;
780
783
  if (checkedChange && !scope["#Creating"]) el.checked = normalizedChecked;
@@ -796,19 +799,19 @@ function _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, val
796
799
  const multiple = Array.isArray(checkedValue);
797
800
  const normalizedValue = normalizeStrProp(value);
798
801
  const normalizedCheckedValue = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
799
- _attr(scope[nodeAccessor], "value", normalizedValue);
802
+ _attr(scope[nodeAccessor], "value", value);
800
803
  _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
801
804
  }
802
805
  function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
803
806
  const el = scope[nodeAccessor];
804
807
  const multiple = Array.isArray(checkedValue);
805
- const normalizedValue = normalizeStrProp(value);
806
808
  const normalizedCheckedValue = scope["ControlledValue:" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
807
- _attr(el, "value", normalizedValue);
808
809
  scope["ControlledHandler:" + nodeAccessor] = checkedValueChange;
809
810
  scope["ControlledType:" + nodeAccessor] = checkedValueChange ? 1 : 5;
810
- if (checkedValueChange && !scope["#Creating"]) el.checked = multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue;
811
- else _attr_input_checkedValue_default(scope, nodeAccessor, normalizedCheckedValue, normalizedValue);
811
+ if (checkedValueChange && !scope["#Creating"]) {
812
+ el.checked = multiple ? normalizedCheckedValue.includes(normalizeStrProp(value)) : normalizeStrProp(value) === normalizedCheckedValue;
813
+ _attr(el, "value", value);
814
+ } else _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value);
812
815
  }
813
816
  function _attr_input_checkedValue_script(scope, nodeAccessor) {
814
817
  const el = scope[nodeAccessor];
@@ -829,7 +832,7 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
829
832
  }
830
833
  function _attr_input_value_default(scope, nodeAccessor, value) {
831
834
  const el = scope[nodeAccessor];
832
- const normalizedValue = normalizeStrProp(value);
835
+ const normalizedValue = normalizeAttrValue(value) || "";
833
836
  if (el.defaultValue !== normalizedValue) {
834
837
  const restoreValue = scope["#Creating"] ? normalizedValue : el.value;
835
838
  el.defaultValue = normalizedValue;
@@ -838,7 +841,7 @@ function _attr_input_value_default(scope, nodeAccessor, value) {
838
841
  }
839
842
  function _attr_input_value(scope, nodeAccessor, value, valueChange) {
840
843
  const el = scope[nodeAccessor];
841
- const normalizedValue = normalizeStrProp(value);
844
+ const normalizedValue = normalizeAttrValue(value) || "";
842
845
  scope["ControlledHandler:" + nodeAccessor] = valueChange;
843
846
  scope["ControlledValue:" + nodeAccessor] = normalizedValue;
844
847
  scope["ControlledType:" + nodeAccessor] = valueChange ? 2 : 5;
@@ -932,10 +935,10 @@ function getSelectValue(el, multiple) {
932
935
  return multiple ? Array.from(el.selectedOptions, (opt) => opt.value) : el.value;
933
936
  }
934
937
  function _attr_details_or_dialog_open_default(scope, nodeAccessor, open) {
935
- if (scope["#Creating"]) scope[nodeAccessor].open = normalizeBoolProp(open);
938
+ if (scope["#Creating"]) scope[nodeAccessor].open = isNotVoid(open);
936
939
  }
937
940
  function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
938
- const normalizedOpen = scope["ControlledValue:" + nodeAccessor] = normalizeBoolProp(open);
941
+ const normalizedOpen = scope["ControlledValue:" + nodeAccessor] = isNotVoid(open);
939
942
  scope["ControlledHandler:" + nodeAccessor] = openChange;
940
943
  scope["ControlledType:" + nodeAccessor] = openChange ? 4 : 5;
941
944
  if (openChange && !scope["#Creating"]) scope[nodeAccessor].open = normalizedOpen;
@@ -987,9 +990,6 @@ function hasFormElementChanged(el) {
987
990
  function normalizeStrProp(value) {
988
991
  return normalizeAttrValue(value) || "";
989
992
  }
990
- function normalizeBoolProp(value) {
991
- return value != null && value !== false;
992
- }
993
993
  function updateList(arr, val, push) {
994
994
  const index = arr.indexOf(val);
995
995
  return (push ? !~index && [...arr, val] : ~index && arr.slice(0, index).concat(arr.slice(index + 1))) || arr;
@@ -1165,7 +1165,7 @@ function normalizeClientRender(value) {
1165
1165
  else throw new Error(`Invalid \`content\` attribute. Received ${typeof value}`);
1166
1166
  }
1167
1167
  function normalizeAttrValue(value) {
1168
- if (value || value === 0) return value === true ? "" : value + "";
1168
+ if (isNotVoid(value)) return value === true ? "" : value + "";
1169
1169
  }
1170
1170
  function _lifecycle(scope, thisObj, index = 0) {
1171
1171
  const accessor = "Lifecycle:" + index;
@@ -123,6 +123,9 @@ function isEventHandler(name) {
123
123
  function getEventHandlerName(name) {
124
124
  return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
125
125
  }
126
+ function isNotVoid(value) {
127
+ return value != null && value !== false;
128
+ }
126
129
  function normalizeDynamicRenderer(value) {
127
130
  if (value) {
128
131
  if (typeof value === "string") return value;
@@ -763,7 +766,7 @@ let inputType = "";
763
766
  const controllableDelegate = /* @__PURE__ */ createDelegator();
764
767
  function _attr_input_checked_default(scope, nodeAccessor, checked) {
765
768
  const el = scope[nodeAccessor];
766
- const normalizedChecked = normalizeBoolProp(checked);
769
+ const normalizedChecked = isNotVoid(checked);
767
770
  if (el.defaultChecked !== normalizedChecked) {
768
771
  const restoreValue = scope["#Creating"] ? normalizedChecked : el.checked;
769
772
  el.defaultChecked = normalizedChecked;
@@ -772,7 +775,7 @@ function _attr_input_checked_default(scope, nodeAccessor, checked) {
772
775
  }
773
776
  function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
774
777
  const el = scope[nodeAccessor];
775
- const normalizedChecked = normalizeBoolProp(checked);
778
+ const normalizedChecked = isNotVoid(checked);
776
779
  scope["ControlledHandler:" + nodeAccessor] = checkedChange;
777
780
  scope["ControlledType:" + nodeAccessor] = checkedChange ? 0 : 5;
778
781
  if (checkedChange && !scope["#Creating"]) el.checked = normalizedChecked;
@@ -794,19 +797,19 @@ function _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, val
794
797
  const multiple = Array.isArray(checkedValue);
795
798
  const normalizedValue = normalizeStrProp(value);
796
799
  const normalizedCheckedValue = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
797
- _attr(scope[nodeAccessor], "value", normalizedValue);
800
+ _attr(scope[nodeAccessor], "value", value);
798
801
  _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
799
802
  }
800
803
  function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
801
804
  const el = scope[nodeAccessor];
802
805
  const multiple = Array.isArray(checkedValue);
803
- const normalizedValue = normalizeStrProp(value);
804
806
  const normalizedCheckedValue = scope["ControlledValue:" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
805
- _attr(el, "value", normalizedValue);
806
807
  scope["ControlledHandler:" + nodeAccessor] = checkedValueChange;
807
808
  scope["ControlledType:" + nodeAccessor] = checkedValueChange ? 1 : 5;
808
- if (checkedValueChange && !scope["#Creating"]) el.checked = multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue;
809
- else _attr_input_checkedValue_default(scope, nodeAccessor, normalizedCheckedValue, normalizedValue);
809
+ if (checkedValueChange && !scope["#Creating"]) {
810
+ el.checked = multiple ? normalizedCheckedValue.includes(normalizeStrProp(value)) : normalizeStrProp(value) === normalizedCheckedValue;
811
+ _attr(el, "value", value);
812
+ } else _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value);
810
813
  }
811
814
  function _attr_input_checkedValue_script(scope, nodeAccessor) {
812
815
  const el = scope[nodeAccessor];
@@ -827,7 +830,7 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
827
830
  }
828
831
  function _attr_input_value_default(scope, nodeAccessor, value) {
829
832
  const el = scope[nodeAccessor];
830
- const normalizedValue = normalizeStrProp(value);
833
+ const normalizedValue = normalizeAttrValue(value) || "";
831
834
  if (el.defaultValue !== normalizedValue) {
832
835
  const restoreValue = scope["#Creating"] ? normalizedValue : el.value;
833
836
  el.defaultValue = normalizedValue;
@@ -836,7 +839,7 @@ function _attr_input_value_default(scope, nodeAccessor, value) {
836
839
  }
837
840
  function _attr_input_value(scope, nodeAccessor, value, valueChange) {
838
841
  const el = scope[nodeAccessor];
839
- const normalizedValue = normalizeStrProp(value);
842
+ const normalizedValue = normalizeAttrValue(value) || "";
840
843
  scope["ControlledHandler:" + nodeAccessor] = valueChange;
841
844
  scope["ControlledValue:" + nodeAccessor] = normalizedValue;
842
845
  scope["ControlledType:" + nodeAccessor] = valueChange ? 2 : 5;
@@ -930,10 +933,10 @@ function getSelectValue(el, multiple) {
930
933
  return multiple ? Array.from(el.selectedOptions, (opt) => opt.value) : el.value;
931
934
  }
932
935
  function _attr_details_or_dialog_open_default(scope, nodeAccessor, open) {
933
- if (scope["#Creating"]) scope[nodeAccessor].open = normalizeBoolProp(open);
936
+ if (scope["#Creating"]) scope[nodeAccessor].open = isNotVoid(open);
934
937
  }
935
938
  function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
936
- const normalizedOpen = scope["ControlledValue:" + nodeAccessor] = normalizeBoolProp(open);
939
+ const normalizedOpen = scope["ControlledValue:" + nodeAccessor] = isNotVoid(open);
937
940
  scope["ControlledHandler:" + nodeAccessor] = openChange;
938
941
  scope["ControlledType:" + nodeAccessor] = openChange ? 4 : 5;
939
942
  if (openChange && !scope["#Creating"]) scope[nodeAccessor].open = normalizedOpen;
@@ -985,9 +988,6 @@ function hasFormElementChanged(el) {
985
988
  function normalizeStrProp(value) {
986
989
  return normalizeAttrValue(value) || "";
987
990
  }
988
- function normalizeBoolProp(value) {
989
- return value != null && value !== false;
990
- }
991
991
  function updateList(arr, val, push) {
992
992
  const index = arr.indexOf(val);
993
993
  return (push ? !~index && [...arr, val] : ~index && arr.slice(0, index).concat(arr.slice(index + 1))) || arr;
@@ -1163,7 +1163,7 @@ function normalizeClientRender(value) {
1163
1163
  else throw new Error(`Invalid \`content\` attribute. Received ${typeof value}`);
1164
1164
  }
1165
1165
  function normalizeAttrValue(value) {
1166
- if (value || value === 0) return value === true ? "" : value + "";
1166
+ if (isNotVoid(value)) return value === true ? "" : value + "";
1167
1167
  }
1168
1168
  function _lifecycle(scope, thisObj, index = 0) {
1169
1169
  const accessor = "Lifecycle:" + index;
@@ -1344,6 +1344,9 @@ function getEventHandlerName(name) {
1344
1344
  function isVoid(value) {
1345
1345
  return value == null || value === false;
1346
1346
  }
1347
+ function isNotVoid(value) {
1348
+ return value != null && value !== false;
1349
+ }
1347
1350
  function normalizeDynamicRenderer(value) {
1348
1351
  if (value) {
1349
1352
  if (typeof value === "string") return value;
@@ -2384,7 +2387,7 @@ function _attr_input_value(scopeId, nodeAccessor, value, valueChange) {
2384
2387
  }
2385
2388
  function _attr_input_checked(scopeId, nodeAccessor, checked, checkedChange) {
2386
2389
  if (checkedChange) writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange);
2387
- return normalizeBoolAttrValue(checked) ? " checked" : "";
2390
+ return isNotVoid(checked) ? " checked" : "";
2388
2391
  }
2389
2392
  function _attr_input_checkedValue(scopeId, nodeAccessor, checkedValue, checkedValueChange, value) {
2390
2393
  const valueAttr = _attr("value", value);
@@ -2403,8 +2406,8 @@ function getCheckedValueRef(checkedValue) {
2403
2406
  }
2404
2407
  }
2405
2408
  function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange) {
2406
- const normalizedOpen = normalizeBoolAttrValue(open);
2407
- if (openChange) writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen, openChange);
2409
+ const normalizedOpen = isNotVoid(open);
2410
+ if (openChange) writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen || void 0, openChange);
2408
2411
  return normalizedOpen ? " open" : "";
2409
2412
  }
2410
2413
  function _attr_nonce() {
@@ -2421,17 +2424,17 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2421
2424
  case "input":
2422
2425
  assertExclusiveAttrs(data);
2423
2426
  if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange);
2424
- else if (data.checkedValue || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
2427
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
2425
2428
  else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange);
2426
2429
  else break;
2427
2430
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2428
2431
  break;
2429
2432
  case "select":
2430
2433
  case "textarea":
2431
- if (data.value || data.valueChange) skip = /^value(?:Change)?$|[\s/>"'=]/;
2434
+ if ("value" in data || data.valueChange) skip = /^value(?:Change)?$|[\s/>"'=]/;
2432
2435
  break;
2433
2436
  case "option":
2434
- if (data.value) {
2437
+ if ("value" in data) {
2435
2438
  result += _attr_option_value(data.value);
2436
2439
  skip = /^value$|[\s/>"'=]/;
2437
2440
  }
@@ -2534,9 +2537,6 @@ function normalizedValueMatches(a, b) {
2534
2537
  function normalizeStrAttrValue(value) {
2535
2538
  return value && value !== true || value === 0 ? value + "" : "";
2536
2539
  }
2537
- function normalizeBoolAttrValue(value) {
2538
- if (value != null && value !== false) return true;
2539
- }
2540
2540
  //#endregion
2541
2541
  //#region src/html/dynamic-tag.ts
2542
2542
  const voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
@@ -1342,6 +1342,9 @@ function getEventHandlerName(name) {
1342
1342
  function isVoid(value) {
1343
1343
  return value == null || value === false;
1344
1344
  }
1345
+ function isNotVoid(value) {
1346
+ return value != null && value !== false;
1347
+ }
1345
1348
  function normalizeDynamicRenderer(value) {
1346
1349
  if (value) {
1347
1350
  if (typeof value === "string") return value;
@@ -2382,7 +2385,7 @@ function _attr_input_value(scopeId, nodeAccessor, value, valueChange) {
2382
2385
  }
2383
2386
  function _attr_input_checked(scopeId, nodeAccessor, checked, checkedChange) {
2384
2387
  if (checkedChange) writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange);
2385
- return normalizeBoolAttrValue(checked) ? " checked" : "";
2388
+ return isNotVoid(checked) ? " checked" : "";
2386
2389
  }
2387
2390
  function _attr_input_checkedValue(scopeId, nodeAccessor, checkedValue, checkedValueChange, value) {
2388
2391
  const valueAttr = _attr("value", value);
@@ -2401,8 +2404,8 @@ function getCheckedValueRef(checkedValue) {
2401
2404
  }
2402
2405
  }
2403
2406
  function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange) {
2404
- const normalizedOpen = normalizeBoolAttrValue(open);
2405
- if (openChange) writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen, openChange);
2407
+ const normalizedOpen = isNotVoid(open);
2408
+ if (openChange) writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen || void 0, openChange);
2406
2409
  return normalizedOpen ? " open" : "";
2407
2410
  }
2408
2411
  function _attr_nonce() {
@@ -2419,17 +2422,17 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
2419
2422
  case "input":
2420
2423
  assertExclusiveAttrs(data);
2421
2424
  if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange);
2422
- else if (data.checkedValue || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
2425
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
2423
2426
  else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange);
2424
2427
  else break;
2425
2428
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
2426
2429
  break;
2427
2430
  case "select":
2428
2431
  case "textarea":
2429
- if (data.value || data.valueChange) skip = /^value(?:Change)?$|[\s/>"'=]/;
2432
+ if ("value" in data || data.valueChange) skip = /^value(?:Change)?$|[\s/>"'=]/;
2430
2433
  break;
2431
2434
  case "option":
2432
- if (data.value) {
2435
+ if ("value" in data) {
2433
2436
  result += _attr_option_value(data.value);
2434
2437
  skip = /^value$|[\s/>"'=]/;
2435
2438
  }
@@ -2532,9 +2535,6 @@ function normalizedValueMatches(a, b) {
2532
2535
  function normalizeStrAttrValue(value) {
2533
2536
  return value && value !== true || value === 0 ? value + "" : "";
2534
2537
  }
2535
- function normalizeBoolAttrValue(value) {
2536
- if (value != null && value !== false) return true;
2537
- }
2538
2538
  //#endregion
2539
2539
  //#region src/html/dynamic-tag.ts
2540
2540
  const voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
package/dist/dom.js CHANGED
@@ -158,6 +158,9 @@ function isEventHandler(name) {
158
158
  function getEventHandlerName(name) {
159
159
  return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
160
160
  }
161
+ function isNotVoid(value) {
162
+ return value != null && value !== !1;
163
+ }
161
164
  function normalizeDynamicRenderer(value) {
162
165
  if (value) {
163
166
  if (typeof value == "string") return value;
@@ -522,14 +525,14 @@ function _el(id, accessor) {
522
525
  //#endregion
523
526
  //#region src/dom/controllable.ts
524
527
  function _attr_input_checked_default(scope, nodeAccessor, checked) {
525
- let el = scope[nodeAccessor], normalizedChecked = normalizeBoolProp(checked);
528
+ let el = scope[nodeAccessor], normalizedChecked = isNotVoid(checked);
526
529
  if (el.defaultChecked !== normalizedChecked) {
527
530
  let restoreValue = scope.H ? normalizedChecked : el.checked;
528
531
  el.defaultChecked = normalizedChecked, restoreValue !== normalizedChecked && (el.checked = restoreValue);
529
532
  }
530
533
  }
531
534
  function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
532
- let el = scope[nodeAccessor], normalizedChecked = normalizeBoolProp(checked);
535
+ let el = scope[nodeAccessor], normalizedChecked = isNotVoid(checked);
533
536
  scope["E" + nodeAccessor] = checkedChange, scope["F" + nodeAccessor] = checkedChange ? 0 : 5, checkedChange && !scope.H ? el.checked = normalizedChecked : _attr_input_checked_default(scope, nodeAccessor, normalizedChecked);
534
537
  }
535
538
  function _attr_input_checked_script(scope, nodeAccessor) {
@@ -544,11 +547,11 @@ function _attr_input_checked_script(scope, nodeAccessor) {
544
547
  }
545
548
  function _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value) {
546
549
  let multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
547
- _attr(scope[nodeAccessor], "value", normalizedValue), _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
550
+ _attr(scope[nodeAccessor], "value", value), _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
548
551
  }
549
552
  function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
550
- let el = scope[nodeAccessor], multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = scope["G" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
551
- _attr(el, "value", normalizedValue), scope["E" + nodeAccessor] = checkedValueChange, scope["F" + nodeAccessor] = checkedValueChange ? 1 : 5, checkedValueChange && !scope.H ? el.checked = multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue : _attr_input_checkedValue_default(scope, nodeAccessor, normalizedCheckedValue, normalizedValue);
553
+ let el = scope[nodeAccessor], multiple = Array.isArray(checkedValue), normalizedCheckedValue = scope["G" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
554
+ scope["E" + nodeAccessor] = checkedValueChange, scope["F" + nodeAccessor] = checkedValueChange ? 1 : 5, checkedValueChange && !scope.H ? (el.checked = multiple ? normalizedCheckedValue.includes(normalizeStrProp(value)) : normalizeStrProp(value) === normalizedCheckedValue, _attr(el, "value", value)) : _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value);
552
555
  }
553
556
  function _attr_input_checkedValue_script(scope, nodeAccessor) {
554
557
  let el = scope[nodeAccessor];
@@ -563,14 +566,14 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
563
566
  });
564
567
  }
565
568
  function _attr_input_value_default(scope, nodeAccessor, value) {
566
- let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
569
+ let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
567
570
  if (el.defaultValue !== normalizedValue) {
568
571
  let restoreValue = scope.H ? normalizedValue : el.value;
569
572
  el.defaultValue = normalizedValue, setInputValue(el, restoreValue);
570
573
  }
571
574
  }
572
575
  function _attr_input_value(scope, nodeAccessor, value, valueChange) {
573
- let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
576
+ let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
574
577
  scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && !scope.H ? setInputValue(el, normalizedValue) : _attr_input_value_default(scope, nodeAccessor, normalizedValue);
575
578
  }
576
579
  function _attr_input_value_script(scope, nodeAccessor) {
@@ -634,10 +637,10 @@ function getSelectValue(el, multiple) {
634
637
  return multiple ? Array.from(el.selectedOptions, (opt) => opt.value) : el.value;
635
638
  }
636
639
  function _attr_details_or_dialog_open_default(scope, nodeAccessor, open) {
637
- scope.H && (scope[nodeAccessor].open = normalizeBoolProp(open));
640
+ scope.H && (scope[nodeAccessor].open = isNotVoid(open));
638
641
  }
639
642
  function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
640
- let normalizedOpen = scope["G" + nodeAccessor] = normalizeBoolProp(open);
643
+ let normalizedOpen = scope["G" + nodeAccessor] = isNotVoid(open);
641
644
  scope["E" + nodeAccessor] = openChange, scope["F" + nodeAccessor] = openChange ? 4 : 5, openChange && !scope.H ? scope[nodeAccessor].open = normalizedOpen : _attr_details_or_dialog_open_default(scope, nodeAccessor, normalizedOpen);
642
645
  }
643
646
  function _attr_details_or_dialog_open_script(scope, nodeAccessor) {
@@ -681,9 +684,6 @@ function hasFormElementChanged(el) {
681
684
  function normalizeStrProp(value) {
682
685
  return normalizeAttrValue(value) || "";
683
686
  }
684
- function normalizeBoolProp(value) {
685
- return value != null && value !== !1;
686
- }
687
687
  function updateList(arr, val, push) {
688
688
  let index = arr.indexOf(val);
689
689
  return (push ? !~index && [...arr, val] : ~index && arr.slice(0, index).concat(arr.slice(index + 1))) || arr;
@@ -828,7 +828,7 @@ function normalizeClientRender(value) {
828
828
  if (renderer && renderer.a) return renderer;
829
829
  }
830
830
  function normalizeAttrValue(value) {
831
- if (value || value === 0) return value === !0 ? "" : value + "";
831
+ if (isNotVoid(value)) return value === !0 ? "" : value + "";
832
832
  }
833
833
  function _lifecycle(scope, thisObj, index = 0) {
834
834
  let accessor = "K" + index, instance = scope[accessor];
package/dist/dom.mjs CHANGED
@@ -157,6 +157,9 @@ function isEventHandler(name) {
157
157
  function getEventHandlerName(name) {
158
158
  return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
159
159
  }
160
+ function isNotVoid(value) {
161
+ return value != null && value !== !1;
162
+ }
160
163
  function normalizeDynamicRenderer(value) {
161
164
  if (value) {
162
165
  if (typeof value == "string") return value;
@@ -521,14 +524,14 @@ function _el(id, accessor) {
521
524
  //#endregion
522
525
  //#region src/dom/controllable.ts
523
526
  function _attr_input_checked_default(scope, nodeAccessor, checked) {
524
- let el = scope[nodeAccessor], normalizedChecked = normalizeBoolProp(checked);
527
+ let el = scope[nodeAccessor], normalizedChecked = isNotVoid(checked);
525
528
  if (el.defaultChecked !== normalizedChecked) {
526
529
  let restoreValue = scope.H ? normalizedChecked : el.checked;
527
530
  el.defaultChecked = normalizedChecked, restoreValue !== normalizedChecked && (el.checked = restoreValue);
528
531
  }
529
532
  }
530
533
  function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
531
- let el = scope[nodeAccessor], normalizedChecked = normalizeBoolProp(checked);
534
+ let el = scope[nodeAccessor], normalizedChecked = isNotVoid(checked);
532
535
  scope["E" + nodeAccessor] = checkedChange, scope["F" + nodeAccessor] = checkedChange ? 0 : 5, checkedChange && !scope.H ? el.checked = normalizedChecked : _attr_input_checked_default(scope, nodeAccessor, normalizedChecked);
533
536
  }
534
537
  function _attr_input_checked_script(scope, nodeAccessor) {
@@ -543,11 +546,11 @@ function _attr_input_checked_script(scope, nodeAccessor) {
543
546
  }
544
547
  function _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value) {
545
548
  let multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
546
- _attr(scope[nodeAccessor], "value", normalizedValue), _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
549
+ _attr(scope[nodeAccessor], "value", value), _attr_input_checked_default(scope, nodeAccessor, multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue);
547
550
  }
548
551
  function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
549
- let el = scope[nodeAccessor], multiple = Array.isArray(checkedValue), normalizedValue = normalizeStrProp(value), normalizedCheckedValue = scope["G" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
550
- _attr(el, "value", normalizedValue), scope["E" + nodeAccessor] = checkedValueChange, scope["F" + nodeAccessor] = checkedValueChange ? 1 : 5, checkedValueChange && !scope.H ? el.checked = multiple ? normalizedCheckedValue.includes(normalizedValue) : normalizedValue === normalizedCheckedValue : _attr_input_checkedValue_default(scope, nodeAccessor, normalizedCheckedValue, normalizedValue);
552
+ let el = scope[nodeAccessor], multiple = Array.isArray(checkedValue), normalizedCheckedValue = scope["G" + nodeAccessor] = multiple ? checkedValue.map(normalizeStrProp) : normalizeStrProp(checkedValue);
553
+ scope["E" + nodeAccessor] = checkedValueChange, scope["F" + nodeAccessor] = checkedValueChange ? 1 : 5, checkedValueChange && !scope.H ? (el.checked = multiple ? normalizedCheckedValue.includes(normalizeStrProp(value)) : normalizeStrProp(value) === normalizedCheckedValue, _attr(el, "value", value)) : _attr_input_checkedValue_default(scope, nodeAccessor, checkedValue, value);
551
554
  }
552
555
  function _attr_input_checkedValue_script(scope, nodeAccessor) {
553
556
  let el = scope[nodeAccessor];
@@ -562,14 +565,14 @@ function _attr_input_checkedValue_script(scope, nodeAccessor) {
562
565
  });
563
566
  }
564
567
  function _attr_input_value_default(scope, nodeAccessor, value) {
565
- let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
568
+ let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
566
569
  if (el.defaultValue !== normalizedValue) {
567
570
  let restoreValue = scope.H ? normalizedValue : el.value;
568
571
  el.defaultValue = normalizedValue, setInputValue(el, restoreValue);
569
572
  }
570
573
  }
571
574
  function _attr_input_value(scope, nodeAccessor, value, valueChange) {
572
- let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
575
+ let el = scope[nodeAccessor], normalizedValue = normalizeAttrValue(value) || "";
573
576
  scope["E" + nodeAccessor] = valueChange, scope["G" + nodeAccessor] = normalizedValue, scope["F" + nodeAccessor] = valueChange ? 2 : 5, valueChange && !scope.H ? setInputValue(el, normalizedValue) : _attr_input_value_default(scope, nodeAccessor, normalizedValue);
574
577
  }
575
578
  function _attr_input_value_script(scope, nodeAccessor) {
@@ -633,10 +636,10 @@ function getSelectValue(el, multiple) {
633
636
  return multiple ? Array.from(el.selectedOptions, (opt) => opt.value) : el.value;
634
637
  }
635
638
  function _attr_details_or_dialog_open_default(scope, nodeAccessor, open) {
636
- scope.H && (scope[nodeAccessor].open = normalizeBoolProp(open));
639
+ scope.H && (scope[nodeAccessor].open = isNotVoid(open));
637
640
  }
638
641
  function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
639
- let normalizedOpen = scope["G" + nodeAccessor] = normalizeBoolProp(open);
642
+ let normalizedOpen = scope["G" + nodeAccessor] = isNotVoid(open);
640
643
  scope["E" + nodeAccessor] = openChange, scope["F" + nodeAccessor] = openChange ? 4 : 5, openChange && !scope.H ? scope[nodeAccessor].open = normalizedOpen : _attr_details_or_dialog_open_default(scope, nodeAccessor, normalizedOpen);
641
644
  }
642
645
  function _attr_details_or_dialog_open_script(scope, nodeAccessor) {
@@ -680,9 +683,6 @@ function hasFormElementChanged(el) {
680
683
  function normalizeStrProp(value) {
681
684
  return normalizeAttrValue(value) || "";
682
685
  }
683
- function normalizeBoolProp(value) {
684
- return value != null && value !== !1;
685
- }
686
686
  function updateList(arr, val, push) {
687
687
  let index = arr.indexOf(val);
688
688
  return (push ? !~index && [...arr, val] : ~index && arr.slice(0, index).concat(arr.slice(index + 1))) || arr;
@@ -827,7 +827,7 @@ function normalizeClientRender(value) {
827
827
  if (renderer && renderer.a) return renderer;
828
828
  }
829
829
  function normalizeAttrValue(value) {
830
- if (value || value === 0) return value === !0 ? "" : value + "";
830
+ if (isNotVoid(value)) return value === !0 ? "" : value + "";
831
831
  }
832
832
  function _lifecycle(scope, thisObj, index = 0) {
833
833
  let accessor = "K" + index, instance = scope[accessor];
package/dist/html.js CHANGED
@@ -982,6 +982,9 @@ function getEventHandlerName(name) {
982
982
  function isVoid(value) {
983
983
  return value == null || value === !1;
984
984
  }
985
+ function isNotVoid(value) {
986
+ return value != null && value !== !1;
987
+ }
985
988
  function normalizeDynamicRenderer(value) {
986
989
  if (value) {
987
990
  if (typeof value == "string") return value;
@@ -1611,7 +1614,7 @@ function _attr_input_value(scopeId, nodeAccessor, value, valueChange) {
1611
1614
  return valueChange && writeControlledScope(2, scopeId, nodeAccessor, void 0, valueChange), _attr("value", value);
1612
1615
  }
1613
1616
  function _attr_input_checked(scopeId, nodeAccessor, checked, checkedChange) {
1614
- return checkedChange && writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange), normalizeBoolAttrValue(checked) ? " checked" : "";
1617
+ return checkedChange && writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange), isNotVoid(checked) ? " checked" : "";
1615
1618
  }
1616
1619
  function _attr_input_checkedValue(scopeId, nodeAccessor, checkedValue, checkedValueChange, value) {
1617
1620
  let valueAttr = _attr("value", value);
@@ -1624,8 +1627,8 @@ function getCheckedValueRef(checkedValue) {
1624
1627
  }
1625
1628
  }
1626
1629
  function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange) {
1627
- let normalizedOpen = normalizeBoolAttrValue(open);
1628
- return openChange && writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen, openChange), normalizedOpen ? " open" : "";
1630
+ let normalizedOpen = isNotVoid(open);
1631
+ return openChange && writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen || void 0, openChange), normalizedOpen ? " open" : "";
1629
1632
  }
1630
1633
  function _attr_nonce() {
1631
1634
  return getChunk().boundary.state.nonceAttr;
@@ -1638,17 +1641,17 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
1638
1641
  switch (tagName) {
1639
1642
  case "input":
1640
1643
  if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange);
1641
- else if (data.checkedValue || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
1644
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
1642
1645
  else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange);
1643
1646
  else break;
1644
1647
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1645
1648
  break;
1646
1649
  case "select":
1647
1650
  case "textarea":
1648
- (data.value || data.valueChange) && (skip = /^value(?:Change)?$|[\s/>"'=]/);
1651
+ ("value" in data || data.valueChange) && (skip = /^value(?:Change)?$|[\s/>"'=]/);
1649
1652
  break;
1650
1653
  case "option":
1651
- data.value && (result += _attr_option_value(data.value), skip = /^value$|[\s/>"'=]/);
1654
+ "value" in data && (result += _attr_option_value(data.value), skip = /^value$|[\s/>"'=]/);
1652
1655
  break;
1653
1656
  case "details":
1654
1657
  case "dialog":
@@ -1731,9 +1734,6 @@ function normalizedValueMatches(a, b) {
1731
1734
  function normalizeStrAttrValue(value) {
1732
1735
  return value && value !== !0 || value === 0 ? value + "" : "";
1733
1736
  }
1734
- function normalizeBoolAttrValue(value) {
1735
- if (value != null && value !== !1) return !0;
1736
- }
1737
1737
  //#endregion
1738
1738
  //#region src/html/dynamic-tag.ts
1739
1739
  function _content(id, fn) {
package/dist/html.mjs CHANGED
@@ -981,6 +981,9 @@ function getEventHandlerName(name) {
981
981
  function isVoid(value) {
982
982
  return value == null || value === !1;
983
983
  }
984
+ function isNotVoid(value) {
985
+ return value != null && value !== !1;
986
+ }
984
987
  function normalizeDynamicRenderer(value) {
985
988
  if (value) {
986
989
  if (typeof value == "string") return value;
@@ -1610,7 +1613,7 @@ function _attr_input_value(scopeId, nodeAccessor, value, valueChange) {
1610
1613
  return valueChange && writeControlledScope(2, scopeId, nodeAccessor, void 0, valueChange), _attr("value", value);
1611
1614
  }
1612
1615
  function _attr_input_checked(scopeId, nodeAccessor, checked, checkedChange) {
1613
- return checkedChange && writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange), normalizeBoolAttrValue(checked) ? " checked" : "";
1616
+ return checkedChange && writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange), isNotVoid(checked) ? " checked" : "";
1614
1617
  }
1615
1618
  function _attr_input_checkedValue(scopeId, nodeAccessor, checkedValue, checkedValueChange, value) {
1616
1619
  let valueAttr = _attr("value", value);
@@ -1623,8 +1626,8 @@ function getCheckedValueRef(checkedValue) {
1623
1626
  }
1624
1627
  }
1625
1628
  function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange) {
1626
- let normalizedOpen = normalizeBoolAttrValue(open);
1627
- return openChange && writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen, openChange), normalizedOpen ? " open" : "";
1629
+ let normalizedOpen = isNotVoid(open);
1630
+ return openChange && writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen || void 0, openChange), normalizedOpen ? " open" : "";
1628
1631
  }
1629
1632
  function _attr_nonce() {
1630
1633
  return getChunk().boundary.state.nonceAttr;
@@ -1637,17 +1640,17 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
1637
1640
  switch (tagName) {
1638
1641
  case "input":
1639
1642
  if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange);
1640
- else if (data.checkedValue || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
1643
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
1641
1644
  else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange);
1642
1645
  else break;
1643
1646
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1644
1647
  break;
1645
1648
  case "select":
1646
1649
  case "textarea":
1647
- (data.value || data.valueChange) && (skip = /^value(?:Change)?$|[\s/>"'=]/);
1650
+ ("value" in data || data.valueChange) && (skip = /^value(?:Change)?$|[\s/>"'=]/);
1648
1651
  break;
1649
1652
  case "option":
1650
- data.value && (result += _attr_option_value(data.value), skip = /^value$|[\s/>"'=]/);
1653
+ "value" in data && (result += _attr_option_value(data.value), skip = /^value$|[\s/>"'=]/);
1651
1654
  break;
1652
1655
  case "details":
1653
1656
  case "dialog":
@@ -1730,9 +1733,6 @@ function normalizedValueMatches(a, b) {
1730
1733
  function normalizeStrAttrValue(value) {
1731
1734
  return value && value !== !0 || value === 0 ? value + "" : "";
1732
1735
  }
1733
- function normalizeBoolAttrValue(value) {
1734
- if (value != null && value !== !1) return !0;
1735
- }
1736
1736
  //#endregion
1737
1737
  //#region src/html/dynamic-tag.ts
1738
1738
  function _content(id, fn) {
@@ -239,6 +239,9 @@ function getEventHandlerName(name) {
239
239
  function isVoid(value) {
240
240
  return value == null || value === false;
241
241
  }
242
+ function isNotVoid(value) {
243
+ return value != null && value !== false;
244
+ }
242
245
  function normalizeDynamicRenderer(value) {
243
246
  if (value) {
244
247
  if (typeof value === "string") return value;
@@ -1932,7 +1935,7 @@ function _attr_input_value(scopeId, nodeAccessor, value, valueChange) {
1932
1935
  }
1933
1936
  function _attr_input_checked(scopeId, nodeAccessor, checked, checkedChange) {
1934
1937
  if (checkedChange) writeControlledScope(0, scopeId, nodeAccessor, void 0, checkedChange);
1935
- return normalizeBoolAttrValue(checked) ? " checked" : "";
1938
+ return isNotVoid(checked) ? " checked" : "";
1936
1939
  }
1937
1940
  function _attr_input_checkedValue(scopeId, nodeAccessor, checkedValue, checkedValueChange, value) {
1938
1941
  const valueAttr = _attr("value", value);
@@ -1951,8 +1954,8 @@ function getCheckedValueRef(checkedValue) {
1951
1954
  }
1952
1955
  }
1953
1956
  function _attr_details_or_dialog_open(scopeId, nodeAccessor, open, openChange) {
1954
- const normalizedOpen = normalizeBoolAttrValue(open);
1955
- if (openChange) writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen, openChange);
1957
+ const normalizedOpen = isNotVoid(open);
1958
+ if (openChange) writeControlledScope(4, scopeId, nodeAccessor, normalizedOpen || void 0, openChange);
1956
1959
  return normalizedOpen ? " open" : "";
1957
1960
  }
1958
1961
  function _attr(name, value) {
@@ -1965,17 +1968,17 @@ function _attrs(data, nodeAccessor, scopeId, tagName) {
1965
1968
  switch (tagName) {
1966
1969
  case "input":
1967
1970
  if (data.checkedChange) result += _attr_input_checked(scopeId, nodeAccessor, data.checked, data.checkedChange);
1968
- else if (data.checkedValue || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
1971
+ else if ("checkedValue" in data || data.checkedValueChange) result += _attr_input_checkedValue(scopeId, nodeAccessor, data.checkedValue, data.checkedValueChange, data.value);
1969
1972
  else if (data.valueChange) result += _attr_input_value(scopeId, nodeAccessor, data.value, data.valueChange);
1970
1973
  else break;
1971
1974
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$|[\s/>"'=]/;
1972
1975
  break;
1973
1976
  case "select":
1974
1977
  case "textarea":
1975
- if (data.value || data.valueChange) skip = /^value(?:Change)?$|[\s/>"'=]/;
1978
+ if ("value" in data || data.valueChange) skip = /^value(?:Change)?$|[\s/>"'=]/;
1976
1979
  break;
1977
1980
  case "option":
1978
- if (data.value) {
1981
+ if ("value" in data) {
1979
1982
  result += _attr_option_value(data.value);
1980
1983
  skip = /^value$|[\s/>"'=]/;
1981
1984
  }
@@ -2059,9 +2062,6 @@ function normalizedValueMatches(a, b) {
2059
2062
  function normalizeStrAttrValue(value) {
2060
2063
  return value && value !== true || value === 0 ? value + "" : "";
2061
2064
  }
2062
- function normalizeBoolAttrValue(value) {
2063
- if (value != null && value !== false) return true;
2064
- }
2065
2065
  //#endregion
2066
2066
  //#region src/html/dynamic-tag.ts
2067
2067
  const voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
@@ -3249,9 +3249,21 @@ function writeHTMLResumeStatements(path) {
3249
3249
  const writeSerializedBinding = (binding) => {
3250
3250
  const reason = getSerializeReason(section, binding);
3251
3251
  if (!reason) return;
3252
+ if (binding.noSerialize) {
3253
+ serializedLookup.delete(getScopeAccessor(binding));
3254
+ return;
3255
+ }
3252
3256
  const accessor = getScopeAccessor(binding);
3253
3257
  serializedLookup.delete(accessor);
3254
- serializedProperties.push(toObjectProperty(accessor, ifSerialized(reason, getDeclaredBindingExpression(binding))));
3258
+ let expr = getDeclaredBindingExpression(binding);
3259
+ if (binding.noSerializeProperties) {
3260
+ const props = [_marko_compiler.types.spreadElement(expr)];
3261
+ forEach(binding.noSerializeProperties, (prop) => {
3262
+ props.push(toObjectProperty(prop, _marko_compiler.types.identifier("undefined")));
3263
+ });
3264
+ expr = _marko_compiler.types.objectExpression(props);
3265
+ }
3266
+ serializedProperties.push(toObjectProperty(accessor, ifSerialized(reason, expr)));
3255
3267
  if (debug) {
3256
3268
  const { root, access } = getDebugScopeAccess(binding);
3257
3269
  const locExpr = root.loc && _marko_compiler.types.stringLiteral(`${root.loc.start.line}:${root.loc.start.column + 1}`);
@@ -4064,10 +4076,16 @@ function finalizeTagDownstreams(section) {
4064
4076
  function crawlSectionsAndSetBinding(tag, binding, properties, skip) {
4065
4077
  if (!skip) {
4066
4078
  const contentSection = getSectionForBody(tag.get("body"));
4067
- if (contentSection) contentSection.downstreamBinding = {
4068
- binding,
4069
- properties: concat(properties, "content")
4070
- };
4079
+ if (contentSection) {
4080
+ let target = binding;
4081
+ forEach(properties, (property) => {
4082
+ target = target?.propertyAliases.get(property);
4083
+ });
4084
+ contentSection.downstreamBinding = target && (target.noSerialize || includes(target.noSerializeProperties, "content")) ? false : {
4085
+ binding,
4086
+ properties: concat(properties, "content")
4087
+ };
4088
+ }
4071
4089
  }
4072
4090
  const attrTagLookup = analyzeAttributeTags(tag);
4073
4091
  if (!attrTagLookup) return;
@@ -4194,11 +4212,26 @@ var native_tag_default = {
4194
4212
  const nodeBinding = tagExtra[kNativeTagBinding] = createBinding("#" + getCanonicalTagName(tag), 0, tagSection, void 0, void 0, void 0, void 0, !!node.var);
4195
4213
  if (hasEventHandlers) (0, _marko_compiler_babel_utils.getProgram)().node.extra.isInteractive = true;
4196
4214
  if (spreadReferenceNodes) {
4215
+ const isMergedSpread = !!relatedControllable;
4197
4216
  if (relatedControllable && !relatedControllable.attrs.every(Boolean)) {
4198
4217
  for (const attr of relatedControllable.attrs) if (attr) spreadReferenceNodes.push(attr.value);
4199
4218
  relatedControllable = void 0;
4200
4219
  }
4201
- mergeReferences(tagSection, tag.node, spreadReferenceNodes);
4220
+ const spreadExtra = mergeReferences(tagSection, tag.node, spreadReferenceNodes);
4221
+ spreadExtra.nativeTagSpread = true;
4222
+ if (isMergedSpread) spreadExtra.nativeTagSpreadMerged = true;
4223
+ let carveProperties = getSpreadControllableValueProps(tagName);
4224
+ if (!tag.node.body.body.length && !isTextOnly && !(0, _marko_compiler_babel_utils.getTagDef)(tag)?.parseOptions?.openTagOnly && !seen.content) if (carveProperties) carveProperties.push("content");
4225
+ else carveProperties = ["content"];
4226
+ for (const node of spreadReferenceNodes) {
4227
+ const spreadBinding = node.extra?.spreadFrom;
4228
+ if (spreadBinding) {
4229
+ spreadBinding.noSerialize = true;
4230
+ if (carveProperties) {
4231
+ for (const property of carveProperties) if (!includes(spreadBinding.noSerializeProperties, property)) spreadBinding.noSerializeProperties = push(spreadBinding.noSerializeProperties, property);
4232
+ }
4233
+ }
4234
+ }
4202
4235
  } else relatedControllable = getRelatedControllable(tagName, seen);
4203
4236
  if (relatedControllable) mergeReferences(tagSection, relatedControllable.attrs.find(Boolean).value, relatedControllable.attrs.map((it) => it?.value));
4204
4237
  if (textPlaceholders) exprExtras = push(exprExtras, textPlaceholders.length === 1 ? textPlaceholders[0].extra ??= {} : mergeReferences(tagSection, textPlaceholders[0], textPlaceholders.slice(1)));
@@ -4428,6 +4461,19 @@ var native_tag_default = {
4428
4461
  }
4429
4462
  })
4430
4463
  };
4464
+ function getSpreadControllableValueProps(tagName) {
4465
+ switch (tagName) {
4466
+ case "input": return [
4467
+ "value",
4468
+ "checked",
4469
+ "checkedValue"
4470
+ ];
4471
+ case "select":
4472
+ case "textarea": return ["value"];
4473
+ case "details":
4474
+ case "dialog": return ["open"];
4475
+ }
4476
+ }
4431
4477
  function getRelatedControllable(tagName, attrs) {
4432
4478
  switch (tagName) {
4433
4479
  case "input":
@@ -5687,6 +5733,8 @@ function createBinding(name, type, refSection, upstreamAlias, property, excludeP
5687
5733
  closureSections: void 0,
5688
5734
  assignmentSections: void 0,
5689
5735
  excludeProperties,
5736
+ noSerialize: false,
5737
+ noSerializeProperties: void 0,
5690
5738
  sources: void 0,
5691
5739
  reads: /* @__PURE__ */ new Set(),
5692
5740
  aliases: /* @__PURE__ */ new Set(),
@@ -5993,8 +6041,22 @@ function finalizeReferences() {
5993
6041
  }
5994
6042
  }
5995
6043
  }
5996
- for (const binding of bindings) if (binding.type !== 0) {
5997
- if (pruneBinding(binding)) bindings.delete(binding);
6044
+ for (const binding of bindings) {
6045
+ if (binding.type !== 0) {
6046
+ if (pruneBinding(binding)) bindings.delete(binding);
6047
+ }
6048
+ if (binding.noSerialize) if (isPureSpreadResolved(binding)) if (hasAnyMemberAccess(binding)) {
6049
+ let kept = void 0;
6050
+ binding.noSerialize = false;
6051
+ forEach(binding.noSerializeProperties, (property) => {
6052
+ if (!isPropertyMemberAccessed(binding, property)) kept = push(kept, property);
6053
+ });
6054
+ binding.noSerializeProperties = kept;
6055
+ } else binding.noSerializeProperties = void 0;
6056
+ else {
6057
+ binding.noSerialize = false;
6058
+ binding.noSerializeProperties = void 0;
6059
+ }
5998
6060
  }
5999
6061
  forEachSection(finalizeTagDownstreams);
6000
6062
  for (const binding of bindings) {
@@ -6722,6 +6784,21 @@ function getAllSerializeReasonsForBinding(binding, properties) {
6722
6784
  }
6723
6785
  return reason;
6724
6786
  }
6787
+ function isPureSpreadResolved(binding) {
6788
+ for (const read of binding.reads) if (!read.nativeTagSpread || read.nativeTagSpreadMerged) return false;
6789
+ for (const alias of binding.aliases) if (!isPureSpreadResolved(alias)) return false;
6790
+ return true;
6791
+ }
6792
+ function hasAnyMemberAccess(binding) {
6793
+ if (binding.propertyAliases.size) return true;
6794
+ for (const alias of binding.aliases) if (hasAnyMemberAccess(alias)) return true;
6795
+ return false;
6796
+ }
6797
+ function isPropertyMemberAccessed(binding, property) {
6798
+ if (binding.propertyAliases.has(property)) return true;
6799
+ for (const alias of binding.aliases) if (isPropertyMemberAccessed(alias, property)) return true;
6800
+ return false;
6801
+ }
6725
6802
  function addNumericPropertiesUntil(props, len) {
6726
6803
  let result = props;
6727
6804
  for (let i = len; i--;) result = propsUtil.add(result, i + "");
@@ -8117,7 +8194,7 @@ function isStaticText(node) {
8117
8194
  case "MarkoText": return true;
8118
8195
  case "MarkoPlaceholder": if (node.escape) {
8119
8196
  const { confident, computed } = evaluate(node.value);
8120
- return confident && !isVoid(computed);
8197
+ return confident && isNotVoid(computed);
8121
8198
  } else return false;
8122
8199
  }
8123
8200
  }
@@ -37,6 +37,8 @@ export interface Binding {
37
37
  property: string | undefined;
38
38
  propertyAliases: Map<string, Binding>;
39
39
  excludeProperties: Opt<string>;
40
+ noSerialize: boolean;
41
+ noSerializeProperties: Opt<string>;
40
42
  upstreamAlias: Binding | undefined;
41
43
  restOffset: number | undefined;
42
44
  scopeOffset: Binding | undefined;
@@ -84,6 +86,8 @@ declare module "@marko/compiler/dist/types" {
84
86
  pruned?: true;
85
87
  isEffect?: true;
86
88
  spreadFrom?: Binding;
89
+ nativeTagSpread?: true;
90
+ nativeTagSpreadMerged?: true;
87
91
  merged?: NodeExtra;
88
92
  }
89
93
  interface FunctionExtra {
@@ -45,7 +45,7 @@ export interface Section {
45
45
  downstreamBinding: {
46
46
  binding: Binding;
47
47
  properties: Opt<string>;
48
- } | undefined;
48
+ } | false | undefined;
49
49
  hasAbortSignal: boolean;
50
50
  readsOwner: boolean;
51
51
  isBranch: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/runtime-tags",
3
- "version": "6.1.10",
3
+ "version": "6.1.11",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",