{"id":15099428,"url":"https://github.com/datapuzzler/lse-tree-selection","last_synced_at":"2026-02-28T01:45:24.939Z","repository":{"id":251904427,"uuid":"838784244","full_name":"dataPuzzler/lse-tree-selection","owner":"dataPuzzler","description":"Dependency-free web component enabling consistent interactivity of tree selection views.","archived":false,"fork":false,"pushed_at":"2024-08-11T14:54:32.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T01:05:49.131Z","etag":null,"topics":["tree-selection","vanilla-js","web-component"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dataPuzzler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-06T10:36:35.000Z","updated_at":"2024-08-11T14:54:35.000Z","dependencies_parsed_at":"2024-08-11T16:08:03.090Z","dependency_job_id":null,"html_url":"https://github.com/dataPuzzler/lse-tree-selection","commit_stats":null,"previous_names":["datapuzzler/lse-tree-selection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataPuzzler%2Flse-tree-selection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataPuzzler%2Flse-tree-selection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataPuzzler%2Flse-tree-selection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dataPuzzler%2Flse-tree-selection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dataPuzzler","download_url":"https://codeload.github.com/dataPuzzler/lse-tree-selection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240794953,"owners_count":19858716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tree-selection","vanilla-js","web-component"],"created_at":"2024-09-25T17:20:39.549Z","updated_at":"2026-02-28T01:45:24.907Z","avatar_url":"https://github.com/dataPuzzler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LSE-TREE-SELECTION\n\nA dependency free web component enabling consistent interactivity of a tree selection view. It's usable both in client- and server side rendering settings (csr \u0026 ssr).\n\n# Showcase\n[![E2E-Tests](https://img.youtube.com/vi/OWD8yDEvPuw/0.jpg)](https://www.youtube.com/watch?v=OWD8yDEvPuw)\n\n\n## Table of Contents\n- [Installation](#installation)\n- [HTML-API](#html-api)\n- [Event-API](#event-api)\n- [Style-API](#style-api)\n\n## Installation\n\nYou can install the web component's javascript into your project with your npm-manager of choice.\nFor example:\n```sh\nnpm install 'lse-tree-selection'\n```\n\nImport from the package to make sure its js contents are loaded in places of usage. After that interactivity should work for the introduced HTML tags as defined below.\n```js\nimport * as LseTreeSelection from \"lse-tree-selection\"\n```\n\n\n## HTML-API\n\n### `\u003clse-tree-selection\u003e`\n#### Attributes\n\n| Attribute        | Description                                               | Possible Values               | Required       |\n|------------------|-----------------------------------------------------------|-------------------------------|----------------|\n| `init-dimension` | Identifier to identify the selection hierarchy uniquely.  |  A distinctive string         | yes            |\n| `init-data`      | Holder of data selection structure in csr-setting         |  Stringified JSON string, see below | csr only |\n\nThe data selection structure is defined as follows in recursive manner:\n```javascript\n// Leaf Node Example\n{\n    id: 1 // Numeric identifier of selection option, must be unique within the `\u003clse-tree-selection\u003e` instance\n    label: \"Label for option 1\" // String that is visually displayed\n    children: [] // Array that holds objects of the exact structure as defined in this example or is empty in case of Leaf Nodes\n}\n```\n\n#### Inner-HTML Characteristics \n- Empty in csr-etting\n- In ssr-setting a structure of nested `\u003clse-tree-selection-node\u003e`\n\n\n### `\u003clse-tree-selection-node\u003e`\nIf the attribute **init-data** is given in `\u003clse-tree-selection\u003e` as explained above, these nodes are automatically rendered, when the `\u003clse-tree-selection\u003e` DOM node is mounted.\n\nIn a ssr-setting the following characterics must be satisfied.\n\n#### Attributes\n| Attribute        | Description                                               | Possible Values               | Required       |\n|------------------|-----------------------------------------------------------|-------------------------------|----------------|\n| `id` | Identifier to identify the selection node uniquely within the lse-tree-selection instance |  A numeric identifier         | yes            |\n\n\n#### Inner-HTML Characteristics\nThe Inner-HTML must contain an `\u003cinput\u003e` element of type checkbox and with a value that corresponds to the id-attribute of the containing `\u003clse-tree-selection-node\u003e` DOM node.\n\n## Event-API\n\nWith each selection the `\u003clse-tree-selection\u003e` element dispatches a custom *TreeSelectionChangeEvent*.\nHierarchically higher DOM Nodes should listen to `lse-tree-selection-change` to get notified about selection changes as well.\n\n###  TreeSelectionChangeEvent\nThis is a custom Event, whose detail property refers to an object with the following properties\n- *dimension_key*: Corresponds to the attribute value `init-dimension` of `\u003clse-tree-selection\u003e`\n- *selected_ids* : An Array numbers, that correspond to the selected leaf nodes identifiers of the corresponding selection hierarchy.  \n\n\n## Style-API\nThe component doesn't make any assumptions about its CSS styling. \u003cbr/\u003e\nAs showed in the examples CSS can leverage the high specificity of the introduced selection tags, which should help to define enterprise-wise consistent styling of such components. \u003cbr /\u003e\nThe component doesn't make use of any shadow DOM feature. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatapuzzler%2Flse-tree-selection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatapuzzler%2Flse-tree-selection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatapuzzler%2Flse-tree-selection/lists"}