@f-ewald/components 1.11.0 → 1.12.0
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 +1 -0
- package/custom-elements.json +247 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/tree-view.d.ts +44 -0
- package/dist/tree-view.d.ts.map +1 -0
- package/dist/tree-view.js +200 -0
- package/dist/tree-view.js.map +1 -0
- package/docs/tree-view.md +69 -0
- package/llms.txt +39 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,6 +99,7 @@ import "@f-ewald/components/roman-numeral.js";
|
|
|
99
99
|
| `<timeline-container>` | [API reference](https://f-ewald.github.io/components/docs/timeline-container.html) |
|
|
100
100
|
| `<timeline-entry>` | [API reference](https://f-ewald.github.io/components/docs/timeline-entry.html) |
|
|
101
101
|
| `<toast-notification>` | [API reference](https://f-ewald.github.io/components/docs/toast-notification.html) |
|
|
102
|
+
| `<tree-view>` | [API reference](https://f-ewald.github.io/components/docs/tree-view.html) |
|
|
102
103
|
| `<ui-button>` | [API reference](https://f-ewald.github.io/components/docs/ui-button.html) |
|
|
103
104
|
| `<user-avatar>` | [API reference](https://f-ewald.github.io/components/docs/user-avatar.html) |
|
|
104
105
|
| `<weight-bar-chart>` | [API reference](https://f-ewald.github.io/components/docs/weight-bar-chart.html) |
|
package/custom-elements.json
CHANGED
|
@@ -6531,6 +6531,22 @@
|
|
|
6531
6531
|
"module": "./tile-grid.js"
|
|
6532
6532
|
}
|
|
6533
6533
|
},
|
|
6534
|
+
{
|
|
6535
|
+
"kind": "js",
|
|
6536
|
+
"name": "TreeView",
|
|
6537
|
+
"declaration": {
|
|
6538
|
+
"name": "TreeView",
|
|
6539
|
+
"module": "./tree-view.js"
|
|
6540
|
+
}
|
|
6541
|
+
},
|
|
6542
|
+
{
|
|
6543
|
+
"kind": "js",
|
|
6544
|
+
"name": "TreeNode",
|
|
6545
|
+
"declaration": {
|
|
6546
|
+
"name": "TreeNode",
|
|
6547
|
+
"module": "./tree-view.js"
|
|
6548
|
+
}
|
|
6549
|
+
},
|
|
6534
6550
|
{
|
|
6535
6551
|
"kind": "js",
|
|
6536
6552
|
"name": "PopoverPanel",
|
|
@@ -12304,6 +12320,237 @@
|
|
|
12304
12320
|
}
|
|
12305
12321
|
]
|
|
12306
12322
|
},
|
|
12323
|
+
{
|
|
12324
|
+
"kind": "javascript-module",
|
|
12325
|
+
"path": "src/tree-view.ts",
|
|
12326
|
+
"declarations": [
|
|
12327
|
+
{
|
|
12328
|
+
"kind": "class",
|
|
12329
|
+
"description": "A generic, presentational tree shell: renders `nodes` recursively, one row\nper node, with each row's content produced by `renderNode` (default: plain\nlabel). Modeled on `data-table`'s headless pattern — knows nothing about\nwhat a node's `data` means beyond what `renderNode` does with it.\n\nA node with a `children` array (even empty) is a folder: clicking or\nactivating its row toggles expand/collapse instead of firing `node-click`.\nA node with no `children` is a leaf: clicking or activating its row fires\n`node-click`. Folders start collapsed; set `default-expanded` to start\nevery folder expanded instead. Expansion state is otherwise managed\ninternally and untouched by later `nodes` updates, so a user's manual\ntoggles survive a data refresh.",
|
|
12330
|
+
"name": "TreeView",
|
|
12331
|
+
"members": [
|
|
12332
|
+
{
|
|
12333
|
+
"kind": "field",
|
|
12334
|
+
"name": "nodes",
|
|
12335
|
+
"type": {
|
|
12336
|
+
"text": "TreeNode[]"
|
|
12337
|
+
},
|
|
12338
|
+
"default": "[]",
|
|
12339
|
+
"description": "Tree data; opaque to this component beyond what `renderNode` does with it."
|
|
12340
|
+
},
|
|
12341
|
+
{
|
|
12342
|
+
"kind": "field",
|
|
12343
|
+
"name": "renderNode",
|
|
12344
|
+
"type": {
|
|
12345
|
+
"text": "(node: TreeNode) => unknown"
|
|
12346
|
+
},
|
|
12347
|
+
"description": "Produces a row's rendered content for `node`. Default: plain label text."
|
|
12348
|
+
},
|
|
12349
|
+
{
|
|
12350
|
+
"kind": "field",
|
|
12351
|
+
"name": "defaultExpanded",
|
|
12352
|
+
"type": {
|
|
12353
|
+
"text": "boolean"
|
|
12354
|
+
},
|
|
12355
|
+
"default": "false",
|
|
12356
|
+
"description": "Start every folder expanded instead of the default all-collapsed.",
|
|
12357
|
+
"attribute": "default-expanded"
|
|
12358
|
+
},
|
|
12359
|
+
{
|
|
12360
|
+
"kind": "field",
|
|
12361
|
+
"name": "expanded",
|
|
12362
|
+
"privacy": "private",
|
|
12363
|
+
"default": "new Set<string>()"
|
|
12364
|
+
},
|
|
12365
|
+
{
|
|
12366
|
+
"kind": "field",
|
|
12367
|
+
"name": "#initializedExpansion",
|
|
12368
|
+
"privacy": "private",
|
|
12369
|
+
"type": {
|
|
12370
|
+
"text": "boolean"
|
|
12371
|
+
},
|
|
12372
|
+
"default": "false"
|
|
12373
|
+
},
|
|
12374
|
+
{
|
|
12375
|
+
"kind": "method",
|
|
12376
|
+
"name": "#toggle",
|
|
12377
|
+
"privacy": "private",
|
|
12378
|
+
"return": {
|
|
12379
|
+
"type": {
|
|
12380
|
+
"text": "void"
|
|
12381
|
+
}
|
|
12382
|
+
},
|
|
12383
|
+
"parameters": [
|
|
12384
|
+
{
|
|
12385
|
+
"name": "id",
|
|
12386
|
+
"type": {
|
|
12387
|
+
"text": "string"
|
|
12388
|
+
}
|
|
12389
|
+
}
|
|
12390
|
+
]
|
|
12391
|
+
},
|
|
12392
|
+
{
|
|
12393
|
+
"kind": "method",
|
|
12394
|
+
"name": "#activate",
|
|
12395
|
+
"privacy": "private",
|
|
12396
|
+
"return": {
|
|
12397
|
+
"type": {
|
|
12398
|
+
"text": "void"
|
|
12399
|
+
}
|
|
12400
|
+
},
|
|
12401
|
+
"parameters": [
|
|
12402
|
+
{
|
|
12403
|
+
"name": "node",
|
|
12404
|
+
"type": {
|
|
12405
|
+
"text": "TreeNode"
|
|
12406
|
+
}
|
|
12407
|
+
}
|
|
12408
|
+
]
|
|
12409
|
+
},
|
|
12410
|
+
{
|
|
12411
|
+
"kind": "method",
|
|
12412
|
+
"name": "#onKeydown",
|
|
12413
|
+
"privacy": "private",
|
|
12414
|
+
"return": {
|
|
12415
|
+
"type": {
|
|
12416
|
+
"text": "void"
|
|
12417
|
+
}
|
|
12418
|
+
},
|
|
12419
|
+
"parameters": [
|
|
12420
|
+
{
|
|
12421
|
+
"name": "node",
|
|
12422
|
+
"type": {
|
|
12423
|
+
"text": "TreeNode"
|
|
12424
|
+
}
|
|
12425
|
+
},
|
|
12426
|
+
{
|
|
12427
|
+
"name": "e",
|
|
12428
|
+
"type": {
|
|
12429
|
+
"text": "KeyboardEvent"
|
|
12430
|
+
}
|
|
12431
|
+
}
|
|
12432
|
+
]
|
|
12433
|
+
},
|
|
12434
|
+
{
|
|
12435
|
+
"kind": "method",
|
|
12436
|
+
"name": "#onRowClick",
|
|
12437
|
+
"privacy": "private",
|
|
12438
|
+
"return": {
|
|
12439
|
+
"type": {
|
|
12440
|
+
"text": "void"
|
|
12441
|
+
}
|
|
12442
|
+
},
|
|
12443
|
+
"parameters": [
|
|
12444
|
+
{
|
|
12445
|
+
"name": "node",
|
|
12446
|
+
"type": {
|
|
12447
|
+
"text": "TreeNode"
|
|
12448
|
+
}
|
|
12449
|
+
},
|
|
12450
|
+
{
|
|
12451
|
+
"name": "e",
|
|
12452
|
+
"type": {
|
|
12453
|
+
"text": "MouseEvent"
|
|
12454
|
+
}
|
|
12455
|
+
}
|
|
12456
|
+
]
|
|
12457
|
+
},
|
|
12458
|
+
{
|
|
12459
|
+
"kind": "method",
|
|
12460
|
+
"name": "#isNestedInteractive",
|
|
12461
|
+
"privacy": "private",
|
|
12462
|
+
"return": {
|
|
12463
|
+
"type": {
|
|
12464
|
+
"text": "boolean"
|
|
12465
|
+
}
|
|
12466
|
+
},
|
|
12467
|
+
"parameters": [
|
|
12468
|
+
{
|
|
12469
|
+
"name": "path",
|
|
12470
|
+
"type": {
|
|
12471
|
+
"text": "EventTarget[]"
|
|
12472
|
+
}
|
|
12473
|
+
},
|
|
12474
|
+
{
|
|
12475
|
+
"name": "row",
|
|
12476
|
+
"type": {
|
|
12477
|
+
"text": "EventTarget | null"
|
|
12478
|
+
}
|
|
12479
|
+
}
|
|
12480
|
+
]
|
|
12481
|
+
},
|
|
12482
|
+
{
|
|
12483
|
+
"kind": "method",
|
|
12484
|
+
"name": "#renderNode",
|
|
12485
|
+
"privacy": "private",
|
|
12486
|
+
"return": {
|
|
12487
|
+
"type": {
|
|
12488
|
+
"text": "TemplateResult"
|
|
12489
|
+
}
|
|
12490
|
+
},
|
|
12491
|
+
"parameters": [
|
|
12492
|
+
{
|
|
12493
|
+
"name": "node",
|
|
12494
|
+
"type": {
|
|
12495
|
+
"text": "TreeNode"
|
|
12496
|
+
}
|
|
12497
|
+
},
|
|
12498
|
+
{
|
|
12499
|
+
"name": "depth",
|
|
12500
|
+
"type": {
|
|
12501
|
+
"text": "number"
|
|
12502
|
+
}
|
|
12503
|
+
}
|
|
12504
|
+
]
|
|
12505
|
+
}
|
|
12506
|
+
],
|
|
12507
|
+
"events": [
|
|
12508
|
+
{
|
|
12509
|
+
"name": "node-click",
|
|
12510
|
+
"type": {
|
|
12511
|
+
"text": "CustomEvent"
|
|
12512
|
+
},
|
|
12513
|
+
"description": "A leaf row was activated; detail is `{ id, data }`."
|
|
12514
|
+
}
|
|
12515
|
+
],
|
|
12516
|
+
"attributes": [
|
|
12517
|
+
{
|
|
12518
|
+
"name": "default-expanded",
|
|
12519
|
+
"type": {
|
|
12520
|
+
"text": "boolean"
|
|
12521
|
+
},
|
|
12522
|
+
"default": "false",
|
|
12523
|
+
"description": "Start every folder expanded instead of the default all-collapsed.",
|
|
12524
|
+
"fieldName": "defaultExpanded"
|
|
12525
|
+
}
|
|
12526
|
+
],
|
|
12527
|
+
"superclass": {
|
|
12528
|
+
"name": "LitElement",
|
|
12529
|
+
"package": "lit"
|
|
12530
|
+
},
|
|
12531
|
+
"tagName": "tree-view",
|
|
12532
|
+
"customElement": true
|
|
12533
|
+
}
|
|
12534
|
+
],
|
|
12535
|
+
"exports": [
|
|
12536
|
+
{
|
|
12537
|
+
"kind": "js",
|
|
12538
|
+
"name": "TreeView",
|
|
12539
|
+
"declaration": {
|
|
12540
|
+
"name": "TreeView",
|
|
12541
|
+
"module": "src/tree-view.ts"
|
|
12542
|
+
}
|
|
12543
|
+
},
|
|
12544
|
+
{
|
|
12545
|
+
"kind": "custom-element-definition",
|
|
12546
|
+
"name": "tree-view",
|
|
12547
|
+
"declaration": {
|
|
12548
|
+
"name": "TreeView",
|
|
12549
|
+
"module": "src/tree-view.ts"
|
|
12550
|
+
}
|
|
12551
|
+
}
|
|
12552
|
+
]
|
|
12553
|
+
},
|
|
12307
12554
|
{
|
|
12308
12555
|
"kind": "javascript-module",
|
|
12309
12556
|
"path": "src/ui-button.ts",
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export { FormSelect, type SelectOption } from "./form-select.js";
|
|
|
33
33
|
export { MultiSelect, type MultiSelectOption, type MultiSelectVariant, } from "./multi-select.js";
|
|
34
34
|
export { DataTable, type DataTableColumn } from "./data-table.js";
|
|
35
35
|
export { TileGrid } from "./tile-grid.js";
|
|
36
|
+
export { TreeView, type TreeNode } from "./tree-view.js";
|
|
36
37
|
export { PopoverPanel } from "./popover-panel.js";
|
|
37
38
|
export { DropdownButton, type DropdownOption } from "./dropdown-button.js";
|
|
38
39
|
export { IconButton } from "./icon-button.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,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M,aAAa,CAAC;AACnE,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ export { FormSelect } from "./form-select.js";
|
|
|
33
33
|
export { MultiSelect, } from "./multi-select.js";
|
|
34
34
|
export { DataTable } from "./data-table.js";
|
|
35
35
|
export { TileGrid } from "./tile-grid.js";
|
|
36
|
+
export { TreeView } from "./tree-view.js";
|
|
36
37
|
export { PopoverPanel } from "./popover-panel.js";
|
|
37
38
|
export { DropdownButton } from "./dropdown-button.js";
|
|
38
39
|
export { IconButton } from "./icon-button.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,GAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,GAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,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{ GalleryItem } from \"./gallery-item.js\";\nexport { GalleryItemVariant } from \"./gallery-item-variant.js\";\nexport {\n PhotoGallery,\n type PhotoGalleryChangeReason,\n type PhotoGalleryObjectFit,\n type PhotoGallerySlideChangeDetail,\n} from \"./photo-gallery.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport { ContentDivider } from \"./content-divider.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { ButtonGroup, type ButtonGroupOption } from \"./button-group.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { StatMeter } from \"./stat-meter.js\";\nexport { StatusPill, type StatusPillColor } from \"./status-pill.js\";\nexport { EditableText } from \"./editable-text.js\";\nexport { LiveTimer } from \"./live-timer.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { FormSelect, type SelectOption } from \"./form-select.js\";\nexport {\n MultiSelect,\n type MultiSelectOption,\n type MultiSelectVariant,\n} from \"./multi-select.js\";\nexport { DataTable, type DataTableColumn } from \"./data-table.js\";\nexport { TileGrid } from \"./tile-grid.js\";\nexport { PopoverPanel } from \"./popover-panel.js\";\nexport { DropdownButton, type DropdownOption } from \"./dropdown-button.js\";\nexport { IconButton } from \"./icon-button.js\";\nexport { KbdHint, type KbdPlatform } from \"./kbd-hint.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { AppShell, type SidebarToggleDetail } from \"./app-shell.js\";\nexport { AppSidebar } from \"./app-sidebar.js\";\nexport { ActionBar } from \"./action-bar.js\";\nexport { PageHeader } from \"./page-header.js\";\nexport { PaginationNav, type PageChangeDetail } from \"./pagination-nav.js\";\nexport { FormActions } from \"./form-actions.js\";\nexport { TimelineContainer } from \"./timeline-container.js\";\nexport { TimelineEntry } from \"./timeline-entry.js\";\nexport { CalendarEntry } from \"./calendar-entry.js\";\nexport { CalendarMonth } from \"./calendar-month.js\";\nexport { CalendarYear } from \"./calendar-year.js\";\nexport {\n KanbanBoard,\n type KanbanCardData,\n type KanbanColumnData,\n type KanbanCardMoveDetail,\n type KanbanCardOpenDetail,\n} from \"./kanban-board.js\";\nexport { KanbanColumn } from \"./kanban-column.js\";\nexport { KanbanCard } from \"./kanban-card.js\";\nexport { TextArea } from \"./text-area.js\";\nexport { LinkCard, type LinkCardStatus } from \"./link-card.js\";\nexport { CardGrid } from \"./card-grid.js\";\nexport { MarkdownView } from \"./markdown-view.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,O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ACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,WAAW,GAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,cAAc,YAAY,CAAC","sourcesContent":["export { AnimateConfetti } from \"./animate-confetti.js\";\nexport { GalleryItem } from \"./gallery-item.js\";\nexport { GalleryItemVariant } from \"./gallery-item-variant.js\";\nexport {\n PhotoGallery,\n type PhotoGalleryChangeReason,\n type PhotoGalleryObjectFit,\n type PhotoGallerySlideChangeDetail,\n} from \"./photo-gallery.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport { ContentDivider } from \"./content-divider.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { ButtonGroup, type ButtonGroupOption } from \"./button-group.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { StatMeter } from \"./stat-meter.js\";\nexport { StatusPill, type StatusPillColor } from \"./status-pill.js\";\nexport { EditableText } from \"./editable-text.js\";\nexport { LiveTimer } from \"./live-timer.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { FormSelect, type SelectOption } from \"./form-select.js\";\nexport {\n MultiSelect,\n type MultiSelectOption,\n type MultiSelectVariant,\n} from \"./multi-select.js\";\nexport { DataTable, type DataTableColumn } from \"./data-table.js\";\nexport { TileGrid } from \"./tile-grid.js\";\nexport { TreeView, type TreeNode } from \"./tree-view.js\";\nexport { PopoverPanel } from \"./popover-panel.js\";\nexport { DropdownButton, type DropdownOption } from \"./dropdown-button.js\";\nexport { IconButton } from \"./icon-button.js\";\nexport { KbdHint, type KbdPlatform } from \"./kbd-hint.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { AppShell, type SidebarToggleDetail } from \"./app-shell.js\";\nexport { AppSidebar } from \"./app-sidebar.js\";\nexport { ActionBar } from \"./action-bar.js\";\nexport { PageHeader } from \"./page-header.js\";\nexport { PaginationNav, type PageChangeDetail } from \"./pagination-nav.js\";\nexport { FormActions } from \"./form-actions.js\";\nexport { TimelineContainer } from \"./timeline-container.js\";\nexport { TimelineEntry } from \"./timeline-entry.js\";\nexport { CalendarEntry } from \"./calendar-entry.js\";\nexport { CalendarMonth } from \"./calendar-month.js\";\nexport { CalendarYear } from \"./calendar-year.js\";\nexport {\n KanbanBoard,\n type KanbanCardData,\n type KanbanColumnData,\n type KanbanCardMoveDetail,\n type KanbanCardOpenDetail,\n} from \"./kanban-board.js\";\nexport { KanbanColumn } from \"./kanban-column.js\";\nexport { KanbanCard } from \"./kanban-card.js\";\nexport { TextArea } from \"./text-area.js\";\nexport { LinkCard, type LinkCardStatus } from \"./link-card.js\";\nexport { CardGrid } from \"./card-grid.js\";\nexport { MarkdownView } from \"./markdown-view.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/** One tree node: a folder when `children` is set (even `[]`), a leaf otherwise. */
|
|
3
|
+
export interface TreeNode {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
children?: TreeNode[];
|
|
7
|
+
data?: unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A generic, presentational tree shell: renders `nodes` recursively, one row
|
|
11
|
+
* per node, with each row's content produced by `renderNode` (default: plain
|
|
12
|
+
* label). Modeled on `data-table`'s headless pattern — knows nothing about
|
|
13
|
+
* what a node's `data` means beyond what `renderNode` does with it.
|
|
14
|
+
*
|
|
15
|
+
* A node with a `children` array (even empty) is a folder: clicking or
|
|
16
|
+
* activating its row toggles expand/collapse instead of firing `node-click`.
|
|
17
|
+
* A node with no `children` is a leaf: clicking or activating its row fires
|
|
18
|
+
* `node-click`. Folders start collapsed; set `default-expanded` to start
|
|
19
|
+
* every folder expanded instead. Expansion state is otherwise managed
|
|
20
|
+
* internally and untouched by later `nodes` updates, so a user's manual
|
|
21
|
+
* toggles survive a data refresh.
|
|
22
|
+
*
|
|
23
|
+
* @element tree-view
|
|
24
|
+
* @fires node-click - A leaf row was activated; detail is `{ id, data }`.
|
|
25
|
+
*/
|
|
26
|
+
export declare class TreeView extends LitElement {
|
|
27
|
+
#private;
|
|
28
|
+
static styles: import("lit").CSSResult[];
|
|
29
|
+
/** Tree data; opaque to this component beyond what `renderNode` does with it. */
|
|
30
|
+
nodes: TreeNode[];
|
|
31
|
+
/** Produces a row's rendered content for `node`. Default: plain label text. */
|
|
32
|
+
renderNode: (node: TreeNode) => unknown;
|
|
33
|
+
/** Start every folder expanded instead of the default all-collapsed. */
|
|
34
|
+
defaultExpanded: boolean;
|
|
35
|
+
private expanded;
|
|
36
|
+
willUpdate(changed: Map<string, unknown>): void;
|
|
37
|
+
render(): unknown;
|
|
38
|
+
}
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
"tree-view": TreeView;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=tree-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-view.d.ts","sourceRoot":"","sources":["../src/tree-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,KAAK,CAAC;AAM1E,oFAAoF;AACpF,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,QAAS,SAAQ,UAAU;;IACtC,OAAgB,MAAM,4BAsDpB;IAEF,iFAAiF;IACjD,KAAK,EAAE,QAAQ,EAAE,CAAM;IACvD,+EAA+E;IAC/C,UAAU,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAwB;IAC/F,wEAAwE;IACZ,eAAe,UAAS;IAE3E,OAAO,CAAC,QAAQ,CAAqB;IAGrC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAcvD;IAyEQ,MAAM,YAMd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
10
|
+
import { iconChevronDown, iconChevronRight } from "./icons.js";
|
|
11
|
+
import { tokens } from "./tokens.js";
|
|
12
|
+
/**
|
|
13
|
+
* A generic, presentational tree shell: renders `nodes` recursively, one row
|
|
14
|
+
* per node, with each row's content produced by `renderNode` (default: plain
|
|
15
|
+
* label). Modeled on `data-table`'s headless pattern — knows nothing about
|
|
16
|
+
* what a node's `data` means beyond what `renderNode` does with it.
|
|
17
|
+
*
|
|
18
|
+
* A node with a `children` array (even empty) is a folder: clicking or
|
|
19
|
+
* activating its row toggles expand/collapse instead of firing `node-click`.
|
|
20
|
+
* A node with no `children` is a leaf: clicking or activating its row fires
|
|
21
|
+
* `node-click`. Folders start collapsed; set `default-expanded` to start
|
|
22
|
+
* every folder expanded instead. Expansion state is otherwise managed
|
|
23
|
+
* internally and untouched by later `nodes` updates, so a user's manual
|
|
24
|
+
* toggles survive a data refresh.
|
|
25
|
+
*
|
|
26
|
+
* @element tree-view
|
|
27
|
+
* @fires node-click - A leaf row was activated; detail is `{ id, data }`.
|
|
28
|
+
*/
|
|
29
|
+
let TreeView = class TreeView extends LitElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
/** Tree data; opaque to this component beyond what `renderNode` does with it. */
|
|
33
|
+
this.nodes = [];
|
|
34
|
+
/** Produces a row's rendered content for `node`. Default: plain label text. */
|
|
35
|
+
this.renderNode = (node) => node.label;
|
|
36
|
+
/** Start every folder expanded instead of the default all-collapsed. */
|
|
37
|
+
this.defaultExpanded = false;
|
|
38
|
+
this.expanded = new Set();
|
|
39
|
+
this.#initializedExpansion = false;
|
|
40
|
+
}
|
|
41
|
+
static { this.styles = [
|
|
42
|
+
tokens,
|
|
43
|
+
css `
|
|
44
|
+
:host {
|
|
45
|
+
display: block;
|
|
46
|
+
font-family: var(
|
|
47
|
+
--ui-font,
|
|
48
|
+
ui-sans-serif,
|
|
49
|
+
system-ui,
|
|
50
|
+
sans-serif,
|
|
51
|
+
"Apple Color Emoji",
|
|
52
|
+
"Segoe UI Emoji",
|
|
53
|
+
"Segoe UI Symbol",
|
|
54
|
+
"Noto Color Emoji"
|
|
55
|
+
);
|
|
56
|
+
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
57
|
+
}
|
|
58
|
+
.row {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 0.25rem;
|
|
62
|
+
padding: 0.25rem 0.5rem;
|
|
63
|
+
border-radius: var(--ui-radius-sm, 0.25rem);
|
|
64
|
+
color: var(--ui-text, #0f172a);
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
.row:hover {
|
|
68
|
+
background: var(--ui-surface-muted, #f8fafc);
|
|
69
|
+
}
|
|
70
|
+
.row:focus-visible {
|
|
71
|
+
outline: none;
|
|
72
|
+
box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
|
|
73
|
+
}
|
|
74
|
+
.toggle {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
width: 1rem;
|
|
78
|
+
height: 1rem;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
color: var(--ui-text-muted, #64748b);
|
|
82
|
+
}
|
|
83
|
+
.content {
|
|
84
|
+
min-width: 0;
|
|
85
|
+
flex: 1;
|
|
86
|
+
}
|
|
87
|
+
@media (forced-colors: active) {
|
|
88
|
+
.row:focus-visible {
|
|
89
|
+
outline: 2px solid CanvasText;
|
|
90
|
+
outline-offset: -2px;
|
|
91
|
+
box-shadow: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`,
|
|
95
|
+
]; }
|
|
96
|
+
#initializedExpansion;
|
|
97
|
+
willUpdate(changed) {
|
|
98
|
+
if (!changed.has("nodes") || this.#initializedExpansion)
|
|
99
|
+
return;
|
|
100
|
+
this.#initializedExpansion = true;
|
|
101
|
+
if (!this.defaultExpanded)
|
|
102
|
+
return;
|
|
103
|
+
const all = new Set();
|
|
104
|
+
const collect = (list) => {
|
|
105
|
+
for (const node of list) {
|
|
106
|
+
if (!node.children)
|
|
107
|
+
continue;
|
|
108
|
+
all.add(node.id);
|
|
109
|
+
collect(node.children);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
collect(this.nodes);
|
|
113
|
+
this.expanded = all;
|
|
114
|
+
}
|
|
115
|
+
#toggle(id) {
|
|
116
|
+
const next = new Set(this.expanded);
|
|
117
|
+
if (next.has(id))
|
|
118
|
+
next.delete(id);
|
|
119
|
+
else
|
|
120
|
+
next.add(id);
|
|
121
|
+
this.expanded = next;
|
|
122
|
+
}
|
|
123
|
+
#activate(node) {
|
|
124
|
+
if (node.children) {
|
|
125
|
+
this.#toggle(node.id);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.dispatchEvent(new CustomEvent("node-click", {
|
|
129
|
+
detail: { id: node.id, data: node.data },
|
|
130
|
+
bubbles: true,
|
|
131
|
+
composed: true,
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
#onKeydown(node, e) {
|
|
135
|
+
if (e.key !== "Enter" && e.key !== " ")
|
|
136
|
+
return;
|
|
137
|
+
if (e.target !== e.currentTarget)
|
|
138
|
+
return;
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
this.#activate(node);
|
|
141
|
+
}
|
|
142
|
+
#onRowClick(node, e) {
|
|
143
|
+
if (this.#isNestedInteractive(e.composedPath(), e.currentTarget))
|
|
144
|
+
return;
|
|
145
|
+
this.#activate(node);
|
|
146
|
+
}
|
|
147
|
+
#isNestedInteractive(path, row) {
|
|
148
|
+
const selector = "a, button, input, select, textarea, summary, [contenteditable], [role='button'], [role='link'], [tabindex]";
|
|
149
|
+
for (const target of path) {
|
|
150
|
+
if (target === row)
|
|
151
|
+
return false;
|
|
152
|
+
if (target instanceof HTMLElement && target.matches(selector))
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
#renderNode(node, depth) {
|
|
158
|
+
const isFolder = !!node.children;
|
|
159
|
+
const isOpen = isFolder && this.expanded.has(node.id);
|
|
160
|
+
return html `
|
|
161
|
+
<div
|
|
162
|
+
class="row"
|
|
163
|
+
role=${isFolder ? "button" : "link"}
|
|
164
|
+
aria-expanded=${isFolder ? String(isOpen) : nothing}
|
|
165
|
+
tabindex="0"
|
|
166
|
+
style="padding-left: ${depth * 1.25}rem"
|
|
167
|
+
@click=${(e) => this.#onRowClick(node, e)}
|
|
168
|
+
@keydown=${(e) => this.#onKeydown(node, e)}
|
|
169
|
+
>
|
|
170
|
+
<span class="toggle" aria-hidden="true">
|
|
171
|
+
${isFolder ? (isOpen ? iconChevronDown(14) : iconChevronRight(14)) : nothing}
|
|
172
|
+
</span>
|
|
173
|
+
<span class="content">${this.renderNode(node)}</span>
|
|
174
|
+
</div>
|
|
175
|
+
${isFolder && isOpen
|
|
176
|
+
? repeat(node.children, (child) => child.id, (child) => this.#renderNode(child, depth + 1))
|
|
177
|
+
: nothing}
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
render() {
|
|
181
|
+
return repeat(this.nodes, (node) => node.id, (node) => this.#renderNode(node, 0));
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
__decorate([
|
|
185
|
+
property({ attribute: false })
|
|
186
|
+
], TreeView.prototype, "nodes", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ attribute: false })
|
|
189
|
+
], TreeView.prototype, "renderNode", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
property({ type: Boolean, attribute: "default-expanded" })
|
|
192
|
+
], TreeView.prototype, "defaultExpanded", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
state()
|
|
195
|
+
], TreeView.prototype, "expanded", void 0);
|
|
196
|
+
TreeView = __decorate([
|
|
197
|
+
customElement("tree-view")
|
|
198
|
+
], TreeView);
|
|
199
|
+
export { TreeView };
|
|
200
|
+
//# sourceMappingURL=tree-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-view.js","sourceRoot":"","sources":["../src/tree-view.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC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CAC9C;YACH,CAAC,CAAC,OAAO;KACZ,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,OAAO,MAAM,CACX,IAAI,CAAC,KAAK,EACV,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EACjB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CACpC,CAAC;IACJ,CAAC;CACF,CAAA;AAvGiC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uCAAwB;AAEvB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;4CAAgE;AAEnC;IAA3D,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;iDAAyB;AAEnE;IAAhB,KAAK,EAAE;0CAAsC;AAhEnC,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAiKpB","sourcesContent":["import { LitElement, css, html, nothing, type TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { iconChevronDown, iconChevronRight } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** One tree node: a folder when `children` is set (even `[]`), a leaf otherwise. */\nexport interface TreeNode {\n id: string;\n label: string;\n children?: TreeNode[];\n data?: unknown;\n}\n\n/**\n * A generic, presentational tree shell: renders `nodes` recursively, one row\n * per node, with each row's content produced by `renderNode` (default: plain\n * label). Modeled on `data-table`'s headless pattern — knows nothing about\n * what a node's `data` means beyond what `renderNode` does with it.\n *\n * A node with a `children` array (even empty) is a folder: clicking or\n * activating its row toggles expand/collapse instead of firing `node-click`.\n * A node with no `children` is a leaf: clicking or activating its row fires\n * `node-click`. Folders start collapsed; set `default-expanded` to start\n * every folder expanded instead. Expansion state is otherwise managed\n * internally and untouched by later `nodes` updates, so a user's manual\n * toggles survive a data refresh.\n *\n * @element tree-view\n * @fires node-click - A leaf row was activated; detail is `{ id, data }`.\n */\n@customElement(\"tree-view\")\nexport class TreeView extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n }\n .row {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n padding: 0.25rem 0.5rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n color: var(--ui-text, #0f172a);\n cursor: pointer;\n }\n .row:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .row:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .toggle {\n display: inline-flex;\n flex-shrink: 0;\n width: 1rem;\n height: 1rem;\n align-items: center;\n justify-content: center;\n color: var(--ui-text-muted, #64748b);\n }\n .content {\n min-width: 0;\n flex: 1;\n }\n @media (forced-colors: active) {\n .row:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: -2px;\n box-shadow: none;\n }\n }\n `,\n ];\n\n /** Tree data; opaque to this component beyond what `renderNode` does with it. */\n @property({ attribute: false }) nodes: TreeNode[] = [];\n /** Produces a row's rendered content for `node`. Default: plain label text. */\n @property({ attribute: false }) renderNode: (node: TreeNode) => unknown = (node) => node.label;\n /** Start every folder expanded instead of the default all-collapsed. */\n @property({ type: Boolean, attribute: \"default-expanded\" }) defaultExpanded = false;\n\n @state() private expanded = new Set<string>();\n #initializedExpansion = false;\n\n override willUpdate(changed: Map<string, unknown>): void {\n if (!changed.has(\"nodes\") || this.#initializedExpansion) return;\n this.#initializedExpansion = true;\n if (!this.defaultExpanded) return;\n const all = new Set<string>();\n const collect = (list: TreeNode[]) => {\n for (const node of list) {\n if (!node.children) continue;\n all.add(node.id);\n collect(node.children);\n }\n };\n collect(this.nodes);\n this.expanded = all;\n }\n\n #toggle(id: string): void {\n const next = new Set(this.expanded);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n this.expanded = next;\n }\n\n #activate(node: TreeNode): void {\n if (node.children) {\n this.#toggle(node.id);\n return;\n }\n this.dispatchEvent(\n new CustomEvent(\"node-click\", {\n detail: { id: node.id, data: node.data },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n #onKeydown(node: TreeNode, e: KeyboardEvent): void {\n if (e.key !== \"Enter\" && e.key !== \" \") return;\n if (e.target !== e.currentTarget) return;\n e.preventDefault();\n this.#activate(node);\n }\n\n #onRowClick(node: TreeNode, e: MouseEvent): void {\n if (this.#isNestedInteractive(e.composedPath(), e.currentTarget)) return;\n this.#activate(node);\n }\n\n #isNestedInteractive(path: EventTarget[], row: EventTarget | null): boolean {\n const selector =\n \"a, button, input, select, textarea, summary, [contenteditable], [role='button'], [role='link'], [tabindex]\";\n for (const target of path) {\n if (target === row) return false;\n if (target instanceof HTMLElement && target.matches(selector)) return true;\n }\n return false;\n }\n\n #renderNode(node: TreeNode, depth: number): TemplateResult {\n const isFolder = !!node.children;\n const isOpen = isFolder && this.expanded.has(node.id);\n return html`\n <div\n class=\"row\"\n role=${isFolder ? \"button\" : \"link\"}\n aria-expanded=${isFolder ? String(isOpen) : nothing}\n tabindex=\"0\"\n style=\"padding-left: ${depth * 1.25}rem\"\n @click=${(e: MouseEvent) => this.#onRowClick(node, e)}\n @keydown=${(e: KeyboardEvent) => this.#onKeydown(node, e)}\n >\n <span class=\"toggle\" aria-hidden=\"true\">\n ${isFolder ? (isOpen ? iconChevronDown(14) : iconChevronRight(14)) : nothing}\n </span>\n <span class=\"content\">${this.renderNode(node)}</span>\n </div>\n ${isFolder && isOpen\n ? repeat(\n node.children!,\n (child) => child.id,\n (child) => this.#renderNode(child, depth + 1),\n )\n : nothing}\n `;\n }\n\n override render() {\n return repeat(\n this.nodes,\n (node) => node.id,\n (node) => this.#renderNode(node, 0),\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"tree-view\": TreeView;\n }\n}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# `<tree-view>`
|
|
2
|
+
|
|
3
|
+
A generic, presentational tree shell: renders `nodes` recursively, one row
|
|
4
|
+
per node, with each row's content produced by `renderNode` (default: plain
|
|
5
|
+
label). Modeled on `data-table`'s headless pattern — knows nothing about
|
|
6
|
+
what a node's `data` means beyond what `renderNode` does with it.
|
|
7
|
+
|
|
8
|
+
A node with a `children` array (even empty) is a folder: clicking or
|
|
9
|
+
activating its row toggles expand/collapse instead of firing `node-click`.
|
|
10
|
+
A node with no `children` is a leaf: clicking or activating its row fires
|
|
11
|
+
`node-click`. Folders start collapsed; set `default-expanded` to start
|
|
12
|
+
every folder expanded instead. Expansion state is otherwise managed
|
|
13
|
+
internally and untouched by later `nodes` updates, so a user's manual
|
|
14
|
+
toggles survive a data refresh.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import "@f-ewald/components/tree-view.js";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<tree-view></tree-view>
|
|
26
|
+
<script type="module">
|
|
27
|
+
const tree = document.querySelector("tree-view");
|
|
28
|
+
tree.nodes = [
|
|
29
|
+
{
|
|
30
|
+
id: "docs",
|
|
31
|
+
label: "docs",
|
|
32
|
+
children: [{ id: "fil_1", label: "notes.txt", data: { id: "fil_1" } }],
|
|
33
|
+
},
|
|
34
|
+
{ id: "fil_2", label: "readme.md", data: { id: "fil_2" } },
|
|
35
|
+
];
|
|
36
|
+
tree.renderNode = (node) => node.label;
|
|
37
|
+
tree.addEventListener("node-click", (e) => console.log(e.detail));
|
|
38
|
+
</script>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Attributes / properties
|
|
42
|
+
|
|
43
|
+
| Property | Attribute | Type | Default | Description |
|
|
44
|
+
| --- | --- | --- | --- | --- |
|
|
45
|
+
| `nodes` | _(JS property only)_ | `TreeNode[]` | `[]` | Tree data; opaque to this component beyond what `renderNode` does with it. |
|
|
46
|
+
| `renderNode` | _(JS property only)_ | `(node: TreeNode) => unknown` | `—` | Produces a row's rendered content for `node`. Default: plain label text. |
|
|
47
|
+
| `defaultExpanded` | `default-expanded` | `boolean` | `false` | Start every folder expanded instead of the default all-collapsed. |
|
|
48
|
+
|
|
49
|
+
## Events
|
|
50
|
+
|
|
51
|
+
| Event | Description |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `node-click` | A leaf row was activated; detail is `{ id, data }`. |
|
|
54
|
+
|
|
55
|
+
## Slots
|
|
56
|
+
|
|
57
|
+
_None._
|
|
58
|
+
|
|
59
|
+
## CSS custom properties
|
|
60
|
+
|
|
61
|
+
| Custom property |
|
|
62
|
+
| --- |
|
|
63
|
+
| `--ui-focus-ring` |
|
|
64
|
+
| `--ui-font` |
|
|
65
|
+
| `--ui-font-size-sm` |
|
|
66
|
+
| `--ui-radius-sm` |
|
|
67
|
+
| `--ui-surface-muted` |
|
|
68
|
+
| `--ui-text` |
|
|
69
|
+
| `--ui-text-muted` |
|
package/llms.txt
CHANGED
|
@@ -1534,6 +1534,45 @@ Example:
|
|
|
1534
1534
|
</script>
|
|
1535
1535
|
```
|
|
1536
1536
|
|
|
1537
|
+
## <tree-view>
|
|
1538
|
+
|
|
1539
|
+
A generic, presentational tree shell: renders `nodes` recursively, one row
|
|
1540
|
+
per node, with each row's content produced by `renderNode` (default: plain
|
|
1541
|
+
label). Modeled on `data-table`'s headless pattern — knows nothing about
|
|
1542
|
+
what a node's `data` means beyond what `renderNode` does with it.
|
|
1543
|
+
|
|
1544
|
+
A node with a `children` array (even empty) is a folder: clicking or
|
|
1545
|
+
activating its row toggles expand/collapse instead of firing `node-click`.
|
|
1546
|
+
A node with no `children` is a leaf: clicking or activating its row fires
|
|
1547
|
+
`node-click`. Folders start collapsed; set `default-expanded` to start
|
|
1548
|
+
every folder expanded instead. Expansion state is otherwise managed
|
|
1549
|
+
internally and untouched by later `nodes` updates, so a user's manual
|
|
1550
|
+
toggles survive a data refresh.
|
|
1551
|
+
|
|
1552
|
+
Import: `import "@f-ewald/components/tree-view.js";`
|
|
1553
|
+
|
|
1554
|
+
Properties: `nodes` (JS property only) : TreeNode[], default []; `renderNode` (JS property only) : (node: TreeNode) => unknown, default —; `defaultExpanded` (attribute `default-expanded`) : boolean, default false
|
|
1555
|
+
Events: `node-click`
|
|
1556
|
+
CSS custom properties: `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-radius-sm`, `--ui-surface-muted`, `--ui-text`, `--ui-text-muted`
|
|
1557
|
+
|
|
1558
|
+
Example:
|
|
1559
|
+
```html
|
|
1560
|
+
<tree-view></tree-view>
|
|
1561
|
+
<script type="module">
|
|
1562
|
+
const tree = document.querySelector("tree-view");
|
|
1563
|
+
tree.nodes = [
|
|
1564
|
+
{
|
|
1565
|
+
id: "docs",
|
|
1566
|
+
label: "docs",
|
|
1567
|
+
children: [{ id: "fil_1", label: "notes.txt", data: { id: "fil_1" } }],
|
|
1568
|
+
},
|
|
1569
|
+
{ id: "fil_2", label: "readme.md", data: { id: "fil_2" } },
|
|
1570
|
+
];
|
|
1571
|
+
tree.renderNode = (node) => node.label;
|
|
1572
|
+
tree.addEventListener("node-click", (e) => console.log(e.detail));
|
|
1573
|
+
</script>
|
|
1574
|
+
```
|
|
1575
|
+
|
|
1537
1576
|
## <ui-button>
|
|
1538
1577
|
|
|
1539
1578
|
Button (or link styled as one) with an optional leading icon, in three
|