@mintjamsinc/ichigojs 0.1.62 → 0.1.63

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 CHANGED
@@ -7621,7 +7621,9 @@
7621
7621
  * (lowercased) HTML attribute name. HTML attributes are always lowercase,
7622
7622
  * but custom element props are typically camelCase. This method checks the
7623
7623
  * element's declared _props (set by defineComponent) for a case-insensitive
7624
- * match, falling back to scanning the prototype's own property descriptors.
7624
+ * match against both the raw attribute name and its kebab-case → camelCase
7625
+ * conversion (so `user-name` resolves to `userName`), falling back to the
7626
+ * original name when no match is found.
7625
7627
  */
7626
7628
  #resolveCustomElementPropertyName(element, name) {
7627
7629
  // Fast path: exact match already exists
@@ -7632,13 +7634,23 @@
7632
7634
  const props = element.constructor._props;
7633
7635
  if (Array.isArray(props)) {
7634
7636
  const lowerName = name.toLowerCase();
7635
- const match = props.find(p => p.toLowerCase() === lowerName);
7637
+ const camelName = this.#kebabToCamel(lowerName);
7638
+ const match = props.find(p => {
7639
+ const lowerProp = p.toLowerCase();
7640
+ return lowerProp === lowerName || lowerProp === camelName.toLowerCase() || p === camelName;
7641
+ });
7636
7642
  if (match) {
7637
7643
  return match;
7638
7644
  }
7639
7645
  }
7640
7646
  return name;
7641
7647
  }
7648
+ /**
7649
+ * Converts kebab-case to camelCase (e.g. `user-name` → `userName`).
7650
+ */
7651
+ #kebabToCamel(str) {
7652
+ return str.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
7653
+ }
7642
7654
  /**
7643
7655
  * Checks if the attribute should be set as a DOM property.
7644
7656
  */