@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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FIELD_TYPES } from '../../constants.js';
|
|
2
|
+
import { labels } from '../../i18n/translations.js';
|
|
3
|
+
export const fieldTypeField = {
|
|
4
|
+
name: 'fieldType',
|
|
5
|
+
type: 'select',
|
|
6
|
+
defaultValue: FIELD_TYPES.text,
|
|
7
|
+
label: labels.formFields.fields.fieldType.label,
|
|
8
|
+
options: [
|
|
9
|
+
// Text inputs
|
|
10
|
+
{
|
|
11
|
+
label: labels.formFields.fields.fieldType.options.text,
|
|
12
|
+
value: FIELD_TYPES.text
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: labels.formFields.fields.fieldType.options.textarea,
|
|
16
|
+
value: FIELD_TYPES.textarea
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: labels.formFields.fields.fieldType.options.email,
|
|
20
|
+
value: FIELD_TYPES.email
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: labels.formFields.fields.fieldType.options.tel,
|
|
24
|
+
value: FIELD_TYPES.tel
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: labels.formFields.fields.fieldType.options.url,
|
|
28
|
+
value: FIELD_TYPES.url
|
|
29
|
+
},
|
|
30
|
+
// Number & selection
|
|
31
|
+
{
|
|
32
|
+
label: labels.formFields.fields.fieldType.options.number,
|
|
33
|
+
value: FIELD_TYPES.number
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: labels.formFields.fields.fieldType.options.dropdown,
|
|
37
|
+
value: FIELD_TYPES.dropdown
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: labels.formFields.fields.fieldType.options.radio,
|
|
41
|
+
value: FIELD_TYPES.radio
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: labels.formFields.fields.fieldType.options.checkbox,
|
|
45
|
+
value: FIELD_TYPES.checkbox
|
|
46
|
+
},
|
|
47
|
+
// Date & time
|
|
48
|
+
{
|
|
49
|
+
label: labels.formFields.fields.fieldType.options.date,
|
|
50
|
+
value: FIELD_TYPES.date
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: labels.formFields.fields.fieldType.options.time,
|
|
54
|
+
value: FIELD_TYPES.time
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: labels.formFields.fields.fieldType.options.datetime,
|
|
58
|
+
value: FIELD_TYPES.datetime
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
required: true
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=fieldTypeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/fieldTypeField.ts"],"sourcesContent":["import type { SelectField } from 'payload'\n\nimport { FIELD_TYPES } from '../../constants.js'\nimport { labels } from '../../i18n/translations.js'\n\nexport const fieldTypeField: SelectField = {\n name: 'fieldType',\n type: 'select',\n defaultValue: FIELD_TYPES.text,\n label: labels.formFields.fields.fieldType.label,\n options: [\n // Text inputs\n { label: labels.formFields.fields.fieldType.options.text, value: FIELD_TYPES.text },\n { label: labels.formFields.fields.fieldType.options.textarea, value: FIELD_TYPES.textarea },\n { label: labels.formFields.fields.fieldType.options.email, value: FIELD_TYPES.email },\n { label: labels.formFields.fields.fieldType.options.tel, value: FIELD_TYPES.tel },\n { label: labels.formFields.fields.fieldType.options.url, value: FIELD_TYPES.url },\n // Number & selection\n { label: labels.formFields.fields.fieldType.options.number, value: FIELD_TYPES.number },\n { label: labels.formFields.fields.fieldType.options.dropdown, value: FIELD_TYPES.dropdown },\n { label: labels.formFields.fields.fieldType.options.radio, value: FIELD_TYPES.radio },\n { label: labels.formFields.fields.fieldType.options.checkbox, value: FIELD_TYPES.checkbox },\n // Date & time\n { label: labels.formFields.fields.fieldType.options.date, value: FIELD_TYPES.date },\n { label: labels.formFields.fields.fieldType.options.time, value: FIELD_TYPES.time },\n { label: labels.formFields.fields.fieldType.options.datetime, value: FIELD_TYPES.datetime },\n ],\n required: true,\n}\n"],"names":["FIELD_TYPES","labels","fieldTypeField","name","type","defaultValue","text","label","formFields","fields","fieldType","options","value","textarea","email","tel","url","number","dropdown","radio","checkbox","date","time","datetime","required"],"mappings":"AAEA,SAASA,WAAW,QAAQ,qBAAoB;AAChD,SAASC,MAAM,QAAQ,6BAA4B;AAEnD,OAAO,MAAMC,iBAA8B;IACzCC,MAAM;IACNC,MAAM;IACNC,cAAcL,YAAYM,IAAI;IAC9BC,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACH,KAAK;IAC/CI,SAAS;QACP,cAAc;QACd;YAAEJ,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACL,IAAI;YAAEM,OAAOZ,YAAYM,IAAI;QAAC;QAClF;YAAEC,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACE,QAAQ;YAAED,OAAOZ,YAAYa,QAAQ;QAAC;QAC1F;YAAEN,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACG,KAAK;YAAEF,OAAOZ,YAAYc,KAAK;QAAC;QACpF;YAAEP,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACI,GAAG;YAAEH,OAAOZ,YAAYe,GAAG;QAAC;QAChF;YAAER,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACK,GAAG;YAAEJ,OAAOZ,YAAYgB,GAAG;QAAC;QAChF,qBAAqB;QACrB;YAAET,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACM,MAAM;YAAEL,OAAOZ,YAAYiB,MAAM;QAAC;QACtF;YAAEV,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACO,QAAQ;YAAEN,OAAOZ,YAAYkB,QAAQ;QAAC;QAC1F;YAAEX,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACQ,KAAK;YAAEP,OAAOZ,YAAYmB,KAAK;QAAC;QACpF;YAAEZ,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACS,QAAQ;YAAER,OAAOZ,YAAYoB,QAAQ;QAAC;QAC1F,cAAc;QACd;YAAEb,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACU,IAAI;YAAET,OAAOZ,YAAYqB,IAAI;QAAC;QAClF;YAAEd,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACW,IAAI;YAAEV,OAAOZ,YAAYsB,IAAI;QAAC;QAClF;YAAEf,OAAON,OAAOO,UAAU,CAACC,MAAM,CAACC,SAAS,CAACC,OAAO,CAACY,QAAQ;YAAEX,OAAOZ,YAAYuB,QAAQ;QAAC;KAC3F;IACDC,UAAU;AACZ,EAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { autocompleteField } from './autocompleteField.js';
|
|
2
|
+
export { conditionGroup } from './conditionGroup.js';
|
|
3
|
+
export { dateRow } from './dateRow.js';
|
|
4
|
+
export { emptyDefaultField } from './emptyDefaultField.js';
|
|
5
|
+
export { fieldTypeField } from './fieldTypeField.js';
|
|
6
|
+
export { createLabelDescriptionRow } from './labelDescriptionRow.js';
|
|
7
|
+
export { lengthRow } from './lengthRow.js';
|
|
8
|
+
export { numberRow } from './numberRow.js';
|
|
9
|
+
export { createOptionsArray } from './optionsArray.js';
|
|
10
|
+
export { createPlaceholderDefaultRow } from './placeholderDefaultRow.js';
|
|
11
|
+
export { requiredWidthRow } from './requiredWidthRow.js';
|
|
12
|
+
export { textareaRowsField } from './textareaRow.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { autocompleteField } from './autocompleteField.js';
|
|
2
|
+
export { conditionGroup } from './conditionGroup.js';
|
|
3
|
+
export { dateRow } from './dateRow.js';
|
|
4
|
+
export { emptyDefaultField } from './emptyDefaultField.js';
|
|
5
|
+
export { fieldTypeField } from './fieldTypeField.js';
|
|
6
|
+
export { createLabelDescriptionRow } from './labelDescriptionRow.js';
|
|
7
|
+
export { lengthRow } from './lengthRow.js';
|
|
8
|
+
export { numberRow } from './numberRow.js';
|
|
9
|
+
export { createOptionsArray } from './optionsArray.js';
|
|
10
|
+
export { createPlaceholderDefaultRow } from './placeholderDefaultRow.js';
|
|
11
|
+
export { requiredWidthRow } from './requiredWidthRow.js';
|
|
12
|
+
export { textareaRowsField } from './textareaRow.js';
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/index.ts"],"sourcesContent":["export { autocompleteField } from './autocompleteField.js'\nexport { conditionGroup } from './conditionGroup.js'\nexport { dateRow } from './dateRow.js'\nexport { emptyDefaultField } from './emptyDefaultField.js'\nexport { fieldTypeField } from './fieldTypeField.js'\nexport { createLabelDescriptionRow } from './labelDescriptionRow.js'\nexport { lengthRow } from './lengthRow.js'\nexport { numberRow } from './numberRow.js'\nexport { createOptionsArray } from './optionsArray.js'\nexport { createPlaceholderDefaultRow } from './placeholderDefaultRow.js'\nexport { requiredWidthRow } from './requiredWidthRow.js'\nexport { textareaRowsField } from './textareaRow.js'\n"],"names":["autocompleteField","conditionGroup","dateRow","emptyDefaultField","fieldTypeField","createLabelDescriptionRow","lengthRow","numberRow","createOptionsArray","createPlaceholderDefaultRow","requiredWidthRow","textareaRowsField"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,OAAO,QAAQ,eAAc;AACtC,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,yBAAyB,QAAQ,2BAA0B;AACpE,SAASC,SAAS,QAAQ,iBAAgB;AAC1C,SAASC,SAAS,QAAQ,iBAAgB;AAC1C,SAASC,kBAAkB,QAAQ,oBAAmB;AACtD,SAASC,2BAA2B,QAAQ,6BAA4B;AACxE,SAASC,gBAAgB,QAAQ,wBAAuB;AACxD,SAASC,iBAAiB,QAAQ,mBAAkB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForDescription } from '../../utils/conditions.js';
|
|
3
|
+
export const createLabelDescriptionRow = ({ localized })=>({
|
|
4
|
+
type: 'row',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'label',
|
|
8
|
+
type: 'text',
|
|
9
|
+
admin: {
|
|
10
|
+
description: labels.formFields.fields.label.description,
|
|
11
|
+
width: '50%'
|
|
12
|
+
},
|
|
13
|
+
label: labels.formFields.fields.label.label,
|
|
14
|
+
localized,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'description',
|
|
19
|
+
type: 'text',
|
|
20
|
+
admin: {
|
|
21
|
+
condition: showForDescription,
|
|
22
|
+
description: labels.formFields.fields.description.description,
|
|
23
|
+
width: '50%'
|
|
24
|
+
},
|
|
25
|
+
label: labels.formFields.fields.description.label,
|
|
26
|
+
localized
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=labelDescriptionRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/labelDescriptionRow.ts"],"sourcesContent":["import type { RowField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForDescription } from '../../utils/conditions.js'\n\ntype LabelDescriptionRowOptions = {\n localized: boolean\n}\n\nexport const createLabelDescriptionRow = ({\n localized,\n}: LabelDescriptionRowOptions): RowField => ({\n type: 'row',\n fields: [\n {\n name: 'label',\n type: 'text',\n admin: {\n description: labels.formFields.fields.label.description,\n width: '50%',\n },\n label: labels.formFields.fields.label.label,\n localized,\n required: true,\n },\n {\n name: 'description',\n type: 'text',\n admin: {\n condition: showForDescription,\n description: labels.formFields.fields.description.description,\n width: '50%',\n },\n label: labels.formFields.fields.description.label,\n localized,\n },\n ],\n})\n"],"names":["labels","showForDescription","createLabelDescriptionRow","localized","type","fields","name","admin","description","formFields","label","width","required","condition"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,kBAAkB,QAAQ,4BAA2B;AAM9D,OAAO,MAAMC,4BAA4B,CAAC,EACxCC,SAAS,EACkB,GAAgB,CAAA;QAC3CC,MAAM;QACNC,QAAQ;YACN;gBACEC,MAAM;gBACNF,MAAM;gBACNG,OAAO;oBACLC,aAAaR,OAAOS,UAAU,CAACJ,MAAM,CAACK,KAAK,CAACF,WAAW;oBACvDG,OAAO;gBACT;gBACAD,OAAOV,OAAOS,UAAU,CAACJ,MAAM,CAACK,KAAK,CAACA,KAAK;gBAC3CP;gBACAS,UAAU;YACZ;YACA;gBACEN,MAAM;gBACNF,MAAM;gBACNG,OAAO;oBACLM,WAAWZ;oBACXO,aAAaR,OAAOS,UAAU,CAACJ,MAAM,CAACG,WAAW,CAACA,WAAW;oBAC7DG,OAAO;gBACT;gBACAD,OAAOV,OAAOS,UAAU,CAACJ,MAAM,CAACG,WAAW,CAACE,KAAK;gBACjDP;YACF;SACD;IACH,CAAA,EAAE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForLengthValidation } from '../../utils/conditions.js';
|
|
3
|
+
export const lengthRow = {
|
|
4
|
+
type: 'row',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'minLength',
|
|
8
|
+
type: 'number',
|
|
9
|
+
admin: {
|
|
10
|
+
condition: showForLengthValidation,
|
|
11
|
+
width: '50%'
|
|
12
|
+
},
|
|
13
|
+
label: labels.formFields.fields.minLength.label
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'maxLength',
|
|
17
|
+
type: 'number',
|
|
18
|
+
admin: {
|
|
19
|
+
condition: showForLengthValidation,
|
|
20
|
+
width: '50%'
|
|
21
|
+
},
|
|
22
|
+
label: labels.formFields.fields.maxLength.label
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=lengthRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/lengthRow.ts"],"sourcesContent":["import type { RowField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForLengthValidation } from '../../utils/conditions.js'\n\nexport const lengthRow: RowField = {\n type: 'row',\n fields: [\n {\n name: 'minLength',\n type: 'number',\n admin: {\n condition: showForLengthValidation,\n width: '50%',\n },\n label: labels.formFields.fields.minLength.label,\n },\n {\n name: 'maxLength',\n type: 'number',\n admin: {\n condition: showForLengthValidation,\n width: '50%',\n },\n label: labels.formFields.fields.maxLength.label,\n },\n ],\n}\n"],"names":["labels","showForLengthValidation","lengthRow","type","fields","name","admin","condition","width","label","formFields","minLength","maxLength"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,uBAAuB,QAAQ,4BAA2B;AAEnE,OAAO,MAAMC,YAAsB;IACjCC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXO,OAAO;YACT;YACAC,OAAOT,OAAOU,UAAU,CAACN,MAAM,CAACO,SAAS,CAACF,KAAK;QACjD;QACA;YACEJ,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXO,OAAO;YACT;YACAC,OAAOT,OAAOU,UAAU,CAACN,MAAM,CAACQ,SAAS,CAACH,KAAK;QACjD;KACD;AACH,EAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForNumber } from '../../utils/conditions.js';
|
|
3
|
+
export const numberRow = {
|
|
4
|
+
type: 'row',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'minValue',
|
|
8
|
+
type: 'number',
|
|
9
|
+
admin: {
|
|
10
|
+
condition: showForNumber,
|
|
11
|
+
width: '33%'
|
|
12
|
+
},
|
|
13
|
+
label: labels.formFields.fields.minValue.label
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'maxValue',
|
|
17
|
+
type: 'number',
|
|
18
|
+
admin: {
|
|
19
|
+
condition: showForNumber,
|
|
20
|
+
width: '33%'
|
|
21
|
+
},
|
|
22
|
+
label: labels.formFields.fields.maxValue.label
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'step',
|
|
26
|
+
type: 'number',
|
|
27
|
+
admin: {
|
|
28
|
+
condition: showForNumber,
|
|
29
|
+
description: labels.formFields.fields.step.description,
|
|
30
|
+
width: '33%'
|
|
31
|
+
},
|
|
32
|
+
label: labels.formFields.fields.step.label
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=numberRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/numberRow.ts"],"sourcesContent":["import type { RowField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForNumber } from '../../utils/conditions.js'\n\nexport const numberRow: RowField = {\n type: 'row',\n fields: [\n {\n name: 'minValue',\n type: 'number',\n admin: {\n condition: showForNumber,\n width: '33%',\n },\n label: labels.formFields.fields.minValue.label,\n },\n {\n name: 'maxValue',\n type: 'number',\n admin: {\n condition: showForNumber,\n width: '33%',\n },\n label: labels.formFields.fields.maxValue.label,\n },\n {\n name: 'step',\n type: 'number',\n admin: {\n condition: showForNumber,\n description: labels.formFields.fields.step.description,\n width: '33%',\n },\n label: labels.formFields.fields.step.label,\n },\n ],\n}\n"],"names":["labels","showForNumber","numberRow","type","fields","name","admin","condition","width","label","formFields","minValue","maxValue","description","step"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,aAAa,QAAQ,4BAA2B;AAEzD,OAAO,MAAMC,YAAsB;IACjCC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXO,OAAO;YACT;YACAC,OAAOT,OAAOU,UAAU,CAACN,MAAM,CAACO,QAAQ,CAACF,KAAK;QAChD;QACA;YACEJ,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXO,OAAO;YACT;YACAC,OAAOT,OAAOU,UAAU,CAACN,MAAM,CAACQ,QAAQ,CAACH,KAAK;QAChD;QACA;YACEJ,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,WAAWN;gBACXY,aAAab,OAAOU,UAAU,CAACN,MAAM,CAACU,IAAI,CAACD,WAAW;gBACtDL,OAAO;YACT;YACAC,OAAOT,OAAOU,UAAU,CAACN,MAAM,CAACU,IAAI,CAACL,KAAK;QAC5C;KACD;AACH,EAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForOptionsFields } from '../../utils/conditions.js';
|
|
3
|
+
export const createOptionsArray = ({ localized })=>({
|
|
4
|
+
name: 'options',
|
|
5
|
+
type: 'array',
|
|
6
|
+
admin: {
|
|
7
|
+
components: {
|
|
8
|
+
RowLabel: '@art-design-digital/payload-plugin-forms-v3/client#OptionRowLabel'
|
|
9
|
+
},
|
|
10
|
+
condition: showForOptionsFields,
|
|
11
|
+
description: labels.formFields.fields.options.description
|
|
12
|
+
},
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
type: 'row',
|
|
16
|
+
fields: [
|
|
17
|
+
{
|
|
18
|
+
name: 'label',
|
|
19
|
+
type: 'text',
|
|
20
|
+
admin: {
|
|
21
|
+
description: labels.formFields.fields.options.optionLabel.description,
|
|
22
|
+
width: '50%'
|
|
23
|
+
},
|
|
24
|
+
label: labels.formFields.fields.options.optionLabel.label,
|
|
25
|
+
localized,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'value',
|
|
30
|
+
type: 'text',
|
|
31
|
+
admin: {
|
|
32
|
+
description: labels.formFields.fields.options.value.description,
|
|
33
|
+
width: '50%'
|
|
34
|
+
},
|
|
35
|
+
label: labels.formFields.fields.options.value.label,
|
|
36
|
+
required: true
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
label: labels.formFields.fields.options.label
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=optionsArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/optionsArray.ts"],"sourcesContent":["import type { ArrayField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForOptionsFields } from '../../utils/conditions.js'\n\ntype OptionsArrayOptions = {\n localized: boolean\n}\n\nexport const createOptionsArray = ({ localized }: OptionsArrayOptions): ArrayField => ({\n name: 'options',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@art-design-digital/payload-plugin-forms-v3/client#OptionRowLabel',\n },\n condition: showForOptionsFields,\n description: labels.formFields.fields.options.description,\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'label',\n type: 'text',\n admin: {\n description: labels.formFields.fields.options.optionLabel.description,\n width: '50%',\n },\n label: labels.formFields.fields.options.optionLabel.label,\n localized,\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n admin: {\n description: labels.formFields.fields.options.value.description,\n width: '50%',\n },\n label: labels.formFields.fields.options.value.label,\n required: true,\n },\n ],\n },\n ],\n label: labels.formFields.fields.options.label,\n})\n"],"names":["labels","showForOptionsFields","createOptionsArray","localized","name","type","admin","components","RowLabel","condition","description","formFields","fields","options","optionLabel","width","label","required","value"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,oBAAoB,QAAQ,4BAA2B;AAMhE,OAAO,MAAMC,qBAAqB,CAAC,EAAEC,SAAS,EAAuB,GAAkB,CAAA;QACrFC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;gBACVC,UAAU;YACZ;YACAC,WAAWR;YACXS,aAAaV,OAAOW,UAAU,CAACC,MAAM,CAACC,OAAO,CAACH,WAAW;QAC3D;QACAE,QAAQ;YACN;gBACEP,MAAM;gBACNO,QAAQ;oBACN;wBACER,MAAM;wBACNC,MAAM;wBACNC,OAAO;4BACLI,aAAaV,OAAOW,UAAU,CAACC,MAAM,CAACC,OAAO,CAACC,WAAW,CAACJ,WAAW;4BACrEK,OAAO;wBACT;wBACAC,OAAOhB,OAAOW,UAAU,CAACC,MAAM,CAACC,OAAO,CAACC,WAAW,CAACE,KAAK;wBACzDb;wBACAc,UAAU;oBACZ;oBACA;wBACEb,MAAM;wBACNC,MAAM;wBACNC,OAAO;4BACLI,aAAaV,OAAOW,UAAU,CAACC,MAAM,CAACC,OAAO,CAACK,KAAK,CAACR,WAAW;4BAC/DK,OAAO;wBACT;wBACAC,OAAOhB,OAAOW,UAAU,CAACC,MAAM,CAACC,OAAO,CAACK,KAAK,CAACF,KAAK;wBACnDC,UAAU;oBACZ;iBACD;YACH;SACD;QACDD,OAAOhB,OAAOW,UAAU,CAACC,MAAM,CAACC,OAAO,CAACG,KAAK;IAC/C,CAAA,EAAE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForDefaultValue, showForPlaceholderInputs } from '../../utils/conditions.js';
|
|
3
|
+
export const createPlaceholderDefaultRow = ({ localized })=>({
|
|
4
|
+
type: 'row',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'placeholder',
|
|
8
|
+
type: 'text',
|
|
9
|
+
admin: {
|
|
10
|
+
condition: showForPlaceholderInputs,
|
|
11
|
+
description: labels.formFields.fields.placeholder.description
|
|
12
|
+
},
|
|
13
|
+
label: labels.formFields.fields.placeholder.label,
|
|
14
|
+
localized
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'default',
|
|
18
|
+
type: 'text',
|
|
19
|
+
admin: {
|
|
20
|
+
condition: showForDefaultValue,
|
|
21
|
+
description: labels.formFields.fields.default.description
|
|
22
|
+
},
|
|
23
|
+
label: labels.formFields.fields.default.label,
|
|
24
|
+
localized
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=placeholderDefaultRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/placeholderDefaultRow.ts"],"sourcesContent":["import type { RowField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForDefaultValue, showForPlaceholderInputs } from '../../utils/conditions.js'\n\ntype PlaceholderDefaultRowOptions = {\n localized: boolean\n}\n\nexport const createPlaceholderDefaultRow = ({\n localized,\n}: PlaceholderDefaultRowOptions): RowField => ({\n type: 'row',\n fields: [\n {\n name: 'placeholder',\n type: 'text',\n admin: {\n condition: showForPlaceholderInputs,\n description: labels.formFields.fields.placeholder.description,\n },\n label: labels.formFields.fields.placeholder.label,\n localized,\n },\n {\n name: 'default',\n type: 'text',\n admin: {\n condition: showForDefaultValue,\n description: labels.formFields.fields.default.description,\n },\n label: labels.formFields.fields.default.label,\n localized,\n },\n ],\n})\n"],"names":["labels","showForDefaultValue","showForPlaceholderInputs","createPlaceholderDefaultRow","localized","type","fields","name","admin","condition","description","formFields","placeholder","label","default"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,mBAAmB,EAAEC,wBAAwB,QAAQ,4BAA2B;AAMzF,OAAO,MAAMC,8BAA8B,CAAC,EAC1CC,SAAS,EACoB,GAAgB,CAAA;QAC7CC,MAAM;QACNC,QAAQ;YACN;gBACEC,MAAM;gBACNF,MAAM;gBACNG,OAAO;oBACLC,WAAWP;oBACXQ,aAAaV,OAAOW,UAAU,CAACL,MAAM,CAACM,WAAW,CAACF,WAAW;gBAC/D;gBACAG,OAAOb,OAAOW,UAAU,CAACL,MAAM,CAACM,WAAW,CAACC,KAAK;gBACjDT;YACF;YACA;gBACEG,MAAM;gBACNF,MAAM;gBACNG,OAAO;oBACLC,WAAWR;oBACXS,aAAaV,OAAOW,UAAU,CAACL,MAAM,CAACQ,OAAO,CAACJ,WAAW;gBAC3D;gBACAG,OAAOb,OAAOW,UAAU,CAACL,MAAM,CAACQ,OAAO,CAACD,KAAK;gBAC7CT;YACF;SACD;IACH,CAAA,EAAE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WIDTH_OPTIONS } from '../../constants.js';
|
|
2
|
+
import { labels } from '../../i18n/translations.js';
|
|
3
|
+
export const requiredWidthRow = {
|
|
4
|
+
type: 'row',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'required',
|
|
8
|
+
type: 'checkbox',
|
|
9
|
+
admin: {
|
|
10
|
+
width: '50%'
|
|
11
|
+
},
|
|
12
|
+
label: labels.formFields.fields.required.label
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'width',
|
|
16
|
+
type: 'select',
|
|
17
|
+
admin: {
|
|
18
|
+
width: '50%'
|
|
19
|
+
},
|
|
20
|
+
defaultValue: 'full',
|
|
21
|
+
label: labels.formFields.fields.width.label,
|
|
22
|
+
options: [
|
|
23
|
+
...WIDTH_OPTIONS
|
|
24
|
+
],
|
|
25
|
+
required: true
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=requiredWidthRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/requiredWidthRow.ts"],"sourcesContent":["import type { RowField } from 'payload'\n\nimport { WIDTH_OPTIONS } from '../../constants.js'\nimport { labels } from '../../i18n/translations.js'\n\nexport const requiredWidthRow: RowField = {\n type: 'row',\n fields: [\n {\n name: 'required',\n type: 'checkbox',\n admin: {\n width: '50%',\n },\n label: labels.formFields.fields.required.label,\n },\n {\n name: 'width',\n type: 'select',\n admin: {\n width: '50%',\n },\n defaultValue: 'full',\n label: labels.formFields.fields.width.label,\n options: [...WIDTH_OPTIONS],\n required: true,\n },\n ],\n}\n"],"names":["WIDTH_OPTIONS","labels","requiredWidthRow","type","fields","name","admin","width","label","formFields","required","defaultValue","options"],"mappings":"AAEA,SAASA,aAAa,QAAQ,qBAAoB;AAClD,SAASC,MAAM,QAAQ,6BAA4B;AAEnD,OAAO,MAAMC,mBAA6B;IACxCC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,OAAO;YACT;YACAC,OAAOP,OAAOQ,UAAU,CAACL,MAAM,CAACM,QAAQ,CAACF,KAAK;QAChD;QACA;YACEH,MAAM;YACNF,MAAM;YACNG,OAAO;gBACLC,OAAO;YACT;YACAI,cAAc;YACdH,OAAOP,OAAOQ,UAAU,CAACL,MAAM,CAACG,KAAK,CAACC,KAAK;YAC3CI,SAAS;mBAAIZ;aAAc;YAC3BU,UAAU;QACZ;KACD;AACH,EAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { labels } from '../../i18n/translations.js';
|
|
2
|
+
import { showForTextarea } from '../../utils/conditions.js';
|
|
3
|
+
export const textareaRowsField = {
|
|
4
|
+
name: 'rows',
|
|
5
|
+
type: 'number',
|
|
6
|
+
admin: {
|
|
7
|
+
condition: showForTextarea,
|
|
8
|
+
description: labels.formFields.fields.rows.description
|
|
9
|
+
},
|
|
10
|
+
defaultValue: 5,
|
|
11
|
+
label: labels.formFields.fields.rows.label
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=textareaRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/fields/formFields/textareaRow.ts"],"sourcesContent":["import type { NumberField } from 'payload'\n\nimport { labels } from '../../i18n/translations.js'\nimport { showForTextarea } from '../../utils/conditions.js'\n\nexport const textareaRowsField: NumberField = {\n name: 'rows',\n type: 'number',\n admin: {\n condition: showForTextarea,\n description: labels.formFields.fields.rows.description,\n },\n defaultValue: 5,\n label: labels.formFields.fields.rows.label,\n}\n"],"names":["labels","showForTextarea","textareaRowsField","name","type","admin","condition","description","formFields","fields","rows","defaultValue","label"],"mappings":"AAEA,SAASA,MAAM,QAAQ,6BAA4B;AACnD,SAASC,eAAe,QAAQ,4BAA2B;AAE3D,OAAO,MAAMC,oBAAiC;IAC5CC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,WAAWL;QACXM,aAAaP,OAAOQ,UAAU,CAACC,MAAM,CAACC,IAAI,CAACH,WAAW;IACxD;IACAI,cAAc;IACdC,OAAOZ,OAAOQ,UAAU,CAACC,MAAM,CAACC,IAAI,CAACE,KAAK;AAC5C,EAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { labels } from '../i18n/translations.js';
|
|
2
|
+
import { autocompleteField, conditionGroup, createLabelDescriptionRow, createOptionsArray, createPlaceholderDefaultRow, dateRow, emptyDefaultField, fieldTypeField, lengthRow, numberRow, requiredWidthRow, textareaRowsField } from './formFields/index.js';
|
|
3
|
+
export const createFormFieldsArray = ({ localized })=>({
|
|
4
|
+
name: 'formFields',
|
|
5
|
+
type: 'array',
|
|
6
|
+
admin: {
|
|
7
|
+
components: {
|
|
8
|
+
RowLabel: '@art-design-digital/payload-plugin-forms-v3/client#FormFieldRowLabel'
|
|
9
|
+
},
|
|
10
|
+
description: labels.formFields.description,
|
|
11
|
+
initCollapsed: true
|
|
12
|
+
},
|
|
13
|
+
fields: [
|
|
14
|
+
fieldTypeField,
|
|
15
|
+
createLabelDescriptionRow({
|
|
16
|
+
localized
|
|
17
|
+
}),
|
|
18
|
+
requiredWidthRow,
|
|
19
|
+
autocompleteField,
|
|
20
|
+
createOptionsArray({
|
|
21
|
+
localized
|
|
22
|
+
}),
|
|
23
|
+
emptyDefaultField,
|
|
24
|
+
createPlaceholderDefaultRow({
|
|
25
|
+
localized
|
|
26
|
+
}),
|
|
27
|
+
lengthRow,
|
|
28
|
+
numberRow,
|
|
29
|
+
textareaRowsField,
|
|
30
|
+
dateRow,
|
|
31
|
+
conditionGroup
|
|
32
|
+
],
|
|
33
|
+
label: labels.formFields.label,
|
|
34
|
+
labels: {
|
|
35
|
+
plural: labels.formFields.plural,
|
|
36
|
+
singular: labels.formFields.singular
|
|
37
|
+
},
|
|
38
|
+
minRows: 1
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=formFieldsArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/fields/formFieldsArray.ts"],"sourcesContent":["import type { ArrayField } from 'payload'\n\nimport { labels } from '../i18n/translations.js'\nimport {\n autocompleteField,\n conditionGroup,\n createLabelDescriptionRow,\n createOptionsArray,\n createPlaceholderDefaultRow,\n dateRow,\n emptyDefaultField,\n fieldTypeField,\n lengthRow,\n numberRow,\n requiredWidthRow,\n textareaRowsField,\n} from './formFields/index.js'\n\ntype FormFieldsArrayOptions = {\n localized: boolean\n}\n\nexport const createFormFieldsArray = ({ localized }: FormFieldsArrayOptions): ArrayField => ({\n name: 'formFields',\n type: 'array',\n admin: {\n components: {\n RowLabel: '@art-design-digital/payload-plugin-forms-v3/client#FormFieldRowLabel',\n },\n description: labels.formFields.description,\n initCollapsed: true,\n },\n fields: [\n fieldTypeField,\n createLabelDescriptionRow({ localized }),\n requiredWidthRow,\n autocompleteField,\n createOptionsArray({ localized }),\n emptyDefaultField,\n createPlaceholderDefaultRow({ localized }),\n lengthRow,\n numberRow,\n textareaRowsField,\n dateRow,\n conditionGroup,\n ],\n label: labels.formFields.label,\n labels: {\n plural: labels.formFields.plural,\n singular: labels.formFields.singular,\n },\n minRows: 1,\n})\n"],"names":["labels","autocompleteField","conditionGroup","createLabelDescriptionRow","createOptionsArray","createPlaceholderDefaultRow","dateRow","emptyDefaultField","fieldTypeField","lengthRow","numberRow","requiredWidthRow","textareaRowsField","createFormFieldsArray","localized","name","type","admin","components","RowLabel","description","formFields","initCollapsed","fields","label","plural","singular","minRows"],"mappings":"AAEA,SAASA,MAAM,QAAQ,0BAAyB;AAChD,SACEC,iBAAiB,EACjBC,cAAc,EACdC,yBAAyB,EACzBC,kBAAkB,EAClBC,2BAA2B,EAC3BC,OAAO,EACPC,iBAAiB,EACjBC,cAAc,EACdC,SAAS,EACTC,SAAS,EACTC,gBAAgB,EAChBC,iBAAiB,QACZ,wBAAuB;AAM9B,OAAO,MAAMC,wBAAwB,CAAC,EAAEC,SAAS,EAA0B,GAAkB,CAAA;QAC3FC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;gBACVC,UAAU;YACZ;YACAC,aAAapB,OAAOqB,UAAU,CAACD,WAAW;YAC1CE,eAAe;QACjB;QACAC,QAAQ;YACNf;YACAL,0BAA0B;gBAAEW;YAAU;YACtCH;YACAV;YACAG,mBAAmB;gBAAEU;YAAU;YAC/BP;YACAF,4BAA4B;gBAAES;YAAU;YACxCL;YACAC;YACAE;YACAN;YACAJ;SACD;QACDsB,OAAOxB,OAAOqB,UAAU,CAACG,KAAK;QAC9BxB,QAAQ;YACNyB,QAAQzB,OAAOqB,UAAU,CAACI,MAAM;YAChCC,UAAU1B,OAAOqB,UAAU,CAACK,QAAQ;QACtC;QACAC,SAAS;IACX,CAAA,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/fields/index.ts"],"sourcesContent":["export { createFormFieldsArray } from './formFieldsArray.js'\nexport { createMessagesGroup } from './messagesGroup.js'\nexport { senderReceiverGroup } from './senderReceiverGroup.js'\n"],"names":["createFormFieldsArray","createMessagesGroup","senderReceiverGroup"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,uBAAsB;AAC5D,SAASC,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,mBAAmB,QAAQ,2BAA0B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { labels, locales } from '../i18n/translations.js';
|
|
2
|
+
export const createMessagesGroup = ({ localized })=>({
|
|
3
|
+
name: 'messagesGroup',
|
|
4
|
+
type: 'group',
|
|
5
|
+
admin: {
|
|
6
|
+
hideGutter: true
|
|
7
|
+
},
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
name: 'submitLabel',
|
|
11
|
+
type: 'text',
|
|
12
|
+
defaultValue: locales.en.groups.messages.fields.submitLabel.defaultValue,
|
|
13
|
+
label: labels.groups.messages.fields.submitLabel.label,
|
|
14
|
+
localized,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'successMessage',
|
|
19
|
+
type: 'text',
|
|
20
|
+
defaultValue: locales.en.groups.messages.fields.successMessage.defaultValue,
|
|
21
|
+
label: labels.groups.messages.fields.successMessage.label,
|
|
22
|
+
localized,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'errorMessage',
|
|
27
|
+
type: 'text',
|
|
28
|
+
defaultValue: locales.en.groups.messages.fields.errorMessage.defaultValue,
|
|
29
|
+
label: labels.groups.messages.fields.errorMessage.label,
|
|
30
|
+
localized,
|
|
31
|
+
required: true
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
label: false
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=messagesGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/fields/messagesGroup.ts"],"sourcesContent":["import type { GroupField } from 'payload'\n\nimport { labels, locales } from '../i18n/translations.js'\n\ntype MessagesGroupOptions = {\n localized: boolean\n}\n\nexport const createMessagesGroup = ({ localized }: MessagesGroupOptions): GroupField => ({\n name: 'messagesGroup',\n type: 'group',\n admin: {\n hideGutter: true,\n },\n fields: [\n {\n name: 'submitLabel',\n type: 'text',\n defaultValue: locales.en.groups.messages.fields.submitLabel.defaultValue,\n label: labels.groups.messages.fields.submitLabel.label,\n localized,\n required: true,\n },\n {\n name: 'successMessage',\n type: 'text',\n defaultValue: locales.en.groups.messages.fields.successMessage.defaultValue,\n label: labels.groups.messages.fields.successMessage.label,\n localized,\n required: true,\n },\n {\n name: 'errorMessage',\n type: 'text',\n defaultValue: locales.en.groups.messages.fields.errorMessage.defaultValue,\n label: labels.groups.messages.fields.errorMessage.label,\n localized,\n required: true,\n },\n ],\n label: false,\n})\n"],"names":["labels","locales","createMessagesGroup","localized","name","type","admin","hideGutter","fields","defaultValue","en","groups","messages","submitLabel","label","required","successMessage","errorMessage"],"mappings":"AAEA,SAASA,MAAM,EAAEC,OAAO,QAAQ,0BAAyB;AAMzD,OAAO,MAAMC,sBAAsB,CAAC,EAAEC,SAAS,EAAwB,GAAkB,CAAA;QACvFC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEJ,MAAM;gBACNC,MAAM;gBACNI,cAAcR,QAAQS,EAAE,CAACC,MAAM,CAACC,QAAQ,CAACJ,MAAM,CAACK,WAAW,CAACJ,YAAY;gBACxEK,OAAOd,OAAOW,MAAM,CAACC,QAAQ,CAACJ,MAAM,CAACK,WAAW,CAACC,KAAK;gBACtDX;gBACAY,UAAU;YACZ;YACA;gBACEX,MAAM;gBACNC,MAAM;gBACNI,cAAcR,QAAQS,EAAE,CAACC,MAAM,CAACC,QAAQ,CAACJ,MAAM,CAACQ,cAAc,CAACP,YAAY;gBAC3EK,OAAOd,OAAOW,MAAM,CAACC,QAAQ,CAACJ,MAAM,CAACQ,cAAc,CAACF,KAAK;gBACzDX;gBACAY,UAAU;YACZ;YACA;gBACEX,MAAM;gBACNC,MAAM;gBACNI,cAAcR,QAAQS,EAAE,CAACC,MAAM,CAACC,QAAQ,CAACJ,MAAM,CAACS,YAAY,CAACR,YAAY;gBACzEK,OAAOd,OAAOW,MAAM,CAACC,QAAQ,CAACJ,MAAM,CAACS,YAAY,CAACH,KAAK;gBACvDX;gBACAY,UAAU;YACZ;SACD;QACDD,OAAO;IACT,CAAA,EAAE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { labels } from '../i18n/translations.js';
|
|
2
|
+
export const senderReceiverGroup = {
|
|
3
|
+
name: 'senderReceiverGroup',
|
|
4
|
+
type: 'group',
|
|
5
|
+
admin: {
|
|
6
|
+
hideGutter: true
|
|
7
|
+
},
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
name: 'subject',
|
|
11
|
+
type: 'text',
|
|
12
|
+
admin: {
|
|
13
|
+
description: labels.groups.senderReceiver.fields.subject.description
|
|
14
|
+
},
|
|
15
|
+
label: labels.groups.senderReceiver.fields.subject.label,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'receiver',
|
|
20
|
+
type: 'email',
|
|
21
|
+
admin: {
|
|
22
|
+
description: labels.groups.senderReceiver.fields.receiver.description
|
|
23
|
+
},
|
|
24
|
+
label: labels.groups.senderReceiver.fields.receiver.label,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'row',
|
|
29
|
+
fields: [
|
|
30
|
+
{
|
|
31
|
+
name: 'senderMail',
|
|
32
|
+
type: 'email',
|
|
33
|
+
admin: {
|
|
34
|
+
description: labels.groups.senderReceiver.fields.senderMail.description
|
|
35
|
+
},
|
|
36
|
+
label: labels.groups.senderReceiver.fields.senderMail.label,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'senderName',
|
|
41
|
+
type: 'text',
|
|
42
|
+
admin: {
|
|
43
|
+
description: labels.groups.senderReceiver.fields.senderName.description
|
|
44
|
+
},
|
|
45
|
+
label: labels.groups.senderReceiver.fields.senderName.label,
|
|
46
|
+
required: true
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
label: false
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=senderReceiverGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/fields/senderReceiverGroup.ts"],"sourcesContent":["import type { GroupField } from 'payload'\n\nimport { labels } from '../i18n/translations.js'\n\nexport const senderReceiverGroup: GroupField = {\n name: 'senderReceiverGroup',\n type: 'group',\n admin: {\n hideGutter: true,\n },\n fields: [\n {\n name: 'subject',\n type: 'text',\n admin: {\n description: labels.groups.senderReceiver.fields.subject.description,\n },\n label: labels.groups.senderReceiver.fields.subject.label,\n required: true,\n },\n {\n name: 'receiver',\n type: 'email',\n admin: {\n description: labels.groups.senderReceiver.fields.receiver.description,\n },\n label: labels.groups.senderReceiver.fields.receiver.label,\n required: true,\n },\n {\n type: 'row',\n fields: [\n {\n name: 'senderMail',\n type: 'email',\n admin: {\n description: labels.groups.senderReceiver.fields.senderMail.description,\n },\n label: labels.groups.senderReceiver.fields.senderMail.label,\n required: true,\n },\n {\n name: 'senderName',\n type: 'text',\n admin: {\n description: labels.groups.senderReceiver.fields.senderName.description,\n },\n label: labels.groups.senderReceiver.fields.senderName.label,\n required: true,\n },\n ],\n },\n ],\n label: false,\n}\n"],"names":["labels","senderReceiverGroup","name","type","admin","hideGutter","fields","description","groups","senderReceiver","subject","label","required","receiver","senderMail","senderName"],"mappings":"AAEA,SAASA,MAAM,QAAQ,0BAAyB;AAEhD,OAAO,MAAMC,sBAAkC;IAC7CC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLG,aAAaP,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACI,OAAO,CAACH,WAAW;YACtE;YACAI,OAAOX,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACI,OAAO,CAACC,KAAK;YACxDC,UAAU;QACZ;QACA;YACEV,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLG,aAAaP,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACO,QAAQ,CAACN,WAAW;YACvE;YACAI,OAAOX,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACO,QAAQ,CAACF,KAAK;YACzDC,UAAU;QACZ;QACA;YACET,MAAM;YACNG,QAAQ;gBACN;oBACEJ,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLG,aAAaP,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACQ,UAAU,CAACP,WAAW;oBACzE;oBACAI,OAAOX,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACQ,UAAU,CAACH,KAAK;oBAC3DC,UAAU;gBACZ;gBACA;oBACEV,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLG,aAAaP,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACS,UAAU,CAACR,WAAW;oBACzE;oBACAI,OAAOX,OAAOQ,MAAM,CAACC,cAAc,CAACH,MAAM,CAACS,UAAU,CAACJ,KAAK;oBAC3DC,UAAU;gBACZ;aACD;QACH;KACD;IACDD,OAAO;AACT,EAAC"}
|