@cscfi/csc-ui 4.0.0-alpha.27 → 4.0.0-alpha.28
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/csc-ui.js +9552 -8615
- package/dist/custom-elements.json +692 -6
- package/dist/docs/c-date-picker/usage.md +49 -0
- package/dist/docs/c-time-picker/usage.md +143 -0
- package/dist/styles/css/tailwind-theme.css +1 -0
- package/dist/styles/css/tokens.css +8 -0
- package/dist/vscode.css-custom-data.json +50 -0
- package/dist/vscode.html-custom-data.json +98 -2
- package/dist/web-types.json +330 -4
- package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +26 -5
- package/dist-types/components/c-date-picker/dates.d.ts +31 -2
- package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +199 -0
- package/dist-types/components/c-time-picker/times.d.ts +82 -0
- package/dist-types/index.d.ts +2 -1
- package/dist-types/shared/TypedField.vue.d.ts +40 -0
- package/dist-types/shared/inputMask.d.ts +9 -0
- package/dist-types/shared/useTypedField.d.ts +103 -0
- package/dist-types/tag-name-map.d.ts +106 -4
- package/package.json +1 -1
|
@@ -118,6 +118,51 @@ Availability that comes from a server can follow the calendar: load the
|
|
|
118
118
|
disabled dates of the month `change:month` names and assign `disabled-dates`
|
|
119
119
|
again.
|
|
120
120
|
|
|
121
|
+
## Months
|
|
122
|
+
|
|
123
|
+
With `type="month"` the field picks a year and a month instead of a day. The
|
|
124
|
+
value is an ISO `YYYY-MM` string — `'2026-03'` — or `{ start, end }` of them
|
|
125
|
+
under `range`, like the native `<input type="month">`:
|
|
126
|
+
|
|
127
|
+
```vue
|
|
128
|
+
<c-date-picker v-model="billing" label="Billing month" type="month" />
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The format is the `format` with its day left out, so one app default serves
|
|
132
|
+
both kinds of field: `dd.MM.yyyy` shows months as `MM.yyyy`, `yyyy-MM-dd` as
|
|
133
|
+
`yyyy-MM`. A `format` with no day, such as `MM/yyyy`, is used as given.
|
|
134
|
+
Typing is as lenient as for dates: `3.2026` and `032026` both commit as
|
|
135
|
+
`03.2026`. A full date bound as the value is shown as its month and emits
|
|
136
|
+
nothing; the next pick or commit emits the month.
|
|
137
|
+
|
|
138
|
+
The panel asks for the month first, then the year. It opens on the twelve
|
|
139
|
+
months under a "Month" label, with the selected month marked and focused.
|
|
140
|
+
Picking one collapses it to a summary row and the years unroll beneath it,
|
|
141
|
+
focused on the selected year — else this year, else the nearest year that can
|
|
142
|
+
be picked. Picking a year commits the month and closes the panel; pressing the
|
|
143
|
+
summary row goes back to the months. Both lists take the arrows, Home and End,
|
|
144
|
+
and Enter or Space to pick.
|
|
145
|
+
|
|
146
|
+
Under `range` the steps run twice, labelled "Start month", "Start year", "End
|
|
147
|
+
month" and "End year". The finished start shows as a summary row and is only
|
|
148
|
+
pending, as in the day grid: nothing is emitted until the end's year completes
|
|
149
|
+
the range, a range picked backwards is swapped, and dismissing the panel
|
|
150
|
+
discards the start.
|
|
151
|
+
|
|
152
|
+
`min` and `max` may be months or full dates; a full date counts by its month,
|
|
153
|
+
so `min="2026-03-15"` still allows March. A month is disabled only when every
|
|
154
|
+
one of its days is — by `min` and `max`, `disabled-dates` or
|
|
155
|
+
`is-date-disabled` — so a "no weekends" predicate disables no month, and a
|
|
156
|
+
span covering all of July disables July. In the month list a month is disabled
|
|
157
|
+
when no allowed year takes it; in the year list a year is disabled when the
|
|
158
|
+
picked month is disabled in it, so no pick leads to an empty list. The
|
|
159
|
+
predicate is asked about each day until one is enabled, so in most months it
|
|
160
|
+
runs once; one that disables nearly every day is asked many times when the
|
|
161
|
+
months open.
|
|
162
|
+
|
|
163
|
+
`change:month` names the displayed month of the day grid, so it is never
|
|
164
|
+
fired in month mode.
|
|
165
|
+
|
|
121
166
|
## Texts
|
|
122
167
|
|
|
123
168
|
Month and weekday names and each day's accessible name come from `texts` when
|
|
@@ -139,3 +184,7 @@ calendar. The field stays typeable at every width.
|
|
|
139
184
|
`c-text-field type="date"` remains the browser's own date input — no custom
|
|
140
185
|
calendar, the browser's format, and no ranges or disabled dates. Reach for
|
|
141
186
|
`c-date-picker` when the format, the calendar's look or those features matter.
|
|
187
|
+
`c-text-field` has no month type: for a year and a month, use
|
|
188
|
+
`type="month"` here.
|
|
189
|
+
|
|
190
|
+
`c-time-picker` is the same typeable field for times of day.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
A time field that takes a typed time, or opens hour and minute columns for picking one, or a start and end time under `range`.
|
|
2
|
+
|
|
3
|
+
## Value
|
|
4
|
+
|
|
5
|
+
The value is a time of day as an ISO `HH:mm` string on a 24-hour clock —
|
|
6
|
+
`'14:05'` — or `null` when the field is empty. It carries no seconds, no date
|
|
7
|
+
and no timezone, and whatever the displayed `format` it keeps this one shape:
|
|
8
|
+
a field showing `14.05` or `2:05 PM` holds `'14:05'`. Bind it with `v-model`,
|
|
9
|
+
or listen for `change`:
|
|
10
|
+
|
|
11
|
+
```vue
|
|
12
|
+
<c-time-picker v-model="time" label="Start time" />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Under `range` the value becomes `{ start, end }`. Either end may be `null`
|
|
16
|
+
while only one is set — `{ start: '09:00', end: null }` — and a range with
|
|
17
|
+
neither end is `null`.
|
|
18
|
+
|
|
19
|
+
## Typing
|
|
20
|
+
|
|
21
|
+
The field is typeable first: clicking into it or focusing it never opens the
|
|
22
|
+
columns. Text is read when the user presses Enter or leaves the input, never
|
|
23
|
+
per keystroke. The `format` prop sets how times are shown and read — a pattern
|
|
24
|
+
of the tokens `H` or `HH` (a 24-hour hour), `h` or `hh` (a 12-hour hour, which
|
|
25
|
+
needs the period `a`) and `mm`, with any separators. The default is `HH.mm`;
|
|
26
|
+
`HH:mm` and `h:mm a` are common alternatives. The format is an app default, so
|
|
27
|
+
an app can set it once with `applyDefaults({ 'c-time-picker': { format: 'HH:mm' } })`.
|
|
28
|
+
|
|
29
|
+
Typing follows the format as it goes: the separator appears on its own (`930`
|
|
30
|
+
shows `9.30`), an hour closes early when its first digit can start no
|
|
31
|
+
two-digit hour, any of `.`, `:` or a space typed in place of the separator
|
|
32
|
+
shows as the format's own, and in a 12-hour format a typed `a` or `p` fills in
|
|
33
|
+
the whole AM or PM text. Reading is lenient:
|
|
34
|
+
|
|
35
|
+
| Typed | Reads as |
|
|
36
|
+
| ------- | -------------------------------------------- |
|
|
37
|
+
| `9` | `09:00` — a bare hour is on the hour |
|
|
38
|
+
| `930` | `09:30` — three or four digits split |
|
|
39
|
+
| `9.3` | `09:03` — one minute digit is that minute |
|
|
40
|
+
| `2 pm` | `14:00` — a period makes the hour 12-hour |
|
|
41
|
+
| `14.00` | `14:00`, also in a 12-hour field (`2:00 PM`) |
|
|
42
|
+
|
|
43
|
+
In a 12-hour field an hour typed without a period reads as AM.
|
|
44
|
+
|
|
45
|
+
Text that names no time that can be picked — `25.00`, a time outside `min`
|
|
46
|
+
and `max` — is **bad input**: the text stays as the user typed it, the value
|
|
47
|
+
becomes `null`, and the host exposes the `bad-input` custom state and a
|
|
48
|
+
read-only `badInput` property. The component never shows an error of its own;
|
|
49
|
+
deciding whether bad input is an error, and saying so, is the consumer's
|
|
50
|
+
validation:
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<c-time-picker
|
|
54
|
+
v-model="time"
|
|
55
|
+
:error-message="error"
|
|
56
|
+
:valid="!error"
|
|
57
|
+
label="Start time"
|
|
58
|
+
@change:text="error = $event.target.badInput ? 'Enter a time as hh.mm' : ''"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Every commit of typed text fires `change:text` with the text as typed
|
|
63
|
+
(`{ start, end }` under `range`), whether or not it changed the value.
|
|
64
|
+
|
|
65
|
+
## The columns
|
|
66
|
+
|
|
67
|
+
The clock button at the field's trailing edge, or Alt+ArrowDown in the input,
|
|
68
|
+
opens the columns: hours and minutes side by side, and an AM/PM column in a
|
|
69
|
+
12-hour format. The panel is a dialog: focus moves onto the hour column —
|
|
70
|
+
the value's hour, or the current hour when the field is empty — and Tab
|
|
71
|
+
cycles through the columns until the panel closes.
|
|
72
|
+
|
|
73
|
+
Every pick commits at once and the panel stays open, so the hour can be fixed
|
|
74
|
+
after the minutes are picked. The selected row rests at the top of its column:
|
|
75
|
+
it opens there and returns there after each pick, and so does a minute a pick
|
|
76
|
+
fills in. Scrolling a column only looks; it never picks. Picking into an empty field fills in the rest:
|
|
77
|
+
minute `00`, and the hour the hour column rests on. Moving in a column is
|
|
78
|
+
picking — each arrow key press commits, so a `change` handler doing network
|
|
79
|
+
work should debounce.
|
|
80
|
+
|
|
81
|
+
| Key | In a column |
|
|
82
|
+
| ------------------- | ------------------------------------------ |
|
|
83
|
+
| ArrowUp / ArrowDown | Previous / next row |
|
|
84
|
+
| Home / End | First / last row |
|
|
85
|
+
| PageUp / PageDown | Five rows up / down |
|
|
86
|
+
| Space | Pick the focused row |
|
|
87
|
+
| Enter | Pick the focused row and close |
|
|
88
|
+
| Escape | Close; what was picked stays |
|
|
89
|
+
| Tab | Next column (the end switch under `range`) |
|
|
90
|
+
|
|
91
|
+
Focus returns to the input when the panel closes.
|
|
92
|
+
|
|
93
|
+
## Minute step
|
|
94
|
+
|
|
95
|
+
`minute-step` spaces the minute column's rows: `15` lists `00`, `15`, `30`
|
|
96
|
+
and `45`. It only shapes the column — a typed `14.07` commits as `14:07` and
|
|
97
|
+
shows as an extra row between `00` and `15`. Require a step with your own
|
|
98
|
+
validation if it matters.
|
|
99
|
+
|
|
100
|
+
## Min and max
|
|
101
|
+
|
|
102
|
+
`min` and `max` are ISO `HH:mm` times. Rows outside them are disabled — an
|
|
103
|
+
hour only when none of its minutes fit — and a typed time outside them is bad
|
|
104
|
+
input. A pick never leaves them: picking hour 9 at `10:15` with `min="09:30"`
|
|
105
|
+
commits `09:30`. A `min` later than `max` is not a range across midnight; it
|
|
106
|
+
is ignored with a console warning.
|
|
107
|
+
|
|
108
|
+
## Ranges
|
|
109
|
+
|
|
110
|
+
With `range` the field holds two inputs, the start and the end, in one field
|
|
111
|
+
box, and the panel shows a Start | End switch above the columns. It opens on
|
|
112
|
+
the end last typed in; each end commits on its own as it is picked.
|
|
113
|
+
|
|
114
|
+
An end earlier than the start is an **overnight range** — `22:00` to `06:00`
|
|
115
|
+
spans midnight — and is kept as it is, never swapped or flagged. Where a range
|
|
116
|
+
must stay within one day, check it in your validation; ISO times compare
|
|
117
|
+
correctly as strings:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const sameDay =
|
|
121
|
+
!value || !value.start || !value.end || value.start <= value.end;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Texts
|
|
125
|
+
|
|
126
|
+
The AM and PM texts come from `texts` when given, then from the browser's
|
|
127
|
+
`Intl` data for the page's `lang`, then from the English built-ins — so a page
|
|
128
|
+
with `<html lang="fi">` shows `ap.` and `ip.` without any configuration. The
|
|
129
|
+
button, column and range labels are English unless `texts` replaces them. Set
|
|
130
|
+
them app-wide with `applyDefaults({ 'c-time-picker': { texts } })`.
|
|
131
|
+
|
|
132
|
+
## Narrow viewports
|
|
133
|
+
|
|
134
|
+
On a viewport narrower than 760px the columns open as a **fullscreen panel**:
|
|
135
|
+
a heading row with the field's `label` and a close button above the columns.
|
|
136
|
+
There the selected row rests in the middle of its column instead of the top.
|
|
137
|
+
The field stays typeable at every width.
|
|
138
|
+
|
|
139
|
+
## Related
|
|
140
|
+
|
|
141
|
+
`c-date-picker` is the same field for calendar dates. `c-text-field
|
|
142
|
+
type="time"` remains the browser's own time input — no columns, the browser's
|
|
143
|
+
format, and no ranges.
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
--color-on-surface: var(--c-on-surface);
|
|
33
33
|
--color-on-surface-muted: var(--c-on-surface-muted);
|
|
34
34
|
--color-on-surface-faint: var(--c-on-surface-faint);
|
|
35
|
+
--color-on-surface-disabled: var(--c-on-surface-disabled);
|
|
35
36
|
--color-on-surface-sunken: var(--c-on-surface-sunken);
|
|
36
37
|
--color-border: var(--c-border);
|
|
37
38
|
--color-border-strong: var(--c-border-strong);
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
--c-on-surface: var(--c-primary-900);
|
|
171
171
|
--c-on-surface-muted: var(--c-tertiary-500);
|
|
172
172
|
--c-on-surface-faint: var(--c-tertiary-500);
|
|
173
|
+
--c-on-surface-disabled: var(--c-tertiary-300);
|
|
173
174
|
--c-on-surface-sunken: var(--c-primary-700);
|
|
174
175
|
--c-border: var(--c-tertiary-200);
|
|
175
176
|
--c-border-strong: var(--c-tertiary-600);
|
|
@@ -268,6 +269,7 @@
|
|
|
268
269
|
--c-on-surface: var(--c-slate-100);
|
|
269
270
|
--c-on-surface-muted: var(--c-slate-300);
|
|
270
271
|
--c-on-surface-faint: var(--c-slate-400);
|
|
272
|
+
--c-on-surface-disabled: var(--c-slate-500);
|
|
271
273
|
--c-on-surface-sunken: var(--c-slate-100);
|
|
272
274
|
--c-border: var(--c-slate-700);
|
|
273
275
|
--c-border-strong: var(--c-slate-400);
|
|
@@ -367,6 +369,7 @@
|
|
|
367
369
|
--c-on-surface: var(--c-slate-100);
|
|
368
370
|
--c-on-surface-muted: var(--c-slate-300);
|
|
369
371
|
--c-on-surface-faint: var(--c-slate-400);
|
|
372
|
+
--c-on-surface-disabled: var(--c-slate-500);
|
|
370
373
|
--c-on-surface-sunken: var(--c-slate-100);
|
|
371
374
|
--c-border: var(--c-slate-700);
|
|
372
375
|
--c-border-strong: var(--c-slate-400);
|
|
@@ -472,6 +475,7 @@
|
|
|
472
475
|
--c-on-surface: var(--c-slate-100);
|
|
473
476
|
--c-on-surface-muted: var(--c-slate-300);
|
|
474
477
|
--c-on-surface-faint: var(--c-slate-400);
|
|
478
|
+
--c-on-surface-disabled: var(--c-slate-500);
|
|
475
479
|
--c-on-surface-sunken: var(--c-slate-100);
|
|
476
480
|
--c-border: var(--c-slate-700);
|
|
477
481
|
--c-border-strong: var(--c-slate-400);
|
|
@@ -571,6 +575,7 @@
|
|
|
571
575
|
--c-on-surface: var(--c-primary-900);
|
|
572
576
|
--c-on-surface-muted: var(--c-tertiary-500);
|
|
573
577
|
--c-on-surface-faint: var(--c-tertiary-500);
|
|
578
|
+
--c-on-surface-disabled: var(--c-tertiary-300);
|
|
574
579
|
--c-on-surface-sunken: var(--c-primary-700);
|
|
575
580
|
--c-border: var(--c-tertiary-200);
|
|
576
581
|
--c-border-strong: var(--c-tertiary-600);
|
|
@@ -675,6 +680,7 @@
|
|
|
675
680
|
--c-on-surface: var(--c-primary-900);
|
|
676
681
|
--c-on-surface-muted: var(--c-tertiary-500);
|
|
677
682
|
--c-on-surface-faint: var(--c-tertiary-500);
|
|
683
|
+
--c-on-surface-disabled: var(--c-tertiary-300);
|
|
678
684
|
--c-on-surface-sunken: var(--c-primary-700);
|
|
679
685
|
--c-border: var(--c-tertiary-200);
|
|
680
686
|
--c-border-strong: var(--c-tertiary-600);
|
|
@@ -774,6 +780,7 @@
|
|
|
774
780
|
--c-on-surface: var(--c-slate-100);
|
|
775
781
|
--c-on-surface-muted: var(--c-slate-300);
|
|
776
782
|
--c-on-surface-faint: var(--c-slate-400);
|
|
783
|
+
--c-on-surface-disabled: var(--c-slate-500);
|
|
777
784
|
--c-on-surface-sunken: var(--c-slate-100);
|
|
778
785
|
--c-border: var(--c-slate-700);
|
|
779
786
|
--c-border-strong: var(--c-slate-400);
|
|
@@ -933,6 +940,7 @@ c-tabs:not(:defined),
|
|
|
933
940
|
c-tag:not(:defined),
|
|
934
941
|
c-tags:not(:defined),
|
|
935
942
|
c-text-field:not(:defined),
|
|
943
|
+
c-time-picker:not(:defined),
|
|
936
944
|
c-toast:not(:defined),
|
|
937
945
|
c-toasts:not(:defined),
|
|
938
946
|
c-toolbar:not(:defined),
|
|
@@ -318,6 +318,14 @@
|
|
|
318
318
|
"name": "::part(option)",
|
|
319
319
|
"description": "One month or year in the list"
|
|
320
320
|
},
|
|
321
|
+
{
|
|
322
|
+
"name": "::part(step-label)",
|
|
323
|
+
"description": "The label above the current list under `type=\"month\"`: month or year, and under `range` start or end"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"name": "::part(step-summary)",
|
|
327
|
+
"description": "A finished step under `type=\"month\"`, its label and pick; pressing it returns to that step"
|
|
328
|
+
},
|
|
321
329
|
{
|
|
322
330
|
"name": "::part(root)",
|
|
323
331
|
"description": "The separator line element itself"
|
|
@@ -828,6 +836,48 @@
|
|
|
828
836
|
"name": "::part(mask-guide)",
|
|
829
837
|
"description": "The faint rest of the input mask, shown behind the typed text"
|
|
830
838
|
},
|
|
839
|
+
{
|
|
840
|
+
"name": "::part(input)",
|
|
841
|
+
"description": "The text input; under `range` both the start and the end input"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"name": "::part(separator)",
|
|
845
|
+
"description": "The dash between the start and end inputs under `range`"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"name": "::part(panel)",
|
|
849
|
+
"description": "The top-layer popover container anchored below the field"
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
"name": "::part(card)",
|
|
853
|
+
"description": "The dialog surface inside the panel holding the columns"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"name": "::part(heading-row)",
|
|
857
|
+
"description": "The top row of the fullscreen panel (narrow viewports): the field label as heading and the close button"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"name": "::part(heading)",
|
|
861
|
+
"description": "The field label naming the fullscreen panel"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "::part(close)",
|
|
865
|
+
"description": "The close button of the fullscreen panel"
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"name": "::part(end-switch)",
|
|
869
|
+
"description": "The Start | End switch above the columns under `range`"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"name": "::part(end-tab)",
|
|
873
|
+
"description": "One end's button in the end switch"
|
|
874
|
+
},
|
|
875
|
+
{ "name": "::part(columns)", "description": "The row of time columns" },
|
|
876
|
+
{
|
|
877
|
+
"name": "::part(column)",
|
|
878
|
+
"description": "One time column: hours, minutes or AM/PM"
|
|
879
|
+
},
|
|
880
|
+
{ "name": "::part(option)", "description": "One row of a time column" },
|
|
831
881
|
{
|
|
832
882
|
"name": "::part(root)",
|
|
833
883
|
"description": "The toast's outer box: the inverted-surface pill carrying the shadow"
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
},
|
|
506
506
|
{
|
|
507
507
|
"name": "c-date-picker",
|
|
508
|
-
"description": "A date field that takes a typed date, or opens a calendar panel for picking one, or a start and end date under `range`.\n---\n\n\n### **Events:**\n - **change** - Fired when the value changes — a day or range is picked, typed text is\ncommitted, or the field is cleared — carrying the new value: an ISO\ndate, `{ start, end }` under `range`, or `null`.\n- **change:month** - Fired with the displayed month as `YYYY-MM` whenever it changes, and\nwhen the panel opens — the signal to load that month's `disabled-dates`.\n- **change:text** - Fired on every commit of typed text (Enter or leaving the input) with the\ntext as typed — `{ start, end }` under `range`. Read `badInput` to tell\nwhether it named a date that can be picked.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `change` with the same detail — the `v-model` contract.\n\n### **CSS Parts:**\n - **input** - The text input; under `range` both the start and the end input\n- **separator** - The dash between the start and end inputs under `range`\n- **panel** - The top-layer popover container anchored below the field\n- **card** - The dialog surface inside the panel holding the header and the calendar body\n- **heading-row** - The top row of the fullscreen panel (narrow viewports): the field label as heading and the close button\n- **heading** - The field label naming the fullscreen panel\n- **close** - The close button of the fullscreen panel\n- **header** - The row of month and year controls above the calendar body\n- **previous-month** - The arrow to the previous month\n- **next-month** - The arrow to the next month\n- **month-button** - The button showing the displayed month that opens the month list\n- **previous-year** - The arrow to the same month a year earlier\n- **next-year** - The arrow to the same month a year later\n- **year-button** - The button showing the displayed year that opens the year list\n- **grid** - The day grid of the displayed month\n- **weekday** - A weekday column head in the grid\n- **week-number** - An ISO week number beside a grid row (`show-week-numbers`)\n- **cell** - One day's cell in the grid\n- **day** - The circle showing a day's number inside its cell\n- **range-band** - The strip joining a range's days behind their circles\n- **list** - The month or year list swapped in for the grid\n- **option** - One month or year in the list",
|
|
508
|
+
"description": "A date field that takes a typed date, or opens a calendar panel for picking one, or a start and end date under `range`.\n---\n\n\n### **Events:**\n - **change** - Fired when the value changes — a day or range is picked, typed text is\ncommitted, or the field is cleared — carrying the new value: an ISO\ndate, `{ start, end }` under `range`, or `null`.\n- **change:month** - Fired with the displayed month as `YYYY-MM` whenever it changes, and\nwhen the panel opens — the signal to load that month's `disabled-dates`.\n- **change:text** - Fired on every commit of typed text (Enter or leaving the input) with the\ntext as typed — `{ start, end }` under `range`. Read `badInput` to tell\nwhether it named a date that can be picked.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `change` with the same detail — the `v-model` contract.\n\n### **CSS Parts:**\n - **input** - The text input; under `range` both the start and the end input\n- **separator** - The dash between the start and end inputs under `range`\n- **panel** - The top-layer popover container anchored below the field\n- **card** - The dialog surface inside the panel holding the header and the calendar body\n- **heading-row** - The top row of the fullscreen panel (narrow viewports): the field label as heading and the close button\n- **heading** - The field label naming the fullscreen panel\n- **close** - The close button of the fullscreen panel\n- **header** - The row of month and year controls above the calendar body\n- **previous-month** - The arrow to the previous month\n- **next-month** - The arrow to the next month\n- **month-button** - The button showing the displayed month that opens the month list\n- **previous-year** - The arrow to the same month a year earlier\n- **next-year** - The arrow to the same month a year later\n- **year-button** - The button showing the displayed year that opens the year list\n- **grid** - The day grid of the displayed month\n- **weekday** - A weekday column head in the grid\n- **week-number** - An ISO week number beside a grid row (`show-week-numbers`)\n- **cell** - One day's cell in the grid\n- **day** - The circle showing a day's number inside its cell\n- **range-band** - The strip joining a range's days behind their circles\n- **list** - The month or year list swapped in for the grid\n- **option** - One month or year in the list\n- **step-label** - The label above the current list under `type=\"month\"`: month or year, and under `range` start or end\n- **step-summary** - A finished step under `type=\"month\"`, its label and pick; pressing it returns to that step",
|
|
509
509
|
"attributes": [
|
|
510
510
|
{
|
|
511
511
|
"name": "clearable",
|
|
@@ -594,6 +594,11 @@
|
|
|
594
594
|
"description": "Field height: the 52px default (the shared control height) or the 36px `small` box",
|
|
595
595
|
"values": [{ "name": "default" }, { "name": "small" }]
|
|
596
596
|
},
|
|
597
|
+
{
|
|
598
|
+
"name": "type",
|
|
599
|
+
"description": "What the field picks: a calendar date, or a year and a month\n(`'YYYY-MM'`)",
|
|
600
|
+
"values": [{ "name": "date" }, { "name": "month" }]
|
|
601
|
+
},
|
|
597
602
|
{
|
|
598
603
|
"name": "valid",
|
|
599
604
|
"description": "Set the validity of the field",
|
|
@@ -601,7 +606,7 @@
|
|
|
601
606
|
},
|
|
602
607
|
{
|
|
603
608
|
"name": "value",
|
|
604
|
-
"description": "The date as an ISO `YYYY-MM-DD` string, or `{ start, end }` under
|
|
609
|
+
"description": "The date as an ISO `YYYY-MM-DD` string (an ISO `YYYY-MM` month under\n`type=\"month\"`), or `{ start, end }` under `range`; `null` when empty",
|
|
605
610
|
"values": [{ "name": "CDatePickerValue" }]
|
|
606
611
|
}
|
|
607
612
|
],
|
|
@@ -2158,6 +2163,97 @@
|
|
|
2158
2163
|
],
|
|
2159
2164
|
"references": []
|
|
2160
2165
|
},
|
|
2166
|
+
{
|
|
2167
|
+
"name": "c-time-picker",
|
|
2168
|
+
"description": "A time field that takes a typed time, or opens hour and minute columns for picking one, or a start and end time under `range`.\n---\n\n\n### **Events:**\n - **change** - Fired when the value changes — a row is picked or moved to in a column,\ntyped text is committed, or the field is cleared — carrying the new\nvalue: an ISO `HH:mm` time, `{ start, end }` under `range`, or `null`.\n- **change:text** - Fired on every commit of typed text (Enter or leaving the input) with the\ntext as typed — `{ start, end }` under `range`. Read `badInput` to tell\nwhether it named a time that can be picked.\n- **input** - Native bubbling input event dispatched alongside every value change so a\nplain `v-model` stays in sync. Carries no detail.\n- **update:value** - Fired alongside `change` with the same detail — the `v-model` contract.\n\n### **CSS Parts:**\n - **input** - The text input; under `range` both the start and the end input\n- **separator** - The dash between the start and end inputs under `range`\n- **panel** - The top-layer popover container anchored below the field\n- **card** - The dialog surface inside the panel holding the columns\n- **heading-row** - The top row of the fullscreen panel (narrow viewports): the field label as heading and the close button\n- **heading** - The field label naming the fullscreen panel\n- **close** - The close button of the fullscreen panel\n- **end-switch** - The Start | End switch above the columns under `range`\n- **end-tab** - One end's button in the end switch\n- **columns** - The row of time columns\n- **column** - One time column: hours, minutes or AM/PM\n- **option** - One row of a time column",
|
|
2169
|
+
"attributes": [
|
|
2170
|
+
{
|
|
2171
|
+
"name": "clearable",
|
|
2172
|
+
"description": "Make the value clearable",
|
|
2173
|
+
"values": []
|
|
2174
|
+
},
|
|
2175
|
+
{
|
|
2176
|
+
"name": "disabled",
|
|
2177
|
+
"description": "Disable the field",
|
|
2178
|
+
"values": []
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
"name": "error-message",
|
|
2182
|
+
"description": "Error message shown in place of the hint while the field is invalid",
|
|
2183
|
+
"values": []
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
"name": "format",
|
|
2187
|
+
"description": "How times are shown and read from typing: a pattern of the tokens `H`,\n`HH` (24-hour), `h`, `hh` (12-hour, with the period `a`) and `mm` with\nany separators, e.g. `HH:mm` or `h:mm a`",
|
|
2188
|
+
"values": []
|
|
2189
|
+
},
|
|
2190
|
+
{
|
|
2191
|
+
"name": "hide-details",
|
|
2192
|
+
"description": "Hide the hint and error messages",
|
|
2193
|
+
"values": []
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
"name": "hint",
|
|
2197
|
+
"description": "Hint text for the field",
|
|
2198
|
+
"values": []
|
|
2199
|
+
},
|
|
2200
|
+
{ "name": "host-id", "description": "Id of the element", "values": [] },
|
|
2201
|
+
{ "name": "label", "description": "Element label", "values": [] },
|
|
2202
|
+
{
|
|
2203
|
+
"name": "label-on-top",
|
|
2204
|
+
"description": "Label on top of the field",
|
|
2205
|
+
"values": []
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
"name": "max",
|
|
2209
|
+
"description": "The latest time that can be picked or typed, as an ISO `HH:mm` time",
|
|
2210
|
+
"values": []
|
|
2211
|
+
},
|
|
2212
|
+
{
|
|
2213
|
+
"name": "min",
|
|
2214
|
+
"description": "The earliest time that can be picked or typed, as an ISO `HH:mm` time;\na `min` after `max` is invalid and both are ignored",
|
|
2215
|
+
"values": []
|
|
2216
|
+
},
|
|
2217
|
+
{
|
|
2218
|
+
"name": "minute-step",
|
|
2219
|
+
"description": "Minutes between the minute column's rows; typed times need not fall on\nthe step",
|
|
2220
|
+
"values": []
|
|
2221
|
+
},
|
|
2222
|
+
{ "name": "name", "description": "Input field name", "values": [] },
|
|
2223
|
+
{
|
|
2224
|
+
"name": "placeholder",
|
|
2225
|
+
"description": "Placeholder of the input; the `format` pattern when empty",
|
|
2226
|
+
"values": []
|
|
2227
|
+
},
|
|
2228
|
+
{
|
|
2229
|
+
"name": "range",
|
|
2230
|
+
"description": "Pick a range: the value becomes `{ start, end }` and the field holds two\ninputs",
|
|
2231
|
+
"values": []
|
|
2232
|
+
},
|
|
2233
|
+
{
|
|
2234
|
+
"name": "required",
|
|
2235
|
+
"description": "Set the field as required",
|
|
2236
|
+
"values": []
|
|
2237
|
+
},
|
|
2238
|
+
{ "name": "shadow", "description": "Shadow variant", "values": [] },
|
|
2239
|
+
{
|
|
2240
|
+
"name": "size",
|
|
2241
|
+
"description": "Field height: the 52px default (the shared control height) or the 36px `small` box",
|
|
2242
|
+
"values": [{ "name": "default" }, { "name": "small" }]
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
"name": "valid",
|
|
2246
|
+
"description": "Set the validity of the field",
|
|
2247
|
+
"values": []
|
|
2248
|
+
},
|
|
2249
|
+
{
|
|
2250
|
+
"name": "value",
|
|
2251
|
+
"description": "The time as an ISO `HH:mm` string on a 24-hour clock, or `{ start, end }`\nunder `range`; `null` when empty",
|
|
2252
|
+
"values": [{ "name": "CTimePickerValue" }]
|
|
2253
|
+
}
|
|
2254
|
+
],
|
|
2255
|
+
"references": []
|
|
2256
|
+
},
|
|
2161
2257
|
{
|
|
2162
2258
|
"name": "c-toast",
|
|
2163
2259
|
"description": "A single toast notification, rendered and managed by c-toasts\n---\n\n\n### **Events:**\n - **close** - Fired once the toast's leave transition has finished (after a manual\ndismiss or the auto-close timer), carrying the dismissed toast's message\nobject.\n\n### **Slots:**\n - **default** - Custom toast content, shown when the message is flagged `custom`\n\n### **CSS Parts:**\n - **root** - The toast's outer box: the inverted-surface pill carrying the shadow\n- **custom** - Wrapper shown for custom messages in place of the standard item layout\n- **content** - The message body holding the title and text, or the slotted custom content\n- **item** - Row layout of a standard toast: status badge, message body and dismiss button\n- **badge** - The circular tinted badge holding the status icon\n- **dismiss** - The dismiss button (icon-only, or labelled when the message sets `closeText`)\n- **progress** - The track of the auto-close progress bar",
|