@mozaic-ds/angular 2.1.5 → 2.1.6

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.
@@ -6415,7 +6415,7 @@ class MozTreeComponent {
6415
6415
  // Inputs
6416
6416
  nodes = input([], ...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
6417
6417
  selectionMode = input('none', ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
6418
- expandedIds = input(new Set(), ...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
6418
+ expandedIds = model(new Set(), ...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
6419
6419
  selectedIds = input(new Set(), ...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
6420
6420
  loadChildren = input(null, ...(ngDevMode ? [{ debugName: "loadChildren" }] : /* istanbul ignore next */ []));
6421
6421
  canSelect = input(null, ...(ngDevMode ? [{ debugName: "canSelect" }] : /* istanbul ignore next */ []));
@@ -6440,7 +6440,7 @@ class MozTreeComponent {
6440
6440
  return Object.fromEntries(typed.map((d) => [d.type(), d.templateRef]));
6441
6441
  }, ...(ngDevMode ? [{ debugName: "nodeTemplates" }] : /* istanbul ignore next */ []));
6442
6442
  // Outputs
6443
- expandedIdsChange = output();
6443
+ // `expandedIdsChange` is generated automatically by the `expandedIds` model().
6444
6444
  selectionChange = output();
6445
6445
  useVirtualScroll = computed(() => {
6446
6446
  const mode = this.virtualScroll();
@@ -6502,7 +6502,7 @@ class MozTreeComponent {
6502
6502
  this.keyboardService.initFocus();
6503
6503
  }
6504
6504
  onExpandChange() {
6505
- this.expandedIdsChange.emit(new Set(this.stateService.expandedIds()));
6505
+ this.expandedIds.set(new Set(this.stateService.expandedIds()));
6506
6506
  }
6507
6507
  onSelectionChange(ids) {
6508
6508
  this.selectionChange.emit(ids);
@@ -6517,14 +6517,14 @@ class MozTreeComponent {
6517
6517
  // Expand first so the children area is visible
6518
6518
  if (!this.stateService.expandedIds().has(nodeId)) {
6519
6519
  this.stateService.toggleExpanded(nodeId);
6520
- this.expandedIdsChange.emit(new Set(this.stateService.expandedIds()));
6520
+ this.expandedIds.set(new Set(this.stateService.expandedIds()));
6521
6521
  // Yield to let Angular render the expansion
6522
6522
  await new Promise((resolve) => setTimeout(resolve));
6523
6523
  }
6524
6524
  // Load children if needed
6525
6525
  if (loadFn && node.children === undefined) {
6526
6526
  this.stateService.addLoading(nodeId);
6527
- this.expandedIdsChange.emit(new Set(this.stateService.expandedIds()));
6527
+ this.expandedIds.set(new Set(this.stateService.expandedIds()));
6528
6528
  // Yield to let Angular render the loader
6529
6529
  await new Promise((resolve) => setTimeout(resolve));
6530
6530
  const children = await firstValueFrom(loadFn(node).pipe(take(1)));
@@ -6534,7 +6534,7 @@ class MozTreeComponent {
6534
6534
  await new Promise((resolve) => setTimeout(resolve));
6535
6535
  }
6536
6536
  }
6537
- this.expandedIdsChange.emit(new Set(this.stateService.expandedIds()));
6537
+ this.expandedIds.set(new Set(this.stateService.expandedIds()));
6538
6538
  }
6539
6539
  scrollToNode(nodeId) {
6540
6540
  setTimeout(() => {
@@ -6546,11 +6546,11 @@ class MozTreeComponent {
6546
6546
  const flat = this.stateService.flatVisibleNodes();
6547
6547
  const allIds = new Set(flat.map((f) => f.node.id));
6548
6548
  this.stateService.setExpanded(allIds);
6549
- this.expandedIdsChange.emit(new Set(allIds));
6549
+ this.expandedIds.set(new Set(allIds));
6550
6550
  }
6551
6551
  collapseAll() {
6552
6552
  this.stateService.setExpanded(new Set());
6553
- this.expandedIdsChange.emit(new Set());
6553
+ this.expandedIds.set(new Set());
6554
6554
  }
6555
6555
  trackNode(_index, node) {
6556
6556
  return node.id;
@@ -6559,12 +6559,12 @@ class MozTreeComponent {
6559
6559
  return flat.node.id;
6560
6560
  }
6561
6561
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MozTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6562
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: MozTreeComponent, isStandalone: true, selector: "moz-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, loadChildren: { classPropertyName: "loadChildren", publicName: "loadChildren", isSignal: true, isRequired: false, transformFunction: null }, canSelect: { classPropertyName: "canSelect", publicName: "canSelect", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollThreshold: { classPropertyName: "virtualScrollThreshold", publicName: "virtualScrollThreshold", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, viewportHeight: { classPropertyName: "viewportHeight", publicName: "viewportHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedIdsChange: "expandedIdsChange", selectionChange: "selectionChange" }, providers: [TreeStateService, TreeSelectionService, TreeKeyboardService], queries: [{ propertyName: "_defaultTemplate", first: true, predicate: MozTreeNodeTemplateDirective, descendants: true, isSignal: true }, { propertyName: "_typedTemplates", predicate: MozTreeNodeTemplateDirective, isSignal: true }], ngImport: i0, template: "<ul\n class=\"tree\"\n role=\"tree\"\n tabindex=\"0\"\n [attr.aria-multiselectable]=\"selectionMode() === 'checkbox' ? 'true' : null\"\n [attr.aria-activedescendant]=\"keyboardService.focusedNodeId() ? 'tree-node-' + keyboardService.focusedNodeId() : null\"\n (keydown)=\"onTreeKeydown($event)\"\n (focus)=\"onTreeFocus()\"\n>\n @if (!useVirtualScroll()) { @for (node of nodes(); track trackNode($index, node)) {\n <moz-tree-node\n [node]=\"node\"\n [depth]=\"0\"\n [selectionMode]=\"selectionMode()\"\n [indentSize]=\"indentSize()\"\n [nodeTemplate]=\"nodeTemplate()\"\n [nodeTemplates]=\"nodeTemplates()\"\n [loadChildren]=\"loadChildren()\"\n [ancestors]=\"[]\"\n (expandChange)=\"onExpandChange()\"\n (selectionChange)=\"onSelectionChange($event)\"\n />\n } } @else {\n <cdk-virtual-scroll-viewport\n class=\"tree__viewport\"\n [itemSize]=\"itemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <moz-tree-node\n *cdkVirtualFor=\"let flatNode of stateService.flatVisibleNodes(); trackBy: trackFlatNode\"\n [node]=\"flatNode.node\"\n [depth]=\"flatNode.depth\"\n [flat]=\"true\"\n [selectionMode]=\"selectionMode()\"\n [indentSize]=\"indentSize()\"\n [nodeTemplate]=\"nodeTemplate()\"\n [nodeTemplates]=\"nodeTemplates()\"\n [loadChildren]=\"loadChildren()\"\n [ancestors]=\"[]\"\n (expandChange)=\"onExpandChange()\"\n (selectionChange)=\"onSelectionChange($event)\"\n />\n </cdk-virtual-scroll-viewport>\n }\n</ul>\n", styles: [".tree{list-style:none;padding:0;margin:0;width:100%;outline:none;display:flex;flex-direction:column;gap:4px}.tree:focus-visible{outline:2px solid var(--color-background-accent-inverse);outline-offset:2px;border-radius:var(--border-radius-m, 8px)}.tree__viewport{width:100%}\n"], dependencies: [{ kind: "component", type: MozTreeNodeComponent, selector: "moz-tree-node", inputs: ["node", "depth", "selectionMode", "indentSize", "nodeTemplate", "nodeTemplates", "loadChildren", "ancestors", "flat", "noResultText"], outputs: ["expandChange", "selectionChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6562
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: MozTreeComponent, isStandalone: true, selector: "moz-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, loadChildren: { classPropertyName: "loadChildren", publicName: "loadChildren", isSignal: true, isRequired: false, transformFunction: null }, canSelect: { classPropertyName: "canSelect", publicName: "canSelect", isSignal: true, isRequired: false, transformFunction: null }, indentSize: { classPropertyName: "indentSize", publicName: "indentSize", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollThreshold: { classPropertyName: "virtualScrollThreshold", publicName: "virtualScrollThreshold", isSignal: true, isRequired: false, transformFunction: null }, rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null }, viewportHeight: { classPropertyName: "viewportHeight", publicName: "viewportHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedIds: "expandedIdsChange", selectionChange: "selectionChange" }, providers: [TreeStateService, TreeSelectionService, TreeKeyboardService], queries: [{ propertyName: "_defaultTemplate", first: true, predicate: MozTreeNodeTemplateDirective, descendants: true, isSignal: true }, { propertyName: "_typedTemplates", predicate: MozTreeNodeTemplateDirective, isSignal: true }], ngImport: i0, template: "<ul\n class=\"tree\"\n role=\"tree\"\n tabindex=\"0\"\n [attr.aria-multiselectable]=\"selectionMode() === 'checkbox' ? 'true' : null\"\n [attr.aria-activedescendant]=\"keyboardService.focusedNodeId() ? 'tree-node-' + keyboardService.focusedNodeId() : null\"\n (keydown)=\"onTreeKeydown($event)\"\n (focus)=\"onTreeFocus()\"\n>\n @if (!useVirtualScroll()) { @for (node of nodes(); track trackNode($index, node)) {\n <moz-tree-node\n [node]=\"node\"\n [depth]=\"0\"\n [selectionMode]=\"selectionMode()\"\n [indentSize]=\"indentSize()\"\n [nodeTemplate]=\"nodeTemplate()\"\n [nodeTemplates]=\"nodeTemplates()\"\n [loadChildren]=\"loadChildren()\"\n [ancestors]=\"[]\"\n (expandChange)=\"onExpandChange()\"\n (selectionChange)=\"onSelectionChange($event)\"\n />\n } } @else {\n <cdk-virtual-scroll-viewport\n class=\"tree__viewport\"\n [itemSize]=\"itemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <moz-tree-node\n *cdkVirtualFor=\"let flatNode of stateService.flatVisibleNodes(); trackBy: trackFlatNode\"\n [node]=\"flatNode.node\"\n [depth]=\"flatNode.depth\"\n [flat]=\"true\"\n [selectionMode]=\"selectionMode()\"\n [indentSize]=\"indentSize()\"\n [nodeTemplate]=\"nodeTemplate()\"\n [nodeTemplates]=\"nodeTemplates()\"\n [loadChildren]=\"loadChildren()\"\n [ancestors]=\"[]\"\n (expandChange)=\"onExpandChange()\"\n (selectionChange)=\"onSelectionChange($event)\"\n />\n </cdk-virtual-scroll-viewport>\n }\n</ul>\n", styles: [".tree{list-style:none;padding:0;margin:0;width:100%;outline:none;display:flex;flex-direction:column;gap:4px}.tree:focus-visible{outline:2px solid var(--color-background-accent-inverse);outline-offset:2px;border-radius:var(--border-radius-m, 8px)}.tree__viewport{width:100%}\n"], dependencies: [{ kind: "component", type: MozTreeNodeComponent, selector: "moz-tree-node", inputs: ["node", "depth", "selectionMode", "indentSize", "nodeTemplate", "nodeTemplates", "loadChildren", "ancestors", "flat", "noResultText"], outputs: ["expandChange", "selectionChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6563
6563
  }
6564
6564
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: MozTreeComponent, decorators: [{
6565
6565
  type: Component,
6566
6566
  args: [{ selector: 'moz-tree', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MozTreeNodeComponent, ScrollingModule], providers: [TreeStateService, TreeSelectionService, TreeKeyboardService], template: "<ul\n class=\"tree\"\n role=\"tree\"\n tabindex=\"0\"\n [attr.aria-multiselectable]=\"selectionMode() === 'checkbox' ? 'true' : null\"\n [attr.aria-activedescendant]=\"keyboardService.focusedNodeId() ? 'tree-node-' + keyboardService.focusedNodeId() : null\"\n (keydown)=\"onTreeKeydown($event)\"\n (focus)=\"onTreeFocus()\"\n>\n @if (!useVirtualScroll()) { @for (node of nodes(); track trackNode($index, node)) {\n <moz-tree-node\n [node]=\"node\"\n [depth]=\"0\"\n [selectionMode]=\"selectionMode()\"\n [indentSize]=\"indentSize()\"\n [nodeTemplate]=\"nodeTemplate()\"\n [nodeTemplates]=\"nodeTemplates()\"\n [loadChildren]=\"loadChildren()\"\n [ancestors]=\"[]\"\n (expandChange)=\"onExpandChange()\"\n (selectionChange)=\"onSelectionChange($event)\"\n />\n } } @else {\n <cdk-virtual-scroll-viewport\n class=\"tree__viewport\"\n [itemSize]=\"itemSize()\"\n [style.height]=\"viewportHeight()\"\n >\n <moz-tree-node\n *cdkVirtualFor=\"let flatNode of stateService.flatVisibleNodes(); trackBy: trackFlatNode\"\n [node]=\"flatNode.node\"\n [depth]=\"flatNode.depth\"\n [flat]=\"true\"\n [selectionMode]=\"selectionMode()\"\n [indentSize]=\"indentSize()\"\n [nodeTemplate]=\"nodeTemplate()\"\n [nodeTemplates]=\"nodeTemplates()\"\n [loadChildren]=\"loadChildren()\"\n [ancestors]=\"[]\"\n (expandChange)=\"onExpandChange()\"\n (selectionChange)=\"onSelectionChange($event)\"\n />\n </cdk-virtual-scroll-viewport>\n }\n</ul>\n", styles: [".tree{list-style:none;padding:0;margin:0;width:100%;outline:none;display:flex;flex-direction:column;gap:4px}.tree:focus-visible{outline:2px solid var(--color-background-accent-inverse);outline-offset:2px;border-radius:var(--border-radius-m, 8px)}.tree__viewport{width:100%}\n"] }]
6567
- }], ctorParameters: () => [], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }], loadChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadChildren", required: false }] }], canSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSelect", required: false }] }], indentSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "indentSize", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualScrollThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollThreshold", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], viewportHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewportHeight", required: false }] }], _defaultTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MozTreeNodeTemplateDirective), { isSignal: true }] }], _typedTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MozTreeNodeTemplateDirective), { isSignal: true }] }], expandedIdsChange: [{ type: i0.Output, args: ["expandedIdsChange"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
6567
+ }], ctorParameters: () => [], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }], loadChildren: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadChildren", required: false }] }], canSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSelect", required: false }] }], indentSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "indentSize", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualScrollThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollThreshold", required: false }] }], rowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHeight", required: false }] }], viewportHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewportHeight", required: false }] }], _defaultTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MozTreeNodeTemplateDirective), { isSignal: true }] }], _typedTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MozTreeNodeTemplateDirective), { isSignal: true }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }] } });
6568
6568
 
6569
6569
  /**
6570
6570
  * Generated bundle index. Do not edit.