orbiq-neural-ui-kit 1.1.11 → 1.1.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.
@@ -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,23 @@ 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 class="p-0 border-0 align-middle w-12">
12611
+ <div class="flex items-center justify-center px-4 py-1.5 bg-surface-gray-1 h-full w-full rounded-l-lg">
12612
+ <neural-checkbox size="sm" [checkedModel]="isAllSelected()" (checkedModelChange)="toggleAll($event)"></neural-checkbox>
12613
+ </div>
12614
+ </th>
12615
+ }
12582
12616
  @for (col of visibleColumns(); track col.key; let first = $first; let last = $last) {
12583
- <th
12584
- class="px-4 py-2.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1"
12585
- [class.rounded-l-md]="first"
12586
- [class.rounded-r-md]="last"
12587
- [style.width]="col.width || 'auto'"
12588
- >
12589
- <div class="flex items-center justify-between group cursor-pointer hover:text-ink-gray-9" (click)="col.sortable ? onSort(col.key) : null">
12617
+ <th class="p-0 border-0 align-middle" [style.width]="col.width || 'auto'">
12618
+ <div
12619
+ class="flex items-center justify-between group cursor-pointer hover:text-ink-gray-9 px-4 py-1.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1 h-full w-full"
12620
+ [ngClass]="{
12621
+ 'rounded-l-lg': !selectable() && first,
12622
+ 'rounded-r-lg': last
12623
+ }"
12624
+ (click)="col.sortable ? onSort(col.key) : null"
12625
+ >
12590
12626
  <span class="truncate">{{ col.label }}</span>
12591
12627
  @if (col.sortable) {
12592
12628
  <i class="lucide-caret-down size-3.5 text-ink-gray-5 opacity-0 group-hover:opacity-100 transition-opacity"></i>
@@ -12599,7 +12635,12 @@ class NeuralDataTableComponent {
12599
12635
  <tbody>
12600
12636
  @if (rows().length > 0) {
12601
12637
  @for (row of rows(); track row[rowKey()]) {
12602
- <tr class="hover:bg-surface-gray-1 transition-colors group">
12638
+ <tr class="hover:bg-surface-gray-1 transition-colors group cursor-pointer" (click)="selectable() ? toggleRow(row[rowKey()]) : null">
12639
+ @if (selectable()) {
12640
+ <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()">
12641
+ <neural-checkbox size="sm" [checkedModel]="selectedKeys().has(row[rowKey()])" (checkedModelChange)="toggleRow(row[rowKey()])"></neural-checkbox>
12642
+ </td>
12643
+ }
12603
12644
  @for (col of visibleColumns(); track col.key; let last = $last) {
12604
12645
  <td
12605
12646
  class="px-4 py-3 text-[13px] font-normal text-ink-gray-8 border-b border-outline-gray-1 group-last:border-b-0"
@@ -12700,7 +12741,7 @@ class NeuralDataTableComponent {
12700
12741
  </div>
12701
12742
  </neural-dialog>
12702
12743
  </div>
12703
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NeuralButtonComponent, selector: "neural-button", inputs: ["variant", "theme", "size", "type", "disabled", "loading", "icon", "iconLeft", "iconRight", "iconOnly"], outputs: ["clicked"] }, { kind: "component", type: NeuralDialogComponent, selector: "neural-dialog", inputs: ["openModel", "title", "message", "icon", "size", "position", "paddingTop", "actions", "dismissible", "showCloseButton", "bare", "hasTitleSlot", "hasActionsSlot", "hasDefaultSlot"], outputs: ["openModelChange"] }, { kind: "component", type: NeuralSwitchComponent, selector: "neural-switch", inputs: ["valueModel", "size", "padded", "disabled", "required", "controlPosition", "icon", "label", "description", "error", "id", "hasLabelSlot", "hasDescriptionSlot"], outputs: ["valueModelChange"] }, { kind: "component", type: NeuralCheckboxComponent, selector: "neural-checkbox", inputs: ["checkedModel", "size", "padded", "indeterminate", "disabled", "required", "label", "description", "error", "id", "hasLabelSlot", "hasDescriptionSlot"], outputs: ["checkedModelChange"] }, { kind: "component", type: NeuralDropdownComponent, selector: "neural-dropdown", inputs: ["options", "side", "align", "offset", "buttonLabel", "hasTriggerSlot"] }] });
12744
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NeuralButtonComponent, selector: "neural-button", inputs: ["variant", "theme", "size", "type", "disabled", "loading", "icon", "iconLeft", "iconRight", "iconOnly"], outputs: ["clicked"] }, { kind: "component", type: NeuralDialogComponent, selector: "neural-dialog", inputs: ["openModel", "title", "message", "icon", "size", "position", "paddingTop", "actions", "dismissible", "showCloseButton", "bare", "hasTitleSlot", "hasActionsSlot", "hasDefaultSlot"], outputs: ["openModelChange"] }, { kind: "component", type: NeuralSwitchComponent, selector: "neural-switch", inputs: ["valueModel", "size", "padded", "disabled", "required", "controlPosition", "icon", "label", "description", "error", "id", "hasLabelSlot", "hasDescriptionSlot"], outputs: ["valueModelChange"] }, { kind: "component", type: NeuralCheckboxComponent, selector: "neural-checkbox", inputs: ["checkedModel", "size", "padded", "indeterminate", "disabled", "required", "label", "description", "error", "id", "hasLabelSlot", "hasDescriptionSlot"], outputs: ["checkedModelChange"] }, { kind: "component", type: NeuralDropdownComponent, selector: "neural-dropdown", inputs: ["options", "side", "align", "offset", "buttonLabel", "hasTriggerSlot"] }] });
12704
12745
  }
