yukit-web 0.8.2 → 0.8.3

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.
@@ -534,7 +534,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
534
534
  args: [{}]
535
535
  }], propDecorators: { autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], committed: [{ type: i0.Output, args: ["committed"] }] } });
536
536
 
537
- const YUW_DEFAULT_PAGE_SIZE = 20;
537
+ const YUW_DEFAULT_PAGE_SIZE = 15;
538
538
  /** `pageIndex` returns to 0 whenever `pageSize` or any of `resetSignals` changes. */
539
539
  function createPagination(pageSize, ...resetSignals) {
540
540
  return linkedSignal(() => {
@@ -554,7 +554,7 @@ function debouncedSignal(source, ms) {
554
554
  });
555
555
  }
556
556
 
557
- const PAGE_SIZES = [200, 100, 50, 20, 10];
557
+ const PAGE_SIZES = [100, 50, 30, 15];
558
558
  const SEARCH_DEBOUNCE_MS = 300;
559
559
  /**
560
560
  * State of a list paged at the source and the query derived from it. Changing search, filters,
@@ -4561,7 +4561,7 @@ const DATATABLE_WRAP_CONTENT_CLASS = 'whitespace-normal max-w-0';
4561
4561
  * - `columnVisibility`: Two-way column visibility state (`ColumnVisibilityState`).
4562
4562
  * - `rowSelection`: Two-way row selection state (`RowSelectionState`). It is cleared whenever `data` changes: TanStack
4563
4563
  * keys it by row index, so a kept selection would point at whatever rows the new data put there.
4564
- * - `pagination`: Two-way pagination state (`PaginationState`). Default is `{ pageIndex: 0, pageSize: 10 }`.
4564
+ * - `pagination`: Two-way pagination state (`PaginationState`). Default is `{ pageIndex: 0, pageSize: YUW_DEFAULT_PAGE_SIZE }`.
4565
4565
  * - `totalItems`: Total row count across all pages, for server-side pagination where `data` holds
4566
4566
  * only the current page. When set, pagination becomes manual — TanStack stops slicing `data`
4567
4567
  * itself and `getPageCount()` is derived from this count instead of `data.length`. Leave unset
@@ -4631,7 +4631,7 @@ class YuwDatatableComponent {
4631
4631
  this.loadingRows = input(5, { ...(ngDevMode ? { debugName: "loadingRows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
4632
4632
  this.nextPageLabel = input.required(...(ngDevMode ? [{ debugName: "nextPageLabel" }] : /* istanbul ignore next */ []));
