@art-design-digital/payload-plugin-forms-v3 1.0.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 +175 -0
- package/dist/collections/Forms.d.ts +3 -0
- package/dist/collections/Forms.js +64 -0
- package/dist/collections/Forms.js.map +1 -0
- package/dist/components/FormFieldRowLabel.d.ts +1 -0
- package/dist/components/FormFieldRowLabel.js +23 -0
- package/dist/components/FormFieldRowLabel.js.map +1 -0
- package/dist/components/OptionRowLabel.d.ts +1 -0
- package/dist/components/OptionRowLabel.js +21 -0
- package/dist/components/OptionRowLabel.js.map +1 -0
- package/dist/constants.d.ts +36 -0
- package/dist/constants.js +41 -0
- package/dist/constants.js.map +1 -0
- package/dist/exports/client.d.ts +2 -0
- package/dist/exports/client.js +4 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +1 -0
- package/dist/exports/rsc.js +2 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/fields/formFields/autocompleteField.d.ts +2 -0
- package/dist/fields/formFields/autocompleteField.js +63 -0
- package/dist/fields/formFields/autocompleteField.js.map +1 -0
- package/dist/fields/formFields/conditionGroup.d.ts +2 -0
- package/dist/fields/formFields/conditionGroup.js +36 -0
- package/dist/fields/formFields/conditionGroup.js.map +1 -0
- package/dist/fields/formFields/dateRow.d.ts +2 -0
- package/dist/fields/formFields/dateRow.js +29 -0
- package/dist/fields/formFields/dateRow.js.map +1 -0
- package/dist/fields/formFields/emptyDefaultField.d.ts +2 -0
- package/dist/fields/formFields/emptyDefaultField.js +13 -0
- package/dist/fields/formFields/emptyDefaultField.js.map +1 -0
- package/dist/fields/formFields/fieldTypeField.d.ts +2 -0
- package/dist/fields/formFields/fieldTypeField.js +64 -0
- package/dist/fields/formFields/fieldTypeField.js.map +1 -0
- package/dist/fields/formFields/index.d.ts +12 -0
- package/dist/fields/formFields/index.js +14 -0
- package/dist/fields/formFields/index.js.map +1 -0
- package/dist/fields/formFields/labelDescriptionRow.d.ts +6 -0
- package/dist/fields/formFields/labelDescriptionRow.js +31 -0
- package/dist/fields/formFields/labelDescriptionRow.js.map +1 -0
- package/dist/fields/formFields/lengthRow.d.ts +2 -0
- package/dist/fields/formFields/lengthRow.js +27 -0
- package/dist/fields/formFields/lengthRow.js.map +1 -0
- package/dist/fields/formFields/numberRow.d.ts +2 -0
- package/dist/fields/formFields/numberRow.js +37 -0
- package/dist/fields/formFields/numberRow.js.map +1 -0
- package/dist/fields/formFields/optionsArray.d.ts +6 -0
- package/dist/fields/formFields/optionsArray.js +44 -0
- package/dist/fields/formFields/optionsArray.js.map +1 -0
- package/dist/fields/formFields/placeholderDefaultRow.d.ts +6 -0
- package/dist/fields/formFields/placeholderDefaultRow.js +29 -0
- package/dist/fields/formFields/placeholderDefaultRow.js.map +1 -0
- package/dist/fields/formFields/requiredWidthRow.d.ts +2 -0
- package/dist/fields/formFields/requiredWidthRow.js +30 -0
- package/dist/fields/formFields/requiredWidthRow.js.map +1 -0
- package/dist/fields/formFields/textareaRow.d.ts +2 -0
- package/dist/fields/formFields/textareaRow.js +14 -0
- package/dist/fields/formFields/textareaRow.js.map +1 -0
- package/dist/fields/formFieldsArray.d.ts +6 -0
- package/dist/fields/formFieldsArray.js +41 -0
- package/dist/fields/formFieldsArray.js.map +1 -0
- package/dist/fields/index.d.ts +3 -0
- package/dist/fields/index.js +5 -0
- package/dist/fields/index.js.map +1 -0
- package/dist/fields/messagesGroup.d.ts +6 -0
- package/dist/fields/messagesGroup.js +37 -0
- package/dist/fields/messagesGroup.js.map +1 -0
- package/dist/fields/senderReceiverGroup.d.ts +2 -0
- package/dist/fields/senderReceiverGroup.js +54 -0
- package/dist/fields/senderReceiverGroup.js.map +1 -0
- package/dist/i18n/locales/de.d.ts +193 -0
- package/dist/i18n/locales/de.js +195 -0
- package/dist/i18n/locales/de.js.map +1 -0
- package/dist/i18n/locales/en.d.ts +193 -0
- package/dist/i18n/locales/en.js +195 -0
- package/dist/i18n/locales/en.js.map +1 -0
- package/dist/i18n/locales/es.d.ts +193 -0
- package/dist/i18n/locales/es.js +195 -0
- package/dist/i18n/locales/es.js.map +1 -0
- package/dist/i18n/locales/fr.d.ts +193 -0
- package/dist/i18n/locales/fr.js +195 -0
- package/dist/i18n/locales/fr.js.map +1 -0
- package/dist/i18n/locales/index.d.ts +5 -0
- package/dist/i18n/locales/index.js +7 -0
- package/dist/i18n/locales/index.js.map +1 -0
- package/dist/i18n/locales/nl.d.ts +193 -0
- package/dist/i18n/locales/nl.js +195 -0
- package/dist/i18n/locales/nl.js.map +1 -0
- package/dist/i18n/translations.d.ts +1166 -0
- package/dist/i18n/translations.js +223 -0
- package/dist/i18n/translations.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +104 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/conditions.d.ts +46 -0
- package/dist/utils/conditions.js +79 -0
- package/dist/utils/conditions.js.map +1 -0
- package/package.json +122 -0
package/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Payload Plugin Menus v3
|
|
2
|
+
|
|
3
|
+
A flexible navigation menu plugin for [Payload CMS](https://payloadcms.com) v3.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Create and manage navigation menus with nested items (up to 3 levels)
|
|
8
|
+
- Support for internal links (references to collections), external links, and parent items with children
|
|
9
|
+
- Optional icon picker with [react-icons](https://react-icons.github.io/react-icons/) support
|
|
10
|
+
- Full i18n support (EN, DE, ES, FR, NL)
|
|
11
|
+
- Localized menu labels and URLs
|
|
12
|
+
- Validation for required fields
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install payload-plugin-menus-v3
|
|
18
|
+
# or
|
|
19
|
+
pnpm add payload-plugin-menus-v3
|
|
20
|
+
# or
|
|
21
|
+
yarn add payload-plugin-menus-v3
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Optional: Icon Picker
|
|
25
|
+
|
|
26
|
+
If you want to use the icon picker feature, you also need to install `react-icons`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install react-icons
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
Add the plugin to your Payload config:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { buildConfig } from 'payload'
|
|
38
|
+
import { menusPlugin } from 'payload-plugin-menus-v3'
|
|
39
|
+
|
|
40
|
+
export default buildConfig({
|
|
41
|
+
// ... your config
|
|
42
|
+
plugins: [
|
|
43
|
+
menusPlugin({
|
|
44
|
+
// Link to these collections for internal links
|
|
45
|
+
linkableCollections: ['pages', 'posts'],
|
|
46
|
+
// Optional: Menu nesting depth (1-3, default: 2)
|
|
47
|
+
levels: 2,
|
|
48
|
+
// Optional: Admin group name
|
|
49
|
+
adminGroup: 'Navigation',
|
|
50
|
+
// Optional: Enable localization for labels and URLs
|
|
51
|
+
localized: true,
|
|
52
|
+
// Optional: Enable icon picker (default: false)
|
|
53
|
+
allowIcons: true,
|
|
54
|
+
// Optional: Icon pack to use (default: 'Phosphor Icons')
|
|
55
|
+
iconPack: 'Phosphor Icons',
|
|
56
|
+
// Optional: Disable the plugin
|
|
57
|
+
disabled: false,
|
|
58
|
+
}),
|
|
59
|
+
],
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Configuration Options
|
|
64
|
+
|
|
65
|
+
| Option | Type | Default | Description |
|
|
66
|
+
|--------|------|---------|-------------|
|
|
67
|
+
| `linkableCollections` | `string[]` | `[]` | Collection slugs that can be linked to for internal links |
|
|
68
|
+
| `levels` | `1 \| 2 \| 3` | `2` | Maximum nesting depth for menu items |
|
|
69
|
+
| `adminGroup` | `string` | `undefined` | Admin panel group name for the Menus collection |
|
|
70
|
+
| `localized` | `boolean` | `false` | Enable localization for menu item labels and URLs |
|
|
71
|
+
| `allowIcons` | `boolean` | `false` | Enable the icon picker field for menu items |
|
|
72
|
+
| `iconPack` | `IconPackType` | `'Phosphor Icons'` | Icon pack to use (requires `react-icons`) |
|
|
73
|
+
| `allowPreviewImages` | `boolean` | `false` | Enable preview image upload for menu items |
|
|
74
|
+
| `previewImagesMediaCollection` | `string` | `'media'` | Media collection slug for preview images |
|
|
75
|
+
| `access` | `CollectionConfig['access']` | `{ read: () => true }` | Override access control for the Menus collection |
|
|
76
|
+
| `disabled` | `boolean` | `false` | Disable the plugin |
|
|
77
|
+
|
|
78
|
+
### Available Icon Packs
|
|
79
|
+
|
|
80
|
+
When `allowIcons` is enabled, you can choose from these icon packs:
|
|
81
|
+
|
|
82
|
+
- `'Phosphor Icons'` (default)
|
|
83
|
+
- `'Bootstrap Icons'`
|
|
84
|
+
- `'Feather Icons'`
|
|
85
|
+
- `'Font Awesome 6'`
|
|
86
|
+
- `'Heroicons 2'`
|
|
87
|
+
- `'Lucide Icons'`
|
|
88
|
+
- `'Material Design Icons'`
|
|
89
|
+
- `'Remix Icons'`
|
|
90
|
+
- `'Tabler Icons'`
|
|
91
|
+
|
|
92
|
+
## Menu Item Structure
|
|
93
|
+
|
|
94
|
+
Each menu item is organized into two tabs:
|
|
95
|
+
|
|
96
|
+
### Link Settings Tab
|
|
97
|
+
|
|
98
|
+
| Field | Description |
|
|
99
|
+
|-------|-------------|
|
|
100
|
+
| `label` | Display text for the menu item (required) |
|
|
101
|
+
| `linkType` | Type of link: `internal`, `external`, or `children` |
|
|
102
|
+
| `customURL` | External URL (when `linkType` is `external`, must start with `https://`) |
|
|
103
|
+
| `reference` | Reference to a document (when `linkType` is `internal`) |
|
|
104
|
+
| `anchor` | Optional anchor/hash for internal links (e.g., `#section`) |
|
|
105
|
+
| `openInNewTab` | Open link in a new tab |
|
|
106
|
+
| `children` | Nested menu items (when `linkType` is `children`) |
|
|
107
|
+
|
|
108
|
+
### Appearance Tab
|
|
109
|
+
|
|
110
|
+
| Field | Description |
|
|
111
|
+
|-------|-------------|
|
|
112
|
+
| `highlight` | Highlight this menu item (e.g., for CTA buttons) |
|
|
113
|
+
| `marginTop` | Add spacing above this item (child items only) |
|
|
114
|
+
| `icon` | Selected icon name (when `allowIcons` is enabled) |
|
|
115
|
+
| `previewImage` | Reference to a media item (when `allowPreviewImages` is enabled) |
|
|
116
|
+
|
|
117
|
+
## Using the IconPicker Field Standalone
|
|
118
|
+
|
|
119
|
+
You can also use the icon picker field in your own collections:
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { iconPickerField } from 'payload-plugin-menus-v3'
|
|
123
|
+
|
|
124
|
+
const MyCollection = {
|
|
125
|
+
slug: 'my-collection',
|
|
126
|
+
fields: [
|
|
127
|
+
iconPickerField({
|
|
128
|
+
name: 'icon',
|
|
129
|
+
label: 'Icon',
|
|
130
|
+
iconPack: 'Lucide Icons',
|
|
131
|
+
}),
|
|
132
|
+
],
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Fetching Menus
|
|
137
|
+
|
|
138
|
+
You can fetch menus using the Payload Local API or REST API:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
// Local API
|
|
142
|
+
const menu = await payload.find({
|
|
143
|
+
collection: 'menus',
|
|
144
|
+
where: {
|
|
145
|
+
title: { equals: 'Main Navigation' },
|
|
146
|
+
},
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
// REST API
|
|
150
|
+
// GET /api/menus?where[title][equals]=Main Navigation
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## i18n Support
|
|
154
|
+
|
|
155
|
+
The plugin includes translations for:
|
|
156
|
+
|
|
157
|
+
- English (en)
|
|
158
|
+
- German (de)
|
|
159
|
+
- Spanish (es)
|
|
160
|
+
- French (fr)
|
|
161
|
+
- Dutch (nl)
|
|
162
|
+
|
|
163
|
+
All field labels, validation messages, and UI elements are translated based on your Payload admin language setting.
|
|
164
|
+
|
|
165
|
+
## TypeScript
|
|
166
|
+
|
|
167
|
+
The plugin exports types for use in your project:
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
import type { MenusPluginConfig, IconPackType } from 'payload-plugin-menus-v3'
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
MIT
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createFormFieldsArray, createMessagesGroup, senderReceiverGroup } from '../fields/index.js';
|
|
2
|
+
import { labels } from '../i18n/translations.js';
|
|
3
|
+
export const createFormsCollection = (config)=>{
|
|
4
|
+
const { access, adminGroup, localized = false } = config;
|
|
5
|
+
return {
|
|
6
|
+
slug: 'forms',
|
|
7
|
+
access: {
|
|
8
|
+
read: ()=>true,
|
|
9
|
+
...access
|
|
10
|
+
},
|
|
11
|
+
admin: {
|
|
12
|
+
description: labels.collection.description,
|
|
13
|
+
group: adminGroup,
|
|
14
|
+
useAsTitle: 'name'
|
|
15
|
+
},
|
|
16
|
+
fields: [
|
|
17
|
+
{
|
|
18
|
+
name: 'name',
|
|
19
|
+
type: 'text',
|
|
20
|
+
admin: {
|
|
21
|
+
description: labels.fields.name.description
|
|
22
|
+
},
|
|
23
|
+
label: labels.fields.name.label,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: 'tabs',
|
|
28
|
+
tabs: [
|
|
29
|
+
{
|
|
30
|
+
description: labels.tabs.senderReceiver.description,
|
|
31
|
+
fields: [
|
|
32
|
+
senderReceiverGroup
|
|
33
|
+
],
|
|
34
|
+
label: labels.tabs.senderReceiver.label
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
description: labels.tabs.messages.description,
|
|
38
|
+
fields: [
|
|
39
|
+
createMessagesGroup({
|
|
40
|
+
localized
|
|
41
|
+
})
|
|
42
|
+
],
|
|
43
|
+
label: labels.tabs.messages.label
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description: labels.tabs.formFields.description,
|
|
47
|
+
fields: [
|
|
48
|
+
createFormFieldsArray({
|
|
49
|
+
localized
|
|
50
|
+
})
|
|
51
|
+
],
|
|
52
|
+
label: labels.tabs.formFields.label
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
labels: {
|
|
58
|
+
plural: labels.collection.plural,
|
|
59
|
+
singular: labels.collection.singular
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=Forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/collections/Forms.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport type { FormsPluginConfig } from '../types.js'\n\nimport { createFormFieldsArray, createMessagesGroup, senderReceiverGroup } from '../fields/index.js'\nimport { labels } from '../i18n/translations.js'\n\nexport const createFormsCollection = (config: FormsPluginConfig): CollectionConfig => {\n const { access, adminGroup, localized = false } = config\n\n return {\n slug: 'forms',\n access: {\n read: () => true,\n ...access,\n },\n admin: {\n description: labels.collection.description,\n group: adminGroup,\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n admin: {\n description: labels.fields.name.description,\n },\n label: labels.fields.name.label,\n required: true,\n },\n {\n type: 'tabs',\n tabs: [\n {\n description: labels.tabs.senderReceiver.description,\n fields: [senderReceiverGroup],\n label: labels.tabs.senderReceiver.label,\n },\n {\n description: labels.tabs.messages.description,\n fields: [createMessagesGroup({ localized })],\n label: labels.tabs.messages.label,\n },\n {\n description: labels.tabs.formFields.description,\n fields: [createFormFieldsArray({ localized })],\n label: labels.tabs.formFields.label,\n },\n ],\n },\n ],\n labels: {\n plural: labels.collection.plural,\n singular: labels.collection.singular,\n },\n }\n}\n"],"names":["createFormFieldsArray","createMessagesGroup","senderReceiverGroup","labels","createFormsCollection","config","access","adminGroup","localized","slug","read","admin","description","collection","group","useAsTitle","fields","name","type","label","required","tabs","senderReceiver","messages","formFields","plural","singular"],"mappings":"AAIA,SAASA,qBAAqB,EAAEC,mBAAmB,EAAEC,mBAAmB,QAAQ,qBAAoB;AACpG,SAASC,MAAM,QAAQ,0BAAyB;AAEhD,OAAO,MAAMC,wBAAwB,CAACC;IACpC,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAEC,YAAY,KAAK,EAAE,GAAGH;IAElD,OAAO;QACLI,MAAM;QACNH,QAAQ;YACNI,MAAM,IAAM;YACZ,GAAGJ,MAAM;QACX;QACAK,OAAO;YACLC,aAAaT,OAAOU,UAAU,CAACD,WAAW;YAC1CE,OAAOP;YACPQ,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLC,aAAaT,OAAOa,MAAM,CAACC,IAAI,CAACL,WAAW;gBAC7C;gBACAO,OAAOhB,OAAOa,MAAM,CAACC,IAAI,CAACE,KAAK;gBAC/BC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNG,MAAM;oBACJ;wBACET,aAAaT,OAAOkB,IAAI,CAACC,cAAc,CAACV,WAAW;wBACnDI,QAAQ;4BAACd;yBAAoB;wBAC7BiB,OAAOhB,OAAOkB,IAAI,CAACC,cAAc,CAACH,KAAK;oBACzC;oBACA;wBACEP,aAAaT,OAAOkB,IAAI,CAACE,QAAQ,CAACX,WAAW;wBAC7CI,QAAQ;4BAACf,oBAAoB;gCAAEO;4BAAU;yBAAG;wBAC5CW,OAAOhB,OAAOkB,IAAI,CAACE,QAAQ,CAACJ,KAAK;oBACnC;oBACA;wBACEP,aAAaT,OAAOkB,IAAI,CAACG,UAAU,CAACZ,WAAW;wBAC/CI,QAAQ;4BAAChB,sBAAsB;gCAAEQ;4BAAU;yBAAG;wBAC9CW,OAAOhB,OAAOkB,IAAI,CAACG,UAAU,CAACL,KAAK;oBACrC;iBACD;YACH;SACD;QACDhB,QAAQ;YACNsB,QAAQtB,OAAOU,UAAU,CAACY,MAAM;YAChCC,UAAUvB,OAAOU,UAAU,CAACa,QAAQ;QACtC;IACF;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FormFieldRowLabel: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRowLabel } from '@payloadcms/ui';
|
|
4
|
+
import { WIDTHS } from '../constants.js';
|
|
5
|
+
import { locales } from '../i18n/translations.js';
|
|
6
|
+
export const FormFieldRowLabel = ()=>{
|
|
7
|
+
const { data, rowNumber } = useRowLabel();
|
|
8
|
+
const label = data?.label;
|
|
9
|
+
const width = data?.width ? WIDTHS[data.width] : '1/1';
|
|
10
|
+
if (label) {
|
|
11
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
12
|
+
children: `${label} (${width})`
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const lang = typeof document !== 'undefined' ? document.documentElement.lang || 'en' : 'en';
|
|
16
|
+
const fallback = locales[lang]?.formFields.fallback || locales.en.formFields.fallback;
|
|
17
|
+
const paddedNumber = String((rowNumber ?? 0) + 1).padStart(2, '0');
|
|
18
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
19
|
+
children: `${fallback} | ${paddedNumber} (${width})`
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=FormFieldRowLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/FormFieldRowLabel.tsx"],"sourcesContent":["'use client'\n\nimport { useRowLabel } from '@payloadcms/ui'\n\nimport type { Width } from '../constants.js'\n\nimport { WIDTHS } from '../constants.js'\nimport { locales } from '../i18n/translations.js'\n\nexport const FormFieldRowLabel = () => {\n const { data, rowNumber } = useRowLabel<{ label?: string; width?: Width }>()\n\n const label = data?.label\n const width = data?.width ? WIDTHS[data.width] : '1/1'\n\n if (label) {\n return <span>{`${label} (${width})`}</span>\n }\n\n const lang = typeof document !== 'undefined' ? document.documentElement.lang || 'en' : 'en'\n const fallback =\n locales[lang as keyof typeof locales]?.formFields.fallback || locales.en.formFields.fallback\n\n const paddedNumber = String((rowNumber ?? 0) + 1).padStart(2, '0')\n return <span>{`${fallback} | ${paddedNumber} (${width})`}</span>\n}\n"],"names":["useRowLabel","WIDTHS","locales","FormFieldRowLabel","data","rowNumber","label","width","span","lang","document","documentElement","fallback","formFields","en","paddedNumber","String","padStart"],"mappings":"AAAA;;AAEA,SAASA,WAAW,QAAQ,iBAAgB;AAI5C,SAASC,MAAM,QAAQ,kBAAiB;AACxC,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,OAAO,MAAMC,oBAAoB;IAC/B,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGL;IAE5B,MAAMM,QAAQF,MAAME;IACpB,MAAMC,QAAQH,MAAMG,QAAQN,MAAM,CAACG,KAAKG,KAAK,CAAC,GAAG;IAEjD,IAAID,OAAO;QACT,qBAAO,KAACE;sBAAM,GAAGF,MAAM,EAAE,EAAEC,MAAM,CAAC,CAAC;;IACrC;IAEA,MAAME,OAAO,OAAOC,aAAa,cAAcA,SAASC,eAAe,CAACF,IAAI,IAAI,OAAO;IACvF,MAAMG,WACJV,OAAO,CAACO,KAA6B,EAAEI,WAAWD,YAAYV,QAAQY,EAAE,CAACD,UAAU,CAACD,QAAQ;IAE9F,MAAMG,eAAeC,OAAO,AAACX,CAAAA,aAAa,CAAA,IAAK,GAAGY,QAAQ,CAAC,GAAG;IAC9D,qBAAO,KAACT;kBAAM,GAAGI,SAAS,GAAG,EAAEG,aAAa,EAAE,EAAER,MAAM,CAAC,CAAC;;AAC1D,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OptionRowLabel: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRowLabel } from '@payloadcms/ui';
|
|
4
|
+
import { locales } from '../i18n/translations.js';
|
|
5
|
+
export const OptionRowLabel = ()=>{
|
|
6
|
+
const { data, rowNumber } = useRowLabel();
|
|
7
|
+
const value = data?.value;
|
|
8
|
+
if (value) {
|
|
9
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
10
|
+
children: value
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
const lang = typeof document !== 'undefined' ? document.documentElement.lang || 'en' : 'en';
|
|
14
|
+
const fallback = locales[lang]?.formFields.optionFallback || locales.en.formFields.optionFallback;
|
|
15
|
+
const paddedNumber = String((rowNumber ?? 0) + 1).padStart(2, '0');
|
|
16
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
17
|
+
children: `${fallback} | ${paddedNumber}`
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=OptionRowLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/OptionRowLabel.tsx"],"sourcesContent":["'use client'\n\nimport { useRowLabel } from '@payloadcms/ui'\n\nimport { locales } from '../i18n/translations.js'\n\nexport const OptionRowLabel = () => {\n const { data, rowNumber } = useRowLabel<{ value?: string }>()\n\n const value = data?.value\n if (value) {\n return <span>{value}</span>\n }\n\n const lang = typeof document !== 'undefined' ? document.documentElement.lang || 'en' : 'en'\n const fallback =\n locales[lang as keyof typeof locales]?.formFields.optionFallback ||\n locales.en.formFields.optionFallback\n\n const paddedNumber = String((rowNumber ?? 0) + 1).padStart(2, '0')\n return <span>{`${fallback} | ${paddedNumber}`}</span>\n}\n"],"names":["useRowLabel","locales","OptionRowLabel","data","rowNumber","value","span","lang","document","documentElement","fallback","formFields","optionFallback","en","paddedNumber","String","padStart"],"mappings":"AAAA;;AAEA,SAASA,WAAW,QAAQ,iBAAgB;AAE5C,SAASC,OAAO,QAAQ,0BAAyB;AAEjD,OAAO,MAAMC,iBAAiB;IAC5B,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGJ;IAE5B,MAAMK,QAAQF,MAAME;IACpB,IAAIA,OAAO;QACT,qBAAO,KAACC;sBAAMD;;IAChB;IAEA,MAAME,OAAO,OAAOC,aAAa,cAAcA,SAASC,eAAe,CAACF,IAAI,IAAI,OAAO;IACvF,MAAMG,WACJT,OAAO,CAACM,KAA6B,EAAEI,WAAWC,kBAClDX,QAAQY,EAAE,CAACF,UAAU,CAACC,cAAc;IAEtC,MAAME,eAAeC,OAAO,AAACX,CAAAA,aAAa,CAAA,IAAK,GAAGY,QAAQ,CAAC,GAAG;IAC9D,qBAAO,KAACV;kBAAM,GAAGI,SAAS,GAAG,EAAEI,cAAc;;AAC/C,EAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const FIELD_TYPES: {
|
|
2
|
+
readonly checkbox: "checkbox";
|
|
3
|
+
readonly date: "date";
|
|
4
|
+
readonly datetime: "datetime";
|
|
5
|
+
readonly dropdown: "dropdown";
|
|
6
|
+
readonly email: "email";
|
|
7
|
+
readonly number: "number";
|
|
8
|
+
readonly radio: "radio";
|
|
9
|
+
readonly tel: "tel";
|
|
10
|
+
readonly text: "text";
|
|
11
|
+
readonly textarea: "textarea";
|
|
12
|
+
readonly time: "time";
|
|
13
|
+
readonly url: "url";
|
|
14
|
+
};
|
|
15
|
+
export type FieldType = (typeof FIELD_TYPES)[keyof typeof FIELD_TYPES];
|
|
16
|
+
export declare const FIELD_TYPE_VALUES: ("number" | "checkbox" | "date" | "datetime" | "dropdown" | "email" | "radio" | "tel" | "text" | "textarea" | "time" | "url")[];
|
|
17
|
+
export declare const WIDTHS: {
|
|
18
|
+
readonly full: "1/1";
|
|
19
|
+
readonly half: "1/2";
|
|
20
|
+
readonly onequarter: "1/4";
|
|
21
|
+
readonly threequarter: "3/4";
|
|
22
|
+
};
|
|
23
|
+
export type Width = keyof typeof WIDTHS;
|
|
24
|
+
export declare const WIDTH_OPTIONS: readonly [{
|
|
25
|
+
readonly label: "1/1";
|
|
26
|
+
readonly value: "full";
|
|
27
|
+
}, {
|
|
28
|
+
readonly label: "1/2";
|
|
29
|
+
readonly value: "half";
|
|
30
|
+
}, {
|
|
31
|
+
readonly label: "1/4";
|
|
32
|
+
readonly value: "onequarter";
|
|
33
|
+
}, {
|
|
34
|
+
readonly label: "3/4";
|
|
35
|
+
readonly value: "threequarter";
|
|
36
|
+
}];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const FIELD_TYPES = {
|
|
2
|
+
checkbox: 'checkbox',
|
|
3
|
+
date: 'date',
|
|
4
|
+
datetime: 'datetime',
|
|
5
|
+
dropdown: 'dropdown',
|
|
6
|
+
email: 'email',
|
|
7
|
+
number: 'number',
|
|
8
|
+
radio: 'radio',
|
|
9
|
+
tel: 'tel',
|
|
10
|
+
text: 'text',
|
|
11
|
+
textarea: 'textarea',
|
|
12
|
+
time: 'time',
|
|
13
|
+
url: 'url'
|
|
14
|
+
};
|
|
15
|
+
export const FIELD_TYPE_VALUES = Object.values(FIELD_TYPES);
|
|
16
|
+
export const WIDTHS = {
|
|
17
|
+
full: '1/1',
|
|
18
|
+
half: '1/2',
|
|
19
|
+
onequarter: '1/4',
|
|
20
|
+
threequarter: '3/4'
|
|
21
|
+
};
|
|
22
|
+
export const WIDTH_OPTIONS = [
|
|
23
|
+
{
|
|
24
|
+
label: '1/1',
|
|
25
|
+
value: 'full'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: '1/2',
|
|
29
|
+
value: 'half'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: '1/4',
|
|
33
|
+
value: 'onequarter'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: '3/4',
|
|
37
|
+
value: 'threequarter'
|
|
38
|
+
}
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const FIELD_TYPES = {\n checkbox: 'checkbox',\n date: 'date',\n datetime: 'datetime',\n dropdown: 'dropdown',\n email: 'email',\n number: 'number',\n radio: 'radio',\n tel: 'tel',\n text: 'text',\n textarea: 'textarea',\n time: 'time',\n url: 'url',\n} as const\n\nexport type FieldType = (typeof FIELD_TYPES)[keyof typeof FIELD_TYPES]\n\nexport const FIELD_TYPE_VALUES = Object.values(FIELD_TYPES)\n\nexport const WIDTHS = {\n full: '1/1',\n half: '1/2',\n onequarter: '1/4',\n threequarter: '3/4',\n} as const\n\nexport type Width = keyof typeof WIDTHS\n\nexport const WIDTH_OPTIONS = [\n { label: '1/1', value: 'full' },\n { label: '1/2', value: 'half' },\n { label: '1/4', value: 'onequarter' },\n { label: '3/4', value: 'threequarter' },\n] as const\n"],"names":["FIELD_TYPES","checkbox","date","datetime","dropdown","email","number","radio","tel","text","textarea","time","url","FIELD_TYPE_VALUES","Object","values","WIDTHS","full","half","onequarter","threequarter","WIDTH_OPTIONS","label","value"],"mappings":"AAAA,OAAO,MAAMA,cAAc;IACzBC,UAAU;IACVC,MAAM;IACNC,UAAU;IACVC,UAAU;IACVC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLC,MAAM;IACNC,UAAU;IACVC,MAAM;IACNC,KAAK;AACP,EAAU;AAIV,OAAO,MAAMC,oBAAoBC,OAAOC,MAAM,CAACf,aAAY;AAE3D,OAAO,MAAMgB,SAAS;IACpBC,MAAM;IACNC,MAAM;IACNC,YAAY;IACZC,cAAc;AAChB,EAAU;AAIV,OAAO,MAAMC,gBAAgB;IAC3B;QAAEC,OAAO;QAAOC,OAAO;IAAO;IAC9B;QAAED,OAAO;QAAOC,OAAO;IAAO;IAC9B;QAAED,OAAO;QAAOC,OAAO;IAAa;IACpC;QAAED,OAAO;QAAOC,OAAO;IAAe;CACvC,CAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["export { FormFieldRowLabel } from '../components/FormFieldRowLabel.js'\nexport { OptionRowLabel } from '../components/OptionRowLabel.js'\n"],"names":["FormFieldRowLabel","OptionRowLabel"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qCAAoC;AACtE,SAASC,cAAc,QAAQ,kCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/exports/rsc.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForAutocomplete } from '../../utils/conditions.js';
|
|
3
|
+
export const autocompleteField = {
|
|
4
|
+
name: 'autocomplete',
|
|
5
|
+
type: 'select',
|
|
6
|
+
admin: {
|
|
7
|
+
condition: showForAutocomplete,
|
|
8
|
+
description: labels.formFields.fields.autocomplete.description
|
|
9
|
+
},
|
|
10
|
+
label: labels.formFields.fields.autocomplete.label,
|
|
11
|
+
options: [
|
|
12
|
+
{
|
|
13
|
+
label: labels.formFields.fields.autocomplete.options.off,
|
|
14
|
+
value: 'off'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: labels.formFields.fields.autocomplete.options.name,
|
|
18
|
+
value: 'name'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: labels.formFields.fields.autocomplete.options['given-name'],
|
|
22
|
+
value: 'given-name'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: labels.formFields.fields.autocomplete.options['family-name'],
|
|
26
|
+
value: 'family-name'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: labels.formFields.fields.autocomplete.options.email,
|
|
30
|
+
value: 'email'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: labels.formFields.fields.autocomplete.options.tel,
|
|
34
|
+
value: 'tel'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: labels.formFields.fields.autocomplete.options.url,
|
|
38
|
+
value: 'url'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: labels.formFields.fields.autocomplete.options.organization,
|
|
42
|
+
value: 'organization'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: labels.formFields.fields.autocomplete.options['street-address'],
|
|
46
|
+
value: 'street-address'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: labels.formFields.fields.autocomplete.options['postal-code'],
|
|
50
|
+
value: 'postal-code'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: labels.formFields.fields.autocomplete.options['address-level2'],
|
|
54
|
+
value: 'address-level2'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: labels.formFields.fields.autocomplete.options.country,
|
|
58
|
+
value: 'country'
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=autocompleteField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/autocompleteField.ts"],"sourcesContent":["import type { SelectField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForAutocomplete } from '../../utils/conditions.js'\n\nexport const autocompleteField: SelectField = {\n name: 'autocomplete',\n type: 'select',\n admin: {\n condition: showForAutocomplete,\n description: labels.formFields.fields.autocomplete.description,\n },\n label: labels.formFields.fields.autocomplete.label,\n options: [\n { label: labels.formFields.fields.autocomplete.options.off, value: 'off' },\n { label: labels.formFields.fields.autocomplete.options.name, value: 'name' },\n { label: labels.formFields.fields.autocomplete.options['given-name'], value: 'given-name' },\n { label: labels.formFields.fields.autocomplete.options['family-name'], value: 'family-name' },\n { label: labels.formFields.fields.autocomplete.options.email, value: 'email' },\n { label: labels.formFields.fields.autocomplete.options.tel, value: 'tel' },\n { label: labels.formFields.fields.autocomplete.options.url, value: 'url' },\n { label: labels.formFields.fields.autocomplete.options.organization, value: 'organization' },\n {\n label: labels.formFields.fields.autocomplete.options['street-address'],\n value: 'street-address',\n },\n { label: labels.formFields.fields.autocomplete.options['postal-code'], value: 'postal-code' },\n {\n label: labels.formFields.fields.autocomplete.options['address-level2'],\n value: 'address-level2',\n },\n { label: labels.formFields.fields.autocomplete.options.country, value: 'country' },\n ],\n}\n"],"names":["labels","showForAutocomplete","autocompleteField","name","type","admin","condition","description","formFields","fields","autocomplete","label","options","off","value","email","tel","url","organization","country"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,mBAAmB,QAAQ,4BAA2B;AAE/D,OAAO,MAAMC,oBAAiC;IAC5CC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,WAAWL;QACXM,aAAaP,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACH,WAAW;IAChE;IACAI,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACC,KAAK;IAClDC,SAAS;QACP;YAAED,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACC,GAAG;YAAEC,OAAO;QAAM;QACzE;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACT,IAAI;YAAEW,OAAO;QAAO;QAC3E;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAAC,aAAa;YAAEE,OAAO;QAAa;QAC1F;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAAC,cAAc;YAAEE,OAAO;QAAc;QAC5F;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACG,KAAK;YAAED,OAAO;QAAQ;QAC7E;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACI,GAAG;YAAEF,OAAO;QAAM;QACzE;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACK,GAAG;YAAEH,OAAO;QAAM;QACzE;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACM,YAAY;YAAEJ,OAAO;QAAe;QAC3F;YACEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAAC,iBAAiB;YACtEE,OAAO;QACT;QACA;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAAC,cAAc;YAAEE,OAAO;QAAc;QAC5F;YACEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAAC,iBAAiB;YACtEE,OAAO;QACT;QACA;YAAEH,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACE,OAAO,CAACO,OAAO;YAAEL,OAAO;QAAU;KAClF;AACH,EAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
export const conditionGroup = {
|
|
3
|
+
name: 'condition',
|
|
4
|
+
type: 'group',
|
|
5
|
+
admin: {
|
|
6
|
+
description: labels.formFields.fields.condition.description
|
|
7
|
+
},
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
type: 'row',
|
|
11
|
+
fields: [
|
|
12
|
+
{
|
|
13
|
+
name: 'field',
|
|
14
|
+
type: 'text',
|
|
15
|
+
admin: {
|
|
16
|
+
description: labels.formFields.fields.condition.field.description,
|
|
17
|
+
width: '50%'
|
|
18
|
+
},
|
|
19
|
+
label: labels.formFields.fields.condition.field.label
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'value',
|
|
23
|
+
type: 'text',
|
|
24
|
+
admin: {
|
|
25
|
+
description: labels.formFields.fields.condition.value.description,
|
|
26
|
+
width: '50%'
|
|
27
|
+
},
|
|
28
|
+
label: labels.formFields.fields.condition.value.label
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
label: labels.formFields.fields.condition.label
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=conditionGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/conditionGroup.ts"],"sourcesContent":["import type { GroupField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\n\nexport const conditionGroup: GroupField = {\n name: 'condition',\n type: 'group',\n admin: {\n description: labels.formFields.fields.condition.description,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'field',\n type: 'text',\n admin: {\n description: labels.formFields.fields.condition.field.description,\n width: '50%',\n },\n label: labels.formFields.fields.condition.field.label,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n description: labels.formFields.fields.condition.value.description,\n width: '50%',\n },\n label: labels.formFields.fields.condition.value.label,\n },\n ],\n },\n ],\n label: labels.formFields.fields.condition.label,\n}\n"],"names":["labels","conditionGroup","name","type","admin","description","formFields","fields","condition","field","width","label","value"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AAEnD,OAAO,MAAMC,iBAA6B;IACxCC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,aAAaL,OAAOM,UAAU,CAACC,MAAM,CAACC,SAAS,CAACH,WAAW;IAC7D;IACAE,QAAQ;QACN;YACEJ,MAAM;YACNI,QAAQ;gBACN;oBACEL,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,aAAaL,OAAOM,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,KAAK,CAACJ,WAAW;wBACjEK,OAAO;oBACT;oBACAC,OAAOX,OAAOM,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,KAAK,CAACE,KAAK;gBACvD;gBACA;oBACET,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,aAAaL,OAAOM,UAAU,CAACC,MAAM,CAACC,SAAS,CAACI,KAAK,CAACP,WAAW;wBACjEK,OAAO;oBACT;oBACAC,OAAOX,OAAOM,UAAU,CAACC,MAAM,CAACC,SAAS,CAACI,KAAK,CAACD,KAAK;gBACvD;aACD;QACH;KACD;IACDA,OAAOX,OAAOM,UAAU,CAACC,MAAM,CAACC,SAAS,CAACG,KAAK;AACjD,EAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForDateFields } from '../../utils/conditions.js';
|
|
3
|
+
export const dateRow = {
|
|
4
|
+
type: 'row',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'minDate',
|
|
8
|
+
type: 'date',
|
|
9
|
+
admin: {
|
|
10
|
+
condition: showForDateFields,
|
|
11
|
+
description: labels.formFields.fields.minDate.description,
|
|
12
|
+
width: '50%'
|
|
13
|
+
},
|
|
14
|
+
label: labels.formFields.fields.minDate.label
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'maxDate',
|
|
18
|
+
type: 'date',
|
|
19
|
+
admin: {
|
|
20
|
+
condition: showForDateFields,
|
|
21
|
+
description: labels.formFields.fields.maxDate.description,
|
|
22
|
+
width: '50%'
|
|
23
|
+
},
|
|
24
|
+
label: labels.formFields.fields.maxDate.label
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=dateRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/dateRow.ts"],"sourcesContent":["import type { RowField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForDateFields } from '../../utils/conditions.js'\n\nexport const dateRow: RowField = {\n type: 'row',\n fields: [\n {\n name: 'minDate',\n type: 'date',\n admin: {\n condition: showForDateFields,\n description: labels.formFields.fields.minDate.description,\n width: '50%',\n },\n label: labels.formFields.fields.minDate.label,\n },\n {\n name: 'maxDate',\n type: 'date',\n admin: {\n condition: showForDateFields,\n description: labels.formFields.fields.maxDate.description,\n width: '50%',\n },\n label: labels.formFields.fields.maxDate.label,\n },\n ],\n}\n"],"names":["labels","showForDateFields","dateRow","type","fields","name","admin","condition","description","formFields","minDate","width","label","maxDate"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,iBAAiB,QAAQ,4BAA2B;AAE7D,OAAO,MAAMC,UAAoB;IAC/BC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXO,aAAaR,OAAOS,UAAU,CAACL,MAAM,CAACM,OAAO,CAACF,WAAW;gBACzDG,OAAO;YACT;YACAC,OAAOZ,OAAOS,UAAU,CAACL,MAAM,CAACM,OAAO,CAACE,KAAK;QAC/C;QACA;YACEP,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXO,aAAaR,OAAOS,UAAU,CAACL,MAAM,CAACS,OAAO,CAACL,WAAW;gBACzDG,OAAO;YACT;YACAC,OAAOZ,OAAOS,UAAU,CAACL,MAAM,CAACS,OAAO,CAACD,KAAK;QAC/C;KACD;AACH,EAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForOptionsFields } from '../../utils/conditions.js';
|
|
3
|
+
export const emptyDefaultField = {
|
|
4
|
+
name: 'emptyDefault',
|
|
5
|
+
type: 'checkbox',
|
|
6
|
+
admin: {
|
|
7
|
+
condition: showForOptionsFields,
|
|
8
|
+
description: labels.formFields.fields.emptyDefault.description
|
|
9
|
+
},
|
|
10
|
+
label: labels.formFields.fields.emptyDefault.label
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=emptyDefaultField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/emptyDefaultField.ts"],"sourcesContent":["import type { CheckboxField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForOptionsFields } from '../../utils/conditions.js'\n\nexport const emptyDefaultField: CheckboxField = {\n name: 'emptyDefault',\n type: 'checkbox',\n admin: {\n condition: showForOptionsFields,\n description: labels.formFields.fields.emptyDefault.description,\n },\n label: labels.formFields.fields.emptyDefault.label,\n}\n"],"names":["labels","showForOptionsFields","emptyDefaultField","name","type","admin","condition","description","formFields","fields","emptyDefault","label"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,oBAAoB,QAAQ,4BAA2B;AAEhE,OAAO,MAAMC,oBAAmC;IAC9CC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,WAAWL;QACXM,aAAaP,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACH,WAAW;IAChE;IACAI,OAAOX,OAAOQ,UAAU,CAACC,MAAM,CAACC,YAAY,CAACC,KAAK;AACpD,EAAC"}
|