@sveltia/cms 0.141.0 → 0.142.0
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/sveltia-cms.js +229 -229
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +239 -239
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/schema/sveltia-cms.json +1 -1
- package/types/public.d.ts +41 -3
package/types/public.d.ts
CHANGED
|
@@ -587,6 +587,10 @@ export type ComputeFieldProps = {
|
|
|
587
587
|
* Compute field definition.
|
|
588
588
|
*/
|
|
589
589
|
export type ComputeField = CommonFieldProps & VisibleFieldProps & ComputeFieldProps;
|
|
590
|
+
/**
|
|
591
|
+
* DateTime input type. It’s based on the supported date/time input types defined in the HTML spec.
|
|
592
|
+
*/
|
|
593
|
+
export type DateTimeInputType = "datetime-local" | "date" | "time";
|
|
590
594
|
/**
|
|
591
595
|
* DateTime field properties.
|
|
592
596
|
*/
|
|
@@ -600,6 +604,38 @@ export type DateTimeFieldProps = {
|
|
|
600
604
|
* or `{{now}}` to populate the current date/time. Default: empty string.
|
|
601
605
|
*/
|
|
602
606
|
default?: string;
|
|
607
|
+
/**
|
|
608
|
+
* The
|
|
609
|
+
* [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#input_types)
|
|
610
|
+
* HTML attribute value for the date/time input. If `type` is set to `date`, the input will only
|
|
611
|
+
* accept date values and the time part will be disabled. If `type` is set to `time`, the input will
|
|
612
|
+
* only accept time values and the date part will be disabled. Default: `datetime-local`, which
|
|
613
|
+
* accepts both date and time values.
|
|
614
|
+
*/
|
|
615
|
+
type?: DateTimeInputType;
|
|
616
|
+
/**
|
|
617
|
+
* The
|
|
618
|
+
* [`min`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/min) HTML
|
|
619
|
+
* attribute value for the date/time input. The expected format depends on the `type` option:
|
|
620
|
+
* `YYYY-MM-DDTHH:mm` for `datetime-local`, `YYYY-MM-DD` for `date`, and `HH:mm` for `time`.
|
|
621
|
+
*/
|
|
622
|
+
min?: string;
|
|
623
|
+
/**
|
|
624
|
+
* The
|
|
625
|
+
* [`max`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/max) HTML
|
|
626
|
+
* attribute value for the date/time input. The expected format depends on the `type` option:
|
|
627
|
+
* `YYYY-MM-DDTHH:mm` for `datetime-local`, `YYYY-MM-DD` for `date`, and `HH:mm` for `time`.
|
|
628
|
+
*/
|
|
629
|
+
max?: string;
|
|
630
|
+
/**
|
|
631
|
+
* The
|
|
632
|
+
* [`step`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/step) HTML
|
|
633
|
+
* attribute value for the date/time input. Accepts a positive integer or `'any'`. For
|
|
634
|
+
* `datetime-local` and `time` inputs, the integer represents the step in seconds (e.g. `300` for
|
|
635
|
+
* 5-minute steps). For `date` inputs, the integer represents the step in days (e.g. `7` for weekly
|
|
636
|
+
* steps). Default: `60` seconds for `datetime-local` and `time`; `1` day for `date`.
|
|
637
|
+
*/
|
|
638
|
+
step?: number | "any";
|
|
603
639
|
/**
|
|
604
640
|
* Storage format written in [Day.js
|
|
605
641
|
* tokens](https://day.js.org/docs/en/display/format). Default: ISO 8601 format.
|
|
@@ -609,14 +645,16 @@ export type DateTimeFieldProps = {
|
|
|
609
645
|
* Date storage format written in [Day.js
|
|
610
646
|
* tokens](https://day.js.org/docs/en/display/format) if the value is a string and the `format`
|
|
611
647
|
* option is not defined. If `true`, ISO 8601 format is used unless the `format` option is defined.
|
|
612
|
-
* If `false`, date input/output is disabled.
|
|
648
|
+
* If `false`, date input/output is disabled. This option is available for backward compatibility
|
|
649
|
+
* with Netlify CMS; use the `format` or `type` option instead.
|
|
613
650
|
*/
|
|
614
651
|
date_format?: string | boolean;
|
|
615
652
|
/**
|
|
616
653
|
* Time storage format written in [Day.js
|
|
617
654
|
* tokens](https://day.js.org/docs/en/display/format) if the value is a string and the `format`
|
|
618
655
|
* option is not defined. If `true`, ISO 8601 format is used unless the `format` option is defined.
|
|
619
|
-
* If `false`, time input/output is disabled.
|
|
656
|
+
* If `false`, time input/output is disabled. This option is available for backward compatibility
|
|
657
|
+
* with Netlify CMS; use the `format` or `type` option instead.
|
|
620
658
|
*/
|
|
621
659
|
time_format?: string | boolean;
|
|
622
660
|
/**
|
|
@@ -1211,7 +1249,7 @@ export type MultiValueField = MediaField | RelationField | SelectField;
|
|
|
1211
1249
|
/**
|
|
1212
1250
|
* Field types that have the `min` and `max` options.
|
|
1213
1251
|
*/
|
|
1214
|
-
export type MinMaxValueField = MultiValueField | ListField | NumberField;
|
|
1252
|
+
export type MinMaxValueField = MultiValueField | DateTimeField | ListField | NumberField;
|
|
1215
1253
|
/**
|
|
1216
1254
|
* Field types that have subfields.
|
|
1217
1255
|
*/
|