import { h } from "@stencil/core";
/**
 * A Kanban board is a visual management tool that displays work items as
 * cards, organized into groups representing different stages of a workflow.
 * Typically, items move from left to right, with the leftmost group showing
 * new or backlogged tasks and the rightmost group indicating completed work.
 * This layout enables teams to visualize work progress, limit
 * work-in-progress, and identify bottlenecks.
 *
 * @exampleComponent limebb-example-kanban-basic
 * @exampleComponent limebb-example-kanban-selected-item
 * @exampleComponent limebb-example-kanban-color-coding
 * @exampleComponent limebb-example-kanban-assignees
 * @exampleComponent limebb-example-kanban-unpromoted-actions
 * @exampleComponent limebb-example-kanban-group-insights
 * @exampleComponent limebb-example-kanban-body-component
 *
 * @beta
 */
export class Kanban {
    constructor() {
        /**
         * List of groups to display in the kanban board.
         * Each group contains a list of items belonging to that group.
         */
        this.groups = [];
        this.handleLoadMore = (group) => (event) => {
            event.stopPropagation();
            if (group.identifier !== event.detail) {
                return;
            }
            this.loadMore.emit(group);
        };
    }
    render() {
        return this.renderGroups();
    }
    renderGroups() {
        return this.groups.map((group) => (h("limebb-kanban-group", { "aria-busy": group.loading ? 'true' : 'false', "aria-live": "polite", platform: this.platform, context: this.context, identifier: group.identifier, heading: group.heading, help: group.help, totalCount: group.totalCount, summary: group.summary, loading: group.loading, items: group.items, class: group.type, onLoadMore: this.handleLoadMore(group) })));
    }
    static get is() { return "limebb-kanban"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["kanban.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["kanban.css"]
        };
    }
    static get properties() {
        return {
            "platform": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "LimeWebComponentPlatform",
                    "resolved": "LimeWebComponentPlatform",
                    "references": {
                        "LimeWebComponentPlatform": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::LimeWebComponentPlatform",
                            "referenceLocation": "LimeWebComponentPlatform"
                        }
                    }
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "inheritdoc",
                            "text": undefined
                        }],
                    "text": "Reference to the platform service container.\n\nUse this to access all platform services like repositories, HTTP client,\ncommand bus, navigator, and more. The platform instance is shared across\nall components in the same application context."
                },
                "getter": false,
                "setter": false
            },
            "context": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "LimeWebComponentContext",
                    "resolved": "LimeWebComponentContext",
                    "references": {
                        "LimeWebComponentContext": {
                            "location": "import",
                            "path": "@limetech/lime-web-components",
                            "id": "node_modules::LimeWebComponentContext",
                            "referenceLocation": "LimeWebComponentContext"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "inheritdoc",
                            "text": undefined
                        }],
                    "text": "The context describing where this component is running.\n\nThe context provides information about the current limetype and record ID\n(if viewing/editing a specific record). Components can use this to load\nrelevant data and understand their operating environment."
                },
                "getter": false,
                "setter": false
            },
            "groups": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "KanbanGroup[]",
                    "resolved": "KanbanGroup[]",
                    "references": {
                        "KanbanGroup": {
                            "location": "import",
                            "path": "./kanban-group/kanban-group.types",
                            "id": "src/components/kanban/kanban-group/kanban-group.types.ts::KanbanGroup",
                            "referenceLocation": "KanbanGroup"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "List of groups to display in the kanban board.\nEach group contains a list of items belonging to that group."
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            }
        };
    }
    static get events() {
        return [{
                "method": "loadMore",
                "name": "loadMore",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the load more button is clicked"
                },
                "complexType": {
                    "original": "KanbanGroup",
                    "resolved": "KanbanGroup",
                    "references": {
                        "KanbanGroup": {
                            "location": "import",
                            "path": "./kanban-group/kanban-group.types",
                            "id": "src/components/kanban/kanban-group/kanban-group.types.ts::KanbanGroup",
                            "referenceLocation": "KanbanGroup"
                        }
                    }
                }
            }, {
                "method": "interact",
                "name": "interact",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when an item is interacted with"
                },
                "complexType": {
                    "original": "KanbanItem",
                    "resolved": "KanbanItem",
                    "references": {
                        "KanbanItem": {
                            "location": "import",
                            "path": "./kanban-item/kanban-item.types",
                            "id": "src/components/kanban/kanban-item/kanban-item.types.ts::KanbanItem",
                            "referenceLocation": "KanbanItem"
                        }
                    }
                }
            }];
    }
}
