@fusion.dev/helix-headless 0.144.0 → 0.146.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/custom-elements.json +15195 -4240
- package/dist/accordion/item/accordion-item.d.ts +62 -12
- package/dist/accordion/item/accordion-item.js +41 -10
- package/dist/accordion/root/accordion-root.d.ts +14 -5
- package/dist/accordion/root/accordion-root.js +7 -1
- package/dist/announcement/root/announcement-root.d.ts +24 -3
- package/dist/announcement/root/announcement-root.js +39 -2
- package/dist/app-header/root/app-header-root.d.ts +12 -0
- package/dist/app-header/root/app-header-root.js +13 -1
- package/dist/app-header/sectioning.d.ts +9 -0
- package/dist/app-header/sectioning.js +27 -0
- package/dist/avatar/group/avatar-group.d.ts +20 -14
- package/dist/avatar/group/avatar-group.js +17 -19
- package/dist/badge/root/badge-root.d.ts +3 -1
- package/dist/badge/root/badge-root.js +2 -2
- package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
- package/dist/bar-chart/root/bar-chart-root.js +52 -15
- package/dist/bar-chart/stack.d.ts +15 -0
- package/dist/bar-chart/stack.js +19 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +57 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +73 -3
- package/dist/button/root/button-root.d.ts +26 -0
- package/dist/button/root/button-root.js +38 -18
- package/dist/button-group/root/button-group-root.d.ts +2 -1
- package/dist/button-group/root/button-group-root.js +5 -1
- package/dist/canvas/node/canvas-node.d.ts +4 -3
- package/dist/canvas/node/canvas-node.js +3 -2
- package/dist/canvas/root/canvas-root.d.ts +38 -3
- package/dist/canvas/root/canvas-root.js +123 -42
- package/dist/card/root/card-root.d.ts +24 -3
- package/dist/card/root/card-root.js +20 -8
- package/dist/carousel/root/carousel-root.d.ts +133 -4
- package/dist/carousel/root/carousel-root.js +174 -24
- package/dist/carousel/stops.d.ts +20 -0
- package/dist/carousel/stops.js +30 -0
- package/dist/chat/composer/chat-composer.d.ts +38 -6
- package/dist/chat/composer/chat-composer.js +42 -9
- package/dist/chat/message/chat-message.d.ts +32 -1
- package/dist/chat/message/chat-message.js +27 -10
- package/dist/chat/naming.d.ts +26 -0
- package/dist/chat/naming.js +14 -0
- package/dist/chat/root/chat-root.d.ts +58 -0
- package/dist/chat/root/chat-root.js +43 -3
- package/dist/checkbox/root/checkbox-root.d.ts +20 -0
- package/dist/checkbox/root/checkbox-root.js +14 -1
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.js +12 -10
- package/dist/checkbox-group/select-all.d.ts +27 -0
- package/dist/checkbox-group/select-all.js +12 -0
- package/dist/code-block/highlight.d.ts +15 -0
- package/dist/code-block/highlight.js +4 -0
- package/dist/code-block/root/code-block-root.d.ts +57 -2
- package/dist/code-block/root/code-block-root.js +63 -8
- package/dist/color-input/root/color-input-root.d.ts +3 -0
- package/dist/color-input/root/color-input-root.js +6 -3
- package/dist/color-picker/root/color-picker-root.d.ts +33 -4
- package/dist/color-picker/root/color-picker-root.js +80 -21
- package/dist/color-picker/swatches.d.ts +12 -0
- package/dist/color-picker/swatches.js +26 -0
- package/dist/combobox/root/combobox-root.d.ts +43 -0
- package/dist/combobox/root/combobox-root.js +79 -15
- package/dist/command/root/command-root.d.ts +16 -1
- package/dist/command/root/command-root.js +22 -4
- package/dist/copy-button/root/copy-button-root.d.ts +26 -1
- package/dist/copy-button/root/copy-button-root.js +12 -5
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/data-table/keys.d.ts +24 -0
- package/dist/data-table/keys.js +24 -0
- package/dist/data-table/root/data-table-root.d.ts +170 -13
- package/dist/data-table/root/data-table-root.js +294 -52
- package/dist/data-table/tree.d.ts +55 -0
- package/dist/data-table/tree.js +54 -0
- package/dist/date-input/root/date-input-root.d.ts +3 -1
- package/dist/date-input/root/date-input-root.js +18 -7
- package/dist/date-picker/root/date-picker-root.js +12 -6
- package/dist/description-list/item/description-list-item.d.ts +17 -2
- package/dist/description-list/item/description-list-item.js +15 -2
- package/dist/description-list/root/description-list-root.d.ts +27 -1
- package/dist/description-list/root/description-list-root.js +26 -1
- package/dist/dialog/description.js +15 -1
- package/dist/dialog/root/dialog-root.d.ts +8 -2
- package/dist/dialog/root/dialog-root.js +16 -1
- package/dist/divider/root/divider-root.d.ts +3 -0
- package/dist/divider/root/divider-root.js +2 -1
- package/dist/donut-chart/root/donut-chart-root.d.ts +31 -0
- package/dist/donut-chart/root/donut-chart-root.js +48 -1
- package/dist/drawer/reveal.d.ts +8 -0
- package/dist/drawer/reveal.js +1 -0
- package/dist/drawer/root/drawer-root.d.ts +59 -0
- package/dist/drawer/root/drawer-root.js +63 -4
- package/dist/drilldown/item/drilldown-item.d.ts +11 -6
- package/dist/drilldown/item/drilldown-item.js +8 -5
- package/dist/drilldown/root/drilldown-root.d.ts +29 -0
- package/dist/drilldown/root/drilldown-root.js +28 -5
- package/dist/element-events.generated.js +83 -12
- package/dist/empty/root/empty-root.d.ts +3 -1
- package/dist/empty/root/empty-root.js +3 -2
- package/dist/file-input/root/file-input-root.d.ts +69 -6
- package/dist/file-input/root/file-input-root.js +82 -19
- package/dist/file-input/screen.d.ts +2 -1
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +16 -4
- package/dist/filter-input/root/filter-input-root.d.ts +30 -6
- package/dist/filter-input/root/filter-input-root.js +1 -1
- package/dist/filter-input/suggest.d.ts +28 -3
- package/dist/filter-input/suggest.js +18 -8
- package/dist/format-date/root/format-date-root.d.ts +9 -16
- package/dist/format-date/root/format-date-root.js +10 -27
- package/dist/heatmap/root/heatmap-root.d.ts +24 -13
- package/dist/heatmap/root/heatmap-root.js +34 -12
- package/dist/icon/root/icon-root.d.ts +12 -1
- package/dist/icon/root/icon-root.js +21 -10
- package/dist/icon/settle.d.ts +7 -0
- package/dist/icon/settle.js +10 -0
- package/dist/icon-button/root/icon-button-root.d.ts +2 -0
- package/dist/image/root/image-root.d.ts +5 -1
- package/dist/image/root/image-root.js +10 -2
- package/dist/input/root/input-root.d.ts +13 -3
- package/dist/input/root/input-root.js +12 -3
- package/dist/kbd/root/kbd-root.d.ts +35 -1
- package/dist/kbd/root/kbd-root.js +23 -4
- package/dist/legend/root/legend-root.d.ts +55 -8
- package/dist/legend/root/legend-root.js +55 -13
- package/dist/lightbox/root/lightbox-root.d.ts +49 -6
- package/dist/lightbox/root/lightbox-root.js +86 -19
- package/dist/lightbox/zoom-controller.d.ts +59 -0
- package/dist/lightbox/zoom-controller.js +128 -0
- package/dist/lightbox/zoom.d.ts +22 -0
- package/dist/lightbox/zoom.js +16 -0
- package/dist/line-chart/root/line-chart-root.d.ts +22 -1
- package/dist/line-chart/root/line-chart-root.js +21 -1
- package/dist/list/item/list-item.d.ts +70 -1
- package/dist/list/item/list-item.js +77 -6
- package/dist/list/numbering.d.ts +14 -0
- package/dist/list/numbering.js +8 -0
- package/dist/list/root/list-root.d.ts +155 -9
- package/dist/list/root/list-root.js +246 -4
- package/dist/list/selection.d.ts +49 -0
- package/dist/list/selection.js +30 -0
- package/dist/listbox/root/listbox-root.d.ts +37 -1
- package/dist/listbox/root/listbox-root.js +49 -4
- package/dist/loader/busy.d.ts +10 -0
- package/dist/loader/busy.js +11 -0
- package/dist/loader/root/loader-root.d.ts +9 -2
- package/dist/loader/root/loader-root.js +23 -3
- package/dist/map/root/map-root.d.ts +6 -2
- package/dist/map/root/map-root.js +5 -2
- package/dist/megamenu/root/megamenu-root.d.ts +62 -0
- package/dist/megamenu/root/megamenu-root.js +90 -5
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu/item/menu-item.d.ts +87 -11
- package/dist/menu/item/menu-item.js +78 -22
- package/dist/menu/root/menu-root.d.ts +39 -1
- package/dist/menu/root/menu-root.js +65 -8
- package/dist/menu/section/menu-section.d.ts +55 -0
- package/dist/menu/section/menu-section.js +60 -0
- package/dist/meter/root/meter-root.d.ts +20 -1
- package/dist/meter/root/meter-root.js +11 -15
- package/dist/navigation/root/navigation-root.d.ts +18 -2
- package/dist/navigation/root/navigation-root.js +29 -3
- package/dist/notifications/root/notifications-root.d.ts +25 -0
- package/dist/notifications/root/notifications-root.js +33 -5
- package/dist/number-input/root/number-input-root.d.ts +17 -8
- package/dist/number-input/root/number-input-root.js +2 -7
- package/dist/object-inspector/root/object-inspector-root.d.ts +161 -32
- package/dist/object-inspector/root/object-inspector-root.js +264 -123
- package/dist/object-inspector/rows.d.ts +75 -0
- package/dist/object-inspector/rows.js +119 -0
- package/dist/option/root/option-root.d.ts +5 -3
- package/dist/outline/levels.d.ts +31 -0
- package/dist/outline/levels.js +23 -0
- package/dist/outline/root/outline-root.d.ts +86 -3
- package/dist/outline/root/outline-root.js +95 -12
- package/dist/pagination/size/pagination-size.d.ts +12 -2
- package/dist/pagination/size/pagination-size.js +20 -5
- package/dist/pin-input/code.d.ts +10 -0
- package/dist/pin-input/code.js +13 -0
- package/dist/pin-input/root/pin-input-root.d.ts +25 -1
- package/dist/pin-input/root/pin-input-root.js +10 -11
- package/dist/popover/hide-outside.d.ts +14 -0
- package/dist/popover/hide-outside.js +41 -0
- package/dist/popover/root/popover-root.d.ts +57 -7
- package/dist/popover/root/popover-root.js +58 -3
- package/dist/progress/root/progress-root.d.ts +20 -0
- package/dist/progress/root/progress-root.js +15 -15
- package/dist/qr-code/export.d.ts +26 -1
- package/dist/qr-code/export.js +14 -0
- package/dist/qr-code/root/qr-code-root.d.ts +19 -5
- package/dist/qr-code/root/qr-code-root.js +58 -9
- package/dist/quote/marks.d.ts +8 -0
- package/dist/quote/marks.js +5 -0
- package/dist/quote/root/quote-root.d.ts +14 -2
- package/dist/quote/root/quote-root.js +23 -1
- package/dist/radio/group/radio-group.d.ts +4 -10
- package/dist/radio/group/radio-group.js +5 -10
- package/dist/radio/root/radio-root.d.ts +6 -2
- package/dist/radio/root/radio-root.js +6 -1
- package/dist/rating/root/rating-root.d.ts +10 -5
- package/dist/rating/root/rating-root.js +32 -8
- package/dist/rating/steps.d.ts +7 -0
- package/dist/rating/steps.js +9 -0
- package/dist/scatter-chart/fit.d.ts +15 -0
- package/dist/scatter-chart/fit.js +35 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +21 -1
- package/dist/scatter-chart/root/scatter-chart-root.js +30 -17
- package/dist/scroll-area/root/scroll-area-root.d.ts +84 -0
- package/dist/scroll-area/root/scroll-area-root.js +106 -7
- package/dist/scroll-area/scrollbar-controller.d.ts +111 -0
- package/dist/scroll-area/scrollbar-controller.js +172 -0
- package/dist/scroll-area/scrollbar.d.ts +92 -0
- package/dist/scroll-area/scrollbar.js +33 -0
- package/dist/select/root/select-root.d.ts +15 -0
- package/dist/select/root/select-root.js +18 -6
- package/dist/skeleton/root/skeleton-root.d.ts +3 -0
- package/dist/skeleton/root/skeleton-root.js +4 -2
- package/dist/skip-link/root/skip-link-root.js +2 -2
- package/dist/slider/root/slider-root.d.ts +41 -4
- package/dist/slider/root/slider-root.js +23 -3
- package/dist/sparkline/readings.d.ts +18 -0
- package/dist/sparkline/readings.js +19 -0
- package/dist/sparkline/root/sparkline-root.d.ts +78 -7
- package/dist/sparkline/root/sparkline-root.js +118 -23
- package/dist/speed-dial/root/speed-dial-root.js +2 -2
- package/dist/splitter/root/splitter-root.d.ts +20 -12
- package/dist/splitter/root/splitter-root.js +226 -203
- package/dist/splitter/snap.d.ts +9 -0
- package/dist/splitter/snap.js +12 -0
- package/dist/stat/root/stat-root.d.ts +14 -5
- package/dist/stat/root/stat-root.js +21 -5
- package/dist/steps/reach.d.ts +20 -0
- package/dist/steps/reach.js +15 -0
- package/dist/steps/root/steps-root.d.ts +76 -0
- package/dist/steps/root/steps-root.js +93 -1
- package/dist/steps/step/step.d.ts +45 -2
- package/dist/steps/step/step.js +33 -6
- package/dist/switch/root/switch-root.d.ts +10 -0
- package/dist/table/column/table-column.d.ts +11 -10
- package/dist/table/column/table-column.js +8 -19
- package/dist/table/root/table-root.d.ts +126 -4
- package/dist/table/root/table-root.js +156 -6
- package/dist/table/row/table-row.d.ts +47 -1
- package/dist/table/row/table-row.js +39 -2
- package/dist/tabs/panel/tab-panel.d.ts +22 -5
- package/dist/tabs/panel/tab-panel.js +34 -6
- package/dist/tabs/root/tabs-root.d.ts +37 -1
- package/dist/tabs/root/tabs-root.js +22 -4
- package/dist/tabs/tab/tab.d.ts +41 -4
- package/dist/tabs/tab/tab.js +49 -3
- package/dist/tag/group/tag-group.d.ts +31 -4
- package/dist/tag/group/tag-group.js +46 -7
- package/dist/tag/root/tag-root.js +9 -2
- package/dist/textarea/root/textarea-root.d.ts +28 -1
- package/dist/textarea/root/textarea-root.js +40 -1
- package/dist/time-input/root/time-input-root.d.ts +5 -1
- package/dist/time-input/root/time-input-root.js +16 -8
- package/dist/time-picker/root/time-picker-root.d.ts +18 -4
- package/dist/time-picker/root/time-picker-root.js +7 -10
- package/dist/time-picker/wheel-name.d.ts +9 -0
- package/dist/time-picker/wheel-name.js +15 -0
- package/dist/timeline/group/timeline-group.d.ts +46 -0
- package/dist/timeline/group/timeline-group.js +37 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +1 -0
- package/dist/timeline/root/timeline-root.d.ts +10 -3
- package/dist/toast/item/toast-item.d.ts +24 -18
- package/dist/toast/item/toast-item.js +36 -40
- package/dist/toast/root/toast-root.d.ts +6 -0
- package/dist/toast/root/toast-root.js +16 -1
- package/dist/toggle/group/toggle-group.d.ts +24 -3
- package/dist/toggle/group/toggle-group.js +34 -5
- package/dist/toolbar/root/toolbar-root.d.ts +13 -0
- package/dist/toolbar/root/toolbar-root.js +15 -5
- package/dist/tooltip/root/tooltip-root.d.ts +13 -2
- package/dist/tooltip/root/tooltip-root.js +9 -1
- package/dist/tour/back.d.ts +10 -0
- package/dist/tour/back.js +8 -0
- package/dist/tour/root/tour-root.d.ts +30 -2
- package/dist/tour/root/tour-root.js +34 -8
- package/dist/tree/item/tree-item.d.ts +61 -4
- package/dist/tree/item/tree-item.js +92 -20
- package/dist/tree/root/tree-root.d.ts +58 -0
- package/dist/tree/root/tree-root.js +80 -16
- package/dist/tree/selection.d.ts +24 -0
- package/dist/tree/selection.js +13 -0
- package/dist/trend/root/trend-root.d.ts +43 -18
- package/dist/trend/root/trend-root.js +31 -6
- package/dist/video/media-events.d.ts +44 -0
- package/dist/video/media-events.js +35 -0
- package/dist/video/root/video-root.d.ts +117 -18
- package/dist/video/root/video-root.js +93 -47
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/order.d.ts +41 -0
- package/dist/video-playlist/order.js +34 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +77 -3
- package/dist/video-playlist/root/video-playlist-root.js +60 -16
- package/dist/virtual-list/controls.d.ts +4 -0
- package/dist/virtual-list/controls.js +30 -0
- package/dist/virtual-list/fill.d.ts +22 -0
- package/dist/virtual-list/fill.js +23 -0
- package/dist/virtual-list/keys.d.ts +15 -0
- package/dist/virtual-list/keys.js +24 -0
- package/dist/virtual-list/plan.d.ts +49 -0
- package/dist/virtual-list/plan.js +16 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +259 -26
- package/dist/virtual-list/root/virtual-list-root.js +333 -49
- package/lint.json +1 -1
- package/package.json +8 -8
- package/types/jsx.d.ts +8113 -1394
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +1678 -353
- package/dist/data-table/root/order.d.ts +0 -141
- package/dist/data-table/root/order.js +0 -76
- package/dist/listbox/range.d.ts +0 -17
- package/dist/listbox/range.js +0 -5
- package/dist/tag/selection.d.ts +0 -10
- package/dist/tag/selection.js +0 -12
|
@@ -5,22 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var HelixHeadlessObjectInspector_1;
|
|
8
|
-
import { AriaForwardController, CopyController, customElement, elementById, fillTemplate, formatNumbers, HelixElement, inlineStep, scrollItemIntoView, searchableById, VirtualizeController, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { AriaForwardController, CopyController, countLabel, customElement, drawStatus, elementById, fillTemplate, formatNumbers, HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeCloseEvent, HelixBeforeOpenEvent, HelixElement, HelixFilterEvent, HelixFilteredEvent, inlineStep, requestChange, StatusController, scrollItemIntoView, searchableById, treeArrow, VirtualizeController, } from '@fusion.dev/helix-core';
|
|
9
9
|
import { caretDown, caretRight } from '@fusion.dev/helix-icons';
|
|
10
10
|
import { html, nothing } from 'lit';
|
|
11
11
|
import { property, state } from 'lit/decorators.js';
|
|
12
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
12
13
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
13
14
|
import { html as staticHtml } from 'lit/static-html.js';
|
|
14
15
|
import '../../copy-button/index.js';
|
|
15
|
-
|
|
16
|
-
const entries = (value) => Array.isArray(value) ? value.map((item, at) => [String(at), item]) : Object.entries(value);
|
|
17
|
-
const child = (path, key) => `${path}/${key.replaceAll('~', '~0').replaceAll('/', '~1')}`;
|
|
16
|
+
import { cursorFor, entries, flatten, search, seed, siblingBranches, withAncestors, } from '../rows.js';
|
|
18
17
|
let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends HelixElement {
|
|
19
18
|
constructor() {
|
|
20
19
|
super(...arguments);
|
|
21
20
|
this.copyLabel = 'Copy {name}';
|
|
22
21
|
this.copyValueLabel = 'Copy value';
|
|
23
22
|
this.defaultDepth = 1;
|
|
23
|
+
this.filter = '';
|
|
24
|
+
this.filterable = false;
|
|
25
|
+
this.filterLabel = 'Filter';
|
|
24
26
|
this.for = '';
|
|
25
27
|
this.itemLabel = '{count} item';
|
|
26
28
|
this.itemsLabel = '{count} items';
|
|
@@ -28,19 +30,24 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
28
30
|
this.keysLabel = '{count} keys';
|
|
29
31
|
this.label = '';
|
|
30
32
|
this.noCopy = false;
|
|
33
|
+
this.resultLabel = '{count} result';
|
|
34
|
+
this.resultsLabel = '{count} results';
|
|
31
35
|
this.treeLabel = 'Value';
|
|
32
36
|
this.value = undefined;
|
|
33
37
|
this.windowed = false;
|
|
34
38
|
this.read = undefined;
|
|
35
39
|
this.opened = new Set();
|
|
36
|
-
this.
|
|
40
|
+
this.cursor = 0;
|
|
37
41
|
this.revealing = false;
|
|
42
|
+
this.focusing = false;
|
|
43
|
+
this.hadFocus = false;
|
|
38
44
|
this.typed = { at: 0, text: '' };
|
|
39
45
|
this.branches = new Set();
|
|
40
46
|
this.aria = new AriaForwardController(this, {
|
|
41
47
|
label: true,
|
|
42
48
|
target: () => this.partNamed('tree'),
|
|
43
49
|
});
|
|
50
|
+
this.status = new StatusController(this);
|
|
44
51
|
this.virtualize = new VirtualizeController(this, {
|
|
45
52
|
container: () => (this.windowed ? this.partNamed('tree') : null),
|
|
46
53
|
count: () => this.rows.length,
|
|
@@ -52,7 +59,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
52
59
|
this.copier = new CopyController(this);
|
|
53
60
|
this.handleKeydown = (event) => {
|
|
54
61
|
const rows = this.rows;
|
|
55
|
-
const row = rows[this.
|
|
62
|
+
const row = rows[this.cursor];
|
|
56
63
|
if (!row) {
|
|
57
64
|
return;
|
|
58
65
|
}
|
|
@@ -66,10 +73,10 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
66
73
|
}
|
|
67
74
|
switch (event.key) {
|
|
68
75
|
case 'ArrowDown':
|
|
69
|
-
this.move(this.
|
|
76
|
+
this.move(this.cursor + 1);
|
|
70
77
|
break;
|
|
71
78
|
case 'ArrowUp':
|
|
72
|
-
this.move(this.
|
|
79
|
+
this.move(this.cursor - 1);
|
|
73
80
|
break;
|
|
74
81
|
case 'Home':
|
|
75
82
|
this.move(0);
|
|
@@ -79,22 +86,23 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
79
86
|
break;
|
|
80
87
|
case 'ArrowRight':
|
|
81
88
|
case 'ArrowLeft':
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.move(parent);
|
|
89
|
+
switch (treeArrow(row, inlineStep(this, event.key) === 1 ? 1 : -1)) {
|
|
90
|
+
case 'open':
|
|
91
|
+
case 'close':
|
|
92
|
+
this.toggle(row, !row.open);
|
|
93
|
+
break;
|
|
94
|
+
case 'child':
|
|
95
|
+
this.move(this.cursor + 1);
|
|
96
|
+
break;
|
|
97
|
+
case 'parent': {
|
|
98
|
+
const parent = rows.findLastIndex((candidate, at) => at < this.cursor && candidate.depth === row.depth - 1);
|
|
99
|
+
if (parent >= 0) {
|
|
100
|
+
this.move(parent);
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
97
103
|
}
|
|
104
|
+
default:
|
|
105
|
+
break;
|
|
98
106
|
}
|
|
99
107
|
break;
|
|
100
108
|
case 'Enter':
|
|
@@ -104,7 +112,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
104
112
|
}
|
|
105
113
|
break;
|
|
106
114
|
case '*':
|
|
107
|
-
this.
|
|
115
|
+
this.requestOpen(siblingBranches(rows, row), true);
|
|
108
116
|
break;
|
|
109
117
|
default:
|
|
110
118
|
if (event.key.length !== 1 || event.altKey || event.ctrlKey || event.metaKey) {
|
|
@@ -114,80 +122,115 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
114
122
|
}
|
|
115
123
|
event.preventDefault();
|
|
116
124
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return rows;
|
|
127
|
-
}
|
|
128
|
-
const visit = (value, path, depth, position, siblings, key) => {
|
|
129
|
-
const branch = branchy(value);
|
|
130
|
-
const open = branch && this.opened.has(path);
|
|
131
|
-
rows.push({
|
|
132
|
-
branch,
|
|
133
|
-
depth,
|
|
134
|
-
open,
|
|
135
|
-
path,
|
|
136
|
-
position,
|
|
137
|
-
siblings,
|
|
138
|
-
value,
|
|
139
|
-
...(key === undefined ? {} : { key }),
|
|
125
|
+
this.handleFilterInput = (event) => {
|
|
126
|
+
const field = event.currentTarget;
|
|
127
|
+
const applied = requestChange({
|
|
128
|
+
apply: (value) => {
|
|
129
|
+
this.filter = value;
|
|
130
|
+
},
|
|
131
|
+
event: (value) => new HelixFilterEvent({ value }),
|
|
132
|
+
host: this,
|
|
133
|
+
next: field.value,
|
|
140
134
|
});
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
135
|
+
if (applied) {
|
|
136
|
+
this.dispatchEvent(new HelixFilteredEvent({ value: field.value }));
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
field.value = this.filter;
|
|
146
140
|
}
|
|
147
141
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const visit = (value, path, depth) => {
|
|
155
|
-
if (!branchy(value)) {
|
|
156
|
-
return;
|
|
142
|
+
this.handleFilterKeydown = (event) => {
|
|
143
|
+
if (event.key === 'ArrowDown' && this.rows.length > 0) {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
this.revealing = true;
|
|
146
|
+
this.focusing = true;
|
|
147
|
+
this.requestUpdate();
|
|
157
148
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
149
|
+
};
|
|
150
|
+
this.handleFocusIn = (event) => {
|
|
151
|
+
const index = Number(event.target.dataset?.index);
|
|
152
|
+
if (Number.isInteger(index) && index !== this.cursor) {
|
|
153
|
+
this.move(index);
|
|
162
154
|
}
|
|
163
|
-
|
|
164
|
-
|
|
155
|
+
};
|
|
156
|
+
this.handleFocusOut = () => {
|
|
157
|
+
if (this.windowed) {
|
|
158
|
+
this.requestUpdate();
|
|
165
159
|
}
|
|
166
160
|
};
|
|
167
|
-
|
|
161
|
+
}
|
|
162
|
+
static { HelixHeadlessObjectInspector_1 = this; }
|
|
163
|
+
get active() {
|
|
164
|
+
return this.wanted ?? this.rows[this.cursor]?.path ?? '';
|
|
165
|
+
}
|
|
166
|
+
set active(path) {
|
|
167
|
+
const previous = this.active;
|
|
168
|
+
this.wanted = path;
|
|
169
|
+
this.requestUpdate('active', previous);
|
|
170
|
+
}
|
|
171
|
+
get expanded() {
|
|
172
|
+
return [...this.opened];
|
|
173
|
+
}
|
|
174
|
+
set expanded(paths) {
|
|
175
|
+
const previous = this.expanded;
|
|
176
|
+
this.declared = new Set(paths);
|
|
177
|
+
this.opened = this.declared;
|
|
178
|
+
this.requestUpdate('expanded', previous);
|
|
179
|
+
}
|
|
180
|
+
static { this.ESTIMATE = 24; }
|
|
181
|
+
get root() {
|
|
182
|
+
return this.value === undefined ? this.read : this.value;
|
|
183
|
+
}
|
|
184
|
+
seed(keep) {
|
|
185
|
+
const { branches, opened } = seed(this.root, this.defaultDepth, keep ? this.branches : undefined, this.opened);
|
|
168
186
|
this.branches = branches;
|
|
169
187
|
this.opened = opened;
|
|
170
188
|
if (!keep) {
|
|
171
|
-
this.
|
|
189
|
+
this.cursor = 0;
|
|
172
190
|
}
|
|
173
191
|
}
|
|
192
|
+
openAround(paths) {
|
|
193
|
+
this.opened = withAncestors(this.opened, this.branches, paths);
|
|
194
|
+
}
|
|
174
195
|
willUpdate(changed) {
|
|
175
196
|
super.willUpdate(changed);
|
|
197
|
+
this.hadFocus = this.hasFocusedRow();
|
|
176
198
|
if (this.loadedFor !== this.for && searchableById(this) && !this.hydrating) {
|
|
177
199
|
this.loadedFor = this.for;
|
|
178
200
|
this.load();
|
|
179
201
|
}
|
|
180
|
-
const was = this.rows[this.
|
|
181
|
-
|
|
202
|
+
const was = this.rows[this.cursor]?.path;
|
|
203
|
+
const written = this.declared;
|
|
204
|
+
this.declared = undefined;
|
|
205
|
+
const fresh = changed.has('value') || changed.has('read');
|
|
206
|
+
if (fresh || changed.has('defaultDepth')) {
|
|
182
207
|
this.seed(!changed.has('defaultDepth'));
|
|
183
208
|
}
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
this.
|
|
189
|
-
|
|
190
|
-
|
|
209
|
+
if (written) {
|
|
210
|
+
this.opened = written;
|
|
211
|
+
}
|
|
212
|
+
if (fresh || changed.has('filter')) {
|
|
213
|
+
this.found = this.filter.trim() === '' ? undefined : search(this.root, this.filter);
|
|
214
|
+
this.openAround(this.found ?? []);
|
|
215
|
+
}
|
|
216
|
+
const wanted = this.root === undefined ? undefined : this.wanted;
|
|
217
|
+
if (wanted !== undefined) {
|
|
218
|
+
this.wanted = undefined;
|
|
219
|
+
this.openAround([wanted]);
|
|
220
|
+
}
|
|
221
|
+
if (fresh ||
|
|
222
|
+
wanted !== undefined ||
|
|
223
|
+
['active', 'defaultDepth', 'expanded', 'filter', 'opened'].some((name) => changed.has(name))) {
|
|
224
|
+
this.rows = flatten(this.root, this.opened, this.found);
|
|
225
|
+
this.cursor = cursorFor(this.rows, wanted ?? was, this.cursor, changed.has('filter'));
|
|
226
|
+
}
|
|
227
|
+
if (changed.has('filter') && this.hasUpdated) {
|
|
228
|
+
this.tell();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
tell() {
|
|
232
|
+
if (this.found) {
|
|
233
|
+
this.status.say(countLabel(this.found.size, this.resultLabel, this.resultsLabel, this.lang));
|
|
191
234
|
}
|
|
192
235
|
}
|
|
193
236
|
firstUpdated(changed) {
|
|
@@ -203,6 +246,19 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
203
246
|
this.revealing = false;
|
|
204
247
|
this.reveal();
|
|
205
248
|
}
|
|
249
|
+
const lost = this.hadFocus &&
|
|
250
|
+
!this.hasFocusedRow() &&
|
|
251
|
+
this.ownerDocument.activeElement === this.ownerDocument.body;
|
|
252
|
+
if (this.focusing || lost) {
|
|
253
|
+
this.focusing = false;
|
|
254
|
+
this.focusActive();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
focusActive() {
|
|
258
|
+
const row = this.partNamed('tree')?.querySelector(`[data-index="${this.cursor}"]`);
|
|
259
|
+
if (row && this.shadowRoot?.activeElement !== row) {
|
|
260
|
+
row.focus({ preventScroll: true });
|
|
261
|
+
}
|
|
206
262
|
}
|
|
207
263
|
load() {
|
|
208
264
|
const text = this.for === '' ? '' : (elementById(this, this.for)?.textContent ?? '');
|
|
@@ -215,7 +271,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
215
271
|
}
|
|
216
272
|
reveal(attempts = 8) {
|
|
217
273
|
const tree = this.partNamed('tree');
|
|
218
|
-
const row = tree?.querySelector(`[data-index="${this.
|
|
274
|
+
const row = tree?.querySelector(`[data-index="${this.cursor}"]`);
|
|
219
275
|
if (row) {
|
|
220
276
|
scrollItemIntoView(row);
|
|
221
277
|
return;
|
|
@@ -227,10 +283,13 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
227
283
|
return;
|
|
228
284
|
}
|
|
229
285
|
const height = first.offsetHeight || HelixHeadlessObjectInspector_1.ESTIMATE;
|
|
230
|
-
const from = Number(this.
|
|
231
|
-
tree.scrollTop += (this.
|
|
286
|
+
const from = Number(this.cursor > Number(last.dataset.index) ? last.dataset.index : first.dataset.index);
|
|
287
|
+
tree.scrollTop += (this.cursor - from) * height;
|
|
232
288
|
this.virtualize.measure();
|
|
233
|
-
void this.updateComplete.then(() =>
|
|
289
|
+
void this.updateComplete.then(() => {
|
|
290
|
+
this.reveal(attempts - 1);
|
|
291
|
+
this.focusActive();
|
|
292
|
+
});
|
|
234
293
|
}
|
|
235
294
|
copyable(row) {
|
|
236
295
|
if (!row) {
|
|
@@ -241,32 +300,68 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
241
300
|
}
|
|
242
301
|
return JSON.stringify(row.value, null, 2) ?? String(row.value);
|
|
243
302
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
303
|
+
requestOpen(paths, open) {
|
|
304
|
+
if (paths.length === 0) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
const applied = requestChange({
|
|
308
|
+
apply: () => {
|
|
309
|
+
const opened = new Set(this.opened);
|
|
310
|
+
for (const path of paths) {
|
|
311
|
+
if (open) {
|
|
312
|
+
opened.add(path);
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
opened.delete(path);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
this.opened = opened;
|
|
319
|
+
},
|
|
320
|
+
event: (next) => (next ? new HelixBeforeOpenEvent() : new HelixBeforeCloseEvent()),
|
|
321
|
+
host: this,
|
|
322
|
+
next: open,
|
|
323
|
+
});
|
|
324
|
+
if (applied) {
|
|
325
|
+
this.announceToggle(open);
|
|
248
326
|
}
|
|
249
|
-
|
|
250
|
-
|
|
327
|
+
return applied;
|
|
328
|
+
}
|
|
329
|
+
announceToggle(open) {
|
|
330
|
+
const states = { newState: open ? 'open' : 'closed', oldState: open ? 'closed' : 'open' };
|
|
331
|
+
if (typeof ToggleEvent === 'function') {
|
|
332
|
+
this.dispatchEvent(new ToggleEvent('toggle', states));
|
|
333
|
+
return;
|
|
251
334
|
}
|
|
252
|
-
|
|
335
|
+
const event = new Event('toggle', { bubbles: false, cancelable: false, composed: false });
|
|
336
|
+
Object.assign(event, states);
|
|
337
|
+
this.dispatchEvent(event);
|
|
253
338
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
this.active = Math.max(0, Math.min(to, last));
|
|
257
|
-
this.revealing = true;
|
|
339
|
+
toggle(row, open = !row.open) {
|
|
340
|
+
this.requestOpen([row.path], open);
|
|
258
341
|
}
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
342
|
+
move(to) {
|
|
343
|
+
const at = Math.max(0, Math.min(to, this.rows.length - 1));
|
|
344
|
+
const path = this.rows[at]?.path;
|
|
345
|
+
if (path === undefined) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
if (at !== this.cursor) {
|
|
349
|
+
const moved = requestChange({
|
|
350
|
+
apply: () => {
|
|
351
|
+
this.cursor = at;
|
|
352
|
+
},
|
|
353
|
+
event: (value) => new HelixBeforeActivateEvent({ value }),
|
|
354
|
+
host: this,
|
|
355
|
+
next: path,
|
|
356
|
+
});
|
|
357
|
+
if (!moved) {
|
|
358
|
+
return false;
|
|
267
359
|
}
|
|
360
|
+
this.dispatchEvent(new HelixActivateEvent({ value: path }));
|
|
268
361
|
}
|
|
269
|
-
this.
|
|
362
|
+
this.revealing = true;
|
|
363
|
+
this.focusing = true;
|
|
364
|
+
return true;
|
|
270
365
|
}
|
|
271
366
|
typeahead(letter) {
|
|
272
367
|
const now = Date.now();
|
|
@@ -275,7 +370,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
275
370
|
const wanted = text.toLocaleLowerCase();
|
|
276
371
|
const repeated = [...wanted].every((one) => one === wanted[0]);
|
|
277
372
|
const rows = this.rows;
|
|
278
|
-
const start = wanted.length === 1 || repeated ? this.
|
|
373
|
+
const start = wanted.length === 1 || repeated ? this.cursor + 1 : this.cursor;
|
|
279
374
|
for (let step = 0; step < rows.length; step += 1) {
|
|
280
375
|
const at = (start + step) % rows.length;
|
|
281
376
|
const key = rows[at]?.key?.toLocaleLowerCase();
|
|
@@ -286,8 +381,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
286
381
|
}
|
|
287
382
|
}
|
|
288
383
|
handleRowClick(index, row) {
|
|
289
|
-
this.
|
|
290
|
-
if (row.branch) {
|
|
384
|
+
if (this.move(index) && row.branch) {
|
|
291
385
|
this.toggle(row);
|
|
292
386
|
}
|
|
293
387
|
}
|
|
@@ -324,20 +418,20 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
324
418
|
return html `<span part="string" dir="ltr">${String(value)}</span>`;
|
|
325
419
|
}
|
|
326
420
|
renderRow(row, index) {
|
|
327
|
-
const active = index === this.
|
|
421
|
+
const active = index === this.cursor;
|
|
328
422
|
return html `<div
|
|
329
|
-
part="row${active ? ' row-active' : ''}"
|
|
330
|
-
role="
|
|
423
|
+
part="row${active ? ' row-active' : ''}${row.match ? ' row-match' : ''}"
|
|
424
|
+
role="row"
|
|
331
425
|
id=${`row-${index}`}
|
|
332
426
|
data-index=${index}
|
|
427
|
+
tabindex=${active ? '0' : '-1'}
|
|
333
428
|
aria-level=${row.depth + 1}
|
|
334
429
|
aria-posinset=${row.position}
|
|
335
430
|
aria-setsize=${row.siblings}
|
|
336
431
|
aria-expanded=${row.branch ? String(row.open) : nothing}
|
|
337
432
|
style=${`--object-inspector-level: ${row.depth}`}
|
|
338
433
|
@click=${() => this.handleRowClick(index, row)}
|
|
339
|
-
|
|
340
|
-
${row.branch
|
|
434
|
+
><div role="gridcell" style="display: contents">${row.branch
|
|
341
435
|
? html `<svg
|
|
342
436
|
part="toggle"
|
|
343
437
|
?data-mirror=${!row.open}
|
|
@@ -347,9 +441,13 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
347
441
|
>
|
|
348
442
|
${unsafeSVG((row.open ? caretDown : caretRight).content)}
|
|
349
443
|
</svg>`
|
|
350
|
-
: nothing}${row.key === undefined ? nothing : html `<span part="key">${row.key}</span>: `}${this.renderValue(row)}
|
|
444
|
+
: nothing}${row.key === undefined ? nothing : html `<span part="key">${row.key}</span>: `}${this.renderValue(row)}</div>
|
|
351
445
|
</div>`;
|
|
352
446
|
}
|
|
447
|
+
hasFocusedRow() {
|
|
448
|
+
const focused = this.shadowRoot?.activeElement;
|
|
449
|
+
return focused?.getAttribute?.('role') === 'row';
|
|
450
|
+
}
|
|
353
451
|
renderCopyButton(row) {
|
|
354
452
|
return staticHtml `<${this.tag('copy-button')}
|
|
355
453
|
part="copy"
|
|
@@ -364,30 +462,55 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
364
462
|
}
|
|
365
463
|
render() {
|
|
366
464
|
const rows = this.rows;
|
|
367
|
-
const {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
465
|
+
const { first, last } = this.windowed ? this.virtualize.window : { first: 0, last: rows.length };
|
|
466
|
+
const kept = this.windowed && (this.cursor < first || this.cursor >= last) && this.hasFocusedRow()
|
|
467
|
+
? this.cursor
|
|
468
|
+
: undefined;
|
|
469
|
+
const { after, before } = this.windowed
|
|
470
|
+
? this.virtualize.spacers(kept)
|
|
471
|
+
: { after: 0, before: 0 };
|
|
472
|
+
const shown = rows.slice(first, last).map((row, at) => [row, first + at]);
|
|
473
|
+
const keptRow = kept === undefined ? undefined : rows[kept];
|
|
474
|
+
if (kept !== undefined && keptRow) {
|
|
475
|
+
shown.splice(kept < first ? 0 : shown.length, 0, [keptRow, kept]);
|
|
476
|
+
}
|
|
477
|
+
return html `${this.label ? html `<div part="header"><span part="label">${this.label}</span></div>` : nothing}${this.filterable
|
|
478
|
+
? html `<input
|
|
479
|
+
part="search-field"
|
|
480
|
+
type="search"
|
|
481
|
+
spellcheck="false"
|
|
482
|
+
.value=${this.filter}
|
|
483
|
+
placeholder=${this.filterLabel}
|
|
484
|
+
aria-label=${this.filterLabel}
|
|
485
|
+
aria-controls="tree"
|
|
486
|
+
@input=${this.handleFilterInput}
|
|
487
|
+
@keydown=${this.handleFilterKeydown}
|
|
488
|
+
/>`
|
|
489
|
+
: nothing}
|
|
372
490
|
<div part="frame">
|
|
373
491
|
<div
|
|
374
492
|
part="tree"
|
|
375
|
-
|
|
376
|
-
|
|
493
|
+
id="tree"
|
|
494
|
+
role="treegrid"
|
|
377
495
|
?data-scroller=${this.windowed}
|
|
378
496
|
aria-label=${this.label || this.treeLabel}
|
|
379
|
-
aria-activedescendant=${rows.length > 0 ? `row-${this.active}` : nothing}
|
|
380
497
|
@keydown=${this.handleKeydown}
|
|
498
|
+
@focusin=${this.handleFocusIn}
|
|
499
|
+
@focusout=${this.handleFocusOut}
|
|
381
500
|
@scroll=${() => this.virtualize.measure()}
|
|
382
501
|
>
|
|
383
502
|
${this.windowed ? html `<div part="before" role="presentation" style="block-size: ${before}px"></div>` : nothing}
|
|
384
|
-
${shown.
|
|
503
|
+
${repeat(shown, ([row]) => row.path, ([row, at]) => this.renderRow(row, at))}
|
|
385
504
|
${this.windowed ? html `<div part="after" role="presentation" style="block-size: ${after}px"></div>` : nothing}
|
|
386
505
|
</div>
|
|
387
|
-
${this.noCopy ? nothing : this.renderCopyButton(rows[this.
|
|
388
|
-
</div
|
|
506
|
+
${this.noCopy ? nothing : this.renderCopyButton(rows[this.cursor])}
|
|
507
|
+
</div>
|
|
508
|
+
${drawStatus(this.status)}`;
|
|
389
509
|
}
|
|
390
510
|
};
|
|
511
|
+
__decorate([
|
|
512
|
+
property()
|
|
513
|
+
], HelixHeadlessObjectInspector.prototype, "active", null);
|
|
391
514
|
__decorate([
|
|
392
515
|
property({ attribute: 'copy-label' })
|
|
393
516
|
], HelixHeadlessObjectInspector.prototype, "copyLabel", void 0);
|
|
@@ -397,6 +520,18 @@ __decorate([
|
|
|
397
520
|
__decorate([
|
|
398
521
|
property({ attribute: 'default-depth', type: Number })
|
|
399
522
|
], HelixHeadlessObjectInspector.prototype, "defaultDepth", void 0);
|
|
523
|
+
__decorate([
|
|
524
|
+
property({ attribute: false })
|
|
525
|
+
], HelixHeadlessObjectInspector.prototype, "expanded", null);
|
|
526
|
+
__decorate([
|
|
527
|
+
property()
|
|
528
|
+
], HelixHeadlessObjectInspector.prototype, "filter", void 0);
|
|
529
|
+
__decorate([
|
|
530
|
+
property({ type: Boolean })
|
|
531
|
+
], HelixHeadlessObjectInspector.prototype, "filterable", void 0);
|
|
532
|
+
__decorate([
|
|
533
|
+
property({ attribute: 'filter-label' })
|
|
534
|
+
], HelixHeadlessObjectInspector.prototype, "filterLabel", void 0);
|
|
400
535
|
__decorate([
|
|
401
536
|
property()
|
|
402
537
|
], HelixHeadlessObjectInspector.prototype, "for", void 0);
|
|
@@ -418,6 +553,12 @@ __decorate([
|
|
|
418
553
|
__decorate([
|
|
419
554
|
property({ attribute: 'no-copy', type: Boolean })
|
|
420
555
|
], HelixHeadlessObjectInspector.prototype, "noCopy", void 0);
|
|
556
|
+
__decorate([
|
|
557
|
+
property({ attribute: 'result-label' })
|
|
558
|
+
], HelixHeadlessObjectInspector.prototype, "resultLabel", void 0);
|
|
559
|
+
__decorate([
|
|
560
|
+
property({ attribute: 'results-label' })
|
|
561
|
+
], HelixHeadlessObjectInspector.prototype, "resultsLabel", void 0);
|
|
421
562
|
__decorate([
|
|
422
563
|
property({ attribute: 'tree-label' })
|
|
423
564
|
], HelixHeadlessObjectInspector.prototype, "treeLabel", void 0);
|
|
@@ -435,7 +576,7 @@ __decorate([
|
|
|
435
576
|
], HelixHeadlessObjectInspector.prototype, "opened", void 0);
|
|
436
577
|
__decorate([
|
|
437
578
|
state()
|
|
438
|
-
], HelixHeadlessObjectInspector.prototype, "
|
|
579
|
+
], HelixHeadlessObjectInspector.prototype, "cursor", void 0);
|
|
439
580
|
HelixHeadlessObjectInspector = HelixHeadlessObjectInspector_1 = __decorate([
|
|
440
581
|
customElement('helix-headless-object-inspector')
|
|
441
582
|
], HelixHeadlessObjectInspector);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** One visible line of the tree: a value, where it sits, and whether it is open. */
|
|
2
|
+
export interface Row {
|
|
3
|
+
branch: boolean;
|
|
4
|
+
depth: number;
|
|
5
|
+
/** The property name or array index this value is under; absent for the root. */
|
|
6
|
+
key?: string;
|
|
7
|
+
/** Whether its key or its value holds what the tree is filtered by. */
|
|
8
|
+
match: boolean;
|
|
9
|
+
open: boolean;
|
|
10
|
+
path: string;
|
|
11
|
+
position: number;
|
|
12
|
+
siblings: number;
|
|
13
|
+
value: unknown;
|
|
14
|
+
}
|
|
15
|
+
/** Whether a value has entries of its own, an object or an array. */
|
|
16
|
+
export declare const branchy: (value: unknown) => value is object;
|
|
17
|
+
/** A branch's entries, an array's under its indexes. */
|
|
18
|
+
export declare const entries: (value: object) => [string, unknown][];
|
|
19
|
+
/** A child's path under its parent's, escaped the way a JSON Pointer escapes one. */
|
|
20
|
+
export declare const child: (path: string, key: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Every branch a path sits inside, from the root down, and not the path itself.
|
|
23
|
+
*
|
|
24
|
+
* The root's path is the empty string, so every other path has it first. A
|
|
25
|
+
* key's own `/` is escaped as `~1`, so cutting at each `/` cuts between keys.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ancestorsOf: (path: string) => string[];
|
|
28
|
+
/**
|
|
29
|
+
* The paths of every entry whose key or value holds `query`, ignoring case,
|
|
30
|
+
* across the whole value and not only the open branches.
|
|
31
|
+
*
|
|
32
|
+
* A branch is matched by its key alone: its brackets and its count are drawn,
|
|
33
|
+
* and they are not what a reader is looking for.
|
|
34
|
+
*/
|
|
35
|
+
export declare const search: (root: unknown, query: string) => Set<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Every visible row, in order, for a value with `opened` branches open.
|
|
38
|
+
*
|
|
39
|
+
* With `found`, the paths a filter matched, a branch shows only the entries
|
|
40
|
+
* that matched or lead to one, and a matched entry shows everything under it.
|
|
41
|
+
* Position and set size count the entries shown, which is the set a reader
|
|
42
|
+
* hears.
|
|
43
|
+
*/
|
|
44
|
+
export declare const flatten: (root: unknown, opened: Set<string>, found?: Set<string>) => Row[];
|
|
45
|
+
/**
|
|
46
|
+
* Which branches are open for a value, by path.
|
|
47
|
+
*
|
|
48
|
+
* Every branch shallower than `depth` opens. A branch in `known`, the
|
|
49
|
+
* branches of the last value, keeps whether it was in `opened`, so a new value
|
|
50
|
+
* keeps the branches a reader opened or closed and only a new one takes the
|
|
51
|
+
* default. Returns the open branches and every branch, for the next value to
|
|
52
|
+
* be told apart from this one.
|
|
53
|
+
*/
|
|
54
|
+
export declare const seed: (root: unknown, depth: number, known?: Set<string>, opened?: Set<string>) => {
|
|
55
|
+
branches: Set<string>;
|
|
56
|
+
opened: Set<string>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Where the active row goes once the rows have moved, as an index into `rows`.
|
|
60
|
+
*
|
|
61
|
+
* Onto `path` where it is still shown. Where a filter just hid it
|
|
62
|
+
* (`filtered`), onto the first match. Otherwise onto the nearest branch around
|
|
63
|
+
* it that is shown. With no path to keep, `cursor` held inside the rows.
|
|
64
|
+
*/
|
|
65
|
+
export declare const cursorFor: (rows: readonly Row[], path: string | undefined, cursor: number, filtered: boolean) => number;
|
|
66
|
+
/**
|
|
67
|
+
* The open branches with every branch around each of `paths` opened too,
|
|
68
|
+
* where the value has that branch (`branches`).
|
|
69
|
+
*/
|
|
70
|
+
export declare const withAncestors: (opened: ReadonlySet<string>, branches: ReadonlySet<string>, paths: Iterable<string>) => Set<string>;
|
|
71
|
+
/**
|
|
72
|
+
* The branches `*` opens from `row`: every branch at its depth under the same
|
|
73
|
+
* parent, itself included, that is not open yet.
|
|
74
|
+
*/
|
|
75
|
+
export declare const siblingBranches: (rows: readonly Row[], row: Row) => string[];
|