
    h#                        d dl mZ d dlmZ d dlmZ d dlmZ ddl	m
Z
 ddlmZ ddlmZmZmZmZmZ dd	lmZ dd
lmZ ddl	mZ  e
j0                  e      Z G d d ed      e      Z G d d ed      ee      Z G d d ed      e      Zy)    )forms)ValidationError)gettext)EntangledModelForm   )settings)SpacingFormMixin)AttributesFormFieldButtonGroupColoredButtonGroup	IconGroupTagTypeFormField)first_choice)FrontendUIItem   )	utilitiesc                       e Zd Z G d d      Z ej
                   ed      ej                   e	ej                         e
 ed                  Z ej
                   ed      ej                   e	ej                        d	 e
 ed            
      Z ej
                   ed      ej                  d ed      ffz    e	ej                         e
 ed                  Z ej
                   ed      ej"                  ej$                  z   ej"                  d   d   d	 e       
      Z e       Z e       Z fdZ xZS )SpacingFormc                        e Zd ZeZdg diZdZy)SpacingForm.Metaconfig)space_propertyspace_sides
space_sizespace_device
attributes)tag_typeN__name__
__module____qualname__r   modelentangled_fieldsuntangled_fields     Z/home/dcms/DCMS/lib/python3.12/site-packages/djangocms_frontend/contrib/utilities/forms.pyMetar      s     
 )r&   r(   Propertytext)property)attrs)labelchoicesinitialwidgetSidesF)r-   r.   r/   requiredr0   SizeautoAutoDevicer   c                     t         |           | j                  d   dk(  r3| j                  d   dk(  r t        t	        d      t	        d      d      y y )Nr   pr   r4   zQPadding does not have an auto spacing. Either switch to margin or a defined size.zfPadding does not have an auto spacing. Either switch to a defined size or change the spacing property.)r   r   )supercleancleaned_datar   _)self	__class__s    r'   r:   zSpacingForm.clean;   si    -.#5$:K:KL:Y]c:c!&'k' #$S#	
 
 ;d5r&   )r   r    r!   r(   r   ChoiceFieldr<   r   SPACER_PROPERTY_CHOICESr   r   dictr   SPACER_SIDE_CHOICESr   SPACER_SIZE_CHOICESr   EMPTY_CHOICEDEVICE_CHOICESr   r   r
   r   r   r   r:   __classcell__)r>   s   @r'   r   r      sD   ) ) 'U&&
m00X==>v!67	N $%##j,,X99:v!67K #""i,,60C/EEX99:v!67	J %5$$k%%(?(??%%a(+{L %&J!H r&   r   Spacingc                   d   e Zd Z G d d      Zd ed      fd ed      fd ed      fd	 ed
      fd ed      ffZd ed      fd ed      fd ed      ffZ ej                   ed       e	e
de      d      Z ej                   ed      d      Z ej                   ed      d ed            Z ej                   ed      de
j                  e
j                   z   e
j                   e             Z ej                   ed      e
j                  ez   d e              Z e       Zy!)"HeadingFormc                        e Zd ZeZdg diZg Zy)HeadingForm.Metar   )heading_levelheading
heading_idheading_contextheading_alignmentr   Nr   r%   r&   r'   r(   rK   L   s     	
 r&   r(   h1z	Heading 1h2z	Heading 2h3z	Heading 3h4z	Heading 4h5z	Heading 5startLeftcenterCenterendRightzHeading levelDJANGO_FRONTEND_HEADINGST)r-   r.   r2   Heading)r-   r2   IDFz_Fill in unique ID for table of contents. If empty heading will not appear in table of contents.)r-   r2   	help_textzHeading context)r-   r2   r.   r/   r0   	Alignment)r-   r.   r2   r0   N)r   r    r!   r(   r<   HEADINGSALIGNMENT_CHOICESr   r?   getattrr   rL   	CharFieldrM   rN   rD   COLOR_STYLE_CHOICESr   rO   r   rP   r
   r   r%   r&   r'   rI   rI   K   sl     
q~	q~	q~	q~	q~H 
!F)	1X;	'
 &E%% "<hGM eoo	lG
 !guvJ
 (e''!"%%(D(DD%%!#O *))n%%(99{	 %&Jr&   rI   r]   c                       e Zd Z G d d      Z e ed       ed            Z e ed       ed            Z e ed       ed	            Zy
)TableOfContentsFormc                        e Zd ZeZdg diZdZy)TableOfContentsForm.Metar   )list_attributeslink_attributesr   r%   Nr   r%   r&   r'   r(   ri      s     
 r&   r(   zList attributeszLAttributes apply to the <b>list</b> for each level in the table of contents.)r-   r_   zLink attributeszLAttributes apply to the <b>link</b> for each entry in the table of contents.zItem attributeszRAttributes apply to the <b>list items</b> for each entry in the table of contents.N)	r   r    r!   r(   r
   r<   rj   rk   r   r%   r&   r'   rg   rg      sf    	 	 *!"bcO
 *!"bcO %!"hiJr&   rg   TableOfContentsN)djangor   django.core.exceptionsr   django.utils.translationr   r<   entangled.formsr    r   commonr	   fieldsr
   r   r   r   r   helpersr   modelsr   r   	get_formsmixin_factoryr   rI   rg   r%   r&   r'   <module>rx      sz     2 1 .  & g g # $ """9-8-	*,> 8v9'-	*,<>P 9'x-(9:<N r&   