@qualcomm-ui/angular 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ import { useInlineIconButtonApi } from '@qualcomm-ui/angular/inline-icon-button'
7
7
  import { mergeProps } from '@qualcomm-ui/utils/merge-props';
8
8
  import * as i2 from '@qualcomm-ui/angular/icon';
9
9
  import { IconDirective } from '@qualcomm-ui/angular/icon';
10
- import { GripVertical, Filter, UnfoldHorizontal, ArrowUp, ArrowDownUp, GripHorizontal, ChevronRight } from 'lucide-angular';
10
+ import { GripVertical, Funnel, UnfoldHorizontal, ArrowUp, ArrowDownUp, GripHorizontal, ChevronRight } from 'lucide-angular';
11
11
  import { provideIcons } from '@qualcomm-ui/angular-core/lucide';
12
12
  import { PaginationRootDirective, provideQdsPaginationContext } from '@qualcomm-ui/angular/pagination';
13
13
  import { providePaginationContext } from '@qualcomm-ui/angular-core/pagination';
@@ -422,31 +422,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
422
422
  // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
423
423
  // SPDX-License-Identifier: BSD-3-Clause-Clear
424
424
  class TableColumnFilterActionDirective {
425
+ /**
426
+ * Whether the column can be filtered. Pass in the state from the column:
427
+ *
428
+ * @example
429
+ * ```angular-html
430
+ * <button
431
+ * q-table-column-filter-action
432
+ * [canFilter]="header.column.getCanFilter()"
433
+ * ></button>
434
+ * ```
435
+ */
436
+ canFilter = input(undefined, ...(ngDevMode ? [{ debugName: "canFilter", transform: booleanAttribute }] : [{
437
+ transform: booleanAttribute,
438
+ }]));
439
+ /**
440
+ * Whether the column is filtered. Pass in the state from the column:
441
+ *
442
+ * @example
443
+ * ```angular-html
444
+ * <button
445
+ * q-table-column-filter-action
446
+ * [isFiltered]="header.column.getIsFiltered()"
447
+ * ></button>
448
+ * ```
449
+ */
450
+ isFiltered = input(undefined, ...(ngDevMode ? [{ debugName: "isFiltered", transform: booleanAttribute }] : [{
451
+ transform: booleanAttribute,
452
+ }]));
425
453
  /**
426
454
  * The column header associated with the filter.
427
455
  */
428
- header = input.required(...(ngDevMode ? [{ debugName: "header" }] : []));
456
+ header = input(...(ngDevMode ? [undefined, { debugName: "header" }] : []));
429
457
  /**
430
458
  * Lucide icon to display inside the button.
431
459
  *
432
- * @default "Filter"
460
+ * @default "Funnel"
433
461
  */
434
- icon = input("Filter", ...(ngDevMode ? [{ debugName: "icon" }] : []));
435
- canFilter = computed(() => this.header().column.getCanFilter(), ...(ngDevMode ? [{ debugName: "canFilter" }] : []));
462
+ icon = input("Funnel", ...(ngDevMode ? [{ debugName: "icon" }] : []));
463
+ filterable = computed(() => this.canFilter() || this.header()?.column.getCanFilter(), ...(ngDevMode ? [{ debugName: "filterable" }] : []));
436
464
  inlineIconButtonApi = useInlineIconButtonApi({
437
465
  emphasis: "neutral",
438
466
  size: "sm",
439
467
  variant: "fixed",
440
468
  });
441
469
  trackBindings = useTrackBindings(() => mergeProps(this.inlineIconButtonApi().getRootBindings(), qdsTableApi.getColumnFilterActionBindings({
470
+ canFilter: this.canFilter(),
442
471
  header: this.header(),
472
+ isFiltered: this.isFiltered(),
443
473
  })));
444
474
  ngOnInit() {
445
475
  this.trackBindings();
446
476
  }
447
477
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: TableColumnFilterActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
448
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: TableColumnFilterActionDirective, isStandalone: false, selector: "[q-table-column-filter-action]", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ Filter })], ngImport: i0, template: `
449
- @if (canFilter()) {
478
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: TableColumnFilterActionDirective, isStandalone: false, selector: "[q-table-column-filter-action]", inputs: { canFilter: { classPropertyName: "canFilter", publicName: "canFilter", isSignal: true, isRequired: false, transformFunction: null }, isFiltered: { classPropertyName: "isFiltered", publicName: "isFiltered", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideIcons({ Funnel })], ngImport: i0, template: `
479
+ @if (filterable()) {
450
480
  <svg
451
481
  [q-bind]="inlineIconButtonApi().getIconBindings()"
452
482
  [qIcon]="icon()"
@@ -457,11 +487,11 @@ class TableColumnFilterActionDirective {
457
487
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: TableColumnFilterActionDirective, decorators: [{
458
488
  type: Component,
459
489
  args: [{
460
- providers: [provideIcons({ Filter })],
490
+ providers: [provideIcons({ Funnel })],
461
491
  selector: "[q-table-column-filter-action]",
462
492
  standalone: false,
463
493
  template: `
464
- @if (canFilter()) {
494
+ @if (filterable()) {
465
495
  <svg
466
496
  [q-bind]="inlineIconButtonApi().getIconBindings()"
467
497
  [qIcon]="icon()"
@@ -469,7 +499,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
469
499
  }
470
500
  `,
471
501
  }]
472
- }], propDecorators: { header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
502
+ }], propDecorators: { canFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "canFilter", required: false }] }], isFiltered: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFiltered", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
473
503
 
