orbiq-neural-ui-kit 1.1.12 → 1.1.14

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.
@@ -12422,6 +12422,33 @@ class NeuralDataTableComponent {
12422
12422
  ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
12423
12423
  rowKey = input.required(/* @ts-ignore */
12424
12424
  ...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
12425
+ // Multi-selection
12426
+ selectable = input(false, /* @ts-ignore */
12427
+ ...(ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []));
12428
+ selectedKeys = signal(new Set(), /* @ts-ignore */
12429
+ ...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
12430
+ toggleAll(checked) {
12431
+ if (checked) {
12432
+ this.selectedKeys.set(new Set(this.rows().map(r => r[this.rowKey()])));
12433
+ }
12434
+ else {
12435
+ this.selectedKeys.set(new Set());
12436
+ }
12437
+ }
12438
+ toggleRow(key) {
12439
+ const set = new Set(this.selectedKeys());
12440
+ if (set.has(key)) {
12441
+ set.delete(key);
12442
+ }
12443
+ else {
12444
+ set.add(key);
12445
+ }
12446
+ this.selectedKeys.set(set);
12447
+ }
12448
+ isAllSelected() {
12449
+ const length = this.rows().length;
12450
+ return length > 0 && this.selectedKeys().size === length;
12451
+ }
12425
12452
  page = input(1, /* @ts-ignore */
12426
12453
  ...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
12427
12454
  totalPages = input(1, /* @ts-ignore */
@@ -12495,7 +12522,7 @@ class NeuralDataTableComponent {
12495
12522
  this.sortChange.emit(key);
12496
12523
  }
12497
12524
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NeuralDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12498
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: NeuralDataTableComponent, isStandalone: true, selector: "neural-data-table", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, hasInfo: { classPropertyName: "hasInfo", publicName: "hasInfo", isSignal: true, isRequired: false, transformFunction: null }, newLabel: { classPropertyName: "newLabel", publicName: "newLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, allColumns: { classPropertyName: "allColumns", publicName: "allColumns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: true, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: false, transformFunction: null }, emptyStateTitle: { classPropertyName: "emptyStateTitle", publicName: "emptyStateTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyStateDesc: { classPropertyName: "emptyStateDesc", publicName: "emptyStateDesc", isSignal: true, isRequired: false, transformFunction: null }, customActions: { classPropertyName: "customActions", publicName: "customActions", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleActions: { classPropertyName: "maxVisibleActions", publicName: "maxVisibleActions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSearch: "onSearch", onPageChange: "onPageChange", sortChange: "sortChange", onInfoClick: "onInfoClick", onHelpClick: "onHelpClick", onRefreshClick: "onRefreshClick", onViewChange: "onViewChange", onFilterClick: "onFilterClick", onSortChangeClick: "onSortChangeClick", onSearchClick: "onSearchClick", onCustomActionClick: "onCustomActionClick", onNewClick: "onNewClick" }, host: { properties: { "attr.title": "null" } }, queries: [{ propertyName: "cellTemplate", first: true, predicate: ["cellTemplate"], descendants: true }], ngImport: i0, template: `
12525
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: NeuralDataTableComponent, isStandalone: true, selector: "neural-data-table", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, hasInfo: { classPropertyName: "hasInfo", publicName: "hasInfo", isSignal: true, isRequired: false, transformFunction: null }, newLabel: { classPropertyName: "newLabel", publicName: "newLabel", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, allColumns: { classPropertyName: "allColumns", publicName: "allColumns", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, totalPages: { classPropertyName: "totalPages", publicName: "totalPages", isSignal: true, isRequired: false, transformFunction: null }, emptyStateTitle: { classPropertyName: "emptyStateTitle", publicName: "emptyStateTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyStateDesc: { classPropertyName: "emptyStateDesc", publicName: "emptyStateDesc", isSignal: true, isRequired: false, transformFunction: null }, customActions: { classPropertyName: "customActions", publicName: "customActions", isSignal: true, isRequired: false, transformFunction: null }, maxVisibleActions: { classPropertyName: "maxVisibleActions", publicName: "maxVisibleActions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSearch: "onSearch", onPageChange: "onPageChange", sortChange: "sortChange", onInfoClick: "onInfoClick", onHelpClick: "onHelpClick", onRefreshClick: "onRefreshClick", onViewChange: "onViewChange", onFilterClick: "onFilterClick", onSortChangeClick: "onSortChangeClick", onSearchClick: "onSearchClick", onCustomActionClick: "onCustomActionClick", onNewClick: "onNewClick" }, host: { properties: { "attr.title": "null" } }, queries: [{ propertyName: "cellTemplate", first: true, predicate: ["cellTemplate"], descendants: true }], ngImport: i0, template: `
12499
12526
  <div class="flex flex-col w-full h-full bg-white rounded-md border border-outline-gray-2 shadow-sm overflow-hidden">
12500
12527
 
12501
12528
  <!-- Top Header Area -->
@@ -12579,14 +12606,27 @@ class NeuralDataTableComponent {
12579
12606
  <table class="w-full text-left border-separate" style="border-spacing: 0;">
12580
12607
  <thead>
12581
12608
  <tr>
12609
+ @if (selectable()) {
12610
+ <th
12611
+ class="px-4 py-1.5 align-middle w-12 bg-surface-gray-1 border-0"
12612
+ style="border-top-left-radius: 8px; border-bottom-left-radius: 8px;"
12613
+ >
12614
+ <div class="flex items-center justify-center h-full w-full">
12615
+ <neural-checkbox size="sm" [checkedModel]="isAllSelected()" (checkedModelChange)="toggleAll($event)"></neural-checkbox>
12616
+ </div>
12617
+ </th>
12618
+ }
12582
12619
  @for (col of visibleColumns(); track col.key; let first = $first; let last = $last) {
12583
- <th class="p-0 border-0 align-middle" [style.width]="col.width || 'auto'">
12584
- <div
12585
- class="flex items-center justify-between group cursor-pointer hover:text-ink-gray-9 px-4 py-2.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1 h-full w-full"
12586
- [class.rounded-l-lg]="first"
12587
- [class.rounded-r-lg]="last"
12588
- (click)="col.sortable ? onSort(col.key) : null"
12589
- >
12620
+ <th
12621
+ class="px-4 py-1.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1 border-0 align-middle hover:text-ink-gray-9 cursor-pointer transition-colors"
12622
+ [style.width]="col.width || 'auto'"
12623
+ [style.border-top-left-radius]="!selectable() && first ? '8px' : '0'"
12624
+ [style.border-bottom-left-radius]="!selectable() && first ? '8px' : '0'"
12625
+ [style.border-top-right-radius]="last ? '8px' : '0'"
12626
+ [style.border-bottom-right-radius]="last ? '8px' : '0'"
12627
+ (click)="col.sortable ? onSort(col.key) : null"
12628
+ >
12629
+ <div class="flex items-center justify-between group">
12590
12630
  <span class="truncate">{{ col.label }}</span>
12591
12631
  @if (col.sortable) {
12592
12632
  <i class="lucide-caret-down size-3.5 text-ink-gray-5 opacity-0 group-hover:opacity-100 transition-opacity"></i>
@@ -12599,7 +12639,12 @@ class NeuralDataTableComponent {
12599
12639
  <tbody>
12600
12640
  @if (rows().length > 0) {
12601
12641
  @for (row of rows(); track row[rowKey()]) {
12602
- <tr class="hover:bg-surface-gray-1 transition-colors group">
12642
+ <tr class="hover:bg-surface-gray-1 transition-colors group cursor-pointer" (click)="selectable() ? toggleRow(row[rowKey()]) : null">
12643
+ @if (selectable()) {
12644
+ <td class="px-4 py-2 border-b border-outline-gray-1 group-last:border-b-0 w-12 align-middle text-center" (click)="$event.stopPropagation()">
12645
+ <neural-checkbox size="sm" [checkedModel]="selectedKeys().has(row[rowKey()])" (checkedModelChange)="toggleRow(row[rowKey()])"></neural-checkbox>
12646
+ </td>
12647
+ }
12603
12648
  @for (col of visibleColumns(); track col.key; let last = $last) {
12604
12649
  <td
12605
12650
  class="px-4 py-3 text-[13px] font-normal text-ink-gray-8 border-b border-outline-gray-1 group-last:border-b-0"
@@ -12802,14 +12847,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
12802
12847
  <table class="w-full text-left border-separate" style="border-spacing: 0;">
12803
12848
  <thead>
12804
12849
  <tr>
12850
+ @if (selectable()) {
12851
+ <th
12852
+ class="px-4 py-1.5 align-middle w-12 bg-surface-gray-1 border-0"
12853
+ style="border-top-left-radius: 8px; border-bottom-left-radius: 8px;"
12854
+ >
12855
+ <div class="flex items-center justify-center h-full w-full">
12856
+ <neural-checkbox size="sm" [checkedModel]="isAllSelected()" (checkedModelChange)="toggleAll($event)"></neural-checkbox>
12857
+ </div>
12858
+ </th>
12859
+ }
12805
12860
  @for (col of visibleColumns(); track col.key; let first = $first; let last = $last) {
12806
- <th class="p-0 border-0 align-middle" [style.width]="col.width || 'auto'">
12807
- <div
12808
- class="flex items-center justify-between group cursor-pointer hover:text-ink-gray-9 px-4 py-2.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1 h-full w-full"
12809
- [class.rounded-l-lg]="first"
12810
- [class.rounded-r-lg]="last"
12811
- (click)="col.sortable ? onSort(col.key) : null"
12812
- >
12861
+ <th
12862
+ class="px-4 py-1.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1 border-0 align-middle hover:text-ink-gray-9 cursor-pointer transition-colors"
12863
+ [style.width]="col.width || 'auto'"
12864
+ [style.border-top-left-radius]="!selectable() && first ? '8px' : '0'"
12865
+ [style.border-bottom-left-radius]="!selectable() && first ? '8px' : '0'"
12866
+ [style.border-top-right-radius]="last ? '8px' : '0'"
12867
+ [style.border-bottom-right-radius]="last ? '8px' : '0'"
12868
+ (click)="col.sortable ? onSort(col.key) : null"
12869
+ >
12870
+ <div class="flex items-center justify-between group">
12813
12871
  <span class="truncate">{{ col.label }}</span>
12814
12872
  @if (col.sortable) {
12815
12873
  <i class="lucide-caret-down size-3.5 text-ink-gray-5 opacity-0 group-hover:opacity-100 transition-opacity"></i>
@@ -12822,7 +12880,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
12822
12880
  <tbody>
12823
12881
  @if (rows().length > 0) {
12824
12882
  @for (row of rows(); track row[rowKey()]) {
12825
- <tr class="hover:bg-surface-gray-1 transition-colors group">
12883
+ <tr class="hover:bg-surface-gray-1 transition-colors group cursor-pointer" (click)="selectable() ? toggleRow(row[rowKey()]) : null">
12884
+ @if (selectable()) {
12885
+ <td class="px-4 py-2 border-b border-outline-gray-1 group-last:border-b-0 w-12 align-middle text-center" (click)="$event.stopPropagation()">
12886
+ <neural-checkbox size="sm" [checkedModel]="selectedKeys().has(row[rowKey()])" (checkedModelChange)="toggleRow(row[rowKey()])"></neural-checkbox>
12887
+ </td>
12888
+ }
12826
12889
  @for (col of visibleColumns(); track col.key; let last = $last) {
12827
12890
  <td
12828
12891
  class="px-4 py-3 text-[13px] font-normal text-ink-gray-8 border-b border-outline-gray-1 group-last:border-b-0"
@@ -12925,7 +12988,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
12925
12988
  </div>
12926
12989
  `
12927
12990
  }]
12928
- }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], hasInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasInfo", required: false }] }], newLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "newLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], allColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "allColumns", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: true }] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: false }] }], emptyStateTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateTitle", required: false }] }], emptyStateDesc: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateDesc", required: false }] }], customActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "customActions", required: false }] }], maxVisibleActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleActions", required: false }] }], onSearch: [{
12991
+ }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], hasInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasInfo", required: false }] }], newLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "newLabel", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], allColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "allColumns", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }], totalPages: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalPages", required: false }] }], emptyStateTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateTitle", required: false }] }], emptyStateDesc: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyStateDesc", required: false }] }], customActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "customActions", required: false }] }], maxVisibleActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisibleActions", required: false }] }], onSearch: [{
12929
12992
  type: Output
12930
12993
  }], onPageChange: [{
12931
12994
  type: Output