@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 +14 -2
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +14 -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 +14 -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
|
@@ -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
|
|
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
|
|
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
|
*/
|