@hestia-earth/ui-components 0.33.11 → 0.33.13

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.
@@ -11,16 +11,14 @@ export interface SortSelectEvent {
11
11
  export type SortSelectOrder = 'asc' | 'desc';
12
12
  export declare class SortSelectComponent {
13
13
  protected readonly sortOptions: import("@angular/core").InputSignal<SortOption[]>;
14
- protected readonly alignment: import("@angular/core").WritableSignal<"left" | "right">;
15
14
  protected readonly sortChange: import("@angular/core").OutputEmitterRef<SortSelectEvent>;
16
- protected readonly sortBySignal: import("@angular/core").WritableSignal<string>;
17
- protected readonly sortOrderSignal: import("@angular/core").WritableSignal<SortSelectOrder>;
15
+ protected readonly sortBy: import("@angular/core").ModelSignal<string>;
16
+ protected readonly sortOrder: import("@angular/core").ModelSignal<SortSelectOrder>;
18
17
  protected readonly showSortBy: import("@angular/core").WritableSignal<boolean>;
19
- set sortBy(value: string);
20
- set sortOrder(value: SortSelectOrder);
18
+ protected readonly alignment: import("@angular/core").WritableSignal<"left" | "right">;
21
19
  protected sort(option: SortOption): void;
22
20
  private _toggleSortBy;
23
21
  private _emitSortChange;
24
22
  static ɵfac: i0.ɵɵFactoryDeclaration<SortSelectComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<SortSelectComponent, "he-sort-select", never, { "sortOptions": { "alias": "sortOptions"; "required": true; "isSignal": true; }; "sortBy": { "alias": "sortBy"; "required": false; }; "sortOrder": { "alias": "sortOrder"; "required": false; }; }, { "sortChange": "sortChange"; }, never, never, true, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<SortSelectComponent, "he-sort-select", never, { "sortOptions": { "alias": "sortOptions"; "required": true; "isSignal": true; }; "sortBy": { "alias": "sortBy"; "required": false; "isSignal": true; }; "sortOrder": { "alias": "sortOrder"; "required": false; "isSignal": true; }; }, { "sortChange": "sortChange"; "sortBy": "sortByChange"; "sortOrder": "sortOrderChange"; }, never, never, true, never>;
26
24
  }
@@ -1,10 +1,36 @@
1
1
  import { AfterViewInit, OnDestroy } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ interface ITagsInputOptions {
4
+ enabled?: boolean;
5
+ items?: any;
6
+ allowDuplicates?: boolean;
7
+ caseSensitive?: boolean;
8
+ clearSelectionOnTyping?: boolean;
9
+ closeDropdownOnItemSelect?: boolean;
10
+ delimiter?: string;
11
+ freeInput?: boolean;
12
+ highlightDuplicate?: boolean;
13
+ highlightMatchesString?: boolean;
14
+ itemValue?: string;
15
+ itemText?: string;
16
+ maxTags?: number;
17
+ maxChars?: number;
18
+ minChars?: number;
19
+ noResultsLabel?: string;
20
+ placeholder?: string;
21
+ removable?: boolean;
22
+ searchMinChars?: number;
23
+ searchOn?: 'text' | 'value';
24
+ selectable?: boolean;
25
+ source?: any;
26
+ tagClass?: string;
27
+ trim?: boolean;
28
+ }
3
29
  export declare class TagsInputDirective implements AfterViewInit, OnDestroy {
4
- private elementRef;
30
+ private readonly elementRef;
5
31
  private tagsInput?;
6
32
  private inputEvents;
7
- private appTagsInput;
33
+ protected readonly appTagsInput: import("@angular/core").InputSignal<ITagsInputOptions>;
8
34
  ngAfterViewInit(): void;
9
35
  ngOnDestroy(): void;
10
36
  private get input();
@@ -15,5 +41,6 @@ export declare class TagsInputDirective implements AfterViewInit, OnDestroy {
15
41
  private addInputValue;
16
42
  private enableTagsInput;
17
43
  static ɵfac: i0.ɵɵFactoryDeclaration<TagsInputDirective, never>;
18
- static ɵdir: i0.ɵɵDirectiveDeclaration<TagsInputDirective, "[appTagsInput]", never, { "appTagsInput": { "alias": "appTagsInput"; "required": false; }; }, {}, never, never, true, never>;
44
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TagsInputDirective, "[appTagsInput]", never, { "appTagsInput": { "alias": "appTagsInput"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
19
45
  }
46
+ export {};
@@ -5331,10 +5331,10 @@ class TagsInputDirective {
5331
5331
  constructor() {
5332
5332
  this.elementRef = inject(ElementRef);
5333
5333
  this.inputEvents = [];
5334
- this.appTagsInput = {};
5334
+ this.appTagsInput = input.required({});
5335
5335
  }
5336
5336
  ngAfterViewInit() {
5337
- const { enabled } = this.appTagsInput;
5337
+ const { enabled } = this.appTagsInput();
5338
5338
  const { localName } = this.input;
5339
5339
  setTimeout(() => !this.tagsInput && enabled && localName === 'input' && this.enableTagsInput());
5340
5340
  }
@@ -5357,7 +5357,9 @@ class TagsInputDirective {
5357
5357
  this.inputEvents.push({ event, listener });
5358
5358
  }
5359
5359
  mapValue(value) {
5360
- return this.appTagsInput.items.type in restrictToType ? restrictToType[this.appTagsInput.items.type](value) : value;
5360
+ return this.appTagsInput().items.type in restrictToType
5361
+ ? restrictToType[this.appTagsInput().items.type](value)
5362
+ : value;
5361
5363
  }
5362
5364
  addInputValue(value) {
5363
5365
  if (value && this.mapValue(value)) {
@@ -5367,7 +5369,7 @@ class TagsInputDirective {
5367
5369
  }
5368
5370
  enableTagsInput() {
5369
5371
  try {
5370
- const { enabled, items, ...options } = this.appTagsInput;
5372
+ const { enabled, items, ...options } = this.appTagsInput();
5371
5373
  this.tagsInput = new BulmaTagsInput(this.input, options);
5372
5374
  // TODO: remove when fixed, @see https://github.com/CreativeBulma/bulma-tagsinput/issues/23
5373
5375
  const classes = ['is-small', 'is-large'].filter(v => this.input.classList.contains(v));
@@ -5383,7 +5385,7 @@ class TagsInputDirective {
5383
5385
  }
5384
5386
  }
5385
5387
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: TagsInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
5386
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.4", type: TagsInputDirective, isStandalone: true, selector: "[appTagsInput]", inputs: { appTagsInput: "appTagsInput" }, ngImport: i0 }); }
5388
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.4", type: TagsInputDirective, isStandalone: true, selector: "[appTagsInput]", inputs: { appTagsInput: { classPropertyName: "appTagsInput", publicName: "appTagsInput", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
5387
5389
  }
5388
5390
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: TagsInputDirective, decorators: [{
5389
5391
  type: Directive,
@@ -5391,9 +5393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
5391
5393
  selector: '[appTagsInput]',
5392
5394
  standalone: true
5393
5395
  }]
5394
- }], propDecorators: { appTagsInput: [{
5395
- type: Input
5396
- }] } });
5396
+ }] });
5397
5397
 
