@tzslot/angular 0.1.0-beta.0 → 1.1.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/README.md +48 -5
- package/fesm2022/tzslot-angular.mjs +698 -47
- package/fesm2022/tzslot-angular.mjs.map +1 -1
- package/package.json +6 -6
- package/types/tzslot-angular.d.ts +462 -23
package/README.md
CHANGED
|
@@ -19,8 +19,8 @@ what the clock faces suggest.
|
|
|
19
19
|
|---|---|
|
|
20
20
|
| `@tzslot/core` | The arithmetic. No DOM, no framework — usable on a server too. |
|
|
21
21
|
| `@tzslot/dom` | Every widget, in plain DOM. Works in any framework, or none. |
|
|
22
|
-
| `@tzslot/angular` | Angular components over `@tzslot/dom`: signals, forms, zoneless or not. Angular 18 to
|
|
23
|
-
| `@tzslot/theme` | Optional. CSS (or Sass) setting the widgets' colours; light, dark, high contrast, a Tailwind v4
|
|
22
|
+
| `@tzslot/angular` | Angular components over `@tzslot/dom`: signals, forms, zoneless or not. Angular 18 to 22. |
|
|
23
|
+
| `@tzslot/theme` | Optional. CSS (or Sass) setting the widgets' colours; light, dark, high contrast, a bridge for Tailwind v4 and one for v3. |
|
|
24
24
|
|
|
25
25
|
The widgets live in `@tzslot/dom`; a framework package only translates its own
|
|
26
26
|
idioms into calls on them. A behaviour fixed there is fixed everywhere.
|
|
@@ -32,12 +32,54 @@ idioms into calls on them. A behaviour fixed there is fixed everywhere.
|
|
|
32
32
|
| `<tz-calendar>` | `createCalendar` | a day — month and year views, keyboard, Today / Clear |
|
|
33
33
|
| `<tz-multi-date>` | `createMultiDate` | several days, not necessarily adjacent |
|
|
34
34
|
| `<tz-date-field>` | `createDateField` | a day, from a field that opens a panel, anchored or centred |
|
|
35
|
+
| `<tz-datetime-field>` | `createDateTimeField` | a moment: the same panel with a time under the calendar — flatpickr's `enableTime`, except that it says when the time cannot happen and offers both readings when it happens twice |
|
|
36
|
+
| — | `createTimeInput` | an hour and a minute on their own: arrows, wheel, up/down keys, 12- or 24-hour |
|
|
35
37
|
| `<tz-date-range>` | `createDateRange` | two days, refusing a range across a closed one |
|
|
38
|
+
| `<tz-range-field>` | `createRangeField` | a period in one field: named ranges, months side by side, whole days or moments |
|
|
36
39
|
| `<tz-time-slots>` | `createTimeSlots` | a moment on one day: the skipped hour struck through, the repeated one offered twice |
|
|
37
|
-
| `<tz-datetime-range>` | `createDateTimeRange` | an interval
|
|
40
|
+
| `<tz-datetime-range>` | `createDateTimeRange` | an interval: two date-and-time fields, and the hour it hides |
|
|
38
41
|
| `<tz-daily-range>` | `createDailyRange` | a range of days with the same hours on each, overnight allowed |
|
|
39
42
|
|
|
40
|
-
`renderCell` puts a price, places left or your own class on any day
|
|
43
|
+
`renderCell` puts a price, places left or your own class on any day, and
|
|
44
|
+
`weekNumbers` adds a column of ISO week numbers down the left.
|
|
45
|
+
`timeLayout` chooses how a time is asked for: `'input'` for the compact field
|
|
46
|
+
with arrows, `'select'` for two menus (`minuteStep`, every minute by default),
|
|
47
|
+
`'list'` for the times on offer that day. The menus show the chosen day as the
|
|
48
|
+
zone really has it: the hour the clocks skip is not offered, and the hour they
|
|
49
|
+
repeat appears twice, in the words everyone uses — "02 — summer" and
|
|
50
|
+
"02 — winter", "02 — été" and "02 — hiver" — so there is nothing left to ask
|
|
51
|
+
afterwards. The zone's official name for each is on the tooltip. The compact field does ask, with the same names, and the
|
|
52
|
+
text itself says which of the two it holds — `25/10/2026 02:30 (winter)` —
|
|
53
|
+
because 02:30 looks identical either way. Typed back in, that name is read
|
|
54
|
+
too, so the text always means exactly one moment.
|
|
55
|
+
|
|
56
|
+
## The text in a field
|
|
57
|
+
|
|
58
|
+
A field can be typed into as well as chosen from, and what it writes is what
|
|
59
|
+
it reads back:
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<!-- the locale's own numeric form: 20/09/2026 09:15 in French -->
|
|
63
|
+
<tz-datetime-field [(value)]="at" timeZone="Europe/Paris" />
|
|
64
|
+
|
|
65
|
+
<!-- a pattern, when the shape matters more than the reader -->
|
|
66
|
+
<tz-datetime-field format="yyyy-MM-dd HH:mm" />
|
|
67
|
+
|
|
68
|
+
<!-- read-only, and then free to be written any way at all -->
|
|
69
|
+
<tz-datetime-field [editable]="false" dateStyle="long" timeStyle="short" />
|
|
70
|
+
<tz-datetime-field [editable]="false" [displayWith]="mine" />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Tokens: `yyyy yy MMMM MMM MM M dd d EEEE EEE HH H hh h mm a`, anything else
|
|
74
|
+
kept as written, `'quoted'` to keep letters. Typing gets the separators as the
|
|
75
|
+
figures arrive, the way a card number gets its spaces — `2009` becomes
|
|
76
|
+
`20/09/` — for patterns that leave no doubt about where each part ends; pass
|
|
77
|
+
`[mask]="false"` to turn that off. The pattern is never used as the
|
|
78
|
+
placeholder. Text that cannot be read is
|
|
79
|
+
refused rather than guessed at, and the field goes back to the last moment it
|
|
80
|
+
held when you leave it. A pattern that names its month is for display only:
|
|
81
|
+
"sept.", "Sept" and "septembre" are one month in three spellings, and picking
|
|
82
|
+
between them is how a field stores the wrong date quietly.
|
|
41
83
|
|
|
42
84
|
## Angular
|
|
43
85
|
|
|
@@ -118,7 +160,8 @@ Nine palette colours, each `light-dark(light, dark)`. `data-theme="dark"` on
|
|
|
118
160
|
any element themes everything inside it; `--tz-accent` on any element
|
|
119
161
|
recolours the selection, the range tint and the focus ring beneath it.
|
|
120
162
|
`@tzslot/theme/contrast.css` follows `prefers-contrast: more`, and
|
|
121
|
-
`@tzslot/theme/tailwind.css` maps the palette to a Tailwind v4 theme
|
|
163
|
+
`@tzslot/theme/tailwind.css` maps the palette to a Tailwind v4 theme and
|
|
164
|
+
`tailwind3.css` to a v3 one. From
|
|
122
165
|
Sass, `@use '@tzslot/theme/tzslot' with ($accent: …)`. All of it in
|
|
123
166
|
`docs/customising.md`.
|
|
124
167
|
|