4633
4633
  this.paginated = input(false, { ...(ngDevMode ? { debugName: "paginated" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
4634
- this.pagination = model({ pageIndex: 0, pageSize: 10 }, ...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
4634
+ this.pagination = model({ pageIndex: 0, pageSize: YUW_DEFAULT_PAGE_SIZE }, ...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
4635
4635
  this.paginationAriaLabel = input.required(...(ngDevMode ? [{ debugName: "paginationAriaLabel" }] : /* istanbul ignore next */ []));
4636
4636
  this.paginationEllipsisSrText = input.required(...(ngDevMode ? [{ debugName: "paginationEllipsisSrText" }] : /* istanbul ignore next */ []));
4637
4637
  this.previousPageLabel = input.required(...(ngDevMode ? [{ debugName: "previousPageLabel" }] : /* istanbul ignore next */ []));
@@ -7646,25 +7646,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
7646
7646
  *
7647
7647
  * Inputs:
7648
7648
  * - `action` (required): Callback run on click. An input because `flexRenderComponent` does not subscribe outputs.
7649
+ * - `destructive`: Paints the icon in the destructive color, for an action that removes. Default is `false`.
7649
7650
  * - `icon` (required): SVG markup of the icon.
7650
7651
  * - `label` (required): Accessible name of the button. The consuming app translates it.
7651
7652
  */
7653
+ const DESTRUCTIVE_CLASS = 'text-destructive hover:bg-destructive/10 hover:text-destructive';
7652
7654
  class YuwsIconActionCellComponent {
7653
7655
  constructor() {
7654
7656
  this.action = input.required(...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
7657
+ this.destructive = input(false, ...(ngDevMode ? [{ debugName: "destructive" }] : /* istanbul ignore next */ []));
7655
7658
  this.icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
7656
7659
  this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
7660
+ this.buttonClass = computed(() => (this.destructive() ? DESTRUCTIVE_CLASS : ''), ...(ngDevMode ? [{ debugName: "buttonClass" }] : /* istanbul ignore next */ []));
7657
7661
  }
7658
7662
  run() {
7659
7663
  this.action()();
7660
7664
  }
7661
7665
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsIconActionCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7662
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsIconActionCellComponent, isStandalone: true, selector: "yuws-icon-action-cell", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()" }, classAttribute: "yuw-reveal" }, ngImport: i0, template: "<yuw-button variant=\"ghost\" size=\"icon\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7666
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.22", type: YuwsIconActionCellComponent, isStandalone: true, selector: "yuws-icon-action-cell", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null }, destructive: { classPropertyName: "destructive", publicName: "destructive", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()" }, classAttribute: "yuw-reveal" }, ngImport: i0, template: "<yuw-button variant=\"ghost\" size=\"icon\" [class]=\"buttonClass()\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7663
7667
  }
7664
7668
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsIconActionCellComponent, decorators: [{
7665
7669
  type: Component,
7666
- args: [{ selector: 'yuws-icon-action-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon, YuwButtonComponent], host: { class: 'yuw-reveal', '(click)': '$event.stopPropagation()' }, template: "<yuw-button variant=\"ghost\" size=\"icon\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n" }]
7667
- }], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
7670
+ args: [{ selector: 'yuws-icon-action-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon, YuwButtonComponent], host: { class: 'yuw-reveal', '(click)': '$event.stopPropagation()' }, template: "<yuw-button variant=\"ghost\" size=\"icon\" [class]=\"buttonClass()\" [ariaLabel]=\"label()\" (clicked)=\"run()\">\n <ng-icon [svg]=\"icon()\" size=\"16\" />\n</yuw-button>\n" }]
7671
+ }], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }], destructive: [{ type: i0.Input, args: [{ isSignal: true, alias: "destructive", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }] } });
7668
7672
 
7669
7673
  const SIZE_CLASS = {
7670
7674
  md: 'h-11.25 w-11.25',
@@ -7744,7 +7748,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
7744
7748
  const HOVER_CLOSE_DELAY_MS = 150;
7745
7749
  /**
7746
7750
  * Table cell with the first of a row's `items` and a `+N` badge counting the rest. The whole cell is the trigger of a
7747
- * popover centred under it that lists every item; with a single item it is plain text with no popover.
7751
+ * popover centred under it that lists every item; with a single item it is plain text with no popover. The trigger's
7752
+ * `::after` stretches over the whole `<td>` (made `relative` by `theme/components/overflow-list-cell.css`), so a click
7753
+ * anywhere in the cell opens it and never reaches a clickable row.
7748
7754
  *
7749
7755
  * Only a click opens it. A mouse closes it on leaving the cell and the panel, after a short delay that lets the pointer
7750
7756
  * cross between them; an outside click or Escape closes it too, which is the only way on touch. The host stops the
@@ -7782,7 +7788,7 @@ class YuwsOverflowListCellComponent {
7782
7788
  this._closeTimer = undefined;
7783
7789
  }
7784
7790
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsOverflowListCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7785
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsOverflowListCellComponent, isStandalone: true, selector: "yuws-overflow-list-cell", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "keydown": "$event.stopPropagation()" }, classAttribute: "flex min-w-0 [&_yuw-button]:w-full" }, ngImport: i0, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n", dependencies: [{ kind: "component", type: YuwBadgeComponent, selector: "yuw-badge", inputs: ["color", "dot", "removeLabel", "variant"], outputs: ["removed"] }, { kind: "component", type: YuwPopoverComponent, selector: "yuw-popover", inputs: ["align", "description", "offsetX", "open", "panelClass", "showTrigger", "sideOffset", "title", "triggerClass", "triggerColor", "triggerSize", "triggerTransparent", "triggerVariant"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7791
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsOverflowListCellComponent, isStandalone: true, selector: "yuws-overflow-list-cell", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "keydown": "$event.stopPropagation()" }, classAttribute: "flex min-w-0 [&_yuw-button]:w-full" }, ngImport: i0, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal after:absolute after:inset-0 after:content-['']\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n", dependencies: [{ kind: "component", type: YuwBadgeComponent, selector: "yuw-badge", inputs: ["color", "dot", "removeLabel", "variant"], outputs: ["removed"] }, { kind: "component", type: YuwPopoverComponent, selector: "yuw-popover", inputs: ["align", "description", "offsetX", "open", "panelClass", "showTrigger", "sideOffset", "title", "triggerClass", "triggerColor", "triggerSize", "triggerTransparent", "triggerVariant"], outputs: ["openChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7786
7792
  }
7787
7793
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsOverflowListCellComponent, decorators: [{
7788
7794
  type: Component,
@@ -7790,7 +7796,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
7790
7796
  class: 'flex min-w-0 [&_yuw-button]:w-full',
7791
7797
  '(click)': '$event.stopPropagation()',
7792
7798
  '(keydown)': '$event.stopPropagation()',
7793
- }, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n" }]
7799
+ }, template: "@if (overflows()) {\n <yuw-popover\n triggerTransparent\n triggerClass=\"h-auto w-full min-w-0 justify-start gap-2 px-0 py-0 font-normal after:absolute after:inset-0 after:content-['']\"\n panelClass=\"w-auto min-w-48 max-w-80 gap-0 p-1\"\n [open]=\"open()\"\n (openChange)=\"onOpenChange($event)\"\n (pointerenter)=\"onPointerEnter($event)\"\n (pointerleave)=\"onPointerLeave($event)\"\n >\n <ng-container yuwPopoverTrigger>\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n <yuw-badge variant=\"outline\" color=\"neutral\" class=\"shrink-0 rounded-full px-1.5 font-normal\">\n {{ hiddenCount() }}\n </yuw-badge>\n </ng-container>\n\n <ul class=\"flex flex-col\" (pointerenter)=\"onPointerEnter($event)\" (pointerleave)=\"onPointerLeave($event)\">\n @for (item of items(); track $index) {\n <li class=\"rounded-sm px-2 py-1.5\">{{ item }}</li>\n }\n </ul>\n </yuw-popover>\n} @else {\n <span class=\"min-w-0 truncate\">{{ first() }}</span>\n}\n" }]
7794
7800
  }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }] } });
7795
7801
 
7796
7802
  /**
@@ -7943,7 +7949,12 @@ function buildYuwsIconActionColumn(column) {
7943
7949
  meta: { align: 'end', cellClass: 'w-12' },
7944
7950
  cell: ({ row }) => (column.visible?.(row.original) ?? true)
7945
7951
  ? flexRenderComponent(YuwsIconActionCellComponent, {
7946
- inputs: { icon: column.icon, label: column.label, action: () => column.onAction(row.original) },
7952
+ inputs: {
7953
+ icon: column.icon,
7954
+ label: column.label,
7955
+ destructive: column.destructive ?? false,
7956
+ action: () => column.onAction(row.original),
7957
+ },
7947
7958
  })
7948
7959
  : '',
7949
7960
  };