cotomy 2.0.1 → 2.0.2
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/README.md +2 -0
- package/dist/browser/cotomy.js +2 -2
- package/dist/browser/cotomy.js.map +1 -1
- package/dist/browser/cotomy.min.js +1 -1
- package/dist/browser/cotomy.min.js.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/api.js +2 -2
- package/dist/esm/api.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -271,6 +271,8 @@ The Form layer builds on `CotomyElement` for common form flows.
|
|
|
271
271
|
- `utc` — Treats the value as UTC (or appends `Z` when missing) and formats with `data-cotomy-format` (default `YYYY/MM/DD HH:mm`). By default it renders in local time; set `data-cotomy-timezone` (element or ancestor) to render in a specific IANA timezone.
|
|
272
272
|
- `date` — Renders local dates with `data-cotomy-format` (default `YYYY/MM/DD`) when the input is a valid `Date` value. By default it renders in local time; set `data-cotomy-timezone` (element or ancestor) to render in a specific IANA timezone.
|
|
273
273
|
|
|
274
|
+
`data-cotomy-bindtype` values are matched case-insensitively and surrounding whitespace is ignored. Custom renderers registered through `renderer(type, callback)` are stored with lowercase keys. If you override the protected `renderers` map directly, return lowercase keys such as `date` or `customtype`.
|
|
275
|
+
|
|
274
276
|
### UTC Renderer
|
|
275
277
|
|
|
276
278
|
- Supports ISO 8601 offsets (`+09:00`, `-05:00`)
|
package/dist/browser/cotomy.js
CHANGED
|
@@ -3154,7 +3154,7 @@ class CotomyViewRenderer {
|
|
|
3154
3154
|
this._initialized = false;
|
|
3155
3155
|
}
|
|
3156
3156
|
renderer(type, callback) {
|
|
3157
|
-
this._renderers[type] = callback;
|
|
3157
|
+
this._renderers[type.trim().toLowerCase()] = callback;
|
|
3158
3158
|
return this;
|
|
3159
3159
|
}
|
|
3160
3160
|
get renderers() {
|
|
@@ -3239,7 +3239,7 @@ class CotomyViewRenderer {
|
|
|
3239
3239
|
if (CotomyDebugSettings.isEnabled(CotomyDebugFeature.Bind)) {
|
|
3240
3240
|
console.debug(`Binding data to element [data-cotomy-bind="${propertyName}"]:`, value);
|
|
3241
3241
|
}
|
|
3242
|
-
const type = element.attribute("data-cotomy-bindtype")?.toLowerCase();
|
|
3242
|
+
const type = element.attribute("data-cotomy-bindtype")?.trim().toLowerCase();
|
|
3243
3243
|
if (type && this.renderers[type]) {
|
|
3244
3244
|
this.renderers[type](element, value);
|
|
3245
3245
|
}
|