@ferrlabs/ui-ng 1.46.0 → 1.46.1

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.
@@ -4498,7 +4498,7 @@ function inheritedTokens(element) {
4498
4498
  }
4499
4499
  return tokens;
4500
4500
  }
4501
- let nextId$1 = 0;
4501
+ let nextId$2 = 0;
4502
4502
  const PANEL_POSITIONS = [
4503
4503
  {
4504
4504
  originX: "start",
@@ -4549,7 +4549,7 @@ var MultiSelectComponent = class MultiSelectComponent {
4549
4549
  this.emptyText = input("Nothing to choose from.", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
4550
4550
  this.noMatchText = input("No match.", ...ngDevMode ? [{ debugName: "noMatchText" }] : /* istanbul ignore next */ []);
4551
4551
  this.invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
4552
- this.uid = `flr-ms-${nextId$1++}`;
4552
+ this.uid = `flr-ms-${nextId$2++}`;
4553
4553
  this.query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
4554
4554
  this.disabled = signal(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
4555
4555
  this.open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
@@ -5530,6 +5530,7 @@ i0.ɵɵngDeclareClassMetadata({
5530
5530
  }]
5531
5531
  }
5532
5532
  });
5533
+ let nextId$1 = 0;
5533
5534
  var TreeSelectComponent = class TreeSelectComponent {
5534
5535
  constructor() {
5535
5536
  this.groups = input.required(...ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []);
@@ -5541,6 +5542,10 @@ var TreeSelectComponent = class TreeSelectComponent {
5541
5542
  this.emptyText = input("Nothing to choose from.", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
5542
5543
  this.noMatchText = input("No match.", ...ngDevMode ? [{ debugName: "noMatchText" }] : /* istanbul ignore next */ []);
5543
5544
  this.invalid = input(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
5545
+ this.selectAllText = input((g) => `Select all in ${g}`, ...ngDevMode ? [{ debugName: "selectAllText" }] : /* istanbul ignore next */ []);
5546
+ this.selectedText = input((count) => `${count} selected`, ...ngDevMode ? [{ debugName: "selectedText" }] : /* istanbul ignore next */ []);
5547
+ this.clearText = input("Clear", ...ngDevMode ? [{ debugName: "clearText" }] : /* istanbul ignore next */ []);
5548
+ this.idBase = `flr-ts-${nextId$1++}`;
5544
5549
  this.query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
5545
5550
  this.disabled = signal(false, ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
5546
5551
  this.selected = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
@@ -5558,6 +5563,7 @@ var TreeSelectComponent = class TreeSelectComponent {
5558
5563
  }).filter((g) => g.options.length > 0);
5559
5564
  }, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
5560
5565
  this.selectedCount = computed(() => this.selected().size, ...ngDevMode ? [{ debugName: "selectedCount" }] : /* istanbul ignore next */ []);
5566
+ this.countText = computed(() => this.selectedText()(this.selectedCount()), ...ngDevMode ? [{ debugName: "countText" }] : /* istanbul ignore next */ []);
5561
5567
  this.onChange = () => {};
5562
5568
  this.onTouched = () => {};
5563
5569
  }
@@ -5707,6 +5713,27 @@ var TreeSelectComponent = class TreeSelectComponent {
5707
5713
  isSignal: true,
5708
5714
  isRequired: false,
5709
5715
  transformFunction: null
5716
+ },
5717
+ selectAllText: {
5718
+ classPropertyName: "selectAllText",
5719
+ publicName: "selectAllText",
5720
+ isSignal: true,
5721
+ isRequired: false,
5722
+ transformFunction: null
5723
+ },
5724
+ selectedText: {
5725
+ classPropertyName: "selectedText",
5726
+ publicName: "selectedText",
5727
+ isSignal: true,
5728
+ isRequired: false,
5729
+ transformFunction: null
5730
+ },
5731
+ clearText: {
5732
+ classPropertyName: "clearText",
5733
+ publicName: "clearText",
5734
+ isSignal: true,
5735
+ isRequired: false,
5736
+ transformFunction: null
5710
5737
  }
5711
5738
  },
5712
5739
  providers: [{
@@ -5728,14 +5755,14 @@ var TreeSelectComponent = class TreeSelectComponent {
5728
5755
  />
5729
5756
  }
5730
5757
 
5731
- <div class="flr-ts__tree" role="tree" [attr.aria-label]="label()">
5758
+ <div class="flr-ts__tree" role="group" [attr.aria-label]="label()">
5732
5759
  @for (g of visible(); track g.id) {
5733
- <div class="flr-ts__group" role="treeitem" [attr.aria-selected]="groupState(g) === 'all'">
5760
+ <div class="flr-ts__group" role="group" [attr.aria-labelledby]="idBase + '-h-' + g.id">
5734
5761
  <div class="flr-ts__grouprow">
5735
5762
  <input
5736
5763
  type="checkbox"
5737
5764
  class="flr-ts__box"
5738
- [attr.aria-label]="'Select all in ' + g.label"
5765
+ [attr.aria-label]="selectAllText()(g.label)"
5739
5766
  [checked]="groupState(g) === 'all'"
5740
5767
  [indeterminate]="groupState(g) === 'some'"
5741
5768
  [disabled]="disabled()"
@@ -5744,7 +5771,9 @@ var TreeSelectComponent = class TreeSelectComponent {
5744
5771
  <button
5745
5772
  type="button"
5746
5773
  class="flr-ts__toggle"
5774
+ [id]="idBase + '-h-' + g.id"
5747
5775
  [attr.aria-expanded]="isOpen(g.id)"
5776
+ [attr.aria-controls]="idBase + '-l-' + g.id"
5748
5777
  (click)="toggleOpen(g.id)"
5749
5778
  >
5750
5779
  <span class="flr-ts__chev" [class.flr-ts__chev--open]="isOpen(g.id)">›</span>
@@ -5759,7 +5788,7 @@ var TreeSelectComponent = class TreeSelectComponent {
5759
5788
  </div>
5760
5789
 
5761
5790
  @if (isOpen(g.id)) {
5762
- <div class="flr-ts__leaves" role="group">
5791
+ <div class="flr-ts__leaves" [id]="idBase + '-l-' + g.id">
5763
5792
  @for (o of g.options; track o.id) {
5764
5793
  <label class="flr-ts__row" [class.flr-ts__row--on]="isSelected(o.id)">
5765
5794
  <input
@@ -5790,9 +5819,9 @@ var TreeSelectComponent = class TreeSelectComponent {
5790
5819
  </div>
5791
5820
 
5792
5821
  <div class="flr-ts__foot">
5793
- <span class="flr-ts__count">{{ selectedCount() }} selected</span>
5822
+ <span class="flr-ts__count">{{ countText() }}</span>
5794
5823
  @if (selectedCount() > 0 && !disabled()) {
5795
- <button type="button" class="flr-ts__clear" (click)="clear()">Clear</button>
5824
+ <button type="button" class="flr-ts__clear" (click)="clear()">{{ clearText() }}</button>
5796
5825
  }
5797
5826
  </div>
5798
5827
  </div>
@@ -5831,14 +5860,14 @@ i0.ɵɵngDeclareClassMetadata({
5831
5860
  />
5832
5861
  }
5833
5862
 
5834
- <div class="flr-ts__tree" role="tree" [attr.aria-label]="label()">
5863
+ <div class="flr-ts__tree" role="group" [attr.aria-label]="label()">
5835
5864
  @for (g of visible(); track g.id) {
5836
- <div class="flr-ts__group" role="treeitem" [attr.aria-selected]="groupState(g) === 'all'">
5865
+ <div class="flr-ts__group" role="group" [attr.aria-labelledby]="idBase + '-h-' + g.id">
5837
5866
  <div class="flr-ts__grouprow">
5838
5867
  <input
5839
5868
  type="checkbox"
5840
5869
  class="flr-ts__box"
5841
- [attr.aria-label]="'Select all in ' + g.label"
5870
+ [attr.aria-label]="selectAllText()(g.label)"
5842
5871
  [checked]="groupState(g) === 'all'"
5843
5872
  [indeterminate]="groupState(g) === 'some'"
5844
5873
  [disabled]="disabled()"
@@ -5847,7 +5876,9 @@ i0.ɵɵngDeclareClassMetadata({
5847
5876
  <button
5848
5877
  type="button"
5849
5878
  class="flr-ts__toggle"
5879
+ [id]="idBase + '-h-' + g.id"
5850
5880
  [attr.aria-expanded]="isOpen(g.id)"
5881
+ [attr.aria-controls]="idBase + '-l-' + g.id"
5851
5882
  (click)="toggleOpen(g.id)"
5852
5883
  >
5853
5884
  <span class="flr-ts__chev" [class.flr-ts__chev--open]="isOpen(g.id)">›</span>
@@ -5862,7 +5893,7 @@ i0.ɵɵngDeclareClassMetadata({
5862
5893
  </div>
5863
5894
 
5864
5895
  @if (isOpen(g.id)) {
5865
- <div class="flr-ts__leaves" role="group">
5896
+ <div class="flr-ts__leaves" [id]="idBase + '-l-' + g.id">
5866
5897
  @for (o of g.options; track o.id) {
5867
5898
  <label class="flr-ts__row" [class.flr-ts__row--on]="isSelected(o.id)">
5868
5899
  <input
@@ -5893,9 +5924,9 @@ i0.ɵɵngDeclareClassMetadata({
5893
5924
  </div>
5894
5925
 
5895
5926
  <div class="flr-ts__foot">
5896
- <span class="flr-ts__count">{{ selectedCount() }} selected</span>
5927
+ <span class="flr-ts__count">{{ countText() }}</span>
5897
5928
  @if (selectedCount() > 0 && !disabled()) {
5898
- <button type="button" class="flr-ts__clear" (click)="clear()">Clear</button>
5929
+ <button type="button" class="flr-ts__clear" (click)="clear()">{{ clearText() }}</button>
5899
5930
  }
5900
5931
  </div>
5901
5932
  </div>
@@ -5975,6 +6006,30 @@ i0.ɵɵngDeclareClassMetadata({
5975
6006
  alias: "invalid",
5976
6007
  required: false
5977
6008
  }]
6009
+ }],
6010
+ selectAllText: [{
6011
+ type: i0.Input,
6012
+ args: [{
6013
+ isSignal: true,
6014
+ alias: "selectAllText",
6015
+ required: false
6016
+ }]
6017
+ }],
6018
+ selectedText: [{
6019
+ type: i0.Input,
6020
+ args: [{
6021
+ isSignal: true,
6022
+ alias: "selectedText",
6023
+ required: false
6024
+ }]
6025
+ }],
6026
+ clearText: [{
6027
+ type: i0.Input,
6028
+ args: [{
6029
+ isSignal: true,
6030
+ alias: "clearText",
6031
+ required: false
6032
+ }]
5978
6033
  }]
5979
6034
  }
5980
6035
  });