@wirekyt/angular 0.0.31 → 0.0.33

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.
Files changed (32) hide show
  1. package/dist/fesm2022/wirekyt-angular-field.mjs +1 -1
  2. package/dist/fesm2022/wirekyt-angular-field.mjs.map +1 -1
  3. package/dist/fesm2022/wirekyt-angular-image-cropper.mjs +336 -0
  4. package/dist/fesm2022/wirekyt-angular-image-cropper.mjs.map +1 -0
  5. package/dist/fesm2022/wirekyt-angular-json-tree-view.mjs +768 -0
  6. package/dist/fesm2022/wirekyt-angular-json-tree-view.mjs.map +1 -0
  7. package/dist/fesm2022/wirekyt-angular-menu.mjs +1041 -0
  8. package/dist/fesm2022/wirekyt-angular-menu.mjs.map +1 -0
  9. package/dist/fesm2022/wirekyt-angular-select.mjs +0 -38
  10. package/dist/fesm2022/wirekyt-angular-select.mjs.map +1 -1
  11. package/dist/fesm2022/wirekyt-angular-tooltip.mjs +0 -1
  12. package/dist/fesm2022/wirekyt-angular-tooltip.mjs.map +1 -1
  13. package/dist/fesm2022/wirekyt-angular-tree-view.mjs +858 -0
  14. package/dist/fesm2022/wirekyt-angular-tree-view.mjs.map +1 -0
  15. package/dist/package.json +17 -1
  16. package/dist/types/wirekyt-angular-checkbox.d.ts +1 -1
  17. package/dist/types/wirekyt-angular-color-picker.d.ts +1 -1
  18. package/dist/types/wirekyt-angular-combobox.d.ts +1 -1
  19. package/dist/types/wirekyt-angular-date-picker.d.ts +1 -1
  20. package/dist/types/wirekyt-angular-image-cropper.d.ts +122 -0
  21. package/dist/types/wirekyt-angular-image-cropper.d.ts.map +1 -0
  22. package/dist/types/wirekyt-angular-json-tree-view.d.ts +173 -0
  23. package/dist/types/wirekyt-angular-json-tree-view.d.ts.map +1 -0
  24. package/dist/types/wirekyt-angular-menu.d.ts +340 -0
  25. package/dist/types/wirekyt-angular-menu.d.ts.map +1 -0
  26. package/dist/types/wirekyt-angular-select.d.ts +0 -38
  27. package/dist/types/wirekyt-angular-select.d.ts.map +1 -1
  28. package/dist/types/wirekyt-angular-tooltip.d.ts +0 -1
  29. package/dist/types/wirekyt-angular-tooltip.d.ts.map +1 -1
  30. package/dist/types/wirekyt-angular-tree-view.d.ts +278 -0
  31. package/dist/types/wirekyt-angular-tree-view.d.ts.map +1 -0
  32. package/package.json +18 -2