474
504
  // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
475
505
  // SPDX-License-Identifier: BSD-3-Clause-Clear
@@ -559,13 +589,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
559
589
  // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
560
590
  // SPDX-License-Identifier: BSD-3-Clause-Clear
561
591
  class TableColumnSortActionDirective {
592
+ /**
593
+ * Whether the column is sorted. Pass in the state from the column:
594
+ *
595
+ * @example
596
+ * ```angular-html
597
+ * <button
598
+ * q-table-column-sort-action
599
+ * [isSorted]="column.getIsSorted()">
600
+ * </button>
601
+ * ```
602
+ */
603
+ isSorted = input(false, ...(ngDevMode ? [{ debugName: "isSorted" }] : []));
562
604
  /**
563
605
  * The column header associated with the sort action.
564
606
  */
565
607
  header = input.required(...(ngDevMode ? [{ debugName: "header" }] : []));
566
608
  canSort = computed(() => this.header().column.getCanSort(), ...(ngDevMode ? [{ debugName: "canSort" }] : []));
567
609
  sortIcon = computed(() => {
568
- const sortDirection = this.header().column.getIsSorted();
610
+ const sortDirection = this.isSorted() || this.header().column.getIsSorted();
569
611
  return sortDirection ? "ArrowUp" : "ArrowDownUp";
570
612
  }, ...(ngDevMode ? [{ debugName: "sortIcon" }] : []));
571
613
  inlineIconButtonApi = useInlineIconButtonApi({
@@ -575,12 +617,13 @@ class TableColumnSortActionDirective {
575
617
  });
576
618
  trackBindings = useTrackBindings(() => mergeProps(this.inlineIconButtonApi().getRootBindings(), qdsTableApi.getColumnSortActionBindings({
577
619
  header: this.header(),
620
+ isSorted: this.isSorted() || this.header().column.getIsSorted(),
578
621
  })));
579
622
  ngOnInit() {
580
623
  this.trackBindings();
581
624
  }
582
625
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: TableColumnSortActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
583
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: TableColumnSortActionDirective, isStandalone: false, selector: "[q-table-column-sort-action]", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: true, transformFunction: null } }, providers: [provideIcons({ ArrowDownUp, ArrowUp })], ngImport: i0, template: `
626
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.12", type: TableColumnSortActionDirective, isStandalone: false, selector: "[q-table-column-sort-action]", inputs: { isSorted: { classPropertyName: "isSorted", publicName: "isSorted", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: true, transformFunction: null } }, providers: [provideIcons({ ArrowDownUp, ArrowUp })], ngImport: i0, template: `
584
627
  @if (canSort()) {
585
628
  <svg
586
629
  [q-bind]="inlineIconButtonApi().getIconBindings()"
@@ -604,7 +647,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
604
647
  }
605
648
  `,
606
649
  }]
607
- }], propDecorators: { header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: true }] }] } });
650
+ }], propDecorators: { isSorted: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSorted", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: true }] }] } });
608
651
 
609
652
  // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
610
653
  // SPDX-License-Identifier: BSD-3-Clause-Clear
@@ -847,6 +890,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
847
890
  // Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
848
891
  // SPDX-License-Identifier: BSD-3-Clause-Clear
849
892
  class TableRowExpandButtonDirective {
893
+ /**
894
+ * Whether the row is expanded. Pass in the state from the row:
895
+ *
896
+ * @example
897
+ * ```angular-html
898
+ * <button
899
+ * q-table-row-expand-button
900
+ * [isExpanded]="row.getIsExpanded()"
901
+ * ></button>
902
+ * ```
903
+ */
850
904
  isExpanded = input(undefined, ...(ngDevMode ? [{ debugName: "isExpanded", transform: booleanAttribute }] : [{
851
905
  transform: booleanAttribute,
852
906
  }]));