Skip to content

Commit 2b10b43

Browse files
committed
innergrid props updated
1 parent 8ed665f commit 2b10b43

File tree

2 files changed

+71
-23
lines changed

2 files changed

+71
-23
lines changed

lowcoder-comp-kanban/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"name": "meenams-kanban",
3-
"version": "0.0.29",
2+
"name": "meenams-kanban-updated-component-kanban-1",
3+
"version": "0.0.2",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {
77
"@observablehq/runtime": "^5.9.8",
88
"@syncfusion/ej2-base": "^25.2.7",
99
"@syncfusion/ej2-kanban": "^26.1.40",
1010
"@syncfusion/ej2-material3-theme": "^26.1.35",
11-
"@syncfusion/ej2-react-kanban": "^26.1.40",
11+
"@syncfusion/ej2-react-kanban": "^25.2.6",
1212
"@types/prop-types": "^15.7.12",
1313
"@types/react": "18",
1414
"@types/react-dom": "18",
1515
"antd": "^5.19.1",
1616
"bootstrap": "^5.3.3",
1717
"lowcoder-cli": "^0.0.30",
18-
"lowcoder-sdk": "^2.4.5",
18+
"lowcoder-sdk": "^2.4.11",
1919
"prop-types": "^15.8.1",
2020
"react": "18",
2121
"react-bootstrap": "^2.10.2",

lowcoder-comp-kanban/src/KabanComp.tsx

Lines changed: 67 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
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';
1924
import "./index.css";
2025
import { extend, addClass, registerLicense } from "@syncfusion/ej2-base";
2126
import "./material3.css";
@@ -31,7 +36,7 @@ import {
3136
import * as dataSource from "./datasource.json";
3237
import type { MenuProps } from "antd";
3338
import { trans } from "./i18n/comps";
34-
import { useState } from "react";
39+
import { useContext, useState } from "react";
3540
registerLicense(
3641
"ORg4AjUWIQA/Gnt2UFhhQlJBfV5AQmBIYVp/TGpJfl96cVxMZVVBJAtUQF1hTX5Vd0ViX3pfdXRRR2VY"
3742
);
@@ -241,7 +246,13 @@ const childrenMap = {
241246
// data: jsonValueExposingStateControl("data", dataSource.cardData),
242247
};
243248
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+
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

Comments
 (0)