blixify-ui-web-mcp 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/lib/components/action/button/README.md +75 -0
- package/lib/components/action/button/button.stories.tsx +138 -0
- package/lib/components/action/buttonGroup/README.md +79 -0
- package/lib/components/action/buttonGroup/buttonGroup.stories.tsx +104 -0
- package/lib/components/action/iconButton/README.md +39 -0
- package/lib/components/action/iconButton/iconButton.stories.tsx +22 -0
- package/lib/components/action/radioList/README.md +98 -0
- package/lib/components/action/radioList/radioList.stories.tsx +181 -0
- package/lib/components/action/slider/README.md +86 -0
- package/lib/components/action/slider/slider.stories.tsx +133 -0
- package/lib/components/action/textButton/README.md +34 -0
- package/lib/components/action/textButton/textButton.stories.tsx +16 -0
- package/lib/components/action/toggle/README.md +39 -0
- package/lib/components/action/toggle/toggle.stories.tsx +23 -0
- package/lib/components/advanced/collapse/README.md +106 -0
- package/lib/components/advanced/collapse/collapse.stories.tsx +165 -0
- package/lib/components/advanced/infoWindow/README.md +69 -0
- package/lib/components/advanced/infoWindow/infoWindow.stories.tsx +112 -0
- package/lib/components/advanced/popUp/README.md +95 -0
- package/lib/components/advanced/popUp/popUp.stories.tsx +189 -0
- package/lib/components/auth/bareSignIn/README.md +78 -0
- package/lib/components/auth/bareSignIn/bareSignIn.stories.tsx +141 -0
- package/lib/components/auth/bareSignUp/README.md +130 -0
- package/lib/components/auth/bareSignUp/bareSignUp.stories.tsx +159 -0
- package/lib/components/auth/signIn/README.md +53 -0
- package/lib/components/auth/signIn/signIn.stories.tsx +120 -0
- package/lib/components/auth/signUp/README.md +136 -0
- package/lib/components/auth/signUp/signUp.stories.tsx +193 -0
- package/lib/components/chart/README.md +13 -0
- package/lib/components/chart/areaChart/README.md +133 -0
- package/lib/components/chart/areaChart/areaChart.stories.tsx +199 -0
- package/lib/components/chart/barChart/README.md +193 -0
- package/lib/components/chart/barChart/barChart.stories.tsx +318 -0
- package/lib/components/chart/boxPlotChart/README.md +124 -0
- package/lib/components/chart/boxPlotChart/boxPlotChart.stories.tsx +104 -0
- package/lib/components/chart/bubbleChart/README.md +166 -0
- package/lib/components/chart/bubbleChart/bubbleChart.stories.tsx +144 -0
- package/lib/components/chart/card/README.md +107 -0
- package/lib/components/chart/card/card.stories.tsx +89 -0
- package/lib/components/chart/ganttChart/README.md +142 -0
- package/lib/components/chart/ganttChart/ganttChart.stories.tsx +138 -0
- package/lib/components/chart/heatmapChart/README.md +125 -0
- package/lib/components/chart/heatmapChart/heatmapChart.stories.tsx +106 -0
- package/lib/components/chart/lineChart/README.md +140 -0
- package/lib/components/chart/lineChart/lineChart.stories.tsx +152 -0
- package/lib/components/chart/pieChart/README.md +117 -0
- package/lib/components/chart/pieChart/pieChart.stories.tsx +180 -0
- package/lib/components/chart/polarAreaChart/README.md +126 -0
- package/lib/components/chart/polarAreaChart/polarAreaChart.stories.tsx +106 -0
- package/lib/components/chart/radarChart/README.md +57 -0
- package/lib/components/chart/radarChart/radarChart.stories.tsx +36 -0
- package/lib/components/chart/radialBar/README.md +152 -0
- package/lib/components/chart/radialBar/radialChart.stories.tsx +136 -0
- package/lib/components/chart/rangeBarChart/README.md +323 -0
- package/lib/components/chart/rangeBarChart/rangeBarChart.stories.tsx +208 -0
- package/lib/components/chart/statsCard/README.md +97 -0
- package/lib/components/chart/statsCard/statsCard.stories.tsx +183 -0
- package/lib/components/chart/treemapChart/README.md +142 -0
- package/lib/components/chart/treemapChart/treemapChart.stories.tsx +122 -0
- package/lib/components/chat/chatAnchor/README.md +113 -0
- package/lib/components/chat/chatAnchor/chatAnchor.stories.tsx +156 -0
- package/lib/components/chat/chatBase/README.md +223 -0
- package/lib/components/chat/chatBase/chatBase.stories.tsx +306 -0
- package/lib/components/chat/chatDashboard/README.md +161 -0
- package/lib/components/chat/chatDashboard/chatDashboard.stories.tsx +154 -0
- package/lib/components/data/dataGraph/README.md +13 -0
- package/lib/components/data/dataGraph/dataGraph.stories.tsx +84 -0
- package/lib/components/data/dataReference/README.md +62 -0
- package/lib/components/data/dataReference/dataReference.stories.tsx +53 -0
- package/lib/components/data/dataTemplate/README.md +903 -0
- package/lib/components/data/dataTemplate/dataModule.stories.tsx +196 -0
- package/lib/components/data/dataTemplate/dataTemplate.stories.tsx +337 -0
- package/lib/components/data/dataWrapper/README.md +1077 -0
- package/lib/components/data/dataWrapper/dataWrapper.stories.tsx +831 -0
- package/lib/components/data/queryForm/README.md +56 -0
- package/lib/components/data/queryForm/queryForm.stories.tsx +85 -0
- package/lib/components/data/readQuery/README.md +282 -0
- package/lib/components/data/readQuery/readQuery.stories.tsx +256 -0
- package/lib/components/data/readQueryHoc/README.md +89 -0
- package/lib/components/data/readQueryHoc/readQueryHoc.stories.tsx +33 -0
- package/lib/components/data/writeQuery/README.md +178 -0
- package/lib/components/data/writeQuery/writeQuery.stories.tsx +209 -0
- package/lib/components/design/actionSection/README.md +47 -0
- package/lib/components/design/actionSection/actionSection.stories.tsx +74 -0
- package/lib/components/design/banner/README.md +43 -0
- package/lib/components/design/banner/banner.stories.tsx +34 -0
- package/lib/components/design/bannerAction/README.md +44 -0
- package/lib/components/design/bannerAction/bannerAction.stories.tsx +25 -0
- package/lib/components/design/blogSection/README.md +111 -0
- package/lib/components/design/blogSection/blogSection.stories.tsx +72 -0
- package/lib/components/design/carouselSection/README.md +82 -0
- package/lib/components/design/carouselSection/carouselSection.stories.tsx +52 -0
- package/lib/components/design/designList/README.md +60 -0
- package/lib/components/design/designList/designList.stories.tsx +44 -0
- package/lib/components/design/faq/README.md +121 -0
- package/lib/components/design/faq/faq.stories.tsx +103 -0
- package/lib/components/design/fileGrid/README.md +87 -0
- package/lib/components/design/fileGrid/fileGrid.stories.tsx +110 -0
- package/lib/components/design/fileViewer/README.md +40 -0
- package/lib/components/design/fileViewer/fileViewer.stories.tsx +28 -0
- package/lib/components/design/footerSection/README.md +62 -0
- package/lib/components/design/footerSection/footerSection.stories.tsx +84 -0
- package/lib/components/design/googleReview/README.md +45 -0
- package/lib/components/design/googleReview/googleReview.stories.tsx +33 -0
- package/lib/components/design/heroSection/README.md +48 -0
- package/lib/components/design/heroSection/heroSection.stories.tsx +85 -0
- package/lib/components/design/iconList/README.md +60 -0
- package/lib/components/design/iconList/iconList.stories.tsx +41 -0
- package/lib/components/design/imageGallery/README.md +56 -0
- package/lib/components/design/imageGallery/imageGallery.stories.tsx +45 -0
- package/lib/components/design/imageZoom/README.md +47 -0
- package/lib/components/design/imageZoom/imageZoom.stories.tsx +30 -0
- package/lib/components/design/leftContent/README.md +47 -0
- package/lib/components/design/leftContent/leftContent.stories.tsx +32 -0
- package/lib/components/design/logoCloud/README.md +42 -0
- package/lib/components/design/logoCloud/logoCloud.stories.tsx +44 -0
- package/lib/components/design/onboarding/README.md +100 -0
- package/lib/components/design/onboarding/onboarding.stories.tsx +113 -0
- package/lib/components/design/pricing/README.md +112 -0
- package/lib/components/design/pricing/pricing.stories.tsx +86 -0
- package/lib/components/design/rightContent/README.md +47 -0
- package/lib/components/design/rightContent/rightContent.stories.tsx +32 -0
- package/lib/components/design/sectionList/README.md +51 -0
- package/lib/components/design/sectionList/sectionList.stories.tsx +35 -0
- package/lib/components/design/teams/README.md +62 -0
- package/lib/components/design/teams/teams.stories.tsx +61 -0
- package/lib/components/display/alert/README.md +82 -0
- package/lib/components/display/alert/alert.stories.tsx +71 -0
- package/lib/components/display/calendar/README.md +113 -0
- package/lib/components/display/calendar/calendar.stories.tsx +159 -0
- package/lib/components/display/clipboard/README.md +36 -0
- package/lib/components/display/clipboard/clipboard.stories.tsx +32 -0
- package/lib/components/display/detailList/README.md +61 -0
- package/lib/components/display/detailList/detailList.stories.tsx +131 -0
- package/lib/components/display/drawer/README.md +74 -0
- package/lib/components/display/drawer/drawer.stories.tsx +66 -0
- package/lib/components/display/emptyState/README.md +38 -0
- package/lib/components/display/emptyState/emptyState.stories.tsx +22 -0
- package/lib/components/display/feeds/README.md +80 -0
- package/lib/components/display/feeds/feeds.stories.tsx +75 -0
- package/lib/components/display/flexTable/README.md +160 -0
- package/lib/components/display/flexTable/flexTable.stories.tsx +313 -0
- package/lib/components/display/grid/README.md +121 -0
- package/lib/components/display/grid/grid.stories.tsx +234 -0
- package/lib/components/display/kanban/README.md +78 -0
- package/lib/components/display/kanban/kanban.stories.tsx +133 -0
- package/lib/components/display/list/README.md +109 -0
- package/lib/components/display/list/list.stories.tsx +188 -0
- package/lib/components/display/loading/README.md +25 -0
- package/lib/components/display/loading/loading.stories.tsx +15 -0
- package/lib/components/display/mapView/README.md +99 -0
- package/lib/components/display/mapView/mapView.stories.tsx +225 -0
- package/lib/components/display/modal/README.md +43 -0
- package/lib/components/display/modal/modal.stories.tsx +81 -0
- package/lib/components/display/notification/README.md +43 -0
- package/lib/components/display/notification/notification.stories.tsx +30 -0
- package/lib/components/display/progress/README.md +25 -0
- package/lib/components/display/progress/progress.stories.tsx +15 -0
- package/lib/components/display/stepper/README.md +96 -0
- package/lib/components/display/stepper/stepper.stories.tsx +175 -0
- package/lib/components/display/table/README.md +176 -0
- package/lib/components/display/table/table.stories.tsx +330 -0
- package/lib/components/display/tag/README.md +74 -0
- package/lib/components/display/tag/tag.stories.tsx +79 -0
- package/lib/components/input/address/README.md +132 -0
- package/lib/components/input/address/address.stories.tsx +147 -0
- package/lib/components/input/canvas/README.md +131 -0
- package/lib/components/input/canvas/canvas.stories.tsx +165 -0
- package/lib/components/input/checkbox/README.md +61 -0
- package/lib/components/input/checkbox/checkbox.stories.tsx +30 -0
- package/lib/components/input/datePicker/README.md +124 -0
- package/lib/components/input/datePicker/datePicker.stories.tsx +197 -0
- package/lib/components/input/form/README.md +55 -0
- package/lib/components/input/form/form.stories.tsx +143 -0
- package/lib/components/input/markdown/README.md +146 -0
- package/lib/components/input/markdown/markdown.stories.tsx +40 -0
- package/lib/components/input/monthYearPicker/README.md +69 -0
- package/lib/components/input/monthYearPicker/monthYearPicker.stories.tsx +47 -0
- package/lib/components/input/netPromoterScore/README.md +52 -0
- package/lib/components/input/netPromoterScore/netPromoterScore.stories.tsx +30 -0
- package/lib/components/input/rating/README.md +51 -0
- package/lib/components/input/rating/rating.stories.tsx +30 -0
- package/lib/components/input/select/README.md +108 -0
- package/lib/components/input/select/select.stories.tsx +286 -0
- package/lib/components/input/signature/README.md +106 -0
- package/lib/components/input/signature/signature.stories.tsx +188 -0
- package/lib/components/input/textArea/README.md +55 -0
- package/lib/components/input/textArea/textArea.stories.tsx +30 -0
- package/lib/components/input/textInput/README.md +81 -0
- package/lib/components/input/textInput/textinput.stories.tsx +231 -0
- package/lib/components/input/uploadInput/README.md +134 -0
- package/lib/components/input/uploadInput/uploadInput.stories.tsx +193 -0
- package/lib/components/navigation/bars/README.md +40 -0
- package/lib/components/navigation/bars/bars.stories.tsx +85 -0
- package/lib/components/navigation/bottomTab/README.md +53 -0
- package/lib/components/navigation/bottomTab/bottomTab.stories.tsx +32 -0
- package/lib/components/navigation/breadcrumb/README.md +48 -0
- package/lib/components/navigation/breadcrumb/breadcrumb.stories.tsx +27 -0
- package/lib/components/navigation/header/README.md +149 -0
- package/lib/components/navigation/header/header.stories.tsx +107 -0
- package/lib/components/navigation/leftNav/README.md +91 -0
- package/lib/components/navigation/leftNav/leftNav.stories.tsx +106 -0
- package/lib/components/navigation/tabs/README.md +75 -0
- package/lib/components/navigation/tabs/tabs.stories.tsx +60 -0
- package/lib/components/structure/column/README.md +40 -0
- package/lib/components/structure/column/column.stories.tsx +26 -0
- package/lib/components/structure/container/README.md +34 -0
- package/lib/components/structure/container/container.stories.tsx +19 -0
- package/lib/components/structure/link/README.md +55 -0
- package/lib/components/structure/link/link.stories.tsx +30 -0
- package/lib/components/structure/text/README.md +42 -0
- package/lib/components/structure/text/text.stories.tsx +39 -0
- package/lib/components/template/authPage/authPage.stories.tsx +68 -0
- package/lib/components/template/landingPage/landingPage.stories.tsx +288 -0
- package/lib/components/template/productListing/productListing.stories.tsx +297 -0
- package/lib/components/template/productOverview/productOverview.stories.tsx +194 -0
- package/lib/components/template/shoppingCart/shoppingCart.stories.tsx +252 -0
- package/lib/components/template/userHomePage/userHomePage.stories.tsx +605 -0
- package/lib/components/template/userRankingDashboard/userRankingDashboard.stories.tsx +481 -0
- package/lib/mcp/server.d.ts +2 -0
- package/lib/mcp/server.d.ts.map +1 -0
- package/lib/mcp/server.js +33 -0
- package/lib/mcp/server.js.map +1 -0
- package/lib/mcp/tools/getBackendComponent.d.ts +13 -0
- package/lib/mcp/tools/getBackendComponent.d.ts.map +1 -0
- package/lib/mcp/tools/getBackendComponent.js +119 -0
- package/lib/mcp/tools/getBackendComponent.js.map +1 -0
- package/lib/mcp/tools/getComponent.d.ts +17 -0
- package/lib/mcp/tools/getComponent.d.ts.map +1 -0
- package/lib/mcp/tools/getComponent.js +118 -0
- package/lib/mcp/tools/getComponent.js.map +1 -0
- package/lib/mcp/tools/listComponents.d.ts +13 -0
- package/lib/mcp/tools/listComponents.d.ts.map +1 -0
- package/lib/mcp/tools/listComponents.js +113 -0
- package/lib/mcp/tools/listComponents.js.map +1 -0
- package/lib/mcp/tools/listTemplates.d.ts +13 -0
- package/lib/mcp/tools/listTemplates.d.ts.map +1 -0
- package/lib/mcp/tools/listTemplates.js +68 -0
- package/lib/mcp/tools/listTemplates.js.map +1 -0
- package/lib/mcp/tools/suggestTemplate.d.ts +17 -0
- package/lib/mcp/tools/suggestTemplate.d.ts.map +1 -0
- package/lib/mcp/tools/suggestTemplate.js +212 -0
- package/lib/mcp/tools/suggestTemplate.js.map +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Kanban
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
Kanban for tasks assignment
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { Kanban } from "blixify-ui-web/components/display/kanban";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
const [data, setData] = useState<GridClass[]>(initialData);
|
|
19
|
+
|
|
20
|
+
<Kanban
|
|
21
|
+
data={data}
|
|
22
|
+
loading={false}
|
|
23
|
+
groupBy={groupColumns}
|
|
24
|
+
groupId="groupBy"
|
|
25
|
+
draggable={true}
|
|
26
|
+
droppable={true}
|
|
27
|
+
nullColumn={true}
|
|
28
|
+
onUpdateData={(data, updatedData) => {
|
|
29
|
+
setData(updatedData);
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
##### Usage with Group Clusters
|
|
35
|
+
|
|
36
|
+
```jsx
|
|
37
|
+
const groupColumns = ["Pending", "In Progress", "Done", "Canceled"];
|
|
38
|
+
const groupClusters = [
|
|
39
|
+
{
|
|
40
|
+
"Active Tasks": ["Pending", "In Progress"],
|
|
41
|
+
"Completed Tasks": ["Done", "Canceled"],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
<Kanban
|
|
46
|
+
data={data}
|
|
47
|
+
loading={false}
|
|
48
|
+
groupBy={groupColumns}
|
|
49
|
+
groupCluster={groupClusters}
|
|
50
|
+
groupId="groupBy"
|
|
51
|
+
nullColumn={true}
|
|
52
|
+
/>;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
##### Required props
|
|
56
|
+
|
|
57
|
+
| Name | Type | Description |
|
|
58
|
+
| --------- | ------------ | ----------------------- |
|
|
59
|
+
| `data` | `Grid Class` | Kanban data |
|
|
60
|
+
| `loading` | `boolean` | Loading |
|
|
61
|
+
| `groupBy` | `string[]` | Group By values |
|
|
62
|
+
| `groupId` | `string` | Group Column Id of data |
|
|
63
|
+
|
|
64
|
+
##### Optional props
|
|
65
|
+
|
|
66
|
+
| Name | Type | Default | Description |
|
|
67
|
+
| -------------- | -------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `groupLabel` | `string[]` | `` | Group label |
|
|
69
|
+
| `groupCluster` | `{ [key: string]: string[] }[]` | `` | Clusters of `groupBy` values. `draggable`, `droppable`, and `onUpdateData` props are automatically disabled to maintain data integrity. |
|
|
70
|
+
| `alertMessage` | `string` | `` | Loading message |
|
|
71
|
+
| `className` | `string` | `` | Additional classname |
|
|
72
|
+
| `draggable` | `boolean` | `` | Allow draggable |
|
|
73
|
+
| `droppable` | `boolean` | `` | Allow droppable |
|
|
74
|
+
| `nullColumn` | `boolean` | `` | Null column |
|
|
75
|
+
| `columnWidth` | `string` | `` | Column Width (min-w-[]) |
|
|
76
|
+
| `imgContain` | `boolean` | `` | Image contain for data |
|
|
77
|
+
| `onClickData` | `(id : string) => void` | `` | |
|
|
78
|
+
| `onUpdateData` | `(selectedData: { id: string; [key: string]: any },updatedData: GridClass[]) => void)` | `` | |
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { Kanban } from ".";
|
|
5
|
+
import { GridClass } from "../grid";
|
|
6
|
+
import README from "./README.md";
|
|
7
|
+
|
|
8
|
+
const stories = storiesOf("Display", module);
|
|
9
|
+
|
|
10
|
+
stories.addParameters({
|
|
11
|
+
readme: {
|
|
12
|
+
content: README,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const initialData = [
|
|
17
|
+
{
|
|
18
|
+
id: "1",
|
|
19
|
+
title: "DC-1",
|
|
20
|
+
description: "Desc",
|
|
21
|
+
groupBy: "Open",
|
|
22
|
+
tags: ["Sports", "Promotions"],
|
|
23
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "2",
|
|
27
|
+
title: "DC-2",
|
|
28
|
+
description:
|
|
29
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.",
|
|
30
|
+
groupBy: "In progress",
|
|
31
|
+
tags: ["Sports", "Promotions"],
|
|
32
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "3",
|
|
36
|
+
title: "DC-3",
|
|
37
|
+
description: "test",
|
|
38
|
+
groupBy: "To be tested",
|
|
39
|
+
tags: ["Sports", "Promotions"],
|
|
40
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "4",
|
|
44
|
+
title: "DC-4",
|
|
45
|
+
description: "test",
|
|
46
|
+
groupBy: "Reopen",
|
|
47
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "5",
|
|
51
|
+
title: "DC-5",
|
|
52
|
+
description: "test",
|
|
53
|
+
groupBy: "Reopen",
|
|
54
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "6",
|
|
58
|
+
title: "DC-6",
|
|
59
|
+
description: "test",
|
|
60
|
+
groupBy: "Open",
|
|
61
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "7",
|
|
65
|
+
title: "DC-7",
|
|
66
|
+
description: "test",
|
|
67
|
+
groupBy: "Open",
|
|
68
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "8",
|
|
72
|
+
title: "DC-8",
|
|
73
|
+
description: "test",
|
|
74
|
+
groupBy: "Open",
|
|
75
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: "9",
|
|
79
|
+
title: "DC-9",
|
|
80
|
+
description: "test",
|
|
81
|
+
createdAt: moment("12/24/2020").toDate(),
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const groupColumns = ["Open", "In progress", "To be tested", "Reopen"];
|
|
86
|
+
const groupClusters = [
|
|
87
|
+
{
|
|
88
|
+
"Active Tasks": ["Open", "In progress"],
|
|
89
|
+
"Review Tasks": ["To be tested", "Reopen"],
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
stories.add("Kanban", () => {
|
|
94
|
+
const [data, setData] = useState<GridClass[]>(initialData);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div className="flex flex-col">
|
|
98
|
+
<div>
|
|
99
|
+
<h1 className="mb-4 text-xl font-semibold">Group by Data Column</h1>
|
|
100
|
+
<Kanban
|
|
101
|
+
data={data}
|
|
102
|
+
loading={false}
|
|
103
|
+
groupBy={groupColumns}
|
|
104
|
+
groupId="groupBy"
|
|
105
|
+
draggable={true}
|
|
106
|
+
droppable={true}
|
|
107
|
+
alertMessage="Data limit exceeded"
|
|
108
|
+
nullColumn={true}
|
|
109
|
+
onUpdateData={(data, updatedData) => {
|
|
110
|
+
setData(updatedData);
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
<div className="h-[1px] my-10 bg-gray-200 w-full" />
|
|
115
|
+
<div>
|
|
116
|
+
<h1 className="mb-4 text-xl font-semibold">Group by Cluster</h1>
|
|
117
|
+
<Kanban
|
|
118
|
+
data={data}
|
|
119
|
+
loading={false}
|
|
120
|
+
groupBy={groupColumns}
|
|
121
|
+
groupCluster={groupClusters}
|
|
122
|
+
groupId="groupBy"
|
|
123
|
+
draggable={true}
|
|
124
|
+
droppable={true}
|
|
125
|
+
// alertMessage="Data grouped by clusters"
|
|
126
|
+
onUpdateData={(data, updatedData) => {
|
|
127
|
+
setData(updatedData);
|
|
128
|
+
}}
|
|
129
|
+
/>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# List
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A paginated list component with support for cursor and page pagination, group tab filtering, multi-select checkboxes, and dark mode.
|
|
8
|
+
|
|
9
|
+
### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { List } from "blixify-ui-web/display/list";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
const [pageIndex, setPageIndex] = useState(0);
|
|
19
|
+
const [limit] = useState(10);
|
|
20
|
+
|
|
21
|
+
const lists = [
|
|
22
|
+
{
|
|
23
|
+
id: "1",
|
|
24
|
+
title: "Back End Developer",
|
|
25
|
+
description: "Engineering",
|
|
26
|
+
tag: "Full time",
|
|
27
|
+
date: new Date(),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "2",
|
|
31
|
+
title: "Front End Developer",
|
|
32
|
+
description: "Engineering",
|
|
33
|
+
tag: "Full time",
|
|
34
|
+
date: new Date(),
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const handlePagination = (value) => {
|
|
39
|
+
if (typeof value === "number") setPageIndex(value);
|
|
40
|
+
else if (value === "next") setPageIndex((p) => p + 1);
|
|
41
|
+
else setPageIndex((p) => p - 1);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
<List
|
|
45
|
+
list={lists}
|
|
46
|
+
loading={false}
|
|
47
|
+
paginationType="page"
|
|
48
|
+
size={lists.length}
|
|
49
|
+
limit={limit}
|
|
50
|
+
pageIndex={pageIndex}
|
|
51
|
+
handleUpdatePageIndex={handlePagination}
|
|
52
|
+
/>;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Required props
|
|
56
|
+
|
|
57
|
+
| Name | Type | Description |
|
|
58
|
+
| --------- | ------------- | ----------------------------------- |
|
|
59
|
+
| `list` | `ListClass[]` | Array of items to display |
|
|
60
|
+
| `loading` | `boolean` | Shows a loading spinner when `true` |
|
|
61
|
+
|
|
62
|
+
### Optional props
|
|
63
|
+
|
|
64
|
+
| Name | Type | Default | Description |
|
|
65
|
+
| ----------------------- | -------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
66
|
+
| `paginationType` | `"cursor"` \| `"page"` | — | Enables pagination controls |
|
|
67
|
+
| `limit` | `number` | `10` | Items per page — required when `paginationType` is set |
|
|
68
|
+
| `pageIndex` | `number` | `0` | Current page index — required when `paginationType` is set |
|
|
69
|
+
| `cursor` | `any` | — | Last fetched cursor value (string or Date). Required for `paginationType="cursor"` to enable the next button beyond local data |
|
|
70
|
+
| `size` | `number` | — | Total record count. Required for `paginationType="page"` to calculate page numbers |
|
|
71
|
+
| `hidePagination` | `boolean` | `false` | Hides the pagination row entirely |
|
|
72
|
+
| `groupId` | `string` | — | Key on `ListClass` items to group by. Renders a Tabs bar to filter the list by unique values |
|
|
73
|
+
| `imgContain` | `boolean` | `false` | Uses `object-contain` instead of `object-cover` for item images |
|
|
74
|
+
| `actionMobile` | `boolean` | `false` | Moves the `action` element to a new line on mobile |
|
|
75
|
+
| `noTruncate` | `boolean` | `false` | Removes CSS truncation from item titles |
|
|
76
|
+
| `showId` | `boolean` | `false` | Includes the `id` field in the rendered key/value pairs |
|
|
77
|
+
| `newTabUrl` | `string` | — | Base URL for row links e.g. `"https://example.com/items?id="` |
|
|
78
|
+
| `addNewTabUrl` | `string` | — | Suffix appended after the id in the link URL e.g. `"?type=view"` |
|
|
79
|
+
| `darkMode` | `boolean` | `false` | Applies dark colour scheme |
|
|
80
|
+
| `darkModeBg` | `tailwind class` | `"bg-gray-900"` | Background class used in dark mode |
|
|
81
|
+
| `checkbox` | `boolean` | `false` | Adds a checkbox to each row for multi-select |
|
|
82
|
+
| `selectedIds` | `string[]` | — | Array of selected item ids — required when `checkbox` is `true` |
|
|
83
|
+
| `selectAll` | `boolean` | `false` | When `true`, treats all items across all pages as selected |
|
|
84
|
+
| `selectAllText` | `string` | — | Text appended to "All" in the selected count label |
|
|
85
|
+
| `disableSelectFullData` | `boolean` | `false` | Hides the "Select All in List / Unselect All in List" popup |
|
|
86
|
+
| `multiActionButton` | `ReactElement` | — | Action buttons shown in the selection header when items are selected |
|
|
87
|
+
| `className` | `tailwind class` | — | Class applied to the outer container |
|
|
88
|
+
| `onClickRow` | `(id: string, index?: number) => void` | — | Called when a row is clicked |
|
|
89
|
+
| `handleUpdatePageIndex` | `(value: string \| number) => void` | — | Called on pagination. Receives `"prev"`, `"next"`, or a page number |
|
|
90
|
+
| `handleSelectedIds` | `(value: string[]) => void` | — | Called when the selected ids change |
|
|
91
|
+
| `handleSelectAll` | `(value: boolean) => void` | — | Called when select-all state changes |
|
|
92
|
+
| `linkProps` | `LinkProps` | — | Refer to Link component documentation |
|
|
93
|
+
|
|
94
|
+
### ListClass
|
|
95
|
+
|
|
96
|
+
Any extra fields beyond the reserved ones are automatically rendered as key/value rows below the title.
|
|
97
|
+
|
|
98
|
+
| Name | Type | Description |
|
|
99
|
+
| ------------- | -------------- | ------------------------------------------------------------- |
|
|
100
|
+
| `id` | `string` | Unique identifier |
|
|
101
|
+
| `title` | `string` | Primary text shown in bold |
|
|
102
|
+
| `img` | `string` | Avatar/thumbnail image URL |
|
|
103
|
+
| `icon` | `ReactElement` | Icon shown instead of `img` |
|
|
104
|
+
| `action` | `ReactElement` | Element rendered on the right side of the row |
|
|
105
|
+
| `groupId` | `string` | Value used for group tab filtering when `groupId` prop is set |
|
|
106
|
+
| `description` | `string` | Example extra field — rendered as a key/value row |
|
|
107
|
+
| `tag` | `string` | Example extra field — rendered as a key/value row |
|
|
108
|
+
| `date` | `Date` | Example extra field — rendered as a formatted date |
|
|
109
|
+
| `[key]` | `any` | Any additional fields are rendered automatically |
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { List, ListClass } from ".";
|
|
4
|
+
import { StorySection } from "../../storyUtils";
|
|
5
|
+
import README from "./README.md";
|
|
6
|
+
|
|
7
|
+
const stories = storiesOf("Display", module);
|
|
8
|
+
|
|
9
|
+
stories.addParameters({
|
|
10
|
+
readme: {
|
|
11
|
+
content: README,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const baseLists: ListClass[] = [
|
|
16
|
+
{
|
|
17
|
+
id: "1",
|
|
18
|
+
title: "Back End Developer",
|
|
19
|
+
img: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
20
|
+
description: "Engineering",
|
|
21
|
+
tag: "Full time",
|
|
22
|
+
date: new Date(),
|
|
23
|
+
action: (
|
|
24
|
+
<div className="ml-2 whitespace-nowrap">
|
|
25
|
+
<p className="rounded-full bg-green-100 px-2 text-xs font-semibold leading-5 text-green-800">
|
|
26
|
+
Active
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "2",
|
|
33
|
+
title: "Front End Developer",
|
|
34
|
+
img: "https://images.unsplash.com/photo-1519244703995-f4e0f30006d5?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
35
|
+
description: "Engineering",
|
|
36
|
+
tag: "Full time",
|
|
37
|
+
date: new Date(),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "3",
|
|
41
|
+
title: "Product Designer",
|
|
42
|
+
img: "https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
43
|
+
description: "Design",
|
|
44
|
+
tag: "Part time",
|
|
45
|
+
date: new Date(),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "4",
|
|
49
|
+
title: "DevOps Engineer",
|
|
50
|
+
img: "https://images.unsplash.com/photo-1517841905240-472988babdf9?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80",
|
|
51
|
+
description: "Infrastructure",
|
|
52
|
+
tag: "Full time",
|
|
53
|
+
date: new Date(),
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const groupedLists: ListClass[] = baseLists.map((item) => ({
|
|
58
|
+
...item,
|
|
59
|
+
groupId: item.tag,
|
|
60
|
+
}));
|
|
61
|
+
|
|
62
|
+
stories.add("List", () => {
|
|
63
|
+
const [pageIndex, setPageIndex] = useState(0);
|
|
64
|
+
const [limit] = useState(2);
|
|
65
|
+
const [cursor] = useState("");
|
|
66
|
+
const [selectedIds, setSelectedIds] = useState<string[]>([]);
|
|
67
|
+
const [selectAll, setSelectAll] = useState(false);
|
|
68
|
+
|
|
69
|
+
const handlePagination = (value: string | number) => {
|
|
70
|
+
if (typeof value === "number") {
|
|
71
|
+
setPageIndex(value);
|
|
72
|
+
} else if (value === "next") {
|
|
73
|
+
setPageIndex((p) => p + 1);
|
|
74
|
+
} else {
|
|
75
|
+
setPageIndex((p) => p - 1);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
<StorySection
|
|
82
|
+
title="Cursor Pagination"
|
|
83
|
+
description="paginationType='cursor' shows prev/next controls. Pass cursor (a string or Date from your last fetched record) to enable the next button beyond local data."
|
|
84
|
+
>
|
|
85
|
+
<div className="w-full">
|
|
86
|
+
<List
|
|
87
|
+
cursor={cursor}
|
|
88
|
+
limit={limit}
|
|
89
|
+
list={baseLists}
|
|
90
|
+
loading={false}
|
|
91
|
+
paginationType="cursor"
|
|
92
|
+
pageIndex={pageIndex}
|
|
93
|
+
handleUpdatePageIndex={handlePagination}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
</StorySection>
|
|
97
|
+
|
|
98
|
+
<StorySection
|
|
99
|
+
title="Page Pagination"
|
|
100
|
+
description="paginationType='page' shows numbered page buttons. size is the total record count used to calculate page numbers."
|
|
101
|
+
>
|
|
102
|
+
<div className="w-full">
|
|
103
|
+
<List
|
|
104
|
+
limit={limit}
|
|
105
|
+
list={baseLists}
|
|
106
|
+
loading={false}
|
|
107
|
+
paginationType="page"
|
|
108
|
+
size={baseLists.length}
|
|
109
|
+
pageIndex={pageIndex}
|
|
110
|
+
handleUpdatePageIndex={handlePagination}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</StorySection>
|
|
114
|
+
|
|
115
|
+
<StorySection
|
|
116
|
+
title="Dark Mode"
|
|
117
|
+
description="darkMode=true switches to a dark colour scheme. darkModeBg overrides the default bg-gray-900 background."
|
|
118
|
+
dark
|
|
119
|
+
>
|
|
120
|
+
<div className="w-full">
|
|
121
|
+
<List
|
|
122
|
+
darkMode={true}
|
|
123
|
+
darkModeBg="bg-gray-800"
|
|
124
|
+
limit={limit}
|
|
125
|
+
list={baseLists}
|
|
126
|
+
loading={false}
|
|
127
|
+
paginationType="page"
|
|
128
|
+
size={baseLists.length}
|
|
129
|
+
pageIndex={pageIndex}
|
|
130
|
+
handleUpdatePageIndex={handlePagination}
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
</StorySection>
|
|
134
|
+
|
|
135
|
+
<StorySection
|
|
136
|
+
title="Group Tabs"
|
|
137
|
+
description="groupId='tag' extracts unique values from that field and renders a Tabs bar to filter the list. Items without the field are excluded from the filtered view."
|
|
138
|
+
>
|
|
139
|
+
<div className="w-full">
|
|
140
|
+
<List
|
|
141
|
+
limit={limit}
|
|
142
|
+
list={groupedLists}
|
|
143
|
+
loading={false}
|
|
144
|
+
paginationType="cursor"
|
|
145
|
+
cursor={cursor}
|
|
146
|
+
pageIndex={pageIndex}
|
|
147
|
+
groupId="groupId"
|
|
148
|
+
handleUpdatePageIndex={handlePagination}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</StorySection>
|
|
152
|
+
|
|
153
|
+
<StorySection
|
|
154
|
+
title="Checkbox + Multi-select"
|
|
155
|
+
description="checkbox=true adds a checkbox to each row. selectedIds tracks checked items. selectAll and handleSelectAll support selecting across all pages."
|
|
156
|
+
>
|
|
157
|
+
<div className="w-full">
|
|
158
|
+
<List
|
|
159
|
+
limit={limit}
|
|
160
|
+
list={baseLists}
|
|
161
|
+
loading={false}
|
|
162
|
+
paginationType="page"
|
|
163
|
+
size={baseLists.length}
|
|
164
|
+
pageIndex={pageIndex}
|
|
165
|
+
handleUpdatePageIndex={handlePagination}
|
|
166
|
+
checkbox={true}
|
|
167
|
+
selectedIds={selectedIds}
|
|
168
|
+
selectAll={selectAll}
|
|
169
|
+
handleSelectedIds={(value) => setSelectedIds(value)}
|
|
170
|
+
handleSelectAll={(value) => setSelectAll(value)}
|
|
171
|
+
/>
|
|
172
|
+
<p className="mt-2 text-sm text-gray-500">
|
|
173
|
+
Selected: {selectAll ? "All" : selectedIds.join(", ") || "none"}
|
|
174
|
+
</p>
|
|
175
|
+
</div>
|
|
176
|
+
</StorySection>
|
|
177
|
+
|
|
178
|
+
<StorySection
|
|
179
|
+
title="Loading state"
|
|
180
|
+
description="loading=true shows a spinner and hides the list content."
|
|
181
|
+
>
|
|
182
|
+
<div className="w-full">
|
|
183
|
+
<List list={[]} loading={true} />
|
|
184
|
+
</div>
|
|
185
|
+
</StorySection>
|
|
186
|
+
</>
|
|
187
|
+
);
|
|
188
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Loading
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
Loading spinner
|
|
8
|
+
|
|
9
|
+
##### Import
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { Loading } from "blixify-ui-web/components/display/loading";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
<Loading />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
##### Optional props
|
|
22
|
+
|
|
23
|
+
| Name | Type | Default | Description |
|
|
24
|
+
| --------------- | ---------------- | ------- | ----------- |
|
|
25
|
+
| `sizeClassName` | `tailwind class` | "" | |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { storiesOf } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Loading } from ".";
|
|
4
|
+
import README from "./README.md";
|
|
5
|
+
const stories = storiesOf("Display", module);
|
|
6
|
+
|
|
7
|
+
stories.addParameters({
|
|
8
|
+
readme: {
|
|
9
|
+
content: README,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
stories.add("Loading", () => {
|
|
14
|
+
return <Loading />;
|
|
15
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# MapView
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
<hr>
|
|
6
|
+
|
|
7
|
+
A Google Maps component for rendering markers, polygons, and circles. Supports info windows, color-coded group legends, polygon selection, marker clustering, and KML file overlays.
|
|
8
|
+
|
|
9
|
+
> Requires the Google Maps JavaScript API script to be loaded before the component mounts. Include the `places`, `drawing`, and `geometry` libraries.
|
|
10
|
+
|
|
11
|
+
##### Import
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { MapView, MapMarker } from "blixify-ui-web/display/mapView";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
##### Usage
|
|
18
|
+
|
|
19
|
+
Basic map with markers:
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
<div className="h-[700px] w-full">
|
|
23
|
+
<MapView
|
|
24
|
+
markerList={[
|
|
25
|
+
{
|
|
26
|
+
id: "1",
|
|
27
|
+
coord: { lat: 3.14, lng: 101.69 },
|
|
28
|
+
data: { name: "HQ", description: "Main office", group: "Office" },
|
|
29
|
+
color: "blue",
|
|
30
|
+
},
|
|
31
|
+
]}
|
|
32
|
+
enableMapControl={true}
|
|
33
|
+
autoFitToMarkers
|
|
34
|
+
infoWindowHeaderComponent={(id, data) => (
|
|
35
|
+
<h1 className="text-primary-500 font-semibold">{data.name}</h1>
|
|
36
|
+
)}
|
|
37
|
+
infoWindowComponent={(id, data) => <p>{data.description}</p>}
|
|
38
|
+
handleUpdateOnClick={(ids) => console.log("update", ids)}
|
|
39
|
+
handleDeleteOnClick={(ids) => console.log("delete", ids)}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
With polygon select:
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
<MapView
|
|
48
|
+
markerList={markers}
|
|
49
|
+
enableMapControl={true}
|
|
50
|
+
enablePolygonSelect
|
|
51
|
+
handleSelectPolygon={(ids) => console.log("selected", ids)}
|
|
52
|
+
handleUpdateOnClick={(ids) => {}}
|
|
53
|
+
handleDeleteOnClick={(ids) => {}}
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
##### Optional props
|
|
58
|
+
|
|
59
|
+
| Name | Type | Default | Description |
|
|
60
|
+
| --------------------------- | --------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| `markerList` | `MapMarker[]` | — | List of markers to render |
|
|
62
|
+
| `polygonList` | `MapPolygon[]` | — | List of static circles or polygons to overlay on the map |
|
|
63
|
+
| `mapType` | `"roadmap" \| "satellite" \| "hybrid" \| "terrain"` | `"satellite"` | Google Maps view type |
|
|
64
|
+
| `enableMapControl` | `boolean` | — | Show the Google Maps control UI (zoom, street view, etc.) |
|
|
65
|
+
| `enablePolygonSelect` | `boolean` | — | Show the drawing manager toolbar. Drawn polygons select markers within their bounds |
|
|
66
|
+
| `defaultPolygonDraw` | `boolean` | `false` | Start in polygon draw mode on load |
|
|
67
|
+
| `enableCluster` | `boolean` | — | Cluster nearby markers into a single pin |
|
|
68
|
+
| `autoFitToMarkers` | `boolean` | `true` | Automatically fit the map viewport to show all markers. Pass `false` to disable |
|
|
69
|
+
| `hideColorLegend` | `boolean` | — | Hide the color legend panel. The legend only appears when markers have a `data.group` value |
|
|
70
|
+
| `infoWindowComponent` | `(id: string, data: any) => ReactElement` | — | Custom body content for the marker info window |
|
|
71
|
+
| `infoWindowHeaderComponent` | `(id: string, data: any) => ReactElement` | — | Custom header content for the marker info window |
|
|
72
|
+
| `polygonFileUrl` | `string` | — | URL to a KML file. Coordinates are parsed and rendered as a polygon overlay |
|
|
73
|
+
| `isPolygonAreaReturn` | `boolean` | — | When `true`, enables polygon area calculation. Drawn polygons report their area in m² via `handlePolygonAreaChange` |
|
|
74
|
+
| `handleSelectPolygon` | `(ids: string[]) => void` | — | Called with the ids of markers inside a drawn polygon |
|
|
75
|
+
| `handlePolygonAreaChange` | `(areas: number[]) => void` | — | Called with an array of polygon areas in m² when `isPolygonAreaReturn` is true |
|
|
76
|
+
| `handleUpdateOnClick` | `(ids: string[]) => void` | — | Called when the update (pencil) button in the polygon selection panel is clicked |
|
|
77
|
+
| `handleDeleteOnClick` | `(ids: string[]) => void` | — | Called when the delete (trash) button in the polygon selection panel is clicked |
|
|
78
|
+
|
|
79
|
+
##### MapMarker
|
|
80
|
+
|
|
81
|
+
| Name | Type | Required | Description |
|
|
82
|
+
| ------- | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
83
|
+
| `id` | `string` | yes | Unique marker id |
|
|
84
|
+
| `coord` | `{ lat: number; lng: number }` | yes | Marker position |
|
|
85
|
+
| `color` | `MapMarkerColor` | no | Pin color: `"red" \| "blue" \| "green" \| "yellow" \| "orange" \| "purple" \| "white" \| "black" \| "none"`. Default: `"white"` |
|
|
86
|
+
| `data` | `any` | no | Arbitrary data passed to `infoWindowComponent` and `infoWindowHeaderComponent`. Add `data.group` to enable the color legend |
|
|
87
|
+
| `icon` | `string` | no | Image URL to override the default colored pin icon |
|
|
88
|
+
|
|
89
|
+
##### MapPolygon
|
|
90
|
+
|
|
91
|
+
| Name | Type | Required | Description |
|
|
92
|
+
| -------- | -------------------------------- | -------- | ---------------------------------------------- |
|
|
93
|
+
| `id` | `string` | yes | Unique polygon id |
|
|
94
|
+
| `type` | `"circle" \| "polygon"` | yes | Shape type |
|
|
95
|
+
| `coord` | `{ lat: number; lng: number }` | no | Center point — required for `type: "circle"` |
|
|
96
|
+
| `radius` | `number` | no | Radius in km — used with `type: "circle"` |
|
|
97
|
+
| `path` | `{ lat: number; lng: number }[]` | no | Path vertices — required for `type: "polygon"` |
|
|
98
|
+
| `color` | `MapMarkerColor` | no | Fill and stroke color. Default: yellow |
|
|
99
|
+
| `label` | `string` | no | Text label rendered at the polygon centroid |
|