11import {
2- UICompBuilder ,
2+ ContainerCompBuilder ,
33 Section ,
44 withDefault ,
55 withExposingConfigs ,
@@ -15,7 +15,12 @@ import {
1515 StringControl ,
1616 NumberControl ,
1717 optionsControl ,
18- } from "lowcoder-sdk" ;
18+ EditorContext ,
19+ CompNameContext ,
20+ InnerGrid ,
21+ HintPlaceHolder ,
22+ gridItemCompToGridItems ,
23+ } from 'lowcoder-sdk' ;
1924import "./index.css" ;
2025import { extend , addClass , registerLicense } from "@syncfusion/ej2-base" ;
2126import "./material3.css" ;
@@ -31,7 +36,7 @@ import {
3136import * as dataSource from "./datasource.json" ;
3237import type { MenuProps } from "antd" ;
3338import { trans } from "./i18n/comps" ;
34- import { useState } from "react" ;
39+ import { useContext , useState } from "react" ;
3540registerLicense (
3641 "ORg4AjUWIQA/Gnt2UFhhQlJBfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTX5Vd0ViX3pfdXRRR2VY"
3742) ;
@@ -241,7 +246,13 @@ const childrenMap = {
241246 // data: jsonValueExposingStateControl("data", dataSource.cardData),
242247} ;
243248let ContainerBaseComp = ( function ( ) {
244- return new UICompBuilder ( childrenMap , ( props : any ) => {
249+ console . log ( 'version: 0.0.2, meenams-kanban-updated-component-kanban-1' ) ;
250+
251+ return new ContainerCompBuilder ( childrenMap , ( props : any ) => {
252+ console . log ( "🚀 ~ returnnewContainerCompBuilder ~ props:" , props )
253+
254+ const { items :containerItems , ...otherContainerProps } = props . container ;
255+
245256 let data : Object [ ] = extend (
246257 [ ] ,
247258 props . data as { [ key : string ] : Object } ,
@@ -287,10 +298,28 @@ let ContainerBaseComp = (function () {
287298 } ;
288299
289300 const cardTemplate = ( data : { [ key : string ] : string } ) => {
290- return (
301+ const editorState = useContext ( EditorContext ) ;
302+ return editorState ? (
303+ < InnerGrid
304+ { ...otherContainerProps }
305+ emptyRows = { 15 }
306+ hintPlaceholder = { HintPlaceHolder }
307+ enableGridLines = { false }
308+ items = { gridItemCompToGridItems ( containerItems ) }
309+ // dispatch={props.container.dispatch}
310+ positionParams = { {
311+ margin : [ 0 , 0 ] ,
312+ containerPadding : [ 0 , 0 ] ,
313+ containerWidth : 686 ,
314+ cols : 24 ,
315+ rowHeight : 8 ,
316+ maxRows : null ,
317+ } }
318+ />
319+ ) : (
291320 < Wrapper >
292321 < div
293- className = { " card-template" }
322+ className = { ' card-template' }
294323 style = { {
295324 backgroundColor : props . cardContentStyles . backgroundColor ,
296325 borderRadius : props . cardContentStyles . radius ,
@@ -326,7 +355,7 @@ let ContainerBaseComp = (function () {
326355 </ div >
327356 </ div >
328357 < div className = "e-card-custom-footer" >
329- { data . Tags . split ( "," ) . map ( ( tag : string ) => (
358+ { data . Tags . split ( ',' ) . map ( ( tag : string ) => (
330359 < div
331360 className = "e-card-tag-field e-tooltip-text"
332361 style = { {
@@ -447,7 +476,7 @@ let ContainerBaseComp = (function () {
447476 < Flex vertical gap = { 10 } >
448477 < Typography . Title level = { 5 } > Title</ Typography . Title >
449478 < Input
450- placeholder = { " Title" }
479+ placeholder = { ' Title' }
451480 onChange = { ( e ) =>
452481 setDialogData ( ( prev ) => ( { ...prev , Title : e . target . value } ) )
453482 }
@@ -459,15 +488,15 @@ let ContainerBaseComp = (function () {
459488 <Dropdown menu={dialogData.Status as any} /> */ }
460489 < Typography . Title level = { 5 } > Summary</ Typography . Title >
461490 < Input
462- placeholder = { " Summary" }
491+ placeholder = { ' Summary' }
463492 onChange = { ( e ) =>
464493 setDialogData ( ( prev ) => ( { ...prev , Summary : e . target . value } ) )
465494 }
466495 value = { dialogData . Summary }
467496 />
468497 < Typography . Title level = { 5 } > Tags</ Typography . Title >
469498 < Input
470- placeholder = { " Tags" }
499+ placeholder = { ' Tags' }
471500 onChange = { ( e ) =>
472501 setDialogData ( ( prev ) => ( { ...prev , Tags : e . target . value } ) )
473502 }
@@ -477,13 +506,13 @@ let ContainerBaseComp = (function () {
477506 </ Modal >
478507 < div
479508 className = "col-lg-12 control-section"
480- style = { { height : `100%` , width : `100%` } }
509+ style = { { height : `100%` , width : `100%` } }
481510 >
482511 < ScrollBar
483512 style = { {
484- height : props . autoHeight ? " auto" : " 100%" ,
485- margin : " 0px" ,
486- padding : " 0px" ,
513+ height : props . autoHeight ? ' auto' : ' 100%' ,
514+ margin : ' 0px' ,
515+ padding : ' 0px' ,
487516 } }
488517 hideScrollbar = { ! props . scrollbars }
489518 >
@@ -494,13 +523,32 @@ let ContainerBaseComp = (function () {
494523 keyField = "Status"
495524 dataSource = { data }
496525 // enableTooltip={true}
497- cardDoubleClick = { OnCardDoubleClick }
498- swimlaneSettings = { { keyField : " Assignee" } }
526+ // cardDoubleClick={OnCardDoubleClick}
527+ swimlaneSettings = { { keyField : ' Assignee' } }
499528 actionComplete = { handleDataChange }
500529 cardSettings = { {
501- headerField : "Title" ,
502- template : cardTemplate ,
503- selectionType : "Multiple" ,
530+ headerField : 'Title' ,
531+ template :cardTemplate ,
532+ // template: editorState ? (
533+ // <InnerGrid
534+ // emptyRows={15}
535+ // hintPlaceholder={HintPlaceHolder}
536+ // enableGridLines={false}
537+ // // items={gridItemCompToGridItems({})}
538+ // items={{}}
539+ // positionParams={{
540+ // margin: [0, 0],
541+ // containerPadding: [0, 0],
542+ // containerWidth: 686,
543+ // cols: 24,
544+ // rowHeight: 8,
545+ // maxRows: null,
546+ // }}
547+ // />
548+ // ) : (
549+ // cardTemplate
550+ // ),
551+ selectionType : 'Multiple' ,
504552 } }
505553 dialogOpen = { showModal }
506554 // dialogSettings={{ fields: fields }}
0 commit comments