File tree Expand file tree Collapse file tree 3 files changed +41
-11
lines changed Expand file tree Collapse file tree 3 files changed +41
-11
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,17 @@ const AutoViewForm: React.FC<AutoViewFormProps & AutoViewFormSlots> = (props) =>
163163 < p className = { `notes ${ subHeadingClass } ` } dangerouslySetInnerHTML = { { __html : metaType . notes } } />
164164 ) }
165165 </ div >
166- < MarkupModel value = { model } />
166+ < MarkupModel
167+ value = { model }
168+ tableClass = "border-separate border-spacing-y-1"
169+ basicTrClass = "group"
170+ basicThClass = "py-2 px-4 text-left text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 rounded-l-md"
171+ basicTdClass = "py-2 px-4 text-sm text-gray-900 dark:text-gray-100 bg-white dark:bg-gray-900 border-l border-gray-200 dark:border-gray-700 rounded-r-md"
172+ complexTitleTrClass = "group"
173+ complexTitleTdClass = "py-2 px-4 text-sm font-semibold bg-indigo-600 dark:bg-indigo-700 text-white rounded-md"
174+ complexBodyTrClass = "group"
175+ complexBodyTdClass = "py-2 px-4 bg-white dark:bg-gray-900 rounded-md"
176+ />
167177 </ div >
168178 </ div >
169179 ) : (
@@ -190,7 +200,19 @@ const AutoViewForm: React.FC<AutoViewFormProps & AutoViewFormSlots> = (props) =>
190200 </ div >
191201 </ div >
192202 </ div >
193- < MarkupModel value = { model } />
203+ < div className = "" >
204+ < MarkupModel
205+ value = { model }
206+ tableClass = "w-full border-separate border-spacing-y-1"
207+ basicTrClass = "group"
208+ basicThClass = "py-1 px-4 text-left text-sm font-medium text-gray-700 dark:text-gray-300"
209+ basicTdClass = "py-1 px-4 text-sm text-gray-900"
210+ complexTitleTrClass = "group"
211+ complexTitleTdClass = "py-1 px-4 font-semibold bg-indigo-600 dark:bg-indigo-700 text-white"
212+ complexBodyTrClass = "group"
213+ complexBodyTdClass = "py-1 px-4 bg-white dark:bg-gray-900"
214+ />
215+ </ div >
194216 </ div >
195217 </ div >
196218 < div className = { form . buttonsClass } >
Original file line number Diff line number Diff line change @@ -28,25 +28,25 @@ export default function MarkupModel(props: MarkupModelProps) {
2828 } , [ value ] )
2929
3030 return (
31- < table className = "my-2 w-full" >
31+ < table className = { props . tableClass ?? "my-2 w-full" } >
3232 < tbody >
3333 { Object . entries ( basic ) . map ( ( [ k , v ] ) => (
34- < tr key = { k } className = "leading-7" >
35- < th className = "px-2 text-left align-top" > { humanize ( k ) } </ th >
36- < td className = "align-top" >
34+ < tr key = { k } className = { props . basicTrClass ?? "leading-7" } >
35+ < th className = { props . basicThClass ?? "px-2 text-left align-top" } > { humanize ( k ) } </ th >
36+ < td className = { props . basicTdClass ?? "align-top" } >
3737 < MarkupFormat value = { v } />
3838 </ td >
3939 </ tr >
4040 ) ) }
4141 { Object . entries ( complex ) . map ( ( [ k , v ] ) => (
4242 < React . Fragment key = { k } >
43- < tr className = "my-2 leading-7" >
44- < td colSpan = { 2 } className = "px-2 bg-indigo-700 text-white" >
43+ < tr className = { props . complexTitleTrClass ?? "my-2 leading-7" } >
44+ < th colSpan = { 2 } className = { props . complexTitleTdClass ?? "px-2 bg-indigo-700 text-white" } >
4545 { humanize ( k ) }
46- </ td >
46+ </ th >
4747 </ tr >
48- < tr className = "leading-7" >
49- < td colSpan = { 2 } className = "px-2 align-top" >
48+ < tr className = { props . complexBodyTrClass ?? "leading-7" } >
49+ < td colSpan = { 2 } className = { props . complexBodyTdClass ?? "px-2 align-top" } >
5050 < MarkupFormat value = { v } />
5151 </ td >
5252 </ tr >
Original file line number Diff line number Diff line change @@ -467,6 +467,14 @@ export interface MarkupFormatProps {
467467export interface MarkupModelProps {
468468 value : any ,
469469 imageClass ?: string
470+ tableClass ?: string
471+ basicTrClass ?: string
472+ basicThClass ?: string
473+ basicTdClass ?: string
474+ complexTitleTrClass ?: string
475+ complexTitleTdClass ?: string
476+ complexBodyTrClass ?: string
477+ complexBodyTdClass ?: string
470478}
471479
472480// Additional Components
You can’t perform that action at this time.
0 commit comments