@panneau/fields 5.0.0-alpha.0 → 5.0.0-alpha.10
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 +103 -20
- package/dist/boolean/BooleanField.d.ts +1 -1
- package/dist/boolean/BooleanField.js +78 -17
- package/dist/boolean/BooleanField.js.map +1 -1
- package/dist/boolean/index.d.ts +1 -1
- package/dist/color/ColorField.css +5 -5
- package/dist/color/ColorField.d.ts +2 -2
- package/dist/color/ColorField.js.map +1 -1
- package/dist/color/ColorField.module.js +3 -3
- package/dist/color/index.d.ts +1 -1
- package/dist/date/DateField.d.ts +1 -1
- package/dist/date/DateField.js.map +1 -1
- package/dist/date/index.d.ts +1 -1
- package/dist/datetime/DateTimeField.d.ts +1 -1
- package/dist/datetime/DateTimeField.js +107 -20
- package/dist/datetime/DateTimeField.js.map +1 -1
- package/dist/datetime/index.d.ts +1 -1
- package/dist/duration/DurationField.css +11 -0
- package/dist/duration/DurationField.d.ts +26 -0
- package/dist/duration/DurationField.d.ts.map +1 -0
- package/dist/duration/DurationField.js +214 -0
- package/dist/duration/DurationField.js.map +1 -0
- package/dist/duration/DurationField.module.js +12 -0
- package/dist/duration/DurationField.module.js.map +1 -0
- package/dist/duration/index.d.ts +2 -0
- package/dist/duration/index.d.ts.map +1 -0
- package/dist/duration/index.js +1 -0
- package/dist/email/EmailField.d.ts +2 -2
- package/dist/email/EmailField.js.map +1 -1
- package/dist/email/index.d.ts +1 -1
- package/dist/embed/EmbedField.css +60 -0
- package/dist/embed/EmbedField.d.ts +20 -0
- package/dist/embed/EmbedField.d.ts.map +1 -0
- package/dist/embed/EmbedField.js +246 -0
- package/dist/embed/EmbedField.js.map +1 -0
- package/dist/embed/EmbedField.module.js +22 -0
- package/dist/embed/EmbedField.module.js.map +1 -0
- package/dist/embed/index.d.ts +3 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/index.js +3 -0
- package/dist/file/FileField.css +54 -0
- package/dist/file/FileField.d.ts +50 -0
- package/dist/file/FileField.d.ts.map +1 -0
- package/dist/file/FileField.js +288 -0
- package/dist/file/FileField.js.map +1 -0
- package/dist/file/FileField.module.js +22 -0
- package/dist/file/FileField.module.js.map +1 -0
- package/dist/file/index.d.ts +3 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +1 -0
- package/dist/group/GroupField.css +2 -2
- package/dist/group/GroupField.d.ts +1 -1
- package/dist/group/GroupField.js.map +1 -1
- package/dist/group/GroupField.module.js +1 -1
- package/dist/group/index.d.ts +1 -1
- package/dist/index.d.ts +18 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/json/JsonField.css +7 -0
- package/dist/json/JsonField.d.ts +22 -0
- package/dist/json/JsonField.d.ts.map +1 -0
- package/dist/json/JsonField.js +207 -0
- package/dist/json/JsonField.js.map +1 -0
- package/dist/json/JsonField.module.js +8 -0
- package/dist/json/JsonField.module.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +1 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/localized/LocalizedField.css +2 -2
- package/dist/localized/LocalizedField.d.ts +1 -1
- package/dist/localized/LocalizedField.d.ts.map +1 -1
- package/dist/localized/LocalizedField.js +1 -0
- package/dist/localized/LocalizedField.js.map +1 -1
- package/dist/localized/LocalizedField.module.js +2 -2
- package/dist/localized/index.d.ts +1 -1
- package/dist/location/LocationField.css +54 -0
- package/dist/location/LocationField.d.ts +31 -0
- package/dist/location/LocationField.d.ts.map +1 -0
- package/dist/location/LocationField.js +563 -0
- package/dist/location/LocationField.js.map +1 -0
- package/dist/location/LocationField.module.js +22 -0
- package/dist/location/LocationField.module.js.map +1 -0
- package/dist/location/LocationMap.d.ts +25 -0
- package/dist/location/LocationMap.d.ts.map +1 -0
- package/dist/location/LocationMap.js +205 -0
- package/dist/location/LocationMap.js.map +1 -0
- package/dist/location/index.d.ts +5 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +4 -0
- package/dist/location/leafletCss.d.ts +2 -0
- package/dist/location/leafletCss.d.ts.map +1 -0
- package/dist/location/leafletCss.js +6 -0
- package/dist/location/leafletCss.js.map +1 -0
- package/dist/location/nominatim.d.ts +17 -0
- package/dist/location/nominatim.d.ts.map +1 -0
- package/dist/location/nominatim.js +50 -0
- package/dist/location/nominatim.js.map +1 -0
- package/dist/location/types.d.ts +40 -0
- package/dist/location/types.d.ts.map +1 -0
- package/dist/missing/MissingField.css +4 -3
- package/dist/missing/MissingField.d.ts +4 -3
- package/dist/missing/MissingField.d.ts.map +1 -1
- package/dist/missing/MissingField.js +3 -2
- package/dist/missing/MissingField.js.map +1 -1
- package/dist/missing/MissingField.module.js +3 -3
- package/dist/missing/MissingField.module.js.map +1 -1
- package/dist/number/NumberField.d.ts +1 -1
- package/dist/number/NumberField.js.map +1 -1
- package/dist/number/index.d.ts +1 -1
- package/dist/range/RangeField.d.ts +22 -0
- package/dist/range/RangeField.d.ts.map +1 -0
- package/dist/range/RangeField.js +203 -0
- package/dist/range/RangeField.js.map +1 -0
- package/dist/range/index.d.ts +2 -0
- package/dist/range/index.d.ts.map +1 -0
- package/dist/range/index.js +1 -0
- package/dist/relation/RelationField.css +7 -7
- package/dist/relation/RelationField.d.ts +12 -4
- package/dist/relation/RelationField.d.ts.map +1 -1
- package/dist/relation/RelationField.js +535 -160
- package/dist/relation/RelationField.js.map +1 -1
- package/dist/relation/RelationField.module.js +6 -6
- package/dist/relation/index.d.ts +2 -2
- package/dist/relation/index.d.ts.map +1 -1
- package/dist/relation/index.js +2 -2
- package/dist/repeater/RepeaterField.css +12 -11
- package/dist/repeater/RepeaterField.d.ts +1 -1
- package/dist/repeater/RepeaterField.js +118 -34
- package/dist/repeater/RepeaterField.js.map +1 -1
- package/dist/repeater/RepeaterField.module.js +9 -9
- package/dist/repeater/RepeaterField.module.js.map +1 -1
- package/dist/repeater/index.d.ts +1 -1
- package/dist/select/SelectField.css +1 -1
- package/dist/select/SelectField.d.ts +1 -1
- package/dist/select/SelectField.js.map +1 -1
- package/dist/select/SelectField.module.js +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/shared/DefinitionField.d.ts +5 -3
- package/dist/shared/DefinitionField.d.ts.map +1 -1
- package/dist/shared/DefinitionField.js +81 -73
- package/dist/shared/DefinitionField.js.map +1 -1
- package/dist/shared/builtIn.d.ts +5 -3
- package/dist/shared/builtIn.d.ts.map +1 -1
- package/dist/shared/builtIn.js +21 -3
- package/dist/shared/builtIn.js.map +1 -1
- package/dist/shared/check.d.ts +27 -0
- package/dist/shared/check.d.ts.map +1 -0
- package/dist/shared/check.js +18 -0
- package/dist/shared/check.js.map +1 -0
- package/dist/shared/context.d.ts +28 -5
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/context.js +35 -19
- package/dist/shared/context.js.map +1 -1
- package/dist/shared/cx.js.map +1 -1
- package/dist/shared/dates.js.map +1 -1
- package/dist/shared/embed.d.ts +19 -0
- package/dist/shared/embed.d.ts.map +1 -0
- package/dist/shared/embed.js +14 -0
- package/dist/shared/embed.js.map +1 -0
- package/dist/shared/entry.d.ts +11 -2
- package/dist/shared/entry.d.ts.map +1 -1
- package/dist/shared/entry.js +19 -3
- package/dist/shared/entry.js.map +1 -1
- package/dist/shared/relation.d.ts +41 -5
- package/dist/shared/relation.d.ts.map +1 -1
- package/dist/shared/relation.js +119 -12
- package/dist/shared/relation.js.map +1 -1
- package/dist/shared/types.d.ts +2 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/slug/SlugField.css +18 -0
- package/dist/slug/SlugField.d.ts +33 -5
- package/dist/slug/SlugField.d.ts.map +1 -1
- package/dist/slug/SlugField.js +346 -126
- package/dist/slug/SlugField.js.map +1 -1
- package/dist/slug/SlugField.module.js +14 -0
- package/dist/slug/SlugField.module.js.map +1 -0
- package/dist/slug/index.d.ts +1 -1
- package/dist/slug/index.d.ts.map +1 -1
- package/dist/slug/index.js +1 -1
- package/dist/tags/TagsField.d.ts +17 -0
- package/dist/tags/TagsField.d.ts.map +1 -0
- package/dist/tags/TagsField.js +120 -0
- package/dist/tags/TagsField.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +1 -0
- package/dist/tel/TelField.d.ts +11 -0
- package/dist/tel/TelField.d.ts.map +1 -0
- package/dist/tel/TelField.js +87 -0
- package/dist/tel/TelField.js.map +1 -0
- package/dist/tel/index.d.ts +2 -0
- package/dist/tel/index.d.ts.map +1 -0
- package/dist/tel/index.js +1 -0
- package/dist/text/TextField.d.ts +12 -4
- package/dist/text/TextField.d.ts.map +1 -1
- package/dist/text/TextField.js +104 -60
- package/dist/text/TextField.js.map +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/textarea/TextAreaField.d.ts +1 -1
- package/dist/textarea/TextAreaField.js.map +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/time/TimeField.d.ts +1 -1
- package/dist/time/TimeField.js +64 -10
- package/dist/time/TimeField.js.map +1 -1
- package/dist/time/index.d.ts +1 -1
- package/dist/upload/FilePicker.css +24 -0
- package/dist/upload/FilePicker.d.ts +14 -0
- package/dist/upload/FilePicker.d.ts.map +1 -0
- package/dist/upload/FilePicker.js +130 -0
- package/dist/upload/FilePicker.js.map +1 -0
- package/dist/upload/FilePicker.module.js +12 -0
- package/dist/upload/FilePicker.module.js.map +1 -0
- package/dist/upload/UploadList.css +93 -0
- package/dist/upload/UploadList.d.ts +18 -0
- package/dist/upload/UploadList.d.ts.map +1 -0
- package/dist/upload/UploadList.js +144 -0
- package/dist/upload/UploadList.js.map +1 -0
- package/dist/upload/UploadList.module.js +32 -0
- package/dist/upload/UploadList.module.js.map +1 -0
- package/dist/upload/files.d.ts +5 -0
- package/dist/upload/files.d.ts.map +1 -0
- package/dist/upload/files.js +26 -0
- package/dist/upload/files.js.map +1 -0
- package/dist/upload/types.d.ts +58 -0
- package/dist/upload/types.d.ts.map +1 -0
- package/dist/upload/useRejectionMessage.d.ts +4 -0
- package/dist/upload/useRejectionMessage.d.ts.map +1 -0
- package/dist/upload/useRejectionMessage.js +25 -0
- package/dist/upload/useRejectionMessage.js.map +1 -0
- package/dist/upload/useUploads.d.ts +30 -0
- package/dist/upload/useUploads.d.ts.map +1 -0
- package/dist/upload/useUploads.js +115 -0
- package/dist/upload/useUploads.js.map +1 -0
- package/dist/uppy/index.d.ts +3 -0
- package/dist/uppy/index.d.ts.map +1 -0
- package/dist/uppy/index.js +1 -0
- package/dist/uppy/uploader.d.ts +44 -0
- package/dist/uppy/uploader.d.ts.map +1 -0
- package/dist/uppy/uploader.js +139 -0
- package/dist/uppy/uploader.js.map +1 -0
- package/dist/url/UrlField.css +2 -2
- package/dist/url/UrlField.d.ts +2 -2
- package/dist/url/UrlField.js +69 -14
- package/dist/url/UrlField.js.map +1 -1
- package/dist/url/UrlField.module.js +1 -1
- package/dist/url/index.d.ts +1 -1
- package/package.json +69 -7
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ Controlled field components for the protocol's built-in field types, built on [`
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install @panneau/fields@^5.0.0-alpha.0 @panneau/ui@^5.0.0-alpha.0 react-aria-components react-intl
|
|
7
|
+
npm install @uppy/core@^6.3.0 @uppy/aws-s3@^6.3.0 # only for @panneau/fields/uppy
|
|
7
8
|
```
|
|
8
9
|
|
|
9
10
|
```tsx
|
|
@@ -19,25 +20,34 @@ import { PanneauRoot } from '@panneau/ui';
|
|
|
19
20
|
|
|
20
21
|
Every field takes `value`, `onChange`, `onBlur`, `errors`, `disabled`, `readOnly`, `required`, `label` and `description`, plus `className` and `xxxClassName` props for its inner elements. Fields keep no value of their own, and an empty value is `null`.
|
|
21
22
|
|
|
22
|
-
| Import | Components | Value
|
|
23
|
-
| --------------------------- | -------------------------------------------- |
|
|
24
|
-
| `@panneau/fields/text` | `TextField` | `string`
|
|
25
|
-
| `@panneau/fields/textarea` | `TextAreaField` | `string`
|
|
26
|
-
| `@panneau/fields/number` | `NumberField` | `number`
|
|
27
|
-
| `@panneau/fields/boolean` | `BooleanField` (checkbox, switch) | `boolean`
|
|
28
|
-
| `@panneau/fields/date` | `DateField` | `'2026-10-15'`
|
|
29
|
-
| `@panneau/fields/datetime` | `DateTimeField` | `'2026-10-15T13:30:00Z'`, or without an offset
|
|
30
|
-
| `@panneau/fields/time` | `TimeField` | `'09:30'`
|
|
31
|
-
| `@panneau/fields/select` | `SelectField` (dropdown, radios, checkboxes) | an option's value, or a list with `multiple`
|
|
32
|
-
| `@panneau/fields/email` | `EmailField` | `string`
|
|
33
|
-
| `@panneau/fields/url` | `UrlField` | `string`, with `https://` added on blur
|
|
34
|
-
| `@panneau/fields/color` | `ColorField` | `'#1d4ed8'`
|
|
35
|
-
| `@panneau/fields/slug` | `SlugField`, `slugify()`
|
|
36
|
-
| `@panneau/fields/
|
|
37
|
-
| `@panneau/fields/
|
|
38
|
-
| `@panneau/fields/
|
|
39
|
-
| `@panneau/fields/
|
|
40
|
-
| `@panneau/fields/
|
|
23
|
+
| Import | Components | Value |
|
|
24
|
+
| --------------------------- | -------------------------------------------- | ------------------------------------------------------------------- |
|
|
25
|
+
| `@panneau/fields/text` | `TextField` | `string` |
|
|
26
|
+
| `@panneau/fields/textarea` | `TextAreaField` | `string` |
|
|
27
|
+
| `@panneau/fields/number` | `NumberField` | `number` |
|
|
28
|
+
| `@panneau/fields/boolean` | `BooleanField` (checkbox, switch) | `boolean` |
|
|
29
|
+
| `@panneau/fields/date` | `DateField` | `'2026-10-15'` |
|
|
30
|
+
| `@panneau/fields/datetime` | `DateTimeField` | `'2026-10-15T13:30:00Z'`, or without an offset |
|
|
31
|
+
| `@panneau/fields/time` | `TimeField` | `'09:30'` |
|
|
32
|
+
| `@panneau/fields/select` | `SelectField` (dropdown, radios, checkboxes) | an option's value, or a list with `multiple` |
|
|
33
|
+
| `@panneau/fields/email` | `EmailField` | `string` |
|
|
34
|
+
| `@panneau/fields/url` | `UrlField` | `string`, with `https://` added on blur |
|
|
35
|
+
| `@panneau/fields/color` | `ColorField` | `'#1d4ed8'` |
|
|
36
|
+
| `@panneau/fields/slug` | `SlugField`, `slugify()`, `sourceText()` | `string`, following a `source` until edited, checked with `onCheck` |
|
|
37
|
+
| `@panneau/fields/tel` | `TelField` | `string`, as typed |
|
|
38
|
+
| `@panneau/fields/range` | `RangeField` (a slider) | `number`, `null` until moved |
|
|
39
|
+
| `@panneau/fields/duration` | `DurationField`, `formatDuration()` | seconds, typed in hours, minutes and seconds |
|
|
40
|
+
| `@panneau/fields/json` | `JsonField`, `parseJson()` | an object or an array; the text while it doesn't parse |
|
|
41
|
+
| `@panneau/fields/tags` | `TagsField` | a list of strings, free or among suggestions |
|
|
42
|
+
| `@panneau/fields/embed` | `EmbedField` | `{ url, title, thumbnailUrl, … }`, from the backend (below) |
|
|
43
|
+
| `@panneau/fields/location` | `LocationField`, `createNominatimSource()` | `{ lat, lng, address }`, on a map (below) |
|
|
44
|
+
| `@panneau/fields/localized` | `LocalizedField` | `{ fr: …, en: … }` |
|
|
45
|
+
| `@panneau/fields/group` | `GroupField` | an object |
|
|
46
|
+
| `@panneau/fields/repeater` | `RepeaterField` (items or typed blocks) | a list of objects; blocks have a `type` |
|
|
47
|
+
| `@panneau/fields/relation` | `RelationField`, `createRelationSource()` | `{ id, label }`, or a list with `multiple` |
|
|
48
|
+
| `@panneau/fields/file` | `FileField` | a file, or a list with `multiple` (below) |
|
|
49
|
+
| `@panneau/fields/uppy` | `createUppyUploadSource()` | the upload source on Uppy 6 (below) |
|
|
50
|
+
| `@panneau/fields/locales` | `en`, `fr` | deprecated: use `@panneau/intl` |
|
|
41
51
|
|
|
42
52
|
## From a definition
|
|
43
53
|
|
|
@@ -63,10 +73,83 @@ import {
|
|
|
63
73
|
- **Localized fields** (`localized: true`) render the field of their type for each locale of the provider, at `title.fr`, `title.en`.
|
|
64
74
|
- **Groups and repeaters** render their nested fields with `NestedField`, at paths like `blocks.2.body`. A `binding` in `FieldsProvider` can bind every nested field to a store by path: `@panneau/forms` binds them to its form state. Without one, the group or repeater sets its whole value.
|
|
65
75
|
- **Relations** search a `RelationSource`. `createRelationSource()` makes one from any adapter with a `list()` method, such as the `DataAdapter` of `@panneau/data`. Labels come from the resource's `itemTitle`. Without a source, a relation field shows its references, read-only.
|
|
66
|
-
- **
|
|
76
|
+
- **Plain ids.** Values can be ids (`"12"`, `["12", "13"]`), as a product's own API gives them. The field shows their labels once the source's optional `resolve(resource, ids)` gives them (`createRelationSource()` implements it with the adapter's `get()`), and their ids until then. Fields that show the same ids share one request. `useRelationReferences()` does the same for other components.
|
|
77
|
+
- **Creating from the picker.** When the source has `create(resource, text)`, the picker offers "Create “…”" for a text that matches no item, and adds the new item. `createRelationSource(adapter, { create: true })` creates it with the adapter's `create()`, with the text as its `itemTitle` (in every locale when it is localized), on the resources that allow `create`; a function gives other values. A field's `onCreate` prop replaces the source's, and can open a dialog with a full form: it resolves with the new reference, or `null`. `onCreate={null}` turns creating off.
|
|
78
|
+
- **Files** upload through the `uploadSource` of the provider (below). Without one, the value holds the files themselves.
|
|
79
|
+
- **Plugin slot:** a type without an entry, such as `richtext` and `media` without their plugins (`@panneau/editor`, `@panneau/media`), renders a placeholder that names it. A plugin that provides the type replaces it.
|
|
80
|
+
|
|
81
|
+
## Files and uploads
|
|
82
|
+
|
|
83
|
+
`FileField` (the `file` type) holds files that belong to an item, outside the media library: an attachment, a PDF, a CSV ([decision 0025](../../docs/decisions/0025-presigned-uploads.md)). Its value is a file, or a list of them with `multiple`:
|
|
84
|
+
|
|
85
|
+
- a **stored file**, `{ name, url, mime, size }`, as items give it: the field shows it with a link;
|
|
86
|
+
- an **uploaded file**, `{ upload, name, mime, size }`, once the browser sent the file to storage: requests send its `upload`;
|
|
87
|
+
- the **`File` itself**, without an upload source: the adapter sends it in `multipart/form-data`.
|
|
88
|
+
|
|
89
|
+
A new file replaces the file of a single value, and is added to a multiple one. `accept` and `maxSize` (from the field's `accept`, its `accept` rule and its `maxSize` rule) refuse files before they are sent. A read-only field only shows its files.
|
|
90
|
+
|
|
91
|
+
**Upload sources.** An `UploadSource` makes an uploader for each field, which reports each file's progress and gives its upload once it is done. `createUppyUploadSource()` of `@panneau/fields/uppy` makes one on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in parts when they are large (they can pause and resume), and each upload is completed with the backend. `@uppy/core` and `@uppy/aws-s3` 6 are optional peer dependencies, only for that entry point: nothing else in the package imports Uppy. Make the source once, and pass it as `uploadSource` to `FieldsProvider`, or to `FormView` of `@panneau/forms`, when the definition announces direct uploads:
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { createUppyUploadSource } from '@panneau/fields/uppy';
|
|
95
|
+
|
|
96
|
+
const uploadSource =
|
|
97
|
+
definition.uploads?.mode === 'presigned' && adapter.presignedUploads !== undefined
|
|
98
|
+
? createUppyUploadSource(
|
|
99
|
+
adapter.presignedUploads({ endpoint: definition.uploads.endpoint }),
|
|
100
|
+
)
|
|
101
|
+
: null;
|
|
102
|
+
|
|
103
|
+
<FieldsProvider components={builtInFields} uploadSource={uploadSource}>
|
|
104
|
+
…
|
|
105
|
+
</FieldsProvider>;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`adapter.presignedUploads()` comes from `@panneau/data`; `createUppyUploadSource()` only needs an object with its `signRequest()` and `complete()` (`PresignedUploadsLike`), so fields don't depend on `@panneau/data`. A field's `uploadSource` prop overrides the provider's, and `null` turns uploads off.
|
|
109
|
+
|
|
110
|
+
**Building blocks.** `@panneau/fields` also exports what the file field is made of, for other fields that take files (the media field of `@panneau/media`): `useUploads()` (checks files, uploads them through a source, and gives their state), `UploadList` (a progress bar per file, with pause, resume, cancel and retry), `FilePicker` (a button and a drop zone), and `formatSize()`, `matchesMime()`, `getAccept()`, `getMaxSize()`.
|
|
67
111
|
|
|
68
112
|
## Messages
|
|
69
113
|
|
|
70
114
|
Strings go through react-intl, with English defaults. Add the messages of every Panneau package to the app's with `withPanneauMessages()` from [`@panneau/intl`](../intl), or use `fieldsPlugin`, which carries the French messages of every package (`ui`, `fields` and `forms`).
|
|
71
115
|
|
|
72
116
|
The package layout, scripts and API reports are explained in [`docs/packages.md`](../../docs/packages.md).
|
|
117
|
+
|
|
118
|
+
## Checking a value
|
|
119
|
+
|
|
120
|
+
A field with `check` in the definition, such as a `slug`, checks its value with the backend as it is typed ([decision 0032](../../docs/decisions/0032-field-checks-and-slugs.md)). The slug field then shows the URL the backend gives, says when the slug is taken with a free one to use, and is read-only when the backend says the field doesn't apply to the item. Give forms a check source for the item they edit:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import { createFieldCheckSource } from '@panneau/fields';
|
|
124
|
+
|
|
125
|
+
<FormView form={form} checkSource={createFieldCheckSource(adapter, 'pages', item?.id ?? null)} />;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Without one, fields don't check, and the slug shows its fixed `settings.prefix`.
|
|
129
|
+
|
|
130
|
+
## Embeds and places
|
|
131
|
+
|
|
132
|
+
An `embed` field shows the title and the thumbnail of a URL's video, sound or post. It gets them from the backend (`GET /embeds`), through the embed source of the provider; without one, it keeps the URL alone:
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { createEmbedSource } from '@panneau/fields';
|
|
136
|
+
|
|
137
|
+
<FieldsProvider embedSource={createEmbedSource(adapter)}>…</FieldsProvider>;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
A `location` field places a point on a Leaflet map, loaded when the field is first shown. The tiles are OpenStreetMap's by default. `maps` sets other tiles and an address search, a `GeocodingSource`: `createNominatimSource()` searches OpenStreetMap's Nominatim, whose [usage policy](https://operations.osmfoundation.org/policies/nominatim/) suits small volumes; a product with more uses its own service. Without a geocoding source, the field has no address search, and the latitude and longitude are typed or picked on the map.
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
import { createNominatimSource } from '@panneau/fields';
|
|
144
|
+
|
|
145
|
+
<FieldsProvider
|
|
146
|
+
maps={{
|
|
147
|
+
tiles: { url: 'https://tiles.example.com/{z}/{x}/{y}.png', attribution: '© Example' },
|
|
148
|
+
geocoding: createNominatimSource({ email: 'dev@example.com', countryCodes: ['ca'] }),
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
…
|
|
152
|
+
</FieldsProvider>;
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`<Panneau>` and `createPanneauApp()` give the embed source of their adapter, and take `maps`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface BooleanFieldProps extends Omit<FieldProps<boolean>, 'labelClassName'> {
|
|
3
3
|
/** `checkbox` (default) for a choice saved with the form, `switch` for an on and off setting. */
|
|
4
4
|
widget?: 'checkbox' | 'switch';
|
|
@@ -4,23 +4,84 @@ import { Checkbox, Switch } from "@panneau/ui";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/boolean/BooleanField.tsx
|
|
6
6
|
/** A yes or no value, as a checkbox or a switch with its label. An empty value is `false`. */
|
|
7
|
-
function BooleanField(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
function BooleanField(t0) {
|
|
8
|
+
const $ = c(24);
|
|
9
|
+
let controlClassName;
|
|
10
|
+
let disabled;
|
|
11
|
+
let label;
|
|
12
|
+
let onChange;
|
|
13
|
+
let props;
|
|
14
|
+
let readOnly;
|
|
15
|
+
let required;
|
|
16
|
+
let t1;
|
|
17
|
+
let value;
|
|
18
|
+
if ($[0] !== t0) {
|
|
19
|
+
({value, onChange, label, widget: t1, disabled, readOnly, required, controlClassName, ...props} = t0);
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
$[1] = controlClassName;
|
|
22
|
+
$[2] = disabled;
|
|
23
|
+
$[3] = label;
|
|
24
|
+
$[4] = onChange;
|
|
25
|
+
$[5] = props;
|
|
26
|
+
$[6] = readOnly;
|
|
27
|
+
$[7] = required;
|
|
28
|
+
$[8] = t1;
|
|
29
|
+
$[9] = value;
|
|
30
|
+
} else {
|
|
31
|
+
controlClassName = $[1];
|
|
32
|
+
disabled = $[2];
|
|
33
|
+
label = $[3];
|
|
34
|
+
onChange = $[4];
|
|
35
|
+
props = $[5];
|
|
36
|
+
readOnly = $[6];
|
|
37
|
+
required = $[7];
|
|
38
|
+
t1 = $[8];
|
|
39
|
+
value = $[9];
|
|
40
|
+
}
|
|
41
|
+
const widget = t1 === void 0 ? "checkbox" : t1;
|
|
42
|
+
const t2 = value === true;
|
|
43
|
+
let t3;
|
|
44
|
+
if ($[10] !== onChange) {
|
|
45
|
+
t3 = (next) => onChange?.(next);
|
|
46
|
+
$[10] = onChange;
|
|
47
|
+
$[11] = t3;
|
|
48
|
+
} else t3 = $[11];
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[12] !== disabled || $[13] !== label || $[14] !== props || $[15] !== readOnly || $[16] !== required || $[17] !== t2 || $[18] !== t3) {
|
|
51
|
+
t4 = {
|
|
52
|
+
...props,
|
|
53
|
+
isSelected: t2,
|
|
54
|
+
onChange: t3,
|
|
55
|
+
isDisabled: disabled,
|
|
56
|
+
isReadOnly: readOnly,
|
|
57
|
+
isRequired: required,
|
|
58
|
+
children: label
|
|
59
|
+
};
|
|
60
|
+
$[12] = disabled;
|
|
61
|
+
$[13] = label;
|
|
62
|
+
$[14] = props;
|
|
63
|
+
$[15] = readOnly;
|
|
64
|
+
$[16] = required;
|
|
65
|
+
$[17] = t2;
|
|
66
|
+
$[18] = t3;
|
|
67
|
+
$[19] = t4;
|
|
68
|
+
} else t4 = $[19];
|
|
69
|
+
const shared = t4;
|
|
70
|
+
let t5;
|
|
71
|
+
if ($[20] !== controlClassName || $[21] !== shared || $[22] !== widget) {
|
|
72
|
+
t5 = widget === "switch" ? /* @__PURE__ */ jsx(Switch, {
|
|
73
|
+
...shared,
|
|
74
|
+
switchClassName: controlClassName
|
|
75
|
+
}) : /* @__PURE__ */ jsx(Checkbox, {
|
|
76
|
+
...shared,
|
|
77
|
+
checkboxClassName: controlClassName
|
|
78
|
+
});
|
|
79
|
+
$[20] = controlClassName;
|
|
80
|
+
$[21] = shared;
|
|
81
|
+
$[22] = widget;
|
|
82
|
+
$[23] = t5;
|
|
83
|
+
} else t5 = $[23];
|
|
84
|
+
return t5;
|
|
24
85
|
}
|
|
25
86
|
/** The `boolean` type: setting `widget` (`checkbox` or `switch`). */
|
|
26
87
|
function BooleanFieldEntry(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanField.js","names":["_c"],"sources":["../../src/boolean/BooleanField.tsx"],"sourcesContent":["import { Checkbox, Switch } from '@panneau/ui';\n\nimport { getFieldProps, getSetting, isString } from '../shared/entry';\nimport type { FieldEntryProps, FieldProps } from '../shared/types';\n\nexport interface BooleanFieldProps extends Omit<FieldProps<boolean>, 'labelClassName'> {\n /** `checkbox` (default) for a choice saved with the form, `switch` for an on and off setting. */\n widget?: 'checkbox' | 'switch';\n controlClassName?: string;\n}\n\n/** A yes or no value, as a checkbox or a switch with its label. An empty value is `false`. */\nexport function BooleanField({\n value,\n onChange,\n label,\n widget = 'checkbox',\n disabled,\n readOnly,\n required,\n controlClassName,\n ...props\n}: BooleanFieldProps) {\n const shared = {\n ...props,\n isSelected: value === true,\n onChange: (next: boolean) => onChange?.(next),\n isDisabled: disabled,\n isReadOnly: readOnly,\n isRequired: required,\n children: label,\n };\n return widget === 'switch' ? (\n <Switch {...shared} switchClassName={controlClassName} />\n ) : (\n <Checkbox {...shared} checkboxClassName={controlClassName} />\n );\n}\n\n/** The `boolean` type: setting `widget` (`checkbox` or `switch`). */\nexport function BooleanFieldEntry(props: FieldEntryProps) {\n const widget = getSetting(props.field, 'widget', isString);\n return (\n <BooleanField\n {...getFieldProps(props)}\n value={props.value === true}\n onChange={props.onChange}\n {...(widget === 'switch' || widget === 'checkbox' ? { widget } : {})}\n />\n );\n}\n"],"mappings":";;;;;;AAYA,
|
|
1
|
+
{"version":3,"file":"BooleanField.js","names":["Checkbox","Switch","getFieldProps","getSetting","isString","FieldEntryProps","FieldProps","BooleanFieldProps","Omit","widget","controlClassName","BooleanField","t0","$","_c","disabled","label","onChange","props","readOnly","required","t1","value","undefined","t2","t3","next","t4","isSelected","isDisabled","isReadOnly","isRequired","children","shared","t5","BooleanFieldEntry","field","_c"],"sources":["../../src/boolean/BooleanField.tsx"],"sourcesContent":["import { Checkbox, Switch } from '@panneau/ui';\n\nimport { getFieldProps, getSetting, isString } from '../shared/entry';\nimport type { FieldEntryProps, FieldProps } from '../shared/types';\n\nexport interface BooleanFieldProps extends Omit<FieldProps<boolean>, 'labelClassName'> {\n /** `checkbox` (default) for a choice saved with the form, `switch` for an on and off setting. */\n widget?: 'checkbox' | 'switch';\n controlClassName?: string;\n}\n\n/** A yes or no value, as a checkbox or a switch with its label. An empty value is `false`. */\nexport function BooleanField({\n value,\n onChange,\n label,\n widget = 'checkbox',\n disabled,\n readOnly,\n required,\n controlClassName,\n ...props\n}: BooleanFieldProps) {\n const shared = {\n ...props,\n isSelected: value === true,\n onChange: (next: boolean) => onChange?.(next),\n isDisabled: disabled,\n isReadOnly: readOnly,\n isRequired: required,\n children: label,\n };\n return widget === 'switch' ? (\n <Switch {...shared} switchClassName={controlClassName} />\n ) : (\n <Checkbox {...shared} checkboxClassName={controlClassName} />\n );\n}\n\n/** The `boolean` type: setting `widget` (`checkbox` or `switch`). */\nexport function BooleanFieldEntry(props: FieldEntryProps) {\n const widget = getSetting(props.field, 'widget', isString);\n return (\n <BooleanField\n {...getFieldProps(props)}\n value={props.value === true}\n onChange={props.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AA6D;EAACI,EAAA,KAAAJ;EAAAI,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAK,MAAAD,YAAAJ,EAAA,OAAAQ,MAAAR,EAAA,OAAAW,MAAAX,EAAA,OAAAY,IAAA;EAJvEE,KAAA,oBAAC,cAAD;GAAa,GACLN;GACG,OAAAG;GACG,UAAAN,MAAKD;GAAS,GACnBQ;EAA8D,CAAA;EACrEZ,EAAA,KAAAK,MAAAD;EAAAJ,EAAA,KAAAQ;EAAAR,EAAA,KAAAW;EAAAX,EAAA,KAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OALFc;AAKE"}
|
package/dist/boolean/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BooleanField, BooleanFieldEntry, type BooleanFieldProps } from './BooleanField';
|
|
1
|
+
export { BooleanField, BooleanFieldEntry, type BooleanFieldProps } from './BooleanField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.panneau-swatch
|
|
1
|
+
.panneau-color-field-swatch {
|
|
2
2
|
position: relative;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
width: 1.5rem;
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
border-radius: var(--panneau-radius-sm);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.panneau-swatch
|
|
11
|
+
.panneau-color-field-swatch:focus-within {
|
|
12
12
|
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
13
13
|
outline-offset: 2px;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.panneau-picker
|
|
16
|
+
.panneau-color-field-picker {
|
|
17
17
|
position: absolute;
|
|
18
18
|
inset: -0.5rem;
|
|
19
19
|
width: calc(100% + 1rem);
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
border: 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.panneau-picker
|
|
27
|
+
.panneau-color-field-picker:disabled {
|
|
28
28
|
cursor: not-allowed;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.panneau-input
|
|
31
|
+
.panneau-color-field-input {
|
|
32
32
|
font-family: var(--panneau-font-family-mono);
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
2
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
3
3
|
export type ColorFieldProps = Omit<TextFieldProps, 'type' | 'prefix' | 'maxLength'>;
|
|
4
4
|
/**
|
|
5
5
|
* Normalizes a hexadecimal color: `#` prefix, lowercase, and 3 digits expanded to 6. Returns the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorField.js","names":["value","
|
|
1
|
+
{"version":3,"file":"ColorField.js","names":["usePanneauIntl","cx","getFieldProps","isString","messages","FieldEntryProps","TextField","TextFieldProps","styles","ColorFieldProps","Omit","normalizeColor","value","trimmed","trim","toLowerCase","digits","replace","test","map","digit","join","ColorField","t0","$","_c","disabled","inputClassName","onBlur","onChange","props","readOnly","intl","t1","undefined","valid","t2","input","t3","next","t4","t5","backgroundColor","t6","t7","event","target","t8","t9","formatMessage","pickColor","t10","picker","t11","swatch","t12","ColorFieldEntry","_c","styles"],"sources":["../../src/color/ColorField.tsx"],"sourcesContent":["import { usePanneauIntl } from '@panneau/ui';\n\nimport { cx } from '../shared/cx';\nimport { getFieldProps, isString } from '../shared/entry';\nimport { messages } from '../shared/messages';\nimport type { FieldEntryProps } from '../shared/types';\nimport { TextField, type TextFieldProps } from '../text/TextField';\nimport styles from './ColorField.module.css';\n\nexport type ColorFieldProps = Omit<TextFieldProps, 'type' | 'prefix' | 'maxLength'>;\n\n/**\n * Normalizes a hexadecimal color: `#` prefix, lowercase, and 3 digits expanded to 6. Returns the\n * text as is when it isn't a hexadecimal color.\n */\nexport function normalizeColor(value: string): string {\n const trimmed = value.trim().toLowerCase();\n const digits = trimmed.replace(/^#/, '');\n if (/^[0-9a-f]{3}$/.test(digits)) {\n return `#${[...digits].map((digit) => digit + digit).join('')}`;\n }\n if (/^[0-9a-f]{6}$/.test(digits) || /^[0-9a-f]{8}$/.test(digits)) {\n return `#${digits}`;\n }\n return trimmed;\n}\n\n/**\n * A color as a hexadecimal value (`#1d4ed8`): typed, or picked with the browser's color picker.\n * The value is normalized on blur.\n */\nexport function ColorField({\n value,\n onChange,\n onBlur,\n disabled,\n readOnly,\n inputClassName,\n ...props\n}: ColorFieldProps) {\n const intl = usePanneauIntl();\n const valid = value !== null && value !== undefined && /^#[0-9a-f]{6}$/i.test(value);\n return (\n <TextField\n autoComplete=\"off\"\n {...props}\n value={value}\n onChange={onChange}\n disabled={disabled}\n readOnly={readOnly}\n inputClassName={cx(styles.input, inputClassName)}\n onBlur={() => {\n if (value !== null && value !== undefined) {\n const next = normalizeColor(value);\n if (next !== value) {\n onChange?.(next === '' ? null : next);\n }\n }\n onBlur?.();\n }}\n prefix={\n <span\n className={styles.swatch}\n style={{ backgroundColor: valid ? value : 'transparent' }}\n >\n <input\n type=\"color\"\n className={styles.picker}\n value={valid ? value.toLowerCase() : '#000000'}\n onChange={(event) => onChange?.(event.target.value)}\n disabled={disabled === true || readOnly === true}\n aria-label={intl.formatMessage(messages.pickColor)}\n />\n </span>\n }\n />\n );\n}\n\n/** The `color` type. */\nexport function ColorFieldEntry(props: FieldEntryProps) {\n return (\n <ColorField\n {...getFieldProps(props)}\n value={isString(props.value) ? props.value : null}\n onChange={props.onChange}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAeA,SAAgBW,eAAeC,OAAuB;CAClD,MAAMC,UAAUD,MAAME,KAAK,CAAC,CAACC,YAAY;CACzC,MAAMC,SAASH,QAAQI,QAAQ,MAAM,EAAE;CACvC,I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,IAAAC,EAAA,OAAAM,OAAA;EAGSP,KAAArB,cAAc4B,KAAK;EAACN,EAAA,KAAAM;EAAAN,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CACjB,MAAAS,KAAA9B,SAAS2B,MAAKlB,KAA2B,IAAjBkB,MAAKlB,QAA7B;CAA0C,IAAAwB;CAAA,IAAAZ,EAAA,OAAAM,MAAAD,YAAAL,EAAA,OAAAD,MAAAC,EAAA,OAAAS,IAAA;EAFrDG,KAAA,oBAAC,YAAD;GAAW,GACHb;GACG,OAAAU;GACG,UAAAH,MAAKD;EAAS,CAAA;EAC1BL,EAAA,KAAAM,MAAAD;EAAAL,EAAA,KAAAD;EAAAC,EAAA,KAAAS;EAAAT,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAJFY;AAIE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./ColorField.css";
|
|
2
2
|
//#region src/color/ColorField.module.css
|
|
3
|
-
var swatch = "panneau-swatch
|
|
4
|
-
var picker = "panneau-picker
|
|
5
|
-
var input = "panneau-input
|
|
3
|
+
var swatch = "panneau-color-field-swatch";
|
|
4
|
+
var picker = "panneau-color-field-picker";
|
|
5
|
+
var input = "panneau-color-field-input";
|
|
6
6
|
var ColorField_module_default = {
|
|
7
7
|
swatch,
|
|
8
8
|
picker,
|
package/dist/color/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ColorField, ColorFieldEntry, type ColorFieldProps, normalizeColor } from './ColorField';
|
|
1
|
+
export { ColorField, ColorFieldEntry, type ColorFieldProps, normalizeColor } from './ColorField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/date/DateField.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","names":["disabled","readOnly","required","_c"],"sources":["../../src/date/DateField.tsx"],"sourcesContent":["import { DatePicker } from '@panneau/ui';\n\nimport { toCalendarDate } from '../shared/dates';\nimport { getFieldProps, isString } from '../shared/entry';\nimport type { FieldEntryProps, FieldProps } from '../shared/types';\n\nexport interface DateFieldProps extends FieldProps<string> {\n /** Earliest date (`2026-01-01`). */\n min?: string;\n /** Latest date. */\n max?: string;\n controlClassName?: string;\n}\n\n/**\n * A date as an ISO string (`2026-10-15`), typed in the order of the locale or picked in a\n * calendar.\n */\nexport function DateField({\n value,\n onChange,\n min,\n max,\n disabled,\n readOnly,\n required,\n ...props\n}: DateFieldProps) {\n const minValue = toCalendarDate(min);\n const maxValue = toCalendarDate(max);\n return (\n <DatePicker\n {...props}\n granularity=\"day\"\n value={toCalendarDate(value)}\n onChange={(date) => onChange?.(date === null ? null : date.toString().slice(0, 10))}\n {...(minValue !== null ? { minValue } : {})}\n {...(maxValue !== null ? { maxValue } : {})}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n />\n );\n}\n\n/** The `date` type. */\nexport function DateFieldEntry(props: FieldEntryProps) {\n return (\n <DateField\n {...getFieldProps(props)}\n value={isString(props.value) ? props.value : null}\n onChange={props.onChange}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,
|
|
1
|
+
{"version":3,"file":"DateField.js","names":["DatePicker","toCalendarDate","getFieldProps","isString","FieldEntryProps","FieldProps","DateFieldProps","min","max","controlClassName","DateField","t0","$","_c","disabled","onChange","props","readOnly","required","value","t1","minValue","t2","maxValue","t3","t4","date","toString","slice","t5","t6","t7","DateFieldEntry","_c"],"sources":["../../src/date/DateField.tsx"],"sourcesContent":["import { DatePicker } from '@panneau/ui';\n\nimport { toCalendarDate } from '../shared/dates';\nimport { getFieldProps, isString } from '../shared/entry';\nimport type { FieldEntryProps, FieldProps } from '../shared/types';\n\nexport interface DateFieldProps extends FieldProps<string> {\n /** Earliest date (`2026-01-01`). */\n min?: string;\n /** Latest date. */\n max?: string;\n controlClassName?: string;\n}\n\n/**\n * A date as an ISO string (`2026-10-15`), typed in the order of the locale or picked in a\n * calendar.\n */\nexport function DateField({\n value,\n onChange,\n min,\n max,\n disabled,\n readOnly,\n required,\n ...props\n}: DateFieldProps) {\n const minValue = toCalendarDate(min);\n const maxValue = toCalendarDate(max);\n return (\n <DatePicker\n {...props}\n granularity=\"day\"\n value={toCalendarDate(value)}\n onChange={(date) => onChange?.(date === null ? null : date.toString().slice(0, 10))}\n {...(minValue !== null ? { minValue } : {})}\n {...(maxValue !== null ? { maxValue } : {})}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n />\n );\n}\n\n/** The `date` type. */\nexport function DateFieldEntry(props: FieldEntryProps) {\n return (\n <DateField\n {...getFieldProps(props)}\n value={isString(props.value) ? props.value : null}\n onChange={props.onChange}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AAkBA,SAAOU,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAN;CAAA,IAAAD;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAQ,OAAAJ,UAAAR,KAAAC,KAAAM,UAAAG,UAAAC,UAAA,GAAAF,SAAAL;EASTC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAJ;EAAAI,EAAA,KAAAL;EAAAK,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAA;EAAAL,WAAAF,EAAA;EAAAJ,MAAAI,EAAA;EAAAL,MAAAK,EAAA;EAAAG,WAAAH,EAAA;EAAAI,QAAAJ,EAAA;EAAAK,WAAAL,EAAA;EAAAM,WAAAN,EAAA;EAAAO,QAAAP,EAAA;CAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,OAAAL,KAAA;EACIa,KAAAnB,eAAeM,GAAG;EAACK,EAAA,KAAAL;EAAAK,EAAA,MAAAQ;CA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GACAG,YAAAA;GACAC,YAAAA;EAAQ,CAAA;EACtBN,EAAA,MAAAE;EAAAF,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAVFmB;AAUE;;AAKV,SAAOC,eAAAhB,OAAA;CAAA,MAAAJ,IAAAC,EAAA,CAAA;CAAA,IAAAF;CAAA,IAAAC,EAAA,OAAAI,OAAA;EAGSL,KAAAT,cAAcc,KAAK;EAACJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CACjB,MAAAQ,KAAAjB,SAASa,MAAKG,KAA2B,IAAjBH,MAAKG,QAA7B;CAA0C,IAAAG;CAAA,IAAAV,EAAA,OAAAI,MAAAD,YAAAH,EAAA,OAAAD,MAAAC,EAAA,OAAAQ,IAAA;EAFrDE,KAAA,oBAAC,WAAD;GAAU,GACFX;GACG,OAAAS;GACG,UAAAJ,MAAKD;EAAS,CAAA;EAC1BH,EAAA,KAAAI,MAAAD;EAAAH,EAAA,KAAAD;EAAAC,EAAA,KAAAQ;EAAAR,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAJFU;AAIE"}
|
package/dist/date/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DateField, DateFieldEntry, type DateFieldProps } from './DateField';
|
|
1
|
+
export { DateField, DateFieldEntry, type DateFieldProps } from './DateField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
2
2
|
export interface DateTimeFieldProps extends FieldProps<string> {
|
|
3
3
|
/**
|
|
4
4
|
* Time zone the date and time are shown and typed in, for values with an offset. Defaults to
|
|
@@ -10,28 +10,115 @@ import { getLocalTimeZone, now } from "@internationalized/date";
|
|
|
10
10
|
* the time zone of the browser and written back in UTC. Values without one
|
|
11
11
|
* (`2026-10-15T09:30:00`) are kept without one.
|
|
12
12
|
*/
|
|
13
|
-
function DateTimeField(
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
function DateTimeField(t0) {
|
|
14
|
+
const $ = c(34);
|
|
15
|
+
let disabled;
|
|
16
|
+
let onChange;
|
|
17
|
+
let props;
|
|
18
|
+
let readOnly;
|
|
19
|
+
let required;
|
|
20
|
+
let t1;
|
|
21
|
+
let t2;
|
|
22
|
+
let value;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({value, onChange, timeZone: t1, withSeconds: t2, disabled, readOnly, required, ...props} = t0);
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
$[1] = disabled;
|
|
27
|
+
$[2] = onChange;
|
|
28
|
+
$[3] = props;
|
|
29
|
+
$[4] = readOnly;
|
|
30
|
+
$[5] = required;
|
|
31
|
+
$[6] = t1;
|
|
32
|
+
$[7] = t2;
|
|
33
|
+
$[8] = value;
|
|
34
|
+
} else {
|
|
35
|
+
disabled = $[1];
|
|
36
|
+
onChange = $[2];
|
|
37
|
+
props = $[3];
|
|
38
|
+
readOnly = $[4];
|
|
39
|
+
required = $[5];
|
|
40
|
+
t1 = $[6];
|
|
41
|
+
t2 = $[7];
|
|
42
|
+
value = $[8];
|
|
43
|
+
}
|
|
44
|
+
let T0;
|
|
45
|
+
let t3;
|
|
46
|
+
let t4;
|
|
47
|
+
let t5;
|
|
48
|
+
let t6;
|
|
49
|
+
let t7;
|
|
50
|
+
let t8;
|
|
51
|
+
if ($[9] !== onChange || $[10] !== props || $[11] !== t1 || $[12] !== t2 || $[13] !== value) {
|
|
52
|
+
const timeZone = t1 === void 0 ? getLocalTimeZone() : t1;
|
|
53
|
+
const withSeconds = t2 === void 0 ? false : t2;
|
|
54
|
+
const current = toDateTime(value, timeZone);
|
|
55
|
+
T0 = DatePicker;
|
|
56
|
+
t3 = props;
|
|
57
|
+
t4 = withSeconds ? "second" : "minute";
|
|
58
|
+
t5 = true;
|
|
59
|
+
t6 = current;
|
|
60
|
+
if ($[21] !== onChange) {
|
|
61
|
+
t7 = (next) => {
|
|
62
|
+
if (next === null) {
|
|
63
|
+
onChange?.(null);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if ("hour" in next) onChange?.(fromDateTime(next));
|
|
67
|
+
};
|
|
68
|
+
$[21] = onChange;
|
|
69
|
+
$[22] = t7;
|
|
70
|
+
} else t7 = $[22];
|
|
71
|
+
t8 = current ?? now(timeZone).set({
|
|
28
72
|
second: 0,
|
|
29
73
|
millisecond: 0
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
74
|
+
});
|
|
75
|
+
$[9] = onChange;
|
|
76
|
+
$[10] = props;
|
|
77
|
+
$[11] = t1;
|
|
78
|
+
$[12] = t2;
|
|
79
|
+
$[13] = value;
|
|
80
|
+
$[14] = T0;
|
|
81
|
+
$[15] = t3;
|
|
82
|
+
$[16] = t4;
|
|
83
|
+
$[17] = t5;
|
|
84
|
+
$[18] = t6;
|
|
85
|
+
$[19] = t7;
|
|
86
|
+
$[20] = t8;
|
|
87
|
+
} else {
|
|
88
|
+
T0 = $[14];
|
|
89
|
+
t3 = $[15];
|
|
90
|
+
t4 = $[16];
|
|
91
|
+
t5 = $[17];
|
|
92
|
+
t6 = $[18];
|
|
93
|
+
t7 = $[19];
|
|
94
|
+
t8 = $[20];
|
|
95
|
+
}
|
|
96
|
+
let t9;
|
|
97
|
+
if ($[23] !== T0 || $[24] !== disabled || $[25] !== readOnly || $[26] !== required || $[27] !== t3 || $[28] !== t4 || $[29] !== t5 || $[30] !== t6 || $[31] !== t7 || $[32] !== t8) {
|
|
98
|
+
t9 = /* @__PURE__ */ jsx(T0, {
|
|
99
|
+
...t3,
|
|
100
|
+
granularity: t4,
|
|
101
|
+
hideTimeZone: t5,
|
|
102
|
+
value: t6,
|
|
103
|
+
onChange: t7,
|
|
104
|
+
placeholderValue: t8,
|
|
105
|
+
isDisabled: disabled,
|
|
106
|
+
isReadOnly: readOnly,
|
|
107
|
+
isRequired: required
|
|
108
|
+
});
|
|
109
|
+
$[23] = T0;
|
|
110
|
+
$[24] = disabled;
|
|
111
|
+
$[25] = readOnly;
|
|
112
|
+
$[26] = required;
|
|
113
|
+
$[27] = t3;
|
|
114
|
+
$[28] = t4;
|
|
115
|
+
$[29] = t5;
|
|
116
|
+
$[30] = t6;
|
|
117
|
+
$[31] = t7;
|
|
118
|
+
$[32] = t8;
|
|
119
|
+
$[33] = t9;
|
|
120
|
+
} else t9 = $[33];
|
|
121
|
+
return t9;
|
|
35
122
|
}
|
|
36
123
|
/** The `datetime` type: setting `timeZone`. */
|
|
37
124
|
function DateTimeFieldEntry(props) {
|