@woodylab/payload 0.0.85 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acl/hasRoles.js +17 -0
- package/dist/acl/index.js +1 -0
- package/dist/config/blocks/blockCarousel.d.ts +1 -1
- package/dist/config/blocks/blockCarousel.js +102 -0
- package/dist/config/blocks/blockDisclosureList.d.ts +1 -1
- package/dist/config/blocks/blockDisclosureList.js +58 -0
- package/dist/config/blocks/blockGrid.d.ts +1 -1
- package/dist/config/blocks/blockGrid.js +161 -0
- package/dist/config/blocks/blockGridContent.d.ts +1 -1
- package/dist/config/blocks/blockGridContent.js +195 -0
- package/dist/config/blocks/blockHtmlElement.d.ts +5 -2
- package/dist/config/blocks/blockHtmlElement.js +13 -0
- package/dist/config/blocks/blockImage.d.ts +1 -1
- package/dist/config/blocks/blockImage.js +15 -0
- package/dist/config/blocks/blockParallax.d.ts +1 -1
- package/dist/config/blocks/blockParallax.js +76 -0
- package/dist/config/blocks/blockTabs.d.ts +1 -1
- package/dist/config/blocks/blockTabs.js +24 -0
- package/dist/config/blocks/blockView.d.ts +2 -0
- package/dist/config/blocks/blockView.js +234 -0
- package/dist/config/collections/collectionMenus.js +41 -0
- package/dist/config/globals/configFooter.d.ts +1 -1
- package/dist/config/globals/configFooter.js +46 -0
- package/dist/config/globals/configHeader.d.ts +1 -1
- package/dist/config/globals/configHeader.js +50 -0
- package/dist/config/globals/configSettings.d.ts +1 -1
- package/dist/config/globals/configSettings.js +144 -0
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.js +15 -0
- package/dist/enums/index.js +1 -0
- package/dist/enums/userRoles.js +8 -0
- package/dist/fields/fieldArray.js +9 -0
- package/dist/fields/fieldBlocks.js +9 -0
- package/dist/fields/fieldCheckbox.js +11 -0
- package/dist/fields/fieldCode.js +8 -0
- package/dist/fields/fieldDate.js +15 -0
- package/dist/fields/fieldEmail.js +8 -0
- package/dist/fields/fieldJoin.js +9 -0
- package/dist/fields/fieldNumber.js +8 -0
- package/dist/fields/fieldPoint.js +8 -0
- package/dist/fields/fieldRadioGroup.js +18 -0
- package/dist/fields/fieldRelationship.js +9 -0
- package/dist/fields/fieldRichText.js +12 -0
- package/dist/fields/fieldSelect.js +9 -0
- package/dist/fields/fieldText.js +8 -0
- package/dist/fields/fieldTextArea.js +8 -0
- package/dist/fields/fieldUpload.js +9 -0
- package/dist/fields/index.js +37 -0
- package/dist/fields/layout/fieldContainerProps.js +74 -0
- package/dist/fields/section/fieldAction.js +236 -0
- package/dist/fields/section/fieldConfigProps.js +11 -0
- package/dist/fields/section/fieldContentProps.js +11 -0
- package/dist/fields/section/fieldSectionProps.js +15 -0
- package/dist/fields/section/fieldSectionTabs.js +40 -0
- package/dist/fields/style/fieldColor.js +21 -0
- package/dist/fields/style/fieldContainerWidths.js +17 -0
- package/dist/fields/style/fieldCss.js +68 -0
- package/dist/fields/style/fieldFontSizes.js +14 -0
- package/dist/fields/style/fieldHeights.js +23 -0
- package/dist/fields/style/fieldMargins.js +138 -0
- package/dist/fields/style/fieldPaddings.js +114 -0
- package/dist/fields/style/fieldViewportHeights.js +22 -0
- package/dist/fields/utils/fieldRoles.js +26 -0
- package/dist/generateCssVars.js +71 -0
- package/dist/generatePreviewPath.d.ts +1 -1
- package/dist/generatePreviewPath.js +14 -0
- package/dist/getButtonClasses.js +135 -0
- package/dist/getClassName.js +28 -0
- package/dist/getInlineStyles.d.ts +2 -2
- package/dist/getInlineStyles.js +17 -0
- package/dist/googleFonts.js +1343 -0
- package/dist/hexToRgb.js +21 -0
- package/dist/hooks/fields/getNumberValueFromClassNameString.js +16 -0
- package/dist/hooks/fields/populateSiblingClassName.js +23 -0
- package/dist/hooks/fields/populateSiblingClassNameAfterChange.js +6 -0
- package/dist/hooks/fields/updateClassNameAfterRead.js +16 -0
- package/dist/hooks/index.js +4 -0
- package/dist/iconsList.js +112 -0
- package/dist/index-AsrRNOzZ.js +2 -0
- package/dist/index-AsrRNOzZ.js.map +1 -0
- package/dist/index-CVxEpCHf.js +2 -0
- package/dist/index-CVxEpCHf.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +26 -0
- package/dist/tailwind/index.d.ts +5 -3
- package/dist/tailwind/index.js +2692 -0
- package/dist/types/fieldOverride.js +1 -0
- package/package.json +16 -33
- package/dist/acl/index.cjs.js +0 -2
- package/dist/acl/index.cjs.js.map +0 -1
- package/dist/acl/index.esm.js +0 -2
- package/dist/acl/index.esm.js.map +0 -1
- package/dist/enums/index.cjs.js +0 -2
- package/dist/enums/index.cjs.js.map +0 -1
- package/dist/enums/index.esm.js +0 -2
- package/dist/enums/index.esm.js.map +0 -1
- package/dist/fieldViewportHeights-BDcXwnNa.js +0 -2
- package/dist/fieldViewportHeights-BDcXwnNa.js.map +0 -1
- package/dist/fieldViewportHeights-BiejOiGj.js +0 -2
- package/dist/fieldViewportHeights-BiejOiGj.js.map +0 -1
- package/dist/fields/index.cjs.js +0 -2
- package/dist/fields/index.cjs.js.map +0 -1
- package/dist/fields/index.esm.js +0 -2
- package/dist/fields/index.esm.js.map +0 -1
- package/dist/getNumberValueFromClassNameString-Dm5eOjBJ.js +0 -2
- package/dist/getNumberValueFromClassNameString-Dm5eOjBJ.js.map +0 -1
- package/dist/getNumberValueFromClassNameString-pKKt97eg.js +0 -2
- package/dist/getNumberValueFromClassNameString-pKKt97eg.js.map +0 -1
- package/dist/hooks/index.cjs.js +0 -2
- package/dist/hooks/index.cjs.js.map +0 -1
- package/dist/hooks/index.esm.js +0 -2
- package/dist/hooks/index.esm.js.map +0 -1
- package/dist/index--JXKMhaT.js +0 -2
- package/dist/index--JXKMhaT.js.map +0 -1
- package/dist/index-B-FTpy4t.js +0 -2
- package/dist/index-B-FTpy4t.js.map +0 -1
- package/dist/index-C4uc5BOd.js +0 -2
- package/dist/index-C4uc5BOd.js.map +0 -1
- package/dist/index-C6SROxLn.js +0 -2
- package/dist/index-C6SROxLn.js.map +0 -1
- package/dist/index-CPtPsRwp.js +0 -2
- package/dist/index-CPtPsRwp.js.map +0 -1
- package/dist/index-CbPSDPpZ.js +0 -2
- package/dist/index-CbPSDPpZ.js.map +0 -1
- package/dist/index-D7075_q9.js +0 -2
- package/dist/index-D7075_q9.js.map +0 -1
- package/dist/index-DArGZfob.js +0 -2
- package/dist/index-DArGZfob.js.map +0 -1
- package/dist/index-DfvZ1mDE.js +0 -2
- package/dist/index-DfvZ1mDE.js.map +0 -1
- package/dist/index-FnRjWfU7.js +0 -2
- package/dist/index-FnRjWfU7.js.map +0 -1
- package/dist/index-GDdL2MgQ.js +0 -2
- package/dist/index-GDdL2MgQ.js.map +0 -1
- package/dist/index-gxytNJWT.js +0 -2
- package/dist/index-gxytNJWT.js.map +0 -1
- package/dist/tailwind/index.cjs.js +0 -2
- package/dist/tailwind/index.cjs.js.map +0 -1
- package/dist/tailwind/index.esm.js +0 -2
- package/dist/tailwind/index.esm.js.map +0 -1
- package/dist/userRoles-BIrmWoCJ.js +0 -2
- package/dist/userRoles-BIrmWoCJ.js.map +0 -1
- package/dist/userRoles-Dd_gfx51.js +0 -2
- package/dist/userRoles-Dd_gfx51.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// GLOBALS
|
|
2
|
+
export { default as configSettings } from './globals/configSettings';
|
|
3
|
+
export { default as configHeader } from './globals/configHeader';
|
|
4
|
+
export { default as configFooter } from './globals/configFooter';
|
|
5
|
+
// COLLECTION
|
|
6
|
+
export { default as collectionMenus } from './collections/collectionMenus';
|
|
7
|
+
// BLOCKS
|
|
8
|
+
export { default as blockCarousel } from './blocks/blockCarousel';
|
|
9
|
+
export { default as blockDisclosureList } from './blocks/blockDisclosureList';
|
|
10
|
+
export { default as blockGrid } from './blocks/blockGrid';
|
|
11
|
+
export { default as blockGridContent } from './blocks/blockGridContent';
|
|
12
|
+
export { default as blockImage } from './blocks/blockImage';
|
|
13
|
+
export { default as blockParallax } from './blocks/blockParallax';
|
|
14
|
+
export { default as blockTabs } from './blocks/blockTabs';
|
|
15
|
+
export { default as blockHtmlElement } from './blocks/blockHtmlElement';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as userRoles } from './userRoles';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const fieldDate = (override) => ({
|
|
2
|
+
name: 'date',
|
|
3
|
+
label: 'Date',
|
|
4
|
+
type: 'date',
|
|
5
|
+
required: false,
|
|
6
|
+
admin: {
|
|
7
|
+
description: 'Select a date',
|
|
8
|
+
date: {
|
|
9
|
+
pickerAppearance: 'dayOnly',
|
|
10
|
+
displayFormat: 'yyyy-MM-dd',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
...override,
|
|
14
|
+
});
|
|
15
|
+
export default fieldDate;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const fieldRadioGroup = (override) => ({
|
|
2
|
+
name: 'radio',
|
|
3
|
+
label: 'Radio',
|
|
4
|
+
type: 'boolean',
|
|
5
|
+
required: false,
|
|
6
|
+
options: [
|
|
7
|
+
{
|
|
8
|
+
label: 'true',
|
|
9
|
+
value: true,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: 'true',
|
|
13
|
+
value: false,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
...override,
|
|
17
|
+
});
|
|
18
|
+
export default fieldRadioGroup;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Esportazioni dalle cartelle principali
|
|
2
|
+
export { default as fieldText } from './fieldText';
|
|
3
|
+
export { default as fieldTextArea } from './fieldTextArea';
|
|
4
|
+
export { default as fieldUpload } from './fieldUpload';
|
|
5
|
+
export { default as fieldArray } from './fieldArray';
|
|
6
|
+
export { default as fieldBlocks } from './fieldBlocks';
|
|
7
|
+
export { default as fieldCheckbox } from './fieldCheckbox';
|
|
8
|
+
export { default as fieldCode } from './fieldCode';
|
|
9
|
+
export { default as fieldDate } from './fieldDate';
|
|
10
|
+
export { default as fieldEmail } from './fieldEmail';
|
|
11
|
+
export { default as fieldJoin } from './fieldJoin';
|
|
12
|
+
export { default as fieldNumber } from './fieldNumber';
|
|
13
|
+
export { default as fieldPoint } from './fieldPoint';
|
|
14
|
+
export { default as fieldRadioGroup } from './fieldRadioGroup';
|
|
15
|
+
export { default as fieldRelationship } from './fieldRelationship';
|
|
16
|
+
export { default as fieldRichText } from './fieldRichText';
|
|
17
|
+
export { default as fieldSelect } from './fieldSelect';
|
|
18
|
+
// Esportazioni dalla cartella layout
|
|
19
|
+
export { default as fieldContainerProps } from './layout/fieldContainerProps';
|
|
20
|
+
// Esportazioni dalla cartella section
|
|
21
|
+
export { default as fieldAction } from './section/fieldAction';
|
|
22
|
+
export { default as fieldConfigProps } from './section/fieldConfigProps';
|
|
23
|
+
export { default as fieldContentProps } from './section/fieldContentProps';
|
|
24
|
+
export { default as fieldSectionProps } from './section/fieldSectionProps';
|
|
25
|
+
export { default as fieldSectionTabs } from './section/fieldSectionTabs';
|
|
26
|
+
// Esportazioni dalla cartella style
|
|
27
|
+
export { default as fieldColor } from './style/fieldColor';
|
|
28
|
+
export { default as fieldContainerWidths } from './style/fieldContainerWidths';
|
|
29
|
+
export { default as fieldFontSizes } from './style/fieldFontSizes';
|
|
30
|
+
export { default as fieldHeights } from './style/fieldHeights';
|
|
31
|
+
export { default as fieldMargins } from './style/fieldMargins';
|
|
32
|
+
export { default as fieldPaddings } from './style/fieldPaddings';
|
|
33
|
+
export { default as fieldViewportHeights } from './style/fieldViewportHeights';
|
|
34
|
+
export { default as fieldCss } from './style/fieldCss';
|
|
35
|
+
// Esportazioni dalla cartella utils
|
|
36
|
+
//export { default as fieldMenuItems } from './utils/fieldMenuItems';
|
|
37
|
+
export { default as fieldRoles } from './utils/fieldRoles';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import fieldRichText from '../fieldRichText';
|
|
2
|
+
import fieldContainerWidths from '../style/fieldContainerWidths';
|
|
3
|
+
import fieldUpload from '../fieldUpload';
|
|
4
|
+
import fieldColor from '../style/fieldColor';
|
|
5
|
+
import fieldSelect from '../fieldSelect';
|
|
6
|
+
import fieldHeights from '../style/fieldHeights';
|
|
7
|
+
import fieldCss from '../style/fieldCss';
|
|
8
|
+
const fieldContainerProps = (customFields = []) => {
|
|
9
|
+
return {
|
|
10
|
+
name: 'ctrP',
|
|
11
|
+
label: 'Proprietà container',
|
|
12
|
+
type: 'group',
|
|
13
|
+
fields: [
|
|
14
|
+
...customFields,
|
|
15
|
+
fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
|
|
16
|
+
fieldContainerWidths(),
|
|
17
|
+
{
|
|
18
|
+
type: 'tabs',
|
|
19
|
+
tabs: [
|
|
20
|
+
{
|
|
21
|
+
label: 'Stile',
|
|
22
|
+
fields: [
|
|
23
|
+
fieldUpload('media', { name: 'bgi', label: 'Immagine di sfondo' }),
|
|
24
|
+
fieldColor({ name: 'bgc', label: 'Colore di sfondo', required: false }),
|
|
25
|
+
fieldSelect({
|
|
26
|
+
name: 'borderRadius',
|
|
27
|
+
type: 'select',
|
|
28
|
+
label: 'Angoli arrotondati',
|
|
29
|
+
defaultValue: 'rounded-none',
|
|
30
|
+
options: [
|
|
31
|
+
{ label: 'Nessuno', value: 'rounded-none' },
|
|
32
|
+
{ label: 'Piccolo', value: 'rounded-sm' },
|
|
33
|
+
{ label: 'Medio', value: 'rounded-md' },
|
|
34
|
+
{ label: 'Grande', value: 'rounded-lg' },
|
|
35
|
+
{ label: 'Extra Grande', value: 'rounded-xl' },
|
|
36
|
+
{ label: 'Massimo', value: 'rounded-full' },
|
|
37
|
+
],
|
|
38
|
+
admin: {
|
|
39
|
+
width: '50%',
|
|
40
|
+
description: 'Imposta lo stile degli angoli arrotondati del contenitore.',
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
fieldSelect({
|
|
44
|
+
name: 'boxShadow',
|
|
45
|
+
type: 'select',
|
|
46
|
+
label: 'Ombra contenitore',
|
|
47
|
+
defaultValue: 'shadow-none', // Default: nessuna ombra
|
|
48
|
+
options: [
|
|
49
|
+
{ label: 'Nessuna', value: 'shadow-none' },
|
|
50
|
+
{ label: 'Piccola', value: 'shadow-sm' },
|
|
51
|
+
{ label: 'Normale', value: 'shadow' },
|
|
52
|
+
{ label: 'Media', value: 'shadow-md' },
|
|
53
|
+
{ label: 'Grande', value: 'shadow-lg' },
|
|
54
|
+
{ label: 'Extra Grande', value: 'shadow-xl' },
|
|
55
|
+
{ label: 'Massima', value: 'shadow-2xl' },
|
|
56
|
+
],
|
|
57
|
+
admin: {
|
|
58
|
+
width: '50%',
|
|
59
|
+
description: "Imposta lo stile dell'ombra per il contenitore.",
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Dimensioni',
|
|
66
|
+
fields: [fieldHeights()],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
fieldCss(),
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export default fieldContainerProps;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import fieldColor from '../style/fieldColor';
|
|
2
|
+
import iconsList from '../../iconsList';
|
|
3
|
+
import fieldCheckbox from '../fieldCheckbox';
|
|
4
|
+
import fieldText from '../fieldText';
|
|
5
|
+
import fieldSelect from '../fieldSelect';
|
|
6
|
+
import fieldRelationship from '../fieldRelationship';
|
|
7
|
+
const fieldAction = (config = {}) => {
|
|
8
|
+
const { relationToOptions = ['pages'] } = config;
|
|
9
|
+
return {
|
|
10
|
+
type: 'group',
|
|
11
|
+
label: 'Azione',
|
|
12
|
+
name: 'action',
|
|
13
|
+
fields: [
|
|
14
|
+
fieldCheckbox({
|
|
15
|
+
name: 'show',
|
|
16
|
+
label: 'Mostra azione',
|
|
17
|
+
defaultValue: false,
|
|
18
|
+
admin: {
|
|
19
|
+
width: '50%',
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
fieldText({
|
|
23
|
+
name: 'label',
|
|
24
|
+
type: 'text',
|
|
25
|
+
label: 'Testo da visualizzare',
|
|
26
|
+
defaultValue: 'Action',
|
|
27
|
+
admin: {
|
|
28
|
+
width: '50%',
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
fieldSelect({
|
|
32
|
+
name: 'actionType',
|
|
33
|
+
label: 'Tipo di azione',
|
|
34
|
+
defaultValue: 'internalLink',
|
|
35
|
+
admin: {
|
|
36
|
+
width: '33%',
|
|
37
|
+
},
|
|
38
|
+
options: [
|
|
39
|
+
{
|
|
40
|
+
label: 'Interno',
|
|
41
|
+
value: 'internalLink',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Esterno',
|
|
45
|
+
value: 'externalLink',
|
|
46
|
+
},
|
|
47
|
+
/*
|
|
48
|
+
{
|
|
49
|
+
label: 'Azione',
|
|
50
|
+
value: 'customAction',
|
|
51
|
+
},
|
|
52
|
+
*/
|
|
53
|
+
],
|
|
54
|
+
}),
|
|
55
|
+
fieldRelationship(relationToOptions, {
|
|
56
|
+
name: 'internalLink',
|
|
57
|
+
label: 'Seleziona una pagina interna',
|
|
58
|
+
admin: {
|
|
59
|
+
condition: (data, siblingData) => {
|
|
60
|
+
return siblingData?.actionType === 'internalLink';
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
{
|
|
65
|
+
name: 'externalLink',
|
|
66
|
+
type: 'text',
|
|
67
|
+
label: 'URL esterno',
|
|
68
|
+
admin: {
|
|
69
|
+
condition: (data, siblingData) => {
|
|
70
|
+
return siblingData?.actionType === 'externalLink';
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'collapsible',
|
|
76
|
+
label: 'Stile',
|
|
77
|
+
fields: [
|
|
78
|
+
{
|
|
79
|
+
type: 'row',
|
|
80
|
+
fields: [
|
|
81
|
+
{
|
|
82
|
+
name: 'buttonStyle',
|
|
83
|
+
type: 'select',
|
|
84
|
+
label: 'Stile bottone',
|
|
85
|
+
defaultValue: 'solid',
|
|
86
|
+
admin: {
|
|
87
|
+
width: '33%',
|
|
88
|
+
},
|
|
89
|
+
options: [
|
|
90
|
+
{ label: 'Solido', value: 'solid' },
|
|
91
|
+
{ label: 'Outline', value: 'outline' },
|
|
92
|
+
{ label: 'Ghost', value: 'ghost' },
|
|
93
|
+
{ label: 'Link', value: 'link' },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'buttonColor',
|
|
98
|
+
type: 'select',
|
|
99
|
+
label: 'Colore bottone',
|
|
100
|
+
defaultValue: 'primary',
|
|
101
|
+
admin: {
|
|
102
|
+
width: '33%',
|
|
103
|
+
},
|
|
104
|
+
options: [
|
|
105
|
+
{ label: 'Primary', value: 'primary' },
|
|
106
|
+
{ label: 'Secondary', value: 'secondary' },
|
|
107
|
+
{ label: 'Accent', value: 'accent' },
|
|
108
|
+
{ label: 'Dark', value: 'dark' },
|
|
109
|
+
{ label: 'Light', value: 'light' },
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'buttonSize',
|
|
114
|
+
type: 'select',
|
|
115
|
+
label: 'Dimensione bottone',
|
|
116
|
+
defaultValue: 'default',
|
|
117
|
+
admin: {
|
|
118
|
+
width: '33%',
|
|
119
|
+
},
|
|
120
|
+
options: [
|
|
121
|
+
{ label: 'Small', value: 'small' },
|
|
122
|
+
{ label: 'Default', value: 'default' },
|
|
123
|
+
{ label: 'Medium', value: 'medium' },
|
|
124
|
+
{ label: 'Large', value: 'large' },
|
|
125
|
+
{ label: 'Extra Large', value: 'xl' },
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'buttonRounded',
|
|
130
|
+
type: 'select',
|
|
131
|
+
label: 'Arrotondamento',
|
|
132
|
+
defaultValue: 'default',
|
|
133
|
+
admin: {
|
|
134
|
+
width: '33%',
|
|
135
|
+
},
|
|
136
|
+
options: [
|
|
137
|
+
{ label: 'Nessuno', value: 'none' },
|
|
138
|
+
{ label: 'Piccolo', value: 'sm' },
|
|
139
|
+
{ label: 'Standard', value: 'default' },
|
|
140
|
+
{ label: 'Grande', value: 'lg' },
|
|
141
|
+
{ label: 'Completo', value: 'full' },
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'alignment',
|
|
146
|
+
type: 'select',
|
|
147
|
+
label: 'Allineamento del Bottone',
|
|
148
|
+
defaultValue: 'left',
|
|
149
|
+
options: [
|
|
150
|
+
{
|
|
151
|
+
label: 'Sinistra',
|
|
152
|
+
value: 'left',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'Centro',
|
|
156
|
+
value: 'center',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: 'Destra',
|
|
160
|
+
value: 'right',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
admin: {
|
|
164
|
+
width: '33%',
|
|
165
|
+
condition: (data) => true, // Puoi modificare questa condizione se il campo deve essere mostrato solo in determinate circostanze
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
fieldColor({
|
|
169
|
+
name: 'textColor',
|
|
170
|
+
label: 'Colore del testo',
|
|
171
|
+
admin: {
|
|
172
|
+
width: '33%',
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
{
|
|
176
|
+
name: 'additionalEffects',
|
|
177
|
+
type: 'select',
|
|
178
|
+
label: 'Effetti aggiuntivi',
|
|
179
|
+
hasMany: true,
|
|
180
|
+
admin: {
|
|
181
|
+
width: '33%',
|
|
182
|
+
},
|
|
183
|
+
options: [
|
|
184
|
+
{ label: 'Ombra', value: 'shadow' },
|
|
185
|
+
{ label: 'Transizione', value: 'transition' },
|
|
186
|
+
{ label: 'Animazione scala', value: 'scale' },
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: 'row',
|
|
193
|
+
fields: [
|
|
194
|
+
{
|
|
195
|
+
name: 'useIcon',
|
|
196
|
+
type: 'checkbox',
|
|
197
|
+
label: 'Usa icona',
|
|
198
|
+
defaultValue: false,
|
|
199
|
+
admin: {
|
|
200
|
+
width: '33%',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'iconPosition',
|
|
205
|
+
type: 'select',
|
|
206
|
+
label: 'Posizione icona',
|
|
207
|
+
defaultValue: 'left',
|
|
208
|
+
admin: {
|
|
209
|
+
width: '33%',
|
|
210
|
+
condition: (_, siblingData) => siblingData?.useIcon === true,
|
|
211
|
+
},
|
|
212
|
+
options: [
|
|
213
|
+
{ label: 'Sinistra', value: 'left' },
|
|
214
|
+
{ label: 'Destra', value: 'right' },
|
|
215
|
+
{ label: 'Solo icona', value: 'only' },
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'iconName',
|
|
220
|
+
type: 'select',
|
|
221
|
+
label: 'Icona',
|
|
222
|
+
options: [...iconsList],
|
|
223
|
+
admin: {
|
|
224
|
+
width: '33%',
|
|
225
|
+
condition: (_, siblingData) => siblingData?.useIcon === true,
|
|
226
|
+
},
|
|
227
|
+
// Qui potresti usare un select con le icone disponibili se hai una libreria predefinita
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
export default fieldAction;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fieldRichText from '../fieldRichText';
|
|
2
|
+
import fieldCss from '../style/fieldCss';
|
|
3
|
+
const fieldSectionProps = (customFields = []) => {
|
|
4
|
+
return {
|
|
5
|
+
name: 'sctP',
|
|
6
|
+
label: 'Proprietà sezione',
|
|
7
|
+
type: 'group',
|
|
8
|
+
fields: [
|
|
9
|
+
...customFields,
|
|
10
|
+
fieldRichText({ name: 'body', label: 'Contenuto', required: false }),
|
|
11
|
+
fieldCss(),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default fieldSectionProps;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import fieldConfigProps from './fieldConfigProps';
|
|
2
|
+
import fieldSectionProps from './fieldSectionProps';
|
|
3
|
+
import fieldContentProps from './fieldContentProps';
|
|
4
|
+
import fieldContainerProps from '../layout/fieldContainerProps';
|
|
5
|
+
const fieldSectionTabs = (options = {}) => {
|
|
6
|
+
const { config = true, section = true, container = true, content = true, configFields = [], sectionFields = [], containerFields = [], contentFields = [], } = options;
|
|
7
|
+
const tabs = [];
|
|
8
|
+
if (config) {
|
|
9
|
+
tabs.push({
|
|
10
|
+
label: 'Configurazione',
|
|
11
|
+
fields: [fieldConfigProps(configFields)],
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
// Tab per la sezione
|
|
15
|
+
if (section) {
|
|
16
|
+
tabs.push({
|
|
17
|
+
label: 'Sezione',
|
|
18
|
+
fields: [fieldSectionProps(sectionFields)],
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
// Tab per il container
|
|
22
|
+
if (container) {
|
|
23
|
+
tabs.push({
|
|
24
|
+
label: 'Container',
|
|
25
|
+
fields: [fieldContainerProps(containerFields)],
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// Tab per il contenuto
|
|
29
|
+
if (content) {
|
|
30
|
+
tabs.push({
|
|
31
|
+
label: 'Contenuto',
|
|
32
|
+
fields: [fieldContentProps(contentFields)],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
type: 'tabs',
|
|
37
|
+
tabs: tabs,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default fieldSectionTabs;
|