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