1
1
import {
2
- UICompBuilder ,
2
+ ContainerCompBuilder ,
3
3
Section ,
4
4
withDefault ,
5
5
withExposingConfigs ,
@@ -15,7 +15,12 @@ import {
15
15
StringControl ,
16
16
NumberControl ,
17
17
optionsControl ,
18
- } from "lowcoder-sdk" ;
18
+ EditorContext ,
19
+ CompNameContext ,
20
+ InnerGrid ,
21
+ HintPlaceHolder ,
22
+ gridItemCompToGridItems ,
23
+ } from 'lowcoder-sdk' ;
19
24
import "./index.css" ;
20
25
import { extend , addClass , registerLicense } from "@syncfusion/ej2-base" ;
21
26
import "./material3.css" ;
@@ -31,7 +36,7 @@ import {
31
36
import * as dataSource from "./datasource.json" ;
32
37
import type { MenuProps } from "antd" ;
33
38
import { trans } from "./i18n/comps" ;
34
- import { useState } from "react" ;
39
+ import { useContext , useState } from "react" ;
35
40
registerLicense (
36
41
"ORg4AjUWIQA/Gnt2UFhhQlJBfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTX5Vd0ViX3pfdXRRR2VY"
37
42
) ;
@@ -241,7 +246,13 @@ const childrenMap = {
241
246
// data: jsonValueExposingStateControl("data", dataSource.cardData),
242
247
} ;
243
248
let 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
+
245
256
let data : Object [ ] = extend (
246
257
[ ] ,
247
258
props . data as { [ key : string ] : Object } ,
@@ -287,10 +298,28 @@ let ContainerBaseComp = (function () {
287
298
} ;
288
299
289
300
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
+ ) : (
291
320
< Wrapper >
292
321
< div
293
- className = { " card-template" }
322
+ className = { ' card-template' }
294
323
style = { {
295
324
backgroundColor : props . cardContentStyles . backgroundColor ,
296
325
borderRadius : props . cardContentStyles . radius ,
@@ -326,7 +355,7 @@ let ContainerBaseComp = (function () {
326
355
</ div >
327
356
</ div >
328
357
< div className = "e-card-custom-footer" >
329
- { data . Tags . split ( "," ) . map ( ( tag : string ) => (
358
+ { data . Tags . split ( ',' ) . map ( ( tag : string ) => (
330
359
< div
331
360
className = "e-card-tag-field e-tooltip-text"
332
361
style = { {
@@ -447,7 +476,7 @@ let ContainerBaseComp = (function () {
447
476
< Flex vertical gap = { 10 } >
448
477
< Typography . Title level = { 5 } > Title</ Typography . Title >
449
478
< Input
450
- placeholder = { " Title" }
479
+ placeholder = { ' Title' }
451
480
onChange = { ( e ) =>
452
481
setDialogData ( ( prev ) => ( { ...prev , Title : e . target . value } ) )
453
482
}
@@ -459,15 +488,15 @@ let ContainerBaseComp = (function () {
459
488
<Dropdown menu={dialogData.Status as any} /> */ }
460
489
< Typography . Title level = { 5 } > Summary</ Typography . Title >
461
490
< Input
462
- placeholder = { " Summary" }
491
+ placeholder = { ' Summary' }
463
492
onChange = { ( e ) =>
464
493
setDialogData ( ( prev ) => ( { ...prev , Summary : e . target . value } ) )
465
494
}
466
495
value = { dialogData . Summary }
467
496
/>
468
497
< Typography . Title level = { 5 } > Tags</ Typography . Title >
469
498
< Input
470
- placeholder = { " Tags" }
499
+ placeholder = { ' Tags' }
471
500
onChange = { ( e ) =>
472
501
setDialogData ( ( prev ) => ( { ...prev , Tags : e . target . value } ) )
473
502
}
@@ -477,13 +506,13 @@ let ContainerBaseComp = (function () {
477
506
</ Modal >
478
507
< div
479
508
className = "col-lg-12 control-section"
480
- style = { { height : `100%` , width : `100%` } }
509
+ style = { { height : `100%` , width : `100%` } }
481
510
>
482
511
< ScrollBar
483
512
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' ,
487
516
} }
488
517
hideScrollbar = { ! props . scrollbars }
489
518
>
@@ -494,13 +523,32 @@ let ContainerBaseComp = (function () {
494
523
keyField = "Status"
495
524
dataSource = { data }
496
525
// enableTooltip={true}
497
- cardDoubleClick = { OnCardDoubleClick }
498
- swimlaneSettings = { { keyField : " Assignee" } }
526
+ // cardDoubleClick={OnCardDoubleClick}
527
+ swimlaneSettings = { { keyField : ' Assignee' } }
499
528
actionComplete = { handleDataChange }
500
529
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' ,
504
552
} }
505
553
dialogOpen = { showModal }
506
554
// dialogSettings={{ fields: fields }}
0 commit comments