@@ -0,0 +1,768 @@
1
+ import * as i1 from '@wirekyt/angular/tree-view';
2
+ import { useTreeView, createTreeCollection, TREE_VIEW_CONTEXT, injectTreeViewContext, TreeViewNodeProvider, TreeViewBranch, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchContent, TreeViewBranchIndentGuide, TreeViewItem, TreeViewItemText, TreeViewTree } from '@wirekyt/angular/tree-view';
3
+ export { createTreeCollection } from '@wirekyt/angular/tree-view';
4
+ import * as i0 from '@angular/core';
5
+ import { InjectionToken, inject, computed, booleanAttribute, input, model, output, DestroyRef, Renderer2, ElementRef, forwardRef, Directive, ChangeDetectionStrategy, Component } from '@angular/core';
6
+ import { getRootNode, nodeToString, nodeToValue, keyPathToKey, jsonNodeToElement, getAccessibleDescription } from '@wirekyt/dom/json-tree-utils';
7
+ import { bindProps } from '@wirekyt/angular';
8
+ import { NgTemplateOutlet } from '@angular/common';
9
+
10
+ const JSON_TREE_VIEW_CONTEXT = new InjectionToken("JSON_TREE_VIEW_CONTEXT");
11
+ function injectJsonTreeViewContext() {
12
+ return inject(JSON_TREE_VIEW_CONTEXT);
13
+ }
14
+ const JSON_TREE_VIEW_OPTIONS = new InjectionToken("JSON_TREE_VIEW_OPTIONS");
15
+ function injectJsonTreeViewOptions() {
16
+ return inject(JSON_TREE_VIEW_OPTIONS);
17
+ }
18
+
19
+ function getBranchValues(collection, depth) {
20
+ const values = [];
21
+ collection.visit({
22
+ onEnter: (node, indexPath) => {
23
+ if (indexPath.length === 0)
24
+ return;
25
+ if (collection.isBranchNode(node) && indexPath.length <= depth) {
26
+ values.push(collection.getNodeValue(node));
27
+ }
28
+ },
29
+ });
30
+ return values;
31
+ }
32
+
33
+ function useJsonTreeView(options) {
34
+ const jsonOptions = computed(() => pickJsonOptions(options.context()), /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "jsonOptions" }] : /* istanbul ignore next */ []));
36
+ const collection = computed(() => createJsonTreeCollection(options.context().data, jsonOptions()), /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "collection" }] : /* istanbul ignore next */ []));
38
+ const treeView = useTreeView({
39
+ context: () => {
40
+ const props = options.context();
41
+ const { data: _data, defaultExpandedDepth, maxPreviewItems: _maxPreviewItems, collapseStringsAfterLength: _collapseStringsAfterLength, quotesOnKeys: _quotesOnKeys, groupArraysAfterLength: _groupArraysAfterLength, showNonenumerable: _showNonenumerable, ...treeProps } = props;
42
+ const defaultExpandedValue = resolveDefaultExpandedValue(collection(), defaultExpandedDepth, treeProps.defaultExpandedValue);
43
+ return {
44
+ ...treeProps,
45
+ collection: collection(),
46
+ defaultExpandedValue,
47
+ typeahead: false,
48
+ };
49
+ },
50
+ });
51
+ return {
52
+ ...treeView,
53
+ options: jsonOptions,
54
+ };
55
+ }
56
+ function createJsonTreeCollection(data, options) {
57
+ return createTreeCollection({
58
+ nodeToValue,
59
+ nodeToString,
60
+ rootNode: getRootNode(data, options),
61
+ });
62
+ }
63
+ function resolveDefaultExpandedValue(collection, defaultExpandedDepth, defaultExpandedValue) {
64
+ if (defaultExpandedValue !== undefined)
65
+ return defaultExpandedValue;
66
+ if (defaultExpandedDepth == null)
67
+ return undefined;
68
+ return getBranchValues(collection, defaultExpandedDepth);
69
+ }
70
+ function pickJsonOptions(props) {
71
+ return {
72
+ maxPreviewItems: props.maxPreviewItems,
73
+ collapseStringsAfterLength: props.collapseStringsAfterLength,
74
+ quotesOnKeys: props.quotesOnKeys,
75
+ groupArraysAfterLength: props.groupArraysAfterLength,
76
+ showNonenumerable: props.showNonenumerable,
77
+ };
78
+ }
79
+
80
+ const optionalBooleanAttribute = (value) => value === undefined || value === null ? undefined : booleanAttribute(value);
81
+ class JsonTreeViewRoot {
82
+ data = input.required(/* @ts-ignore */
83
+ ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
84
+ id = input(undefined, /* @ts-ignore */
85
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
86
+ ids = input(undefined, /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "ids" }] : /* istanbul ignore next */ []));
88
+ defaultExpandedDepth = input(undefined, /* @ts-ignore */
89
+ ...(ngDevMode ? [{ debugName: "defaultExpandedDepth" }] : /* istanbul ignore next */ []));
90
+ expandedValue = model(undefined, /* @ts-ignore */
91
+ ...(ngDevMode ? [{ debugName: "expandedValue" }] : /* istanbul ignore next */ []));
92
+ defaultExpandedValue = input(undefined, /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "defaultExpandedValue" }] : /* istanbul ignore next */ []));
94
+ selectedValue = model(undefined, /* @ts-ignore */
95
+ ...(ngDevMode ? [{ debugName: "selectedValue" }] : /* istanbul ignore next */ []));
96
+ defaultSelectedValue = input(undefined, /* @ts-ignore */
97
+ ...(ngDevMode ? [{ debugName: "defaultSelectedValue" }] : /* istanbul ignore next */ []));
98
+ checkedValue = model(undefined, /* @ts-ignore */
99
+ ...(ngDevMode ? [{ debugName: "checkedValue" }] : /* istanbul ignore next */ []));
100
+ defaultCheckedValue = input(undefined, /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "defaultCheckedValue" }] : /* istanbul ignore next */ []));
102
+ focusedValue = model(undefined, /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
104
+ defaultFocusedValue = input(undefined, /* @ts-ignore */
105
+ ...(ngDevMode ? [{ debugName: "defaultFocusedValue" }] : /* istanbul ignore next */ []));
106
+ expandOnClick = input(undefined, { ...(ngDevMode ? { debugName: "expandOnClick" } : /* istanbul ignore next */ {}), transform: optionalBooleanAttribute });
107
+ lazyMount = input(false, { ...(ngDevMode ? { debugName: "lazyMount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
108
+ unmountOnExit = input(false, { ...(ngDevMode ? { debugName: "unmountOnExit" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
109
+ selectionMode = input(undefined, /* @ts-ignore */
110
+ ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
111
+ translations = input(undefined, /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []));
113
+ loadChildren = input(undefined, /* @ts-ignore */
114
+ ...(ngDevMode ? [{ debugName: "loadChildren" }] : /* istanbul ignore next */ []));
115
+ canRename = input(undefined, /* @ts-ignore */
116
+ ...(ngDevMode ? [{ debugName: "canRename" }] : /* istanbul ignore next */ []));
117
+ scrollToIndexFn = input(undefined, /* @ts-ignore */
118
+ ...(ngDevMode ? [{ debugName: "scrollToIndexFn" }] : /* istanbul ignore next */ []));
119
+ maxPreviewItems = input(undefined, /* @ts-ignore */
120
+ ...(ngDevMode ? [{ debugName: "maxPreviewItems" }] : /* istanbul ignore next */ []));
121
+ collapseStringsAfterLength = input(undefined, /* @ts-ignore */
122
+ ...(ngDevMode ? [{ debugName: "collapseStringsAfterLength" }] : /* istanbul ignore next */ []));
123
+ quotesOnKeys = input(undefined, { ...(ngDevMode ? { debugName: "quotesOnKeys" } : /* istanbul ignore next */ {}), transform: optionalBooleanAttribute });
124
+ groupArraysAfterLength = input(undefined, /* @ts-ignore */
125
+ ...(ngDevMode ? [{ debugName: "groupArraysAfterLength" }] : /* istanbul ignore next */ []));
126
+ showNonenumerable = input(undefined, { ...(ngDevMode ? { debugName: "showNonenumerable" } : /* istanbul ignore next */ {}), transform: optionalBooleanAttribute });
127
+ expandedChange = output();
128
+ selectionChange = output();
129
+ checkedChange = output();
130
+ focusChange = output();
131
+ loadChildrenComplete = output();
132
+ loadChildrenError = output();
133
+ renameStart = output();
134
+ beforeRename = output();
135
+ renameComplete = output();
136
+ jsonTreeView = useJsonTreeView({
137
+ context: () => ({
138
+ id: this.id(),
139
+ ids: this.ids(),
140
+ data: this.readData(),
141
+ defaultExpandedDepth: this.defaultExpandedDepth(),
142
+ expandedValue: this.expandedValue(),
143
+ defaultExpandedValue: this.defaultExpandedValue(),
144
+ selectedValue: this.selectedValue(),
145
+ defaultSelectedValue: this.defaultSelectedValue(),
146
+ checkedValue: this.checkedValue(),
147
+ defaultCheckedValue: this.defaultCheckedValue(),
148
+ focusedValue: this.focusedValue(),
149
+ defaultFocusedValue: this.defaultFocusedValue(),
150
+ expandOnClick: this.expandOnClick(),
151
+ selectionMode: this.selectionMode(),
152
+ translations: this.translations(),
153
+ loadChildren: this.loadChildren(),
154
+ canRename: this.canRename(),
155
+ scrollToIndexFn: this.scrollToIndexFn(),
156
+ maxPreviewItems: this.maxPreviewItems(),
157
+ collapseStringsAfterLength: this.collapseStringsAfterLength(),
158
+ quotesOnKeys: this.quotesOnKeys(),
159
+ groupArraysAfterLength: this.groupArraysAfterLength(),
160
+ showNonenumerable: this.showNonenumerable(),
161
+ onExpandedChange: (details) => {
162
+ if (!arraysShallowEqual(this.expandedValue(), details.expandedValue)) {
163
+ this.expandedValue.set([...details.expandedValue]);
164
+ }
165
+ this.expandedChange.emit(details);
166
+ },
167
+ onSelectionChange: (details) => {
168
+ if (!arraysShallowEqual(this.selectedValue(), details.selectedValue)) {
169
+ this.selectedValue.set([...details.selectedValue]);
170
+ }
171
+ this.selectionChange.emit(details);
172
+ },
173
+ onCheckedChange: (details) => {
174
+ if (!arraysShallowEqual(this.checkedValue(), details.checkedValue)) {
175
+ this.checkedValue.set([...details.checkedValue]);
176
+ }
177
+ this.checkedChange.emit(details);
178
+ },
179
+ onFocusChange: (details) => {
180
+ if (this.focusedValue() !== details.focusedValue) {
181
+ this.focusedValue.set(details.focusedValue);
182
+ }
183
+ this.focusChange.emit(details);
184
+ },
185
+ onLoadChildrenComplete: (details) => {
186
+ this.loadChildrenComplete.emit(details);
187
+ },
188
+ onLoadChildrenError: (details) => {
189
+ this.loadChildrenError.emit(details);
190
+ },
191
+ onRenameStart: (details) => {
192
+ this.renameStart.emit(details);
193
+ },
194
+ onBeforeRename: (details) => {
195
+ this.beforeRename.emit(details);
196
+ const renameDetails = details;
197
+ return this.canRename()?.(renameDetails.node, renameDetails.indexPath) ?? true;
198
+ },
199
+ onRenameComplete: (details) => {
200
+ this.renameComplete.emit(details);
201
+ },
202
+ }),
203
+ });
204
+ state = this.jsonTreeView.state;
205
+ api = this.jsonTreeView.api;
206
+ service = this.jsonTreeView.service;
207
+ send = this.jsonTreeView.send;
208
+ options = this.jsonTreeView.options;
209
+ constructor() {
210
+ bindProps({
211
+ elementRef: inject(ElementRef),
212
+ renderer: inject(Renderer2),
213
+ destroyRef: inject(DestroyRef),
214
+ props: () => ({ ...this.api().getRootProps(), "data-scope": "json-tree-view" }),
215
+ });
216
+ }
217
+ readData() {
218
+ try {
219
+ return this.data();
220
+ }
221
+ catch {
222
+ return undefined;
223
+ }
224
+ }
225
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive });
226
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: JsonTreeViewRoot, isStandalone: true, selector: "[json-tree-view-root]", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ids: { classPropertyName: "ids", publicName: "ids", isSignal: true, isRequired: false, transformFunction: null }, defaultExpandedDepth: { classPropertyName: "defaultExpandedDepth", publicName: "defaultExpandedDepth", isSignal: true, isRequired: false, transformFunction: null }, expandedValue: { classPropertyName: "expandedValue", publicName: "expandedValue", isSignal: true, isRequired: false, transformFunction: null }, defaultExpandedValue: { classPropertyName: "defaultExpandedValue", publicName: "defaultExpandedValue", isSignal: true, isRequired: false, transformFunction: null }, selectedValue: { classPropertyName: "selectedValue", publicName: "selectedValue", isSignal: true, isRequired: false, transformFunction: null }, defaultSelectedValue: { classPropertyName: "defaultSelectedValue", publicName: "defaultSelectedValue", isSignal: true, isRequired: false, transformFunction: null }, checkedValue: { classPropertyName: "checkedValue", publicName: "checkedValue", isSignal: true, isRequired: false, transformFunction: null }, defaultCheckedValue: { classPropertyName: "defaultCheckedValue", publicName: "defaultCheckedValue", isSignal: true, isRequired: false, transformFunction: null }, focusedValue: { classPropertyName: "focusedValue", publicName: "focusedValue", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedValue: { classPropertyName: "defaultFocusedValue", publicName: "defaultFocusedValue", isSignal: true, isRequired: false, transformFunction: null }, expandOnClick: { classPropertyName: "expandOnClick", publicName: "expandOnClick", isSignal: true, isRequired: false, transformFunction: null }, lazyMount: { classPropertyName: "lazyMount", publicName: "lazyMount", isSignal: true, isRequired: false, transformFunction: null }, unmountOnExit: { classPropertyName: "unmountOnExit", publicName: "unmountOnExit", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, translations: { classPropertyName: "translations", publicName: "translations", isSignal: true, isRequired: false, transformFunction: null }, loadChildren: { classPropertyName: "loadChildren", publicName: "loadChildren", isSignal: true, isRequired: false, transformFunction: null }, canRename: { classPropertyName: "canRename", publicName: "canRename", isSignal: true, isRequired: false, transformFunction: null }, scrollToIndexFn: { classPropertyName: "scrollToIndexFn", publicName: "scrollToIndexFn", isSignal: true, isRequired: false, transformFunction: null }, maxPreviewItems: { classPropertyName: "maxPreviewItems", publicName: "maxPreviewItems", isSignal: true, isRequired: false, transformFunction: null }, collapseStringsAfterLength: { classPropertyName: "collapseStringsAfterLength", publicName: "collapseStringsAfterLength", isSignal: true, isRequired: false, transformFunction: null }, quotesOnKeys: { classPropertyName: "quotesOnKeys", publicName: "quotesOnKeys", isSignal: true, isRequired: false, transformFunction: null }, groupArraysAfterLength: { classPropertyName: "groupArraysAfterLength", publicName: "groupArraysAfterLength", isSignal: true, isRequired: false, transformFunction: null }, showNonenumerable: { classPropertyName: "showNonenumerable", publicName: "showNonenumerable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedValue: "expandedValueChange", selectedValue: "selectedValueChange", checkedValue: "checkedValueChange", focusedValue: "focusedValueChange", expandedChange: "expandedChange", selectionChange: "selectionChange", checkedChange: "checkedChange", focusChange: "focusChange", loadChildrenComplete: "loadChildrenComplete", loadChildrenError: "loadChildrenError", renameStart: "renameStart", beforeRename: "beforeRename", renameComplete: "renameComplete" }, providers: [
227
+ { provide: JSON_TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRoot) },
228
+ { provide: TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRoot) },
229
+ {
230
+ provide: JSON_TREE_VIEW_OPTIONS,
231
+ useFactory: (root) => root.options,
232
+ deps: [forwardRef(() => JsonTreeViewRoot)],
233
+ },
234
+ ], exportAs: ["jsonTreeViewRoot"], ngImport: i0 });
235
+ }
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewRoot, decorators: [{
237
+ type: Directive,
238
+ args: [{
239
+ selector: "[json-tree-view-root]",
240
+ standalone: true,
241
+ exportAs: "jsonTreeViewRoot",
242
+ providers: [
243
+ { provide: JSON_TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRoot) },
244
+ { provide: TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRoot) },
245
+ {
246
+ provide: JSON_TREE_VIEW_OPTIONS,
247
+ useFactory: (root) => root.options,
248
+ deps: [forwardRef(() => JsonTreeViewRoot)],
249
+ },
250
+ ],
251
+ }]
252
+ }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ids: [{ type: i0.Input, args: [{ isSignal: true, alias: "ids", required: false }] }], defaultExpandedDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultExpandedDepth", required: false }] }], expandedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedValue", required: false }] }, { type: i0.Output, args: ["expandedValueChange"] }], defaultExpandedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultExpandedValue", required: false }] }], selectedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValue", required: false }] }, { type: i0.Output, args: ["selectedValueChange"] }], defaultSelectedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSelectedValue", required: false }] }], checkedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkedValue", required: false }] }, { type: i0.Output, args: ["checkedValueChange"] }], defaultCheckedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCheckedValue", required: false }] }], focusedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusedValue", required: false }] }, { type: i0.Output, args: ["focusedValueChange"] }], defaultFocusedValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultFocusedValue", required: false }] }], expandOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandOnClick", required: false }] }], lazyMount: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyMount", required: false }] }], unmountOnExit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmountOnExit", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], translations: [{ type: i0.Input, args: [{ isSignal: true, alias: "translations", required: false }] }], loadChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadChildren", required: false }] }], canRename: [{ type: i0.Input, args: [{ isSignal: true, alias: "canRename", required: false }] }], scrollToIndexFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollToIndexFn", required: false }] }], maxPreviewItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxPreviewItems", required: false }] }], collapseStringsAfterLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseStringsAfterLength", required: false }] }], quotesOnKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "quotesOnKeys", required: false }] }], groupArraysAfterLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupArraysAfterLength", required: false }] }], showNonenumerable: [{ type: i0.Input, args: [{ isSignal: true, alias: "showNonenumerable", required: false }] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], focusChange: [{ type: i0.Output, args: ["focusChange"] }], loadChildrenComplete: [{ type: i0.Output, args: ["loadChildrenComplete"] }], loadChildrenError: [{ type: i0.Output, args: ["loadChildrenError"] }], renameStart: [{ type: i0.Output, args: ["renameStart"] }], beforeRename: [{ type: i0.Output, args: ["beforeRename"] }], renameComplete: [{ type: i0.Output, args: ["renameComplete"] }] } });
253
+ function arraysShallowEqual(a, b) {
254
+ if (a === b)
255
+ return true;
256
+ if (!a || !b || a.length !== b.length)
257
+ return false;
258
+ return a.every((value, index) => value === b[index]);
259
+ }
260
+
261
+ class JsonTreeViewRootProvider {
262
+ value = input.required(/* @ts-ignore */
263
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
264
+ lazyMount = input(false, { ...(ngDevMode ? { debugName: "lazyMount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
265
+ unmountOnExit = input(false, { ...(ngDevMode ? { debugName: "unmountOnExit" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
266
+ state = computed(() => this.value().state(), /* @ts-ignore */
267
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
268
+ api = computed(() => this.value().api(), /* @ts-ignore */
269
+ ...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
270
+ options = computed(() => this.value().options(), /* @ts-ignore */
271
+ ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
272
+ send = (event) => this.value().send(event);
273
+ get service() {
274
+ return this.value().service;
275
+ }
276
+ constructor() {
277
+ bindProps({
278
+ elementRef: inject(ElementRef),
279
+ renderer: inject(Renderer2),
280
+ destroyRef: inject(DestroyRef),
281
+ props: () => ({ ...this.api().getRootProps(), "data-scope": "json-tree-view" }),
282
+ });
283
+ }
284
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewRootProvider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
285
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: JsonTreeViewRootProvider, isStandalone: true, selector: "[json-tree-view-root-provider]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, lazyMount: { classPropertyName: "lazyMount", publicName: "lazyMount", isSignal: true, isRequired: false, transformFunction: null }, unmountOnExit: { classPropertyName: "unmountOnExit", publicName: "unmountOnExit", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
286
+ { provide: JSON_TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRootProvider) },
287
+ { provide: TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRootProvider) },
288
+ {
289
+ provide: JSON_TREE_VIEW_OPTIONS,
290
+ useFactory: (provider) => provider.options,
291
+ deps: [forwardRef(() => JsonTreeViewRootProvider)],
292
+ },
293
+ ], exportAs: ["jsonTreeViewRootProvider"], ngImport: i0 });
294
+ }
295
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewRootProvider, decorators: [{
296
+ type: Directive,
297
+ args: [{
298
+ selector: "[json-tree-view-root-provider]",
299
+ standalone: true,
300
+ exportAs: "jsonTreeViewRootProvider",
301
+ providers: [
302
+ { provide: JSON_TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRootProvider) },
303
+ { provide: TREE_VIEW_CONTEXT, useExisting: forwardRef(() => JsonTreeViewRootProvider) },
304
+ {
305
+ provide: JSON_TREE_VIEW_OPTIONS,
306
+ useFactory: (provider) => provider.options,
307
+ deps: [forwardRef(() => JsonTreeViewRootProvider)],
308
+ },
309
+ ],
310
+ }]
311
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], lazyMount: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazyMount", required: false }] }], unmountOnExit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmountOnExit", required: false }] }] } });
312
+
313
+ class JsonTreeViewKeyNode {
314
+ node = input.required(/* @ts-ignore */
315
+ ...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
316
+ options = injectJsonTreeViewOptions();
317
+ displayKey = computed(() => {
318
+ const key = keyPathToKey(this.node().keyPath);
319
+ return this.options().quotesOnKeys ? `"${key}"` : key;
320
+ }, /* @ts-ignore */
321
+ ...(ngDevMode ? [{ debugName: "displayKey" }] : /* istanbul ignore next */ []));
322
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewKeyNode, deps: [], target: i0.ɵɵFactoryTarget.Component });
323
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: JsonTreeViewKeyNode, isStandalone: true, selector: "json-tree-view-key-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
324
+ <span data-kind="key" [attr.data-non-enumerable]="node().isNonEnumerable ? '' : null">{{
325
+ displayKey()
326
+ }}</span>
327
+ <span data-kind="colon">:</span>
328
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
329
+ }
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewKeyNode, decorators: [{
331
+ type: Component,
332
+ args: [{
333
+ selector: "json-tree-view-key-node",
334
+ standalone: true,
335
+ changeDetection: ChangeDetectionStrategy.OnPush,
336
+ template: `
337
+ <span data-kind="key" [attr.data-non-enumerable]="node().isNonEnumerable ? '' : null">{{
338
+ displayKey()
339
+ }}</span>
340
+ <span data-kind="colon">:</span>
341
+ `,
342
+ }]
343
+ }], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }] } });
344
+
345
+ class JsonTreeViewValueNode {
346
+ node = input.required(/* @ts-ignore */
347
+ ...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
348
+ renderValue = input(null, /* @ts-ignore */
349
+ ...(ngDevMode ? [{ debugName: "renderValue" }] : /* istanbul ignore next */ []));
350
+ isText(node) {
351
+ return node.type === "text";
352
+ }
353
+ element(node) {
354
+ return node;
355
+ }
356
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewValueNode, deps: [], target: i0.ɵɵFactoryTarget.Component });
357
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: JsonTreeViewValueNode, isStandalone: true, selector: "json-tree-view-value-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, renderValue: { classPropertyName: "renderValue", publicName: "renderValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
358
+ <ng-container *ngTemplateOutlet="renderNode; context: { $implicit: node() }" />
359
+
360
+ <ng-template #renderNode let-current>
361
+ @if (isText(current)) {
362
+ @if (renderValue(); as template) {
363
+ <ng-container
364
+ *ngTemplateOutlet="
365
+ template;
366
+ context: { $implicit: current, node: current, text: current }
367
+ "
368
+ />
369
+ } @else {
370
+ {{ current.value }}
371
+ }
372
+ } @else {
373
+ @switch (current.tagName) {
374
+ @case ("a") {
375
+ <a
376
+ [attr.href]="element(current).properties['href'] ?? null"
377
+ [attr.target]="element(current).properties['target'] ?? null"
378
+ [attr.rel]="element(current).properties['rel'] ?? null"
379
+ [attr.data-root]="element(current).properties.root ? '' : null"
380
+ [attr.data-type]="element(current).properties.nodeType ?? null"
381
+ [attr.data-kind]="element(current).properties.kind ?? null"
382
+ >
383
+ <ng-container
384
+ *ngTemplateOutlet="children; context: { $implicit: element(current) }"
385
+ />
386
+ </a>
387
+ }
388
+ @case ("div") {
389
+ <div
390
+ [attr.data-root]="element(current).properties.root ? '' : null"
391
+ [attr.data-type]="element(current).properties.nodeType ?? null"
392
+ [attr.data-kind]="element(current).properties.kind ?? null"
393
+ >
394
+ <ng-container
395
+ *ngTemplateOutlet="children; context: { $implicit: element(current) }"
396
+ />
397
+ </div>
398
+ }
399
+ @default {
400
+ <span
401
+ [attr.data-root]="element(current).properties.root ? '' : null"
402
+ [attr.data-type]="element(current).properties.nodeType ?? null"
403
+ [attr.data-kind]="element(current).properties.kind ?? null"
404
+ >
405
+ <ng-container
406
+ *ngTemplateOutlet="children; context: { $implicit: element(current) }"
407
+ />
408
+ </span>
409
+ }
410
+ }
411
+ }
412
+ </ng-template>
413
+
414
+ <ng-template #children let-current>
415
+ @for (child of current.children; track $index) {
416
+ <ng-container *ngTemplateOutlet="renderNode; context: { $implicit: child }" />
417
+ }
418
+ </ng-template>
419
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
420
+ }
421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewValueNode, decorators: [{
422
+ type: Component,
423
+ args: [{
424
+ selector: "json-tree-view-value-node",
425
+ standalone: true,
426
+ changeDetection: ChangeDetectionStrategy.OnPush,
427
+ imports: [NgTemplateOutlet],
428
+ template: `
429
+ <ng-container *ngTemplateOutlet="renderNode; context: { $implicit: node() }" />
430
+
431
+ <ng-template #renderNode let-current>
432
+ @if (isText(current)) {
433
+ @if (renderValue(); as template) {
434
+ <ng-container
435
+ *ngTemplateOutlet="
436
+ template;
437
+ context: { $implicit: current, node: current, text: current }
438
+ "
439
+ />
440
+ } @else {
441
+ {{ current.value }}
442
+ }
443
+ } @else {
444
+ @switch (current.tagName) {
445
+ @case ("a") {
446
+ <a
447
+ [attr.href]="element(current).properties['href'] ?? null"
448
+ [attr.target]="element(current).properties['target'] ?? null"
449
+ [attr.rel]="element(current).properties['rel'] ?? null"
450
+ [attr.data-root]="element(current).properties.root ? '' : null"
451
+ [attr.data-type]="element(current).properties.nodeType ?? null"
452
+ [attr.data-kind]="element(current).properties.kind ?? null"
453
+ >
454
+ <ng-container
455
+ *ngTemplateOutlet="children; context: { $implicit: element(current) }"
456
+ />
457
+ </a>
458
+ }
459
+ @case ("div") {
460
+ <div
461
+ [attr.data-root]="element(current).properties.root ? '' : null"
462
+ [attr.data-type]="element(current).properties.nodeType ?? null"
463
+ [attr.data-kind]="element(current).properties.kind ?? null"
464
+ >
465
+ <ng-container
466
+ *ngTemplateOutlet="children; context: { $implicit: element(current) }"
467
+ />
468
+ </div>
469
+ }
470
+ @default {
471
+ <span
472
+ [attr.data-root]="element(current).properties.root ? '' : null"
473
+ [attr.data-type]="element(current).properties.nodeType ?? null"
474
+ [attr.data-kind]="element(current).properties.kind ?? null"
475
+ >
476
+ <ng-container
477
+ *ngTemplateOutlet="children; context: { $implicit: element(current) }"
478
+ />
479
+ </span>
480
+ }
481
+ }
482
+ }
483
+ </ng-template>
484
+
485
+ <ng-template #children let-current>
486
+ @for (child of current.children; track $index) {
487
+ <ng-container *ngTemplateOutlet="renderNode; context: { $implicit: child }" />
488
+ }
489
+ </ng-template>
490
+ `,
491
+ }]
492
+ }], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }], renderValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderValue", required: false }] }] } });
493
+
494
+ class JsonTreeViewNode {
495
+ /** The node to render. */
496
+ node = input.required(/* @ts-ignore */
497
+ ...(ngDevMode ? [{ debugName: "node" }] : /* istanbul ignore next */ []));
498
+ /** The index path of the node. */
499
+ indexPath = input.required(/* @ts-ignore */
500
+ ...(ngDevMode ? [{ debugName: "indexPath" }] : /* istanbul ignore next */ []));
501
+ /** Template for the branch arrow. */
502
+ arrow = input(null, /* @ts-ignore */
503
+ ...(ngDevMode ? [{ debugName: "arrow" }] : /* istanbul ignore next */ []));
504
+ /** Whether to render branch indent guides. */
505
+ indentGuide = input(false, /* @ts-ignore */
506
+ ...(ngDevMode ? [{ debugName: "indentGuide" }] : /* istanbul ignore next */ []));
507
+ /** Template used to render text value nodes. */
508
+ renderValue = input(null, /* @ts-ignore */
509
+ ...(ngDevMode ? [{ debugName: "renderValue" }] : /* istanbul ignore next */ []));
510
+ treeView = injectTreeViewContext();
511
+ options = injectJsonTreeViewOptions();
512
+ valueNode(node) {
513
+ return jsonNodeToElement(node, this.options());
514
+ }
515
+ isBranch(node, indexPath) {
516
+ return this.treeView.api().getNodeState({ node, indexPath }).isBranch;
517
+ }
518
+ children(node) {
519
+ return node.children ?? [];
520
+ }
521
+ indentGuideTemplate() {
522
+ const indentGuide = this.indentGuide();
523
+ return typeof indentGuide === "boolean" ? null : indentGuide;
524
+ }
525
+ key(node) {
526
+ return keyPathToKey(node.keyPath, { excludeRoot: true });
527
+ }
528
+ description(node) {
529
+ return getAccessibleDescription(node);
530
+ }
531
+ line(indexPath) {
532
+ return indexPath.reduce((acc, current) => acc + current, 1);
533
+ }
534
+ lineLength(indexPath) {
535
+ return indexPath.length - 1;
536
+ }
537
+ childIndexPath(indexPath, index) {
538
+ return [...indexPath, index];
539
+ }
540
+ trackNode(index, node) {
541
+ return `${index}:${node.keyPath.join(".")}`;
542
+ }
543
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewNode, deps: [], target: i0.ɵɵFactoryTarget.Component });
544
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: JsonTreeViewNode, isStandalone: true, selector: "json-tree-view-node", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, indexPath: { classPropertyName: "indexPath", publicName: "indexPath", isSignal: true, isRequired: true, transformFunction: null }, arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, indentGuide: { classPropertyName: "indentGuide", publicName: "indentGuide", isSignal: true, isRequired: false, transformFunction: null }, renderValue: { classPropertyName: "renderValue", publicName: "renderValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
545
+ <ng-container
546
+ *ngTemplateOutlet="renderNode; context: { $implicit: node(), indexPath: indexPath() }"
547
+ />
548
+
549
+ <ng-template #renderNode let-current let-currentIndexPath="indexPath">
550
+ <ng-container tree-view-node-provider [node]="current" [indexPath]="currentIndexPath">
551
+ @if (isBranch(current, currentIndexPath)) {
552
+ <div tree-view-branch data-scope="json-tree-view">
553
+ <div
554
+ tree-view-branch-control
555
+ data-scope="json-tree-view"
556
+ [attr.aria-label]="description(current)"
557
+ [attr.data-line]="line(currentIndexPath)"
558
+ [style.--line-length]="lineLength(currentIndexPath)"
559
+ >
560
+ @if (arrow(); as arrowTemplate) {
561
+ <span tree-view-branch-indicator data-scope="json-tree-view">
562
+ <ng-container *ngTemplateOutlet="arrowTemplate" />
563
+ </span>
564
+ }
565
+ <span tree-view-branch-text data-scope="json-tree-view">
566
+ @if (key(current)) {
567
+ <json-tree-view-key-node [node]="current" />
568
+ }
569
+ <json-tree-view-value-node
570
+ [node]="valueNode(current)"
571
+ [renderValue]="renderValue()"
572
+ />
573
+ </span>
574
+ </div>
575
+ <div *tree-view-branch-content data-scope="json-tree-view">
576
+ @if (indentGuideTemplate(); as indentGuideTemplate) {
577
+ <ng-container *ngTemplateOutlet="indentGuideTemplate" />
578
+ } @else if (indentGuide() === true) {
579
+ <span tree-view-branch-indent-guide></span>
580
+ }
581
+ @for (child of children(current); track trackNode($index, child)) {
582
+ <ng-container
583
+ *ngTemplateOutlet="
584
+ renderNode;
585
+ context: {
586
+ $implicit: child,
587
+ indexPath: childIndexPath(currentIndexPath, $index),
588
+ }
589
+ "
590
+ />
591
+ }
592
+ </div>
593
+ </div>
594
+ } @else {
595
+ <div
596
+ tree-view-item
597
+ data-scope="json-tree-view"
598
+ [attr.aria-label]="description(current)"
599
+ [attr.data-line]="line(currentIndexPath)"
600
+ [style.--line-length]="lineLength(currentIndexPath)"
601
+ >
602
+ <span tree-view-item-text data-scope="json-tree-view">
603
+ @if (key(current)) {
604
+ <json-tree-view-key-node [node]="current" />
605
+ }
606
+ <json-tree-view-value-node
607
+ [node]="valueNode(current)"
608
+ [renderValue]="renderValue()"
609
+ />
610
+ </span>
611
+ </div>
612
+ }
613
+ </ng-container>
614
+ </ng-template>
615
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TreeViewNodeProvider, selector: "[tree-view-node-provider]", inputs: ["node", "indexPath"], exportAs: ["treeViewNodeProvider"] }, { kind: "directive", type: TreeViewBranch, selector: "[tree-view-branch]", inputs: ["node", "indexPath"], exportAs: ["treeViewBranch"] }, { kind: "directive", type: TreeViewBranchControl, selector: "[tree-view-branch-control]", inputs: ["node", "indexPath"], exportAs: ["treeViewBranchControl"] }, { kind: "directive", type: TreeViewBranchIndicator, selector: "[tree-view-branch-indicator]", inputs: ["node", "indexPath"], exportAs: ["treeViewBranchIndicator"] }, { kind: "directive", type: TreeViewBranchText, selector: "[tree-view-branch-text]", inputs: ["node", "indexPath"], exportAs: ["treeViewBranchText"] }, { kind: "directive", type: TreeViewBranchContent, selector: "[tree-view-branch-content]", inputs: ["node", "indexPath"], exportAs: ["treeViewBranchContent"] }, { kind: "directive", type: TreeViewBranchIndentGuide, selector: "[tree-view-branch-indent-guide]", inputs: ["node", "indexPath"], exportAs: ["treeViewBranchIndentGuide"] }, { kind: "directive", type: TreeViewItem, selector: "[tree-view-item]", inputs: ["node", "indexPath"], exportAs: ["treeViewItem"] }, { kind: "directive", type: TreeViewItemText, selector: "[tree-view-item-text]", inputs: ["node", "indexPath"], exportAs: ["treeViewItemText"] }, { kind: "component", type: JsonTreeViewKeyNode, selector: "json-tree-view-key-node", inputs: ["node"] }, { kind: "component", type: JsonTreeViewValueNode, selector: "json-tree-view-value-node", inputs: ["node", "renderValue"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
616
+ }
617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewNode, decorators: [{
618
+ type: Component,
619
+ args: [{
620
+ selector: "json-tree-view-node",
621
+ standalone: true,
622
+ changeDetection: ChangeDetectionStrategy.OnPush,
623
+ imports: [
624
+ NgTemplateOutlet,
625
+ TreeViewNodeProvider,
626
+ TreeViewBranch,
627
+ TreeViewBranchControl,
628
+ TreeViewBranchIndicator,
629
+ TreeViewBranchText,
630
+ TreeViewBranchContent,
631
+ TreeViewBranchIndentGuide,
632
+ TreeViewItem,
633
+ TreeViewItemText,
634
+ JsonTreeViewKeyNode,
635
+ JsonTreeViewValueNode,
636
+ ],
637
+ template: `
638
+ <ng-container
639
+ *ngTemplateOutlet="renderNode; context: { $implicit: node(), indexPath: indexPath() }"
640
+ />
641
+
642
+ <ng-template #renderNode let-current let-currentIndexPath="indexPath">
643
+ <ng-container tree-view-node-provider [node]="current" [indexPath]="currentIndexPath">
644
+ @if (isBranch(current, currentIndexPath)) {
645
+ <div tree-view-branch data-scope="json-tree-view">
646
+ <div
647
+ tree-view-branch-control
648
+ data-scope="json-tree-view"
649
+ [attr.aria-label]="description(current)"
650
+ [attr.data-line]="line(currentIndexPath)"
651
+ [style.--line-length]="lineLength(currentIndexPath)"
652
+ >
653
+ @if (arrow(); as arrowTemplate) {
654
+ <span tree-view-branch-indicator data-scope="json-tree-view">
655
+ <ng-container *ngTemplateOutlet="arrowTemplate" />
656
+ </span>
657
+ }
658
+ <span tree-view-branch-text data-scope="json-tree-view">
659
+ @if (key(current)) {
660
+ <json-tree-view-key-node [node]="current" />
661
+ }
662
+ <json-tree-view-value-node
663
+ [node]="valueNode(current)"
664
+ [renderValue]="renderValue()"
665
+ />
666
+ </span>
667
+ </div>
668
+ <div *tree-view-branch-content data-scope="json-tree-view">
669
+ @if (indentGuideTemplate(); as indentGuideTemplate) {
670
+ <ng-container *ngTemplateOutlet="indentGuideTemplate" />
671
+ } @else if (indentGuide() === true) {
672
+ <span tree-view-branch-indent-guide></span>
673
+ }
674
+ @for (child of children(current); track trackNode($index, child)) {
675
+ <ng-container
676
+ *ngTemplateOutlet="
677
+ renderNode;
678
+ context: {
679
+ $implicit: child,
680
+ indexPath: childIndexPath(currentIndexPath, $index),
681
+ }
682
+ "
683
+ />
684
+ }
685
+ </div>
686
+ </div>
687
+ } @else {
688
+ <div
689
+ tree-view-item
690
+ data-scope="json-tree-view"
691
+ [attr.aria-label]="description(current)"
692
+ [attr.data-line]="line(currentIndexPath)"
693
+ [style.--line-length]="lineLength(currentIndexPath)"
694
+ >
695
+ <span tree-view-item-text data-scope="json-tree-view">
696
+ @if (key(current)) {
697
+ <json-tree-view-key-node [node]="current" />
698
+ }
699
+ <json-tree-view-value-node
700
+ [node]="valueNode(current)"
701
+ [renderValue]="renderValue()"
702
+ />
703
+ </span>
704
+ </div>
705
+ }
706
+ </ng-container>
707
+ </ng-template>
708
+ `,
709
+ }]
710
+ }], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: true }] }], indexPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "indexPath", required: true }] }], arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], indentGuide: [{ type: i0.Input, args: [{ isSignal: true, alias: "indentGuide", required: false }] }], renderValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderValue", required: false }] }] } });
711
+
712
+ class JsonTreeViewTree {
713
+ arrow = input(null, /* @ts-ignore */
714
+ ...(ngDevMode ? [{ debugName: "arrow" }] : /* istanbul ignore next */ []));
715
+ indentGuide = input(false, /* @ts-ignore */
716
+ ...(ngDevMode ? [{ debugName: "indentGuide" }] : /* istanbul ignore next */ []));
717
+ renderValue = input(null, /* @ts-ignore */
718
+ ...(ngDevMode ? [{ debugName: "renderValue" }] : /* istanbul ignore next */ []));
719
+ treeView = injectTreeViewContext();
720
+ nodes() {
721
+ const collection = this.treeView.api().collection;
722
+ return collection.getNodeChildren(collection.rootNode);
723
+ }
724
+ trackNode(index, node) {
725
+ return `${index}:${node.keyPath.join(".")}`;
726
+ }
727
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewTree, deps: [], target: i0.ɵɵFactoryTarget.Component });
728
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: JsonTreeViewTree, isStandalone: true, selector: "[json-tree-view-tree]", inputs: { arrow: { classPropertyName: "arrow", publicName: "arrow", isSignal: true, isRequired: false, transformFunction: null }, indentGuide: { classPropertyName: "indentGuide", publicName: "indentGuide", isSignal: true, isRequired: false, transformFunction: null }, renderValue: { classPropertyName: "renderValue", publicName: "renderValue", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-scope": "json-tree-view" } }, hostDirectives: [{ directive: i1.TreeViewTree }], ngImport: i0, template: `
729
+ @for (node of nodes(); track trackNode($index, node)) {
730
+ <json-tree-view-node
731
+ [node]="node"
732
+ [indexPath]="[$index]"
733
+ [arrow]="arrow()"
734
+ [indentGuide]="indentGuide()"
735
+ [renderValue]="renderValue()"
736
+ />
737
+ }
738
+ `, isInline: true, dependencies: [{ kind: "component", type: JsonTreeViewNode, selector: "json-tree-view-node", inputs: ["node", "indexPath", "arrow", "indentGuide", "renderValue"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
739
+ }
740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: JsonTreeViewTree, decorators: [{
741
+ type: Component,
742
+ args: [{
743
+ selector: "[json-tree-view-tree]",
744
+ standalone: true,
745
+ changeDetection: ChangeDetectionStrategy.OnPush,
746
+ hostDirectives: [TreeViewTree],
747
+ host: { "data-scope": "json-tree-view" },
748
+ imports: [JsonTreeViewNode],
749
+ template: `
750
+ @for (node of nodes(); track trackNode($index, node)) {
751
+ <json-tree-view-node
752
+ [node]="node"
753
+ [indexPath]="[$index]"
754
+ [arrow]="arrow()"
755
+ [indentGuide]="indentGuide()"
756
+ [renderValue]="renderValue()"
757
+ />
758
+ }
759
+ `,
760
+ }]
761
+ }], propDecorators: { arrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrow", required: false }] }], indentGuide: [{ type: i0.Input, args: [{ isSignal: true, alias: "indentGuide", required: false }] }], renderValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderValue", required: false }] }] } });
762
+
763
+ /**
764
+ * Generated bundle index. Do not edit.
765
+ */
766
+
767
+ export { JSON_TREE_VIEW_CONTEXT, JSON_TREE_VIEW_OPTIONS, JsonTreeViewKeyNode, JsonTreeViewNode, JsonTreeViewRoot, JsonTreeViewRootProvider, JsonTreeViewTree, JsonTreeViewValueNode, getBranchValues as getJsonTreeViewBranchValues, injectJsonTreeViewContext, injectJsonTreeViewOptions, useJsonTreeView };
768
+ //# sourceMappingURL=wirekyt-angular-json-tree-view.mjs.map