@mintjamsinc/ichigojs 0.1.63 → 0.1.64

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.
@@ -7597,18 +7597,25 @@ class VBindDirective {
7597
7597
  * Returns true when the target is a custom element and the binding should be
7598
7598
  * delivered as a property rather than an HTML attribute.
7599
7599
  *
7600
- * Two conditions trigger property delivery:
7600
+ * Three conditions trigger property delivery:
7601
7601
  * 1. The value is an object or array — serialising these to a string attribute
7602
7602
  * would lose type information.
7603
7603
  * 2. The element exposes a matching property accessor (e.g. a prop declared via
7604
7604
  * defineComponent), even when the value is a primitive.
7605
+ * 3. The element declares a matching prop in its static _props (case-insensitive
7606
+ * and kebab-case → camelCase tolerant), so primitive values reach the
7607
+ * reactive binding via the generated setter instead of being lost as a
7608
+ * plain HTML attribute that no attributeChangedCallback observes.
7605
7609
  */
7606
7610
  #isCustomElementProperty(element, name, value) {
7607
7611
  if (!element.tagName.includes('-')) {
7608
7612
  return false;
7609
7613
  }
7610
7614
  const isObjectOrArray = Array.isArray(value) || (typeof value === 'object' && value !== null);
7611
- return isObjectOrArray || name in element;
7615
+ if (isObjectOrArray || name in element) {
7616
+ return true;
7617
+ }
7618
+ return this.#findDeclaredProp(element, name) !== undefined;
7612
7619
  }
7613
7620
  /**
7614
7621
  * Resolves the actual property name on a custom element for a given
@@ -7624,20 +7631,25 @@ class VBindDirective {
7624
7631
  if (name in element) {
7625
7632
  return name;
7626
7633
  }
7627
- // Check declared _props from defineComponent / IchigoElement
7634
+ return this.#findDeclaredProp(element, name) ?? name;
7635
+ }
7636
+ /**
7637
+ * Looks up a declared prop on a custom element constructor whose name matches
7638
+ * the given attribute name, treating the comparison as case-insensitive and
7639
+ * tolerant of kebab-case → camelCase conversion. Returns the canonical prop
7640
+ * name (as declared) when a match is found, or undefined otherwise.
7641
+ */
7642
+ #findDeclaredProp(element, name) {
7628
7643
  const props = element.constructor._props;
7629
- if (Array.isArray(props)) {
7630
- const lowerName = name.toLowerCase();
7631
- const camelName = this.#kebabToCamel(lowerName);
7632
- const match = props.find(p => {
7633
- const lowerProp = p.toLowerCase();
7634
- return lowerProp === lowerName || lowerProp === camelName.toLowerCase() || p === camelName;
7635
- });
7636
- if (match) {
7637
- return match;
7638
- }
7644
+ if (!Array.isArray(props)) {
7645
+ return undefined;
7639
7646
  }
7640
- return name;
7647
+ const lowerName = name.toLowerCase();
7648
+ const camelLower = this.#kebabToCamel(lowerName).toLowerCase();
7649
+ return props.find(p => {
7650
+ const lowerProp = p.toLowerCase();
7651
+ return lowerProp === lowerName || lowerProp === camelLower;
7652
+ });
7641
7653
  }
7642
7654
  /**
7643
7655
  * Converts kebab-case to camelCase (e.g. `user-name` → `userName`).