@woodylab/payload 0.0.8 → 0.0.9
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/fields/fieldArray.d.ts +1 -1
- package/dist/fields/fieldBlocks.d.ts +1 -1
- package/dist/fields/fieldCheckbox.d.ts +1 -1
- package/dist/fields/fieldCode.d.ts +1 -1
- package/dist/fields/fieldDate.d.ts +1 -1
- package/dist/fields/fieldEmail.d.ts +1 -1
- package/dist/fields/fieldJoin.d.ts +1 -1
- package/dist/fields/fieldNumber.d.ts +1 -1
- package/dist/fields/fieldPoint.d.ts +1 -1
- package/dist/fields/fieldRadioGroup.d.ts +1 -1
- package/dist/fields/fieldRelationship.d.ts +1 -1
- package/dist/fields/fieldRichText.d.ts +1 -1
- package/dist/fields/fieldSelect.d.ts +1 -1
- package/dist/fields/fieldText.d.ts +1 -1
- package/dist/fields/fieldTextArea.d.ts +1 -1
- package/dist/fields/fieldUpload.d.ts +1 -1
- package/dist/fields/index.cjs.js +458 -22
- package/dist/fields/index.cjs.js.map +1 -1
- package/dist/fields/index.d.ts +7 -0
- package/dist/fields/index.esm.js +453 -23
- package/dist/fields/index.esm.js.map +1 -1
- package/dist/fields/style/fieldColor.d.ts +1 -1
- package/dist/fields/utils/fieldMenuItems.d.ts +1 -1
- package/dist/fields/utils/fieldRoles.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/fields/types/{FieldOverride.d.ts → fieldOverride.d.ts} +0 -0
package/dist/fields/index.d.ts
CHANGED
|
@@ -15,11 +15,18 @@ export { default as fieldRelationship } from './fieldRelationship';
|
|
|
15
15
|
export { default as fieldRichText } from './fieldRichText';
|
|
16
16
|
export { default as fieldSelect } from './fieldSelect';
|
|
17
17
|
export { default as fieldContainerProps } from './layout/fieldContainerProps';
|
|
18
|
+
export { default as fieldAction } from './section/fieldAction';
|
|
18
19
|
export { default as fieldConfigProps } from './section/fieldConfigProps';
|
|
19
20
|
export { default as fieldContentProps } from './section/fieldContentProps';
|
|
20
21
|
export { default as fieldSectionProps } from './section/fieldSectionProps';
|
|
21
22
|
export { default as fieldSectionTabs } from './section/fieldSectionTabs';
|
|
23
|
+
export { default as fieldColor } from './style/fieldColor';
|
|
22
24
|
export { default as fieldContainerWidths } from './style/fieldContainerWidths';
|
|
25
|
+
export { default as fieldFontSizes } from './style/fieldFontSizes';
|
|
23
26
|
export { default as fieldHeights } from './style/fieldHeights';
|
|
24
27
|
export { default as fieldMargins } from './style/fieldMargins';
|
|
25
28
|
export { default as fieldPaddings } from './style/fieldPaddings';
|
|
29
|
+
export { default as fieldViewportHeights } from './style/fieldViewportHeights';
|
|
30
|
+
export { FieldOverride as fieldOverride } from './types/fieldOverride';
|
|
31
|
+
export { default as fieldMenuItems } from './utils/fieldMenuItems';
|
|
32
|
+
export { default as fieldRoles } from './utils/fieldRoles';
|
package/dist/fields/index.esm.js
CHANGED
|
@@ -241,6 +241,365 @@ const fieldContainerProps = (customFields = []) => {
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
+
const fieldThemeColor = (override) => ({
|
|
245
|
+
name: override?.name || 'color',
|
|
246
|
+
label: override?.label || 'Colore',
|
|
247
|
+
type: 'select',
|
|
248
|
+
required: override?.required ?? false,
|
|
249
|
+
options: [
|
|
250
|
+
{ label: 'Default', value: '' },
|
|
251
|
+
{ label: 'Foreground', value: 'foreground' },
|
|
252
|
+
{ label: 'Primary', value: 'primary' },
|
|
253
|
+
{ label: 'Secondary', value: 'secondary' },
|
|
254
|
+
{ label: 'Accent', value: 'accent' },
|
|
255
|
+
{ label: 'Dark', value: 'dark' },
|
|
256
|
+
{ label: 'Light', value: 'light' },
|
|
257
|
+
{ label: 'White', value: 'white' },
|
|
258
|
+
{ label: 'Black', value: 'black' },
|
|
259
|
+
],
|
|
260
|
+
admin: {
|
|
261
|
+
...override?.admin,
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const iconsList = [
|
|
266
|
+
{ label: 'Academic Cap', value: 'AcademicCapIcon' },
|
|
267
|
+
{ label: 'Adjustments Horizontal', value: 'AdjustmentsHorizontalIcon' },
|
|
268
|
+
{ label: 'Adjustments Vertical', value: 'AdjustmentsVerticalIcon' },
|
|
269
|
+
{ label: 'Archive Box Arrow Down', value: 'ArchiveBoxArrowDownIcon' },
|
|
270
|
+
{ label: 'Archive Box X Mark', value: 'ArchiveBoxXMarkIcon' },
|
|
271
|
+
{ label: 'Archive Box', value: 'ArchiveBoxIcon' },
|
|
272
|
+
{ label: 'Arrow Down Circle', value: 'ArrowDownCircleIcon' },
|
|
273
|
+
{ label: 'Arrow Down', value: 'ArrowDownIcon' },
|
|
274
|
+
{ label: 'Arrow Left Circle', value: 'ArrowLeftCircleIcon' },
|
|
275
|
+
{ label: 'Arrow Left', value: 'ArrowLeftIcon' },
|
|
276
|
+
{ label: 'Arrow Right Circle', value: 'ArrowRightCircleIcon' },
|
|
277
|
+
{ label: 'Arrow Right', value: 'ArrowRightIcon' },
|
|
278
|
+
{ label: 'Arrow Up Circle', value: 'ArrowUpCircleIcon' },
|
|
279
|
+
{ label: 'Arrow Up', value: 'ArrowUpIcon' },
|
|
280
|
+
{ label: 'Bell Alert', value: 'BellAlertIcon' },
|
|
281
|
+
{ label: 'Bell', value: 'BellIcon' },
|
|
282
|
+
{ label: 'Bookmark Square', value: 'BookmarkSquareIcon' },
|
|
283
|
+
{ label: 'Bookmark', value: 'BookmarkIcon' },
|
|
284
|
+
{ label: 'Building Office', value: 'BuildingOfficeIcon' },
|
|
285
|
+
{ label: 'Calendar', value: 'CalendarIcon' },
|
|
286
|
+
{ label: 'Camera', value: 'CameraIcon' },
|
|
287
|
+
{ label: 'Chart Bar', value: 'ChartBarIcon' },
|
|
288
|
+
{ label: 'Chat Bubble Left Right', value: 'ChatBubbleLeftRightIcon' },
|
|
289
|
+
{ label: 'Chat Bubble Left', value: 'ChatBubbleLeftIcon' },
|
|
290
|
+
{ label: 'Check Circle', value: 'CheckCircleIcon' },
|
|
291
|
+
{ label: 'Check', value: 'CheckIcon' },
|
|
292
|
+
{ label: 'Chevron Down', value: 'ChevronDownIcon' },
|
|
293
|
+
{ label: 'Chevron Left', value: 'ChevronLeftIcon' },
|
|
294
|
+
{ label: 'Chevron Right', value: 'ChevronRightIcon' },
|
|
295
|
+
{ label: 'Chevron Up', value: 'ChevronUpIcon' },
|
|
296
|
+
{ label: 'Clock', value: 'ClockIcon' },
|
|
297
|
+
{ label: 'Cloud Arrow Up', value: 'CloudArrowUpIcon' },
|
|
298
|
+
{ label: 'Cloud', value: 'CloudIcon' },
|
|
299
|
+
{ label: 'Code Bracket', value: 'CodeBracketIcon' },
|
|
300
|
+
{ label: 'Cog', value: 'CogIcon' },
|
|
301
|
+
{ label: 'Command Line', value: 'CommandLineIcon' },
|
|
302
|
+
{ label: 'Computer Desktop', value: 'ComputerDesktopIcon' },
|
|
303
|
+
{ label: 'Credit Card', value: 'CreditCardIcon' },
|
|
304
|
+
{ label: 'Document', value: 'DocumentIcon' },
|
|
305
|
+
{ label: 'Envelope', value: 'EnvelopeIcon' },
|
|
306
|
+
{ label: 'Exclamation Circle', value: 'ExclamationCircleIcon' },
|
|
307
|
+
{ label: 'Exclamation Triangle', value: 'ExclamationTriangleIcon' },
|
|
308
|
+
{ label: 'Eye', value: 'EyeIcon' },
|
|
309
|
+
{ label: 'Face Smile', value: 'FaceSmileIcon' },
|
|
310
|
+
{ label: 'Film', value: 'FilmIcon' },
|
|
311
|
+
{ label: 'Finger Print', value: 'FingerPrintIcon' },
|
|
312
|
+
{ label: 'Fire', value: 'FireIcon' },
|
|
313
|
+
{ label: 'Flag', value: 'FlagIcon' },
|
|
314
|
+
{ label: 'Folder Open', value: 'FolderOpenIcon' },
|
|
315
|
+
{ label: 'Folder', value: 'FolderIcon' },
|
|
316
|
+
{ label: 'Gift', value: 'GiftIcon' },
|
|
317
|
+
{ label: 'Globe Alt', value: 'GlobeAltIcon' },
|
|
318
|
+
{ label: 'Globe Europe Africa', value: 'GlobeEuropeAfricaIcon' },
|
|
319
|
+
{ label: 'Hand Raised', value: 'HandRaisedIcon' },
|
|
320
|
+
{ label: 'Heart', value: 'HeartIcon' },
|
|
321
|
+
{ label: 'Home', value: 'HomeIcon' },
|
|
322
|
+
{ label: 'Identification', value: 'IdentificationIcon' },
|
|
323
|
+
{ label: 'Information Circle', value: 'InformationCircleIcon' },
|
|
324
|
+
{ label: 'Key', value: 'KeyIcon' },
|
|
325
|
+
{ label: 'Link', value: 'LinkIcon' },
|
|
326
|
+
{ label: 'List Bullet', value: 'ListBulletIcon' },
|
|
327
|
+
{ label: 'Lock Closed', value: 'LockClosedIcon' },
|
|
328
|
+
{ label: 'Lock Open', value: 'LockOpenIcon' },
|
|
329
|
+
{ label: 'Magnifying Glass Circle', value: 'MagnifyingGlassCircleIcon' },
|
|
330
|
+
{ label: 'Magnifying Glass', value: 'MagnifyingGlassIcon' },
|
|
331
|
+
{ label: 'Map Pin', value: 'MapPinIcon' },
|
|
332
|
+
{ label: 'Map', value: 'MapIcon' },
|
|
333
|
+
{ label: 'Moon', value: 'MoonIcon' },
|
|
334
|
+
{ label: 'Paper Airplane', value: 'PaperAirplaneIcon' },
|
|
335
|
+
{ label: 'Paper Clip', value: 'PaperClipIcon' },
|
|
336
|
+
{ label: 'Pause Circle', value: 'PauseCircleIcon' },
|
|
337
|
+
{ label: 'Pencil Square', value: 'PencilSquareIcon' },
|
|
338
|
+
{ label: 'Pencil', value: 'PencilIcon' },
|
|
339
|
+
{ label: 'Phone Arrow Up Right', value: 'PhoneArrowUpRightIcon' },
|
|
340
|
+
{ label: 'Phone X Mark', value: 'PhoneXMarkIcon' },
|
|
341
|
+
{ label: 'Phone', value: 'PhoneIcon' },
|
|
342
|
+
{ label: 'Photo', value: 'PhotoIcon' },
|
|
343
|
+
{ label: 'Play Circle', value: 'PlayCircleIcon' },
|
|
344
|
+
{ label: 'Play', value: 'PlayIcon' },
|
|
345
|
+
{ label: 'Plus Circle', value: 'PlusCircleIcon' },
|
|
346
|
+
{ label: 'Plus', value: 'PlusIcon' },
|
|
347
|
+
{ label: 'Power', value: 'PowerIcon' },
|
|
348
|
+
{ label: 'Question Mark Circle', value: 'QuestionMarkCircleIcon' },
|
|
349
|
+
{ label: 'Rocket Launch', value: 'RocketLaunchIcon' },
|
|
350
|
+
{ label: 'Rss', value: 'RssIcon' },
|
|
351
|
+
{ label: 'Scale', value: 'ScaleIcon' },
|
|
352
|
+
{ label: 'Server', value: 'ServerIcon' },
|
|
353
|
+
{ label: 'Share', value: 'ShareIcon' },
|
|
354
|
+
{ label: 'Shield Check', value: 'ShieldCheckIcon' },
|
|
355
|
+
{ label: 'Shield Exclamation', value: 'ShieldExclamationIcon' },
|
|
356
|
+
{ label: 'Shopping Bag', value: 'ShoppingBagIcon' },
|
|
357
|
+
{ label: 'Shopping Cart', value: 'ShoppingCartIcon' },
|
|
358
|
+
{ label: 'Star', value: 'StarIcon' },
|
|
359
|
+
{ label: 'Stop Circle', value: 'StopCircleIcon' },
|
|
360
|
+
{ label: 'Sun', value: 'SunIcon' },
|
|
361
|
+
{ label: 'Tag', value: 'TagIcon' },
|
|
362
|
+
{ label: 'Trash', value: 'TrashIcon' },
|
|
363
|
+
{ label: 'Trophy', value: 'TrophyIcon' },
|
|
364
|
+
{ label: 'User Circle', value: 'UserCircleIcon' },
|
|
365
|
+
{ label: 'User Group', value: 'UserGroupIcon' },
|
|
366
|
+
{ label: 'User', value: 'UserIcon' },
|
|
367
|
+
{ label: 'Users', value: 'UsersIcon' },
|
|
368
|
+
{ label: 'Video Camera', value: 'VideoCameraIcon' },
|
|
369
|
+
{ label: 'Wifi', value: 'WifiIcon' },
|
|
370
|
+
{ label: 'Window', value: 'WindowIcon' },
|
|
371
|
+
{ label: 'Wrench Screwdriver', value: 'WrenchScrewdriverIcon' },
|
|
372
|
+
{ label: 'Wrench', value: 'WrenchIcon' },
|
|
373
|
+
{ label: 'X Circle', value: 'XCircleIcon' },
|
|
374
|
+
{ label: 'X Mark', value: 'XMarkIcon' },
|
|
375
|
+
];
|
|
376
|
+
|
|
377
|
+
const fieldAction = () => ({
|
|
378
|
+
type: 'group',
|
|
379
|
+
label: 'Azione',
|
|
380
|
+
name: 'action',
|
|
381
|
+
fields: [
|
|
382
|
+
fieldCheckbox({ name: 'show', label: 'Mostra azione', defaultValue: false, admin: {
|
|
383
|
+
width: '50%', // TODO CAMBIARE LAYOUT ADMIN
|
|
384
|
+
} }),
|
|
385
|
+
fieldText({
|
|
386
|
+
name: 'label',
|
|
387
|
+
type: 'text',
|
|
388
|
+
label: 'Testo da visualizzare',
|
|
389
|
+
defaultValue: 'Action',
|
|
390
|
+
admin: {
|
|
391
|
+
width: '50%',
|
|
392
|
+
}
|
|
393
|
+
}),
|
|
394
|
+
fieldSelect({
|
|
395
|
+
name: 'actionType',
|
|
396
|
+
label: 'Tipo di azione',
|
|
397
|
+
defaultValue: 'internalLink',
|
|
398
|
+
admin: {
|
|
399
|
+
width: '33%',
|
|
400
|
+
},
|
|
401
|
+
options: [
|
|
402
|
+
{
|
|
403
|
+
label: 'Interno',
|
|
404
|
+
value: 'internalLink',
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
label: 'Esterno',
|
|
408
|
+
value: 'externalLink',
|
|
409
|
+
},
|
|
410
|
+
/*
|
|
411
|
+
{
|
|
412
|
+
label: 'Azione',
|
|
413
|
+
value: 'customAction',
|
|
414
|
+
},
|
|
415
|
+
*/
|
|
416
|
+
],
|
|
417
|
+
}),
|
|
418
|
+
{
|
|
419
|
+
name: 'internalLink',
|
|
420
|
+
type: 'relationship',
|
|
421
|
+
label: 'Seleziona una pagina interna',
|
|
422
|
+
admin: {
|
|
423
|
+
condition: (data, siblingData) => {
|
|
424
|
+
return siblingData?.actionType === 'internalLink';
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
relationTo: ['pages', 'posts', 'destinations'],
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: 'externalLink',
|
|
431
|
+
type: 'text',
|
|
432
|
+
label: 'URL esterno',
|
|
433
|
+
admin: {
|
|
434
|
+
condition: (data, siblingData) => {
|
|
435
|
+
return siblingData?.actionType === 'externalLink';
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
type: 'collapsible',
|
|
441
|
+
label: 'Stile',
|
|
442
|
+
fields: [
|
|
443
|
+
{
|
|
444
|
+
type: 'row',
|
|
445
|
+
fields: [
|
|
446
|
+
{
|
|
447
|
+
name: 'buttonStyle',
|
|
448
|
+
type: 'select',
|
|
449
|
+
label: 'Stile bottone',
|
|
450
|
+
defaultValue: 'solid',
|
|
451
|
+
admin: {
|
|
452
|
+
width: '33%',
|
|
453
|
+
},
|
|
454
|
+
options: [
|
|
455
|
+
{ label: 'Solido', value: 'solid' },
|
|
456
|
+
{ label: 'Outline', value: 'outline' },
|
|
457
|
+
{ label: 'Ghost', value: 'ghost' },
|
|
458
|
+
{ label: 'Link', value: 'link' },
|
|
459
|
+
],
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
name: 'buttonColor',
|
|
463
|
+
type: 'select',
|
|
464
|
+
label: 'Colore bottone',
|
|
465
|
+
defaultValue: 'primary',
|
|
466
|
+
admin: {
|
|
467
|
+
width: '33%',
|
|
468
|
+
},
|
|
469
|
+
options: [
|
|
470
|
+
{ label: 'Primary', value: 'primary' },
|
|
471
|
+
{ label: 'Secondary', value: 'secondary' },
|
|
472
|
+
{ label: 'Accent', value: 'accent' },
|
|
473
|
+
{ label: 'Dark', value: 'dark' },
|
|
474
|
+
{ label: 'Light', value: 'light' },
|
|
475
|
+
],
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: 'buttonSize',
|
|
479
|
+
type: 'select',
|
|
480
|
+
label: 'Dimensione bottone',
|
|
481
|
+
defaultValue: 'default',
|
|
482
|
+
admin: {
|
|
483
|
+
width: '33%',
|
|
484
|
+
},
|
|
485
|
+
options: [
|
|
486
|
+
{ label: 'Small', value: 'small' },
|
|
487
|
+
{ label: 'Default', value: 'default' },
|
|
488
|
+
{ label: 'Medium', value: 'medium' },
|
|
489
|
+
{ label: 'Large', value: 'large' },
|
|
490
|
+
{ label: 'Extra Large', value: 'xl' },
|
|
491
|
+
],
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
name: 'buttonRounded',
|
|
495
|
+
type: 'select',
|
|
496
|
+
label: 'Arrotondamento',
|
|
497
|
+
defaultValue: 'default',
|
|
498
|
+
admin: {
|
|
499
|
+
width: '33%',
|
|
500
|
+
},
|
|
501
|
+
options: [
|
|
502
|
+
{ label: 'Nessuno', value: 'none' },
|
|
503
|
+
{ label: 'Piccolo', value: 'sm' },
|
|
504
|
+
{ label: 'Standard', value: 'default' },
|
|
505
|
+
{ label: 'Grande', value: 'lg' },
|
|
506
|
+
{ label: 'Completo', value: 'full' },
|
|
507
|
+
],
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
name: 'alignment',
|
|
511
|
+
type: 'select',
|
|
512
|
+
label: 'Allineamento del Bottone',
|
|
513
|
+
defaultValue: 'left',
|
|
514
|
+
options: [
|
|
515
|
+
{
|
|
516
|
+
label: 'Sinistra',
|
|
517
|
+
value: 'left',
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
label: 'Centro',
|
|
521
|
+
value: 'center',
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
label: 'Destra',
|
|
525
|
+
value: 'right',
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
admin: {
|
|
529
|
+
width: '33%',
|
|
530
|
+
condition: (data) => true, // Puoi modificare questa condizione se il campo deve essere mostrato solo in determinate circostanze
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
fieldThemeColor({
|
|
534
|
+
name: 'textColor',
|
|
535
|
+
label: 'Colore del testo',
|
|
536
|
+
admin: {
|
|
537
|
+
width: '33%',
|
|
538
|
+
}
|
|
539
|
+
}),
|
|
540
|
+
{
|
|
541
|
+
name: 'additionalEffects',
|
|
542
|
+
type: 'select',
|
|
543
|
+
label: 'Effetti aggiuntivi',
|
|
544
|
+
hasMany: true,
|
|
545
|
+
admin: {
|
|
546
|
+
width: '33%',
|
|
547
|
+
},
|
|
548
|
+
options: [
|
|
549
|
+
{ label: 'Ombra', value: 'shadow' },
|
|
550
|
+
{ label: 'Transizione', value: 'transition' },
|
|
551
|
+
{ label: 'Animazione scala', value: 'scale' },
|
|
552
|
+
],
|
|
553
|
+
}
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
type: 'row',
|
|
558
|
+
fields: [
|
|
559
|
+
{
|
|
560
|
+
name: 'useIcon',
|
|
561
|
+
type: 'checkbox',
|
|
562
|
+
label: 'Usa icona',
|
|
563
|
+
defaultValue: false,
|
|
564
|
+
admin: {
|
|
565
|
+
width: '33%',
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: 'iconPosition',
|
|
570
|
+
type: 'select',
|
|
571
|
+
label: 'Posizione icona',
|
|
572
|
+
defaultValue: 'left',
|
|
573
|
+
admin: {
|
|
574
|
+
width: '33%',
|
|
575
|
+
condition: (_, siblingData) => siblingData?.useIcon === true,
|
|
576
|
+
},
|
|
577
|
+
options: [
|
|
578
|
+
{ label: 'Sinistra', value: 'left' },
|
|
579
|
+
{ label: 'Destra', value: 'right' },
|
|
580
|
+
{ label: 'Solo icona', value: 'only' },
|
|
581
|
+
],
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: 'iconName',
|
|
585
|
+
type: 'select',
|
|
586
|
+
label: 'Icona',
|
|
587
|
+
options: [
|
|
588
|
+
...iconsList
|
|
589
|
+
],
|
|
590
|
+
admin: {
|
|
591
|
+
width: '33%',
|
|
592
|
+
condition: (_, siblingData) => siblingData?.useIcon === true,
|
|
593
|
+
},
|
|
594
|
+
// Qui potresti usare un select con le icone disponibili se hai una libreria predefinita
|
|
595
|
+
},
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
]
|
|
599
|
+
}
|
|
600
|
+
]
|
|
601
|
+
});
|
|
602
|
+
|
|
244
603
|
const fieldConfigProps = (customFields = []) => {
|
|
245
604
|
return {
|
|
246
605
|
name: 'config',
|
|
@@ -923,27 +1282,6 @@ const fieldViewportHeights = () => {
|
|
|
923
1282
|
});
|
|
924
1283
|
};
|
|
925
1284
|
|
|
926
|
-
const fieldThemeColor = (override) => ({
|
|
927
|
-
name: override?.name || 'color',
|
|
928
|
-
label: override?.label || 'Colore',
|
|
929
|
-
type: 'select',
|
|
930
|
-
required: override?.required ?? false,
|
|
931
|
-
options: [
|
|
932
|
-
{ label: 'Default', value: '' },
|
|
933
|
-
{ label: 'Foreground', value: 'foreground' },
|
|
934
|
-
{ label: 'Primary', value: 'primary' },
|
|
935
|
-
{ label: 'Secondary', value: 'secondary' },
|
|
936
|
-
{ label: 'Accent', value: 'accent' },
|
|
937
|
-
{ label: 'Dark', value: 'dark' },
|
|
938
|
-
{ label: 'Light', value: 'light' },
|
|
939
|
-
{ label: 'White', value: 'white' },
|
|
940
|
-
{ label: 'Black', value: 'black' },
|
|
941
|
-
],
|
|
942
|
-
admin: {
|
|
943
|
-
...override?.admin,
|
|
944
|
-
},
|
|
945
|
-
});
|
|
946
|
-
|
|
947
1285
|
const fieldSectionProps = (customFields = []) => {
|
|
948
1286
|
return {
|
|
949
1287
|
name: 'sctP',
|
|
@@ -1054,6 +1392,18 @@ const fieldContainerWidths = () => {
|
|
|
1054
1392
|
});
|
|
1055
1393
|
};
|
|
1056
1394
|
|
|
1395
|
+
const fieldFontSizes = () => {
|
|
1396
|
+
return fieldSelect({
|
|
1397
|
+
name: 'fs',
|
|
1398
|
+
label: 'Dimensione del testo',
|
|
1399
|
+
options: TailwindTextSizes,
|
|
1400
|
+
defaultValue: 'text-base',
|
|
1401
|
+
admin: {
|
|
1402
|
+
description: 'Seleziona una dimensione per il testo (es. Small, Base, Large, ecc.).',
|
|
1403
|
+
},
|
|
1404
|
+
});
|
|
1405
|
+
};
|
|
1406
|
+
|
|
1057
1407
|
/**
|
|
1058
1408
|
* Genera un campo per la selezione delle altezze
|
|
1059
1409
|
* @returns Field - Campo di tipo `select` per PayloadCMS
|
|
@@ -1330,36 +1680,116 @@ const fieldPaddings = () => {
|
|
|
1330
1680
|
};
|
|
1331
1681
|
};
|
|
1332
1682
|
|
|
1683
|
+
const fieldMenuItems = (override) => ({
|
|
1684
|
+
name: 'menuItems',
|
|
1685
|
+
label: 'Menu items',
|
|
1686
|
+
type: 'array',
|
|
1687
|
+
fields: [
|
|
1688
|
+
{
|
|
1689
|
+
name: 'test',
|
|
1690
|
+
type: 'text'
|
|
1691
|
+
},
|
|
1692
|
+
fieldCheckbox({
|
|
1693
|
+
name: 'is-external',
|
|
1694
|
+
label: 'open in new tab',
|
|
1695
|
+
}),
|
|
1696
|
+
fieldText({ name: 'label', label: 'label' }),
|
|
1697
|
+
{
|
|
1698
|
+
name: 'relationship',
|
|
1699
|
+
type: 'relationship',
|
|
1700
|
+
relationTo: ['destinations'],
|
|
1701
|
+
},
|
|
1702
|
+
//WFieldRelationship(['pages', 'destinations']),
|
|
1703
|
+
fieldArray({
|
|
1704
|
+
name: 'sub-menu',
|
|
1705
|
+
label: 'Sub menu',
|
|
1706
|
+
admin: {
|
|
1707
|
+
description: 'Aggiungere voci figlio a una voce di menù ne disabilita il click di navigazione per permettere l\'apertura del dropdown'
|
|
1708
|
+
},
|
|
1709
|
+
fields: [
|
|
1710
|
+
fieldCheckbox({
|
|
1711
|
+
name: 'is-external',
|
|
1712
|
+
label: 'open in new tab',
|
|
1713
|
+
}),
|
|
1714
|
+
fieldText({ name: 'label', label: 'label' }),
|
|
1715
|
+
{
|
|
1716
|
+
name: 'relationship',
|
|
1717
|
+
type: 'relationship',
|
|
1718
|
+
relationTo: ['pages', 'posts', 'destinations'],
|
|
1719
|
+
},
|
|
1720
|
+
]
|
|
1721
|
+
})
|
|
1722
|
+
],
|
|
1723
|
+
});
|
|
1724
|
+
|
|
1725
|
+
var UserRole;
|
|
1726
|
+
(function (UserRole) {
|
|
1727
|
+
UserRole["ADMIN"] = "admin";
|
|
1728
|
+
UserRole["DESIGNER"] = "designer";
|
|
1729
|
+
UserRole["COPY"] = "copy";
|
|
1730
|
+
UserRole["WEBADMIN"] = "webadmin";
|
|
1731
|
+
})(UserRole || (UserRole = {}));
|
|
1732
|
+
const fieldRoles = (override) => ({
|
|
1733
|
+
name: override?.name || 'roles',
|
|
1734
|
+
label: override?.label || 'Ruoli',
|
|
1735
|
+
type: 'select',
|
|
1736
|
+
required: override?.required ?? true,
|
|
1737
|
+
hasMany: override?.hasMany ?? true,
|
|
1738
|
+
options: [
|
|
1739
|
+
...Object.values(UserRole).map((role) => ({
|
|
1740
|
+
label: role.charAt(0).toUpperCase() + role.slice(1).toLowerCase(),
|
|
1741
|
+
value: role,
|
|
1742
|
+
})),
|
|
1743
|
+
...(override?.options || []),
|
|
1744
|
+
],
|
|
1745
|
+
access: {
|
|
1746
|
+
create: () => true,
|
|
1747
|
+
update: () => true,
|
|
1748
|
+
read: () => true,
|
|
1749
|
+
...override?.access,
|
|
1750
|
+
},
|
|
1751
|
+
admin: {
|
|
1752
|
+
description: 'Seleziona uno o più ruoli utente.',
|
|
1753
|
+
...override?.admin,
|
|
1754
|
+
},
|
|
1755
|
+
});
|
|
1756
|
+
|
|
1333
1757
|
// Esportazioni dalle cartelle principali
|
|
1334
1758
|
|
|
1335
1759
|
var index = /*#__PURE__*/Object.freeze({
|
|
1336
1760
|
__proto__: null,
|
|
1761
|
+
fieldAction: fieldAction,
|
|
1337
1762
|
fieldArray: fieldArray,
|
|
1338
1763
|
fieldBlocks: fieldBlocks,
|
|
1339
1764
|
fieldCheckbox: fieldCheckbox,
|
|
1340
1765
|
fieldCode: fieldCode,
|
|
1766
|
+
fieldColor: fieldThemeColor,
|
|
1341
1767
|
fieldConfigProps: fieldConfigProps,
|
|
1342
1768
|
fieldContainerProps: fieldContainerProps,
|
|
1343
1769
|
fieldContainerWidths: fieldContainerWidths,
|
|
1344
1770
|
fieldContentProps: fieldContentProps,
|
|
1345
1771
|
fieldDate: fieldDate,
|
|
1346
1772
|
fieldEmail: fieldEmail,
|
|
1773
|
+
fieldFontSizes: fieldFontSizes,
|
|
1347
1774
|
fieldHeights: fieldHeights,
|
|
1348
1775
|
fieldJoin: fieldJoin,
|
|
1349
1776
|
fieldMargins: fieldMargins,
|
|
1777
|
+
fieldMenuItems: fieldMenuItems,
|
|
1350
1778
|
fieldNumber: fieldNumber,
|
|
1351
1779
|
fieldPaddings: fieldPaddings,
|
|
1352
1780
|
fieldPoint: fieldPoint,
|
|
1353
1781
|
fieldRadioGroup: fieldRadioGroup,
|
|
1354
1782
|
fieldRelationship: fieldRelationship,
|
|
1355
1783
|
fieldRichText: fieldRichText,
|
|
1784
|
+
fieldRoles: fieldRoles,
|
|
1356
1785
|
fieldSectionProps: fieldSectionProps,
|
|
1357
1786
|
fieldSectionTabs: fieldSectionTabs,
|
|
1358
1787
|
fieldSelect: fieldSelect,
|
|
1359
1788
|
fieldText: fieldText,
|
|
1360
1789
|
fieldTextArea: fieldTextArea,
|
|
1361
|
-
fieldUpload: fieldUpload
|
|
1790
|
+
fieldUpload: fieldUpload,
|
|
1791
|
+
fieldViewportHeights: fieldViewportHeights
|
|
1362
1792
|
});
|
|
1363
1793
|
|
|
1364
|
-
export { index$1 as a, fieldArray, fieldBlocks, fieldCheckbox, fieldCode, fieldConfigProps, fieldContainerProps, fieldContainerWidths, fieldContentProps, fieldDate, fieldEmail, fieldHeights, fieldJoin, fieldMargins, fieldNumber, fieldPaddings, fieldPoint, fieldRadioGroup, fieldRelationship, fieldRichText, fieldSectionProps, fieldSectionTabs, fieldSelect, fieldText, fieldTextArea, fieldUpload, index as i };
|
|
1794
|
+
export { index$1 as a, fieldAction, fieldArray, fieldBlocks, fieldCheckbox, fieldCode, fieldThemeColor as fieldColor, fieldConfigProps, fieldContainerProps, fieldContainerWidths, fieldContentProps, fieldDate, fieldEmail, fieldFontSizes, fieldHeights, fieldJoin, fieldMargins, fieldMenuItems, fieldNumber, fieldPaddings, fieldPoint, fieldRadioGroup, fieldRelationship, fieldRichText, fieldRoles, fieldSectionProps, fieldSectionTabs, fieldSelect, fieldText, fieldTextArea, fieldUpload, fieldViewportHeights, index as i };
|
|
1365
1795
|
//# sourceMappingURL=index.esm.js.map
|