12705
12746
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: NeuralDataTableComponent, decorators: [{
12706
12747
  type: Component,
@@ -12802,14 +12843,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
12802
12843
  <table class="w-full text-left border-separate" style="border-spacing: 0;">
12803
12844
  <thead>
12804
12845
  <tr>
12846
+ @if (selectable()) {
12847
+ <th class="p-0 border-0 align-middle w-12">
12848
+ <div class="flex items-center justify-center px-4 py-1.5 bg-surface-gray-1 h-full w-full rounded-l-lg">
12849
+ <neural-checkbox size="sm" [checkedModel]="isAllSelected()" (checkedModelChange)="toggleAll($event)"></neural-checkbox>
12850
+ </div>
12851
+ </th>
12852
+ }
12805
12853
  @for (col of visibleColumns(); track col.key; let first = $first; let last = $last) {
12806
- <th
12807
- class="px-4 py-2.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1"
12808
- [class.rounded-l-md]="first"
12809
- [class.rounded-r-md]="last"
12810
- [style.width]="col.width || 'auto'"
12811
- >
12812
- <div class="flex items-center justify-between group cursor-pointer hover:text-ink-gray-9" (click)="col.sortable ? onSort(col.key) : null">
12854
+ <th class="p-0 border-0 align-middle" [style.width]="col.width || 'auto'">
12855
+ <div
12856
+ class="flex items-center justify-between group cursor-pointer hover:text-ink-gray-9 px-4 py-1.5 text-[13px] font-medium text-ink-gray-6 bg-surface-gray-1 h-full w-full"
12857
+ [ngClass]="{
12858
+ 'rounded-l-lg': !selectable() && first,
12859
+ 'rounded-r-lg': last
12860
+ }"
12861
+ (click)="col.sortable ? onSort(col.key) : null"
12862
+ >
12813
12863
  <span class="truncate">{{ col.label }}</span>
12814
12864
  @if (col.sortable) {
12815
12865
  <i class="lucide-caret-down size-3.5 text-ink-gray-5 opacity-0 group-hover:opacity-100 transition-opacity"></i>
@@ -12822,7 +12872,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
12822
12872
  <tbody>
12823
12873
  @if (rows().length > 0) {
12824
12874
  @for (row of rows(); track row[rowKey()]) {
12825
- <tr class="hover:bg-surface-gray-1 transition-colors group">
12875
+ <tr class="hover:bg-surface-gray-1 transition-colors group cursor-pointer" (click)="selectable() ? toggleRow(row[rowKey()]) : null">
12876
+ @if (selectable()) {
12877
+ <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()">
12878
+ <neural-checkbox size="sm" [checkedModel]="selectedKeys().has(row[rowKey()])" (checkedModelChange)="toggleRow(row[rowKey()])"></neural-checkbox>
12879
+ </td>
12880
+ }
12826
12881
  @for (col of visibleColumns(); track col.key; let last = $last) {
12827
12882
  <td
12828
12883
  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 +12980,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
12925
12980
  </div>
12926
12981
  `
12927
12982
  }]
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: [{
12983
+ }], 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
12984
  type: Output
12930
12985
  }], onPageChange: [{
12931
12986
  type: Output