5398
5398
  class ThousandSuffixesPipe {
5399
5399
  transform(input, digits = 0) {
@@ -5473,48 +5473,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
5473
5473
  class SortSelectComponent {
5474
5474
  constructor() {
5475
5475
  this.sortOptions = input.required();
5476
- this.alignment = signal('right');
5477
5476
  this.sortChange = output();
5478
- this.sortBySignal = signal('');
5479
- this.sortOrderSignal = signal('desc');
5477
+ this.sortBy = model('');
5478
+ this.sortOrder = model('desc');
5480
5479
  this.showSortBy = signal(false);
5481
- }
5482
- set sortBy(value) {
5483
- this.sortBySignal.set(value);
5484
- }
5485
- set sortOrder(value) {
5486
- this.sortOrderSignal.set(value);
5480
+ this.alignment = signal('right');
5487
5481
  }
5488
5482
  sort(option) {
5489
- if (this.sortBySignal() === option.id) {
5483
+ if (this.sortBy() === option.id) {
5490
5484
  this._toggleSortBy();
5491
5485
  }
5492
5486
  else {
5493
- this.sortBySignal.set(option.id);
5494
- this.sortOrderSignal.set('desc');
5487
+ this.sortBy.set(option.id);
5488
+ this.sortOrder.set('desc');
5495
5489
  }
5496
5490
  this._emitSortChange();
5497
5491
  }
5498
5492
  _toggleSortBy() {
5499
- this.sortOrderSignal.update(value => (value === 'asc' ? 'desc' : 'asc'));
5493
+ this.sortOrder.update(value => (value === 'asc' ? 'desc' : 'asc'));
5500
5494
  }
5501
5495
  _emitSortChange() {
5502
5496
  this.sortChange.emit({
5503
- sortBy: this.sortBySignal(),
5504
- sortOrder: this.sortOrderSignal()
5497
+ sortBy: this.sortBy(),
5498
+ sortOrder: this.sortOrder()
5505
5499
  });
5506
5500
  }
5507
5501
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SortSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5508
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: SortSelectComponent, isStandalone: true, selector: "he-sort-select", inputs: { sortOptions: { classPropertyName: "sortOptions", publicName: "sortOptions", isSignal: true, isRequired: true, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: false, isRequired: false, transformFunction: null }, sortOrder: { classPropertyName: "sortOrder", publicName: "sortOrder", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sortChange: "sortChange" }, ngImport: i0, template: "<div\n (clickOutside)=\"showSortBy.set(false)\"\n [class.is-active]=\"showSortBy()\"\n [ngClass]=\"'is-' + alignment()\"\n class=\"dropdown\">\n <div (click)=\"showSortBy.set(!showSortBy())\" class=\"dropdown-trigger\">\n <button\n [class.is-active]=\"showSortBy()\"\n aria-controls=\"sort-menu\"\n aria-haspopup=\"true\"\n class=\"button is-ghost\"\n container=\"body\"\n [ngbTooltip]=\"showSortBy() ? null : 'Sort options'\"\n [disableTooltip]=\"showSortBy()\"\n placement=\"bottom\">\n <he-svg-icon size=\"24\" name=\"sort-ascending\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"dropdown-menu\" id=\"sort-menu\" role=\"menu\">\n <div (click)=\"showSortBy.set(false)\" class=\"dropdown-content\">\n @for (option of sortOptions(); track option) {\n <a (click)=\"sort(option)\" [class.is-selected]=\"sortBySignal() === option.id\" class=\"dropdown-item\">\n <he-svg-icon\n [name]=\"sortOrderSignal() === 'asc' ? 'arrow-up' : 'arrow-down'\"\n [class.is-invisible]=\"sortBySignal() !== option.id\" />\n <span [style.border-color]=\"option.color ?? 'transparent'\" class=\"is-pl-2 is-inline-block is-capitalized\">\n {{ option.label }}\n </span>\n </a>\n }\n </div>\n </div>\n</div>\n", styles: [".dropdown-item>span{border-left:2px solid transparent}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideListenAfter"], outputs: ["clickOutside"] }, { kind: "directive", type: NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "tooltipContext", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: HESvgIconComponent, selector: "he-svg-icon", inputs: ["name", "size", "animation", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5502
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: SortSelectComponent, isStandalone: true, selector: "he-sort-select", inputs: { sortOptions: { classPropertyName: "sortOptions", publicName: "sortOptions", isSignal: true, isRequired: true, transformFunction: null }, sortBy: { classPropertyName: "sortBy", publicName: "sortBy", isSignal: true, isRequired: false, transformFunction: null }, sortOrder: { classPropertyName: "sortOrder", publicName: "sortOrder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortChange: "sortChange", sortBy: "sortByChange", sortOrder: "sortOrderChange" }, ngImport: i0, template: "<div\n (clickOutside)=\"showSortBy.set(false)\"\n [class.is-active]=\"showSortBy()\"\n [ngClass]=\"'is-' + alignment()\"\n class=\"dropdown\">\n <div (click)=\"showSortBy.set(!showSortBy())\" class=\"dropdown-trigger\">\n <button\n [class.is-active]=\"showSortBy()\"\n aria-controls=\"sort-menu\"\n aria-haspopup=\"true\"\n class=\"button is-ghost\"\n container=\"body\"\n [ngbTooltip]=\"showSortBy() ? null : 'Sort options'\"\n [disableTooltip]=\"showSortBy()\"\n placement=\"bottom\">\n <he-svg-icon size=\"24\" name=\"sort-ascending\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"dropdown-menu\" id=\"sort-menu\" role=\"menu\">\n <div (click)=\"showSortBy.set(false)\" class=\"dropdown-content\">\n @for (option of sortOptions(); track option) {\n <a (click)=\"sort(option)\" [class.is-selected]=\"sortBy() === option.id\" class=\"dropdown-item\">\n <he-svg-icon\n [name]=\"sortOrder() === 'asc' ? 'arrow-up' : 'arrow-down'\"\n [class.is-invisible]=\"sortBy() !== option.id\" />\n <span [style.border-color]=\"option.color ?? 'transparent'\" class=\"is-pl-2 is-inline-block is-capitalized\">\n {{ option.label }}\n </span>\n </a>\n }\n </div>\n </div>\n</div>\n", styles: [".dropdown-item>span{border-left:2px solid transparent}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", inputs: ["clickOutsideListenAfter"], outputs: ["clickOutside"] }, { kind: "directive", type: NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "popperOptions", "triggers", "positionTarget", "container", "disableTooltip", "tooltipClass", "tooltipContext", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { kind: "component", type: HESvgIconComponent, selector: "he-svg-icon", inputs: ["name", "size", "animation", "svgClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5509
5503
  }
5510
5504
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SortSelectComponent, decorators: [{
5511
5505
  type: Component$1,
5512
- args: [{ selector: 'he-sort-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, ClickOutsideDirective, NgbTooltip, HESvgIconComponent], template: "<div\n (clickOutside)=\"showSortBy.set(false)\"\n [class.is-active]=\"showSortBy()\"\n [ngClass]=\"'is-' + alignment()\"\n class=\"dropdown\">\n <div (click)=\"showSortBy.set(!showSortBy())\" class=\"dropdown-trigger\">\n <button\n [class.is-active]=\"showSortBy()\"\n aria-controls=\"sort-menu\"\n aria-haspopup=\"true\"\n class=\"button is-ghost\"\n container=\"body\"\n [ngbTooltip]=\"showSortBy() ? null : 'Sort options'\"\n [disableTooltip]=\"showSortBy()\"\n placement=\"bottom\">\n <he-svg-icon size=\"24\" name=\"sort-ascending\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"dropdown-menu\" id=\"sort-menu\" role=\"menu\">\n <div (click)=\"showSortBy.set(false)\" class=\"dropdown-content\">\n @for (option of sortOptions(); track option) {\n <a (click)=\"sort(option)\" [class.is-selected]=\"sortBySignal() === option.id\" class=\"dropdown-item\">\n <he-svg-icon\n [name]=\"sortOrderSignal() === 'asc' ? 'arrow-up' : 'arrow-down'\"\n [class.is-invisible]=\"sortBySignal() !== option.id\" />\n <span [style.border-color]=\"option.color ?? 'transparent'\" class=\"is-pl-2 is-inline-block is-capitalized\">\n {{ option.label }}\n </span>\n </a>\n }\n </div>\n </div>\n</div>\n", styles: [".dropdown-item>span{border-left:2px solid transparent}\n"] }]
5513
- }], propDecorators: { sortBy: [{
5514
- type: Input
5515
- }], sortOrder: [{
5516
- type: Input
5517
- }] } });
5506
+ args: [{ selector: 'he-sort-select', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, ClickOutsideDirective, NgbTooltip, HESvgIconComponent], template: "<div\n (clickOutside)=\"showSortBy.set(false)\"\n [class.is-active]=\"showSortBy()\"\n [ngClass]=\"'is-' + alignment()\"\n class=\"dropdown\">\n <div (click)=\"showSortBy.set(!showSortBy())\" class=\"dropdown-trigger\">\n <button\n [class.is-active]=\"showSortBy()\"\n aria-controls=\"sort-menu\"\n aria-haspopup=\"true\"\n class=\"button is-ghost\"\n container=\"body\"\n [ngbTooltip]=\"showSortBy() ? null : 'Sort options'\"\n [disableTooltip]=\"showSortBy()\"\n placement=\"bottom\">\n <he-svg-icon size=\"24\" name=\"sort-ascending\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"dropdown-menu\" id=\"sort-menu\" role=\"menu\">\n <div (click)=\"showSortBy.set(false)\" class=\"dropdown-content\">\n @for (option of sortOptions(); track option) {\n <a (click)=\"sort(option)\" [class.is-selected]=\"sortBy() === option.id\" class=\"dropdown-item\">\n <he-svg-icon\n [name]=\"sortOrder() === 'asc' ? 'arrow-up' : 'arrow-down'\"\n [class.is-invisible]=\"sortBy() !== option.id\" />\n <span [style.border-color]=\"option.color ?? 'transparent'\" class=\"is-pl-2 is-inline-block is-capitalized\">\n {{ option.label }}\n </span>\n </a>\n }\n </div>\n </div>\n</div>\n", styles: [".dropdown-item>span{border-left:2px solid transparent}\n"] }]
5507
+ }] });
5518
5508
 
5519
5509
  class ShelfDialogComponent {
5520
5510
  constructor() {
@@ -12577,9 +12567,7 @@ const removeCountFromLabel = (label) => label.replace(/\s*\(\d+\)$/, '').trim();
12577
12567
  class FilterAccordionComponent extends ControlValueAccessor {
12578
12568
  constructor() {
12579
12569
  super();
12580
- this.destroyRef = inject(DestroyRef);
12581
12570
  this.filterStore = inject(FilterStore);
12582
- this.debounceSearch = new Subject();
12583
12571
  /**
12584
12572
  * Show the header, with title and global clear/search.
12585
12573
  */
@@ -12627,9 +12615,6 @@ class FilterAccordionComponent extends ControlValueAccessor {
12627
12615
  this.isNumber = isNumber;
12628
12616
  this.search = signal('');
12629
12617
  this.group = computed(() => ({ options: this.filterStore.filteredData() }));
12630
- this.debounceSearch
12631
- .pipe(takeUntilDestroyed(this.destroyRef), debounceTime(500), distinctUntilChanged())
12632
- .subscribe(({ text, group }) => this._onSearch(text, group));
12633
12618
  effect(() => this.data() && this.filterStore.setData(this.data()));
12634
12619
  effect(() => (this.panelStates = Object.fromEntries(allGroups(this.data()).map(({ label }) => [
12635
12620
  label,
@@ -12660,11 +12645,9 @@ class FilterAccordionComponent extends ControlValueAccessor {
12660
12645
  }
12661
12646
  ])));
12662
12647
  }
12663
- _onSearch(text, group) {
12664
- allGroups(getFilteredDirectChildren(group, text)).forEach(group => (this.panelStates[group.label].expanded = true));
12665
- }
12666
12648
  onSearch(text, group) {
12667
- this.debounceSearch.next({ text, group });
12649
+ return (text &&
12650
+ allGroups(getFilteredDirectChildren(group, text)).forEach(group => (this.panelStates[group.label].expanded = true)));
12668
12651
  }
12669
12652
  /**
12670
12653
  * Un-select all options, except disabled options.