@rivet-health/design-system 40.8.0 → 40.9.1
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.
- package/esm2020/lib/navigation/editable-heading/editable-heading.component.mjs +78 -19
- package/esm2020/lib/table/table/clipboard.mjs +182 -0
- package/esm2020/lib/table/table/table/table.component.mjs +35 -2
- package/fesm2015/rivet-health-design-system.mjs +291 -18
- package/fesm2015/rivet-health-design-system.mjs.map +1 -1
- package/fesm2020/rivet-health-design-system.mjs +289 -18
- package/fesm2020/rivet-health-design-system.mjs.map +1 -1
- package/lib/navigation/editable-heading/editable-heading.component.d.ts +42 -8
- package/lib/table/table/clipboard.d.ts +38 -0
- package/lib/table/table/table/table.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { DOCUMENT, DatePipe as DatePipe$1, DecimalPipe, CurrencyPipe, PercentPip
|
|
|
6
6
|
import { BehaviorSubject, Subject, merge, scan, startWith, connectable, map, ReplaySubject, distinctUntilChanged, skip, filter, combineLatest, shareReplay, skipUntil, mergeScan, from, share, fromEvent, tap, switchMap, takeUntil, concatWith, of } from 'rxjs';
|
|
7
7
|
import { timeYears, timeYear, timeMonths, timeMonth, timeDays, timeDay, timeSunday, timeWeek, utcYear, utcMonth, utcWeek, utcDay } from 'd3-time';
|
|
8
8
|
import { timeFormat, utcFormat } from 'd3-time-format';
|
|
9
|
-
import { defaultsDeep, sortBy, isNumber, flattenDeep, debounce, isEqual, cloneDeep, orderBy, range, toInteger, difference, union, sum, uniq } from 'lodash';
|
|
9
|
+
import { defaultsDeep, sortBy, isNumber, flattenDeep, debounce, isEqual, cloneDeep, orderBy, range, toInteger, difference, union, sumBy, sum, uniq } from 'lodash';
|
|
10
10
|
import Fuse from 'fuse.js';
|
|
11
11
|
import { query, style, animate, trigger, transition, group } from '@angular/animations';
|
|
12
12
|
import { map as map$1, distinctUntilChanged as distinctUntilChanged$1 } from 'rxjs/operators';
|
|
@@ -5395,12 +5395,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5395
5395
|
* "commit" framing over "change" is deliberate: consumers that persist on
|
|
5396
5396
|
* commit (analytics, PATCH) treat the gesture itself as the event; those
|
|
5397
5397
|
* that only care about diffs can compare `next === current` in the handler.
|
|
5398
|
-
* There is no cancel path.
|
|
5399
5398
|
*
|
|
5400
|
-
*
|
|
5401
|
-
*
|
|
5402
|
-
*
|
|
5403
|
-
* than changing outside-click's meaning.
|
|
5399
|
+
* Escape cancels: reverts the draft back to the current value and drops out
|
|
5400
|
+
* of edit mode WITHOUT emitting a change. Outside-click still commits (to
|
|
5401
|
+
* match `riv-date` / `riv-select`); Escape is the deliberate abandon path.
|
|
5404
5402
|
*
|
|
5405
5403
|
* Value handling follows the same convention as `riv-text-field`: `[title]`
|
|
5406
5404
|
* and `[description]` are treated as suggestions, not authoritative state.
|
|
@@ -5409,6 +5407,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5409
5407
|
* a different value. That lets the component demo out of the box (e.g. in
|
|
5410
5408
|
* Storybook) without requiring a round trip through the parent.
|
|
5411
5409
|
*
|
|
5410
|
+
* Programmatic entry into edit mode is available via `startEditingTitle()`
|
|
5411
|
+
* and `startEditingDescription()` — obtain a reference with
|
|
5412
|
+
* `@ViewChild(EditableHeadingComponent)`. Use these for secondary entry
|
|
5413
|
+
* points like a kebab-menu "Rename" item, or to auto-open rename after
|
|
5414
|
+
* creating a new entity.
|
|
5415
|
+
*
|
|
5412
5416
|
* The component owns no border, background, or card chrome — consumers who
|
|
5413
5417
|
* want a bordered container should wrap it.
|
|
5414
5418
|
*
|
|
@@ -5445,6 +5449,15 @@ class EditableHeadingComponent {
|
|
|
5445
5449
|
get description() {
|
|
5446
5450
|
return this._description;
|
|
5447
5451
|
}
|
|
5452
|
+
set disabled(v) {
|
|
5453
|
+
this._disabled = v;
|
|
5454
|
+
if (v && this.mode !== 'view')
|
|
5455
|
+
this.cancel();
|
|
5456
|
+
this.cdr.markForCheck();
|
|
5457
|
+
}
|
|
5458
|
+
get disabled() {
|
|
5459
|
+
return this._disabled;
|
|
5460
|
+
}
|
|
5448
5461
|
constructor(cdr, host) {
|
|
5449
5462
|
this.cdr = cdr;
|
|
5450
5463
|
this.host = host;
|
|
@@ -5453,6 +5466,13 @@ class EditableHeadingComponent {
|
|
|
5453
5466
|
this._description = '';
|
|
5454
5467
|
this.titleMaxLength = 100;
|
|
5455
5468
|
this.descriptionMaxLength = 300;
|
|
5469
|
+
/**
|
|
5470
|
+
* When true, the title and description are not clickable and cannot be
|
|
5471
|
+
* edited. Any in-progress edit is dropped without emitting. Imperative
|
|
5472
|
+
* `startEditing*` calls no-op. Useful for consumers that need to gate
|
|
5473
|
+
* editing on a permission or a broader "actions disabled" state.
|
|
5474
|
+
*/
|
|
5475
|
+
this._disabled = false;
|
|
5456
5476
|
this.titleChange = new EventEmitter();
|
|
5457
5477
|
this.descriptionChange = new EventEmitter();
|
|
5458
5478
|
this.mode = 'view';
|
|
@@ -5462,15 +5482,38 @@ class EditableHeadingComponent {
|
|
|
5462
5482
|
get isEditing() {
|
|
5463
5483
|
return this.mode !== 'view';
|
|
5464
5484
|
}
|
|
5485
|
+
/**
|
|
5486
|
+
* Enter title-edit mode programmatically. Same behavior as clicking the
|
|
5487
|
+
* title — populates the edit buffer from the current value, focuses the
|
|
5488
|
+
* input with the caret at the end, and hides the actions slot. No-op if
|
|
5489
|
+
* already in an editing mode or when the component is disabled.
|
|
5490
|
+
*
|
|
5491
|
+
* Intended for consumers that offer a secondary entry point to renaming
|
|
5492
|
+
* (e.g. a kebab menu item), or that want to auto-open rename after
|
|
5493
|
+
* creating a new entity. Bind via `@ViewChild(EditableHeadingComponent)`.
|
|
5494
|
+
*/
|
|
5465
5495
|
startEditingTitle() {
|
|
5496
|
+
if (this.disabled || this.mode !== 'view')
|
|
5497
|
+
return;
|
|
5466
5498
|
this.draftTitle = this.title;
|
|
5467
5499
|
this.mode = 'editingTitle';
|
|
5500
|
+
// `markForCheck` so consumers can call this from outside Angular's zone
|
|
5501
|
+
// (e.g. an async callback) without having to trigger CD themselves.
|
|
5502
|
+
this.cdr.markForCheck();
|
|
5468
5503
|
// Defer focus until Angular has rendered the input into the DOM.
|
|
5469
5504
|
setTimeout(() => this.focusEnd(this.titleInputRef), 0);
|
|
5470
5505
|
}
|
|
5506
|
+
/**
|
|
5507
|
+
* Enter description-edit mode programmatically. Same behavior as clicking
|
|
5508
|
+
* the description (or the "+ Add description" button). No-op if already
|
|
5509
|
+
* in an editing mode or when the component is disabled.
|
|
5510
|
+
*/
|
|
5471
5511
|
startEditingDescription() {
|
|
5512
|
+
if (this.disabled || this.mode !== 'view')
|
|
5513
|
+
return;
|
|
5472
5514
|
this.draftDescription = this.description;
|
|
5473
5515
|
this.mode = 'editingDescription';
|
|
5516
|
+
this.cdr.markForCheck();
|
|
5474
5517
|
setTimeout(() => this.focusEnd(this.descriptionInputRef), 0);
|
|
5475
5518
|
}
|
|
5476
5519
|
commitTitle() {
|
|
@@ -5496,6 +5539,18 @@ class EditableHeadingComponent {
|
|
|
5496
5539
|
this.mode = 'view';
|
|
5497
5540
|
this.descriptionChange.emit(value);
|
|
5498
5541
|
}
|
|
5542
|
+
/**
|
|
5543
|
+
* Abandon the current edit and return to view mode. No change is emitted.
|
|
5544
|
+
* Wired to the Escape key on both edit inputs; also called internally
|
|
5545
|
+
* when `disabled` flips to true mid-edit.
|
|
5546
|
+
*/
|
|
5547
|
+
cancel() {
|
|
5548
|
+
if (this.mode === 'view')
|
|
5549
|
+
return;
|
|
5550
|
+
this.draftTitle = this._title;
|
|
5551
|
+
this.draftDescription = this._description;
|
|
5552
|
+
this.mode = 'view';
|
|
5553
|
+
}
|
|
5499
5554
|
// Listens on `mousedown` (not `click`) so the check runs before Angular
|
|
5500
5555
|
// re-renders the trigger element out of the DOM — otherwise
|
|
5501
5556
|
// `host.contains(target)` returns false for a click that landed on the
|
|
@@ -5513,23 +5568,24 @@ class EditableHeadingComponent {
|
|
|
5513
5568
|
this.commitDescription();
|
|
5514
5569
|
}
|
|
5515
5570
|
}
|
|
5516
|
-
//
|
|
5517
|
-
//
|
|
5571
|
+
// Position caret at end (rather than selecting all) so the user can continue
|
|
5572
|
+
// typing where the previous value left off. `riv-text-field` handles the
|
|
5573
|
+
// focus itself via `[autoFocus]`; we just fix up the selection range on the
|
|
5574
|
+
// descendant `<input>`.
|
|
5518
5575
|
focusEnd(ref) {
|
|
5519
|
-
const
|
|
5520
|
-
if (!
|
|
5576
|
+
const input = ref === null || ref === void 0 ? void 0 : ref.nativeElement.querySelector('input');
|
|
5577
|
+
if (!input)
|
|
5521
5578
|
return;
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
el.setSelectionRange(len, len);
|
|
5579
|
+
const len = input.value.length;
|
|
5580
|
+
input.setSelectionRange(len, len);
|
|
5525
5581
|
this.cdr.markForCheck();
|
|
5526
5582
|
}
|
|
5527
5583
|
}
|
|
5528
5584
|
EditableHeadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EditableHeadingComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5529
|
-
EditableHeadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EditableHeadingComponent, selector: "riv-editable-heading", inputs: { title: "title", description: "description", titleMaxLength: "titleMaxLength", descriptionMaxLength: "descriptionMaxLength" }, outputs: { titleChange: "titleChange", descriptionChange: "descriptionChange" }, host: { listeners: { "document:mousedown": "onDocumentMouseDown($event.target)" }, properties: { "class.editing": "this.isEditing" } }, viewQueries: [{ propertyName: "titleInputRef", first: true, predicate: ["titleInput"], descendants: true }, { propertyName: "descriptionInputRef", first: true, predicate: ["descriptionInput"], descendants: true }], ngImport: i0, template: "<div class=\"leading\">\n <ng-container [ngSwitch]=\"mode\">\n <!-- View mode -->\n <ng-container *ngSwitchDefault>\n <button\n type=\"button\"\n class=\"title\"\n [class.has-description]=\"description\"\n rivTruncate\n aria-label=\"Rename\"\n (click)=\"startEditingTitle()\"\n >\n {{ title || 'Untitled' }}\n </button>\n\n <div class=\"divider\"></div>\n\n <button\n *ngIf=\"description; else addDescription\"\n type=\"button\"\n class=\"description\"\n rivTruncate\n aria-label=\"Edit description\"\n (click)=\"startEditingDescription()\"\n >\n {{ description }}\n </button>\n\n <ng-template #addDescription>\n <div class=\"add-description-wrap\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'xsmall'\"\n [icon]=\"'Plus'\"\n [iconPosition]=\"'first'\"\n type=\"button\"\n (click)=\"startEditingDescription()\"\n >\n Add description\n </button>\n </div>\n </ng-template>\n </ng-container>\n\n
|
|
5585
|
+
EditableHeadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EditableHeadingComponent, selector: "riv-editable-heading", inputs: { title: "title", description: "description", titleMaxLength: "titleMaxLength", descriptionMaxLength: "descriptionMaxLength", disabled: "disabled" }, outputs: { titleChange: "titleChange", descriptionChange: "descriptionChange" }, host: { listeners: { "document:mousedown": "onDocumentMouseDown($event.target)" }, properties: { "class.editing": "this.isEditing" } }, viewQueries: [{ propertyName: "titleInputRef", first: true, predicate: ["titleInput"], descendants: true, read: ElementRef }, { propertyName: "descriptionInputRef", first: true, predicate: ["descriptionInput"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"leading\">\n <ng-container [ngSwitch]=\"mode\">\n <!-- View mode -->\n <ng-container *ngSwitchDefault>\n <button\n type=\"button\"\n class=\"title\"\n [class.has-description]=\"description\"\n [disabled]=\"disabled\"\n rivTruncate\n aria-label=\"Rename\"\n (click)=\"startEditingTitle()\"\n >\n {{ title || 'Untitled' }}\n </button>\n\n <div class=\"divider\"></div>\n\n <button\n *ngIf=\"description; else addDescription\"\n type=\"button\"\n class=\"description\"\n [disabled]=\"disabled\"\n rivTruncate\n aria-label=\"Edit description\"\n (click)=\"startEditingDescription()\"\n >\n {{ description }}\n </button>\n\n <ng-template #addDescription>\n <div class=\"add-description-wrap\" *ngIf=\"!disabled\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'xsmall'\"\n [icon]=\"'Plus'\"\n [iconPosition]=\"'first'\"\n type=\"button\"\n (click)=\"startEditingDescription()\"\n >\n Add description\n </button>\n </div>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'editingTitle'\">\n <riv-text-field\n #titleInput\n class=\"title-input\"\n [value]=\"draftTitle\"\n [maxLength]=\"titleMaxLength\"\n [autoFocus]=\"true\"\n (valueChange)=\"draftTitle = $event\"\n (keydown.enter)=\"commitTitle()\"\n (keydown.escape)=\"cancel()\"\n ></riv-text-field>\n <button\n rivButton\n type=\"button\"\n class=\"commit\"\n [variant]=\"'primary'\"\n [icon]=\"'Check'\"\n [disabled]=\"!draftTitle\"\n (click)=\"commitTitle()\"\n aria-label=\"Save title\"\n ></button>\n </ng-container>\n\n <!-- Editing description -->\n <ng-container *ngSwitchCase=\"'editingDescription'\">\n <riv-text-field\n #descriptionInput\n class=\"description-input\"\n placeholder=\"Add a description\"\n [value]=\"draftDescription\"\n [maxLength]=\"descriptionMaxLength\"\n [autoFocus]=\"true\"\n (valueChange)=\"draftDescription = $event\"\n (keydown.enter)=\"commitDescription()\"\n (keydown.escape)=\"cancel()\"\n ></riv-text-field>\n <button\n rivButton\n type=\"button\"\n class=\"commit\"\n [variant]=\"'primary'\"\n [icon]=\"'Check'\"\n (click)=\"commitDescription()\"\n aria-label=\"Save description\"\n ></button>\n </ng-container>\n </ng-container>\n</div>\n\n<div class=\"actions\" *ngIf=\"!isEditing\">\n <ng-content select=\"[actions]\"></ng-content>\n</div>\n", styles: [":host{display:flex;align-items:stretch;gap:var(--size-large);min-height:calc(var(--base-grid-size) * 8);font:var(--body-medium)}.leading{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:var(--size-small)}.title,.description{padding:0;border:none;background:none;text-align:left;cursor:pointer;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.title:disabled,.description:disabled{cursor:default}.title{font:var(--stat-xsmall);line-height:calc(var(--base-grid-size) * 4.5);color:var(--type-light-high-contrast);max-width:100%}.title.has-description{width:-moz-fit-content;width:fit-content;max-width:50%;flex-shrink:0}.description{font:var(--input-small);line-height:calc(var(--base-grid-size) * 3.5);color:var(--type-light-low-contrast);flex:1 1 auto}.divider{align-self:stretch;border-right:var(--border-width) solid var(--border-light);margin:0 var(--base-grid-size) 0 0;flex-shrink:0}.add-description-wrap{flex-shrink:0}.title-input,.description-input{flex:1 1 auto;min-width:0}.commit{flex-shrink:0}.actions{display:flex;align-items:center;gap:var(--size-small);flex-shrink:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: ButtonComponent, selector: "[rivButton]", inputs: ["locked", "disabled", "loading", "full", "size", "variant", "icon", "iconPosition", "current"] }, { kind: "component", type: TextFieldComponent, selector: "riv-text-field", inputs: ["disabled", "readonly", "placeholder", "casing", "type", "size", "autoFocus", "name", "minLength", "maxLength", "value"], outputs: ["valueChange", "blur"] }, { kind: "component", type: TruncateComponent, selector: "[rivTruncate]", inputs: ["maxTooltipWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5530
5586
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EditableHeadingComponent, decorators: [{
|
|
5531
5587
|
type: Component,
|
|
5532
|
-
args: [{ selector: 'riv-editable-heading', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"leading\">\n <ng-container [ngSwitch]=\"mode\">\n <!-- View mode -->\n <ng-container *ngSwitchDefault>\n <button\n type=\"button\"\n class=\"title\"\n [class.has-description]=\"description\"\n rivTruncate\n aria-label=\"Rename\"\n (click)=\"startEditingTitle()\"\n >\n {{ title || 'Untitled' }}\n </button>\n\n <div class=\"divider\"></div>\n\n <button\n *ngIf=\"description; else addDescription\"\n type=\"button\"\n class=\"description\"\n rivTruncate\n aria-label=\"Edit description\"\n (click)=\"startEditingDescription()\"\n >\n {{ description }}\n </button>\n\n <ng-template #addDescription>\n <div class=\"add-description-wrap\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'xsmall'\"\n [icon]=\"'Plus'\"\n [iconPosition]=\"'first'\"\n type=\"button\"\n (click)=\"startEditingDescription()\"\n >\n Add description\n </button>\n </div>\n </ng-template>\n </ng-container>\n\n
|
|
5588
|
+
args: [{ selector: 'riv-editable-heading', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"leading\">\n <ng-container [ngSwitch]=\"mode\">\n <!-- View mode -->\n <ng-container *ngSwitchDefault>\n <button\n type=\"button\"\n class=\"title\"\n [class.has-description]=\"description\"\n [disabled]=\"disabled\"\n rivTruncate\n aria-label=\"Rename\"\n (click)=\"startEditingTitle()\"\n >\n {{ title || 'Untitled' }}\n </button>\n\n <div class=\"divider\"></div>\n\n <button\n *ngIf=\"description; else addDescription\"\n type=\"button\"\n class=\"description\"\n [disabled]=\"disabled\"\n rivTruncate\n aria-label=\"Edit description\"\n (click)=\"startEditingDescription()\"\n >\n {{ description }}\n </button>\n\n <ng-template #addDescription>\n <div class=\"add-description-wrap\" *ngIf=\"!disabled\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'xsmall'\"\n [icon]=\"'Plus'\"\n [iconPosition]=\"'first'\"\n type=\"button\"\n (click)=\"startEditingDescription()\"\n >\n Add description\n </button>\n </div>\n </ng-template>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'editingTitle'\">\n <riv-text-field\n #titleInput\n class=\"title-input\"\n [value]=\"draftTitle\"\n [maxLength]=\"titleMaxLength\"\n [autoFocus]=\"true\"\n (valueChange)=\"draftTitle = $event\"\n (keydown.enter)=\"commitTitle()\"\n (keydown.escape)=\"cancel()\"\n ></riv-text-field>\n <button\n rivButton\n type=\"button\"\n class=\"commit\"\n [variant]=\"'primary'\"\n [icon]=\"'Check'\"\n [disabled]=\"!draftTitle\"\n (click)=\"commitTitle()\"\n aria-label=\"Save title\"\n ></button>\n </ng-container>\n\n <!-- Editing description -->\n <ng-container *ngSwitchCase=\"'editingDescription'\">\n <riv-text-field\n #descriptionInput\n class=\"description-input\"\n placeholder=\"Add a description\"\n [value]=\"draftDescription\"\n [maxLength]=\"descriptionMaxLength\"\n [autoFocus]=\"true\"\n (valueChange)=\"draftDescription = $event\"\n (keydown.enter)=\"commitDescription()\"\n (keydown.escape)=\"cancel()\"\n ></riv-text-field>\n <button\n rivButton\n type=\"button\"\n class=\"commit\"\n [variant]=\"'primary'\"\n [icon]=\"'Check'\"\n (click)=\"commitDescription()\"\n aria-label=\"Save description\"\n ></button>\n </ng-container>\n </ng-container>\n</div>\n\n<div class=\"actions\" *ngIf=\"!isEditing\">\n <ng-content select=\"[actions]\"></ng-content>\n</div>\n", styles: [":host{display:flex;align-items:stretch;gap:var(--size-large);min-height:calc(var(--base-grid-size) * 8);font:var(--body-medium)}.leading{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:var(--size-small)}.title,.description{padding:0;border:none;background:none;text-align:left;cursor:pointer;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.title:disabled,.description:disabled{cursor:default}.title{font:var(--stat-xsmall);line-height:calc(var(--base-grid-size) * 4.5);color:var(--type-light-high-contrast);max-width:100%}.title.has-description{width:-moz-fit-content;width:fit-content;max-width:50%;flex-shrink:0}.description{font:var(--input-small);line-height:calc(var(--base-grid-size) * 3.5);color:var(--type-light-low-contrast);flex:1 1 auto}.divider{align-self:stretch;border-right:var(--border-width) solid var(--border-light);margin:0 var(--base-grid-size) 0 0;flex-shrink:0}.add-description-wrap{flex-shrink:0}.title-input,.description-input{flex:1 1 auto;min-width:0}.commit{flex-shrink:0}.actions{display:flex;align-items:center;gap:var(--size-small);flex-shrink:0}\n"] }]
|
|
5533
5589
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { title: [{
|
|
5534
5590
|
type: Input
|
|
5535
5591
|
}], description: [{
|
|
@@ -5538,16 +5594,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5538
5594
|
type: Input
|
|
5539
5595
|
}], descriptionMaxLength: [{
|
|
5540
5596
|
type: Input
|
|
5597
|
+
}], disabled: [{
|
|
5598
|
+
type: Input
|
|
5541
5599
|
}], titleChange: [{
|
|
5542
5600
|
type: Output
|
|
5543
5601
|
}], descriptionChange: [{
|
|
5544
5602
|
type: Output
|
|
5545
5603
|
}], titleInputRef: [{
|
|
5546
5604
|
type: ViewChild,
|
|
5547
|
-
args: ['titleInput']
|
|
5605
|
+
args: ['titleInput', { read: ElementRef }]
|
|
5548
5606
|
}], descriptionInputRef: [{
|
|
5549
5607
|
type: ViewChild,
|
|
5550
|
-
args: ['descriptionInput']
|
|
5608
|
+
args: ['descriptionInput', { read: ElementRef }]
|
|
5551
5609
|
}], isEditing: [{
|
|
5552
5610
|
type: HostBinding,
|
|
5553
5611
|
args: ['class.editing']
|
|
@@ -8695,6 +8753,189 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
8695
8753
|
type: Input
|
|
8696
8754
|
}] } });
|
|
8697
8755
|
|
|
8756
|
+
/**
|
|
8757
|
+
* Clipboard serialization for `riv-table`.
|
|
8758
|
+
*
|
|
8759
|
+
* Rows that have a link render as `<a class="row-link">` rather than `<tr>`, and
|
|
8760
|
+
* the browser's clipboard serializer does not treat those as table rows — the
|
|
8761
|
+
* copied content pastes into a spreadsheet as one lateral run instead of a grid.
|
|
8762
|
+
* These helpers rebuild the rendered grid so that copied content pastes as rows
|
|
8763
|
+
* and columns.
|
|
8764
|
+
*/
|
|
8765
|
+
var RivTableClipboard;
|
|
8766
|
+
(function (RivTableClipboard) {
|
|
8767
|
+
/** Cells that hold controls rather than data. */
|
|
8768
|
+
const controlCellSelector = 'th.selection-head, th.menu-head, td.selection-body, td.menu-body';
|
|
8769
|
+
/** The column name within a header cell; the rest of the cell is controls. */
|
|
8770
|
+
const headerLabelSelector = '.header-wrapper';
|
|
8771
|
+
/** Elements whose text exists for assistive technology only. */
|
|
8772
|
+
const assistiveTextSelector = 'riv-sr-only';
|
|
8773
|
+
/** Rows that stand in for data rather than carrying it. */
|
|
8774
|
+
const fillerRowSelector = 'riv-zero-state';
|
|
8775
|
+
/** Elements that own their own clipboard behavior. */
|
|
8776
|
+
const editableSelector = 'input, textarea, select, [contenteditable=""], [contenteditable="true"]';
|
|
8777
|
+
/** Whether the copy came from a control that serializes its own value. */
|
|
8778
|
+
function isEditable(target) {
|
|
8779
|
+
return (target instanceof Element && target.closest(editableSelector) !== null);
|
|
8780
|
+
}
|
|
8781
|
+
RivTableClipboard.isEditable = isEditable;
|
|
8782
|
+
/**
|
|
8783
|
+
* Whether `host` is the first element of its kind that the selection touches.
|
|
8784
|
+
* A selection can span several tables; deferring to the first keeps instances
|
|
8785
|
+
* from overwriting each other's clipboard data.
|
|
8786
|
+
*/
|
|
8787
|
+
function ownsSelection(host, isSelected) {
|
|
8788
|
+
return (Array.from(document.querySelectorAll(host.localName)).find(element => isSelected(element)) === host);
|
|
8789
|
+
}
|
|
8790
|
+
RivTableClipboard.ownsSelection = ownsSelection;
|
|
8791
|
+
/**
|
|
8792
|
+
* Serializes the selected region of `tables` (one per row group), or null when
|
|
8793
|
+
* the selection covers at most one cell — those are left to the browser so
|
|
8794
|
+
* that copying part of a cell's text keeps working.
|
|
8795
|
+
*
|
|
8796
|
+
* `endpoints` are where the selection starts and ends, which narrow the copied
|
|
8797
|
+
* columns to that span. A selection is a linear range in reading order, so
|
|
8798
|
+
* dragging down one column touches every column in between; the endpoints are
|
|
8799
|
+
* what distinguish "this column" from "these rows".
|
|
8800
|
+
*/
|
|
8801
|
+
function extract(tables, isSelected, endpoints = []) {
|
|
8802
|
+
var _a;
|
|
8803
|
+
const layouts = tables.map(layout);
|
|
8804
|
+
const columns = selectedColumns(layouts, isSelected, endpoints);
|
|
8805
|
+
const headers = layouts.flatMap(l => l.header);
|
|
8806
|
+
const rows = layouts
|
|
8807
|
+
.flatMap(l => l.body)
|
|
8808
|
+
.filter(row => selectedCount(row, isSelected) > 0);
|
|
8809
|
+
// Header cells own the pointer for column reordering, so a drag cannot
|
|
8810
|
+
// reach them; the header comes along with any copied data instead.
|
|
8811
|
+
const header = (_a = headers.find(row => selectedCount(row, isSelected) > 0)) !== null && _a !== void 0 ? _a : (rows.length > 0 ? headers[0] : undefined);
|
|
8812
|
+
if (columns.length === 0 ||
|
|
8813
|
+
sumBy([...(header ? [header] : []), ...rows], row => selectedCount(row, isSelected)) < 2)
|
|
8814
|
+
return null;
|
|
8815
|
+
return {
|
|
8816
|
+
text: toText(header, rows, columns),
|
|
8817
|
+
html: toHtml(header, rows, columns),
|
|
8818
|
+
};
|
|
8819
|
+
}
|
|
8820
|
+
RivTableClipboard.extract = extract;
|
|
8821
|
+
function toText(header, rows, columns) {
|
|
8822
|
+
return [
|
|
8823
|
+
...(header ? [columns.map(column => headerText(header[column]))] : []),
|
|
8824
|
+
...rows.map(row => columns.map(column => text(row[column]))),
|
|
8825
|
+
]
|
|
8826
|
+
.map(cells => cells.join('\t'))
|
|
8827
|
+
.join('\n');
|
|
8828
|
+
}
|
|
8829
|
+
function toHtml(header, rows, columns) {
|
|
8830
|
+
const cells = (values, tag) => values.map(value => `<${tag}>${escapeHtml(value)}</${tag}>`).join('');
|
|
8831
|
+
return [
|
|
8832
|
+
'<table>',
|
|
8833
|
+
header
|
|
8834
|
+
? `<thead><tr>${cells(columns.map(column => headerText(header[column])), 'th')}</tr></thead>`
|
|
8835
|
+
: '',
|
|
8836
|
+
`<tbody>${rows
|
|
8837
|
+
.map(row => `<tr>${cells(columns.map(column => text(row[column])), 'td')}</tr>`)
|
|
8838
|
+
.join('')}</tbody>`,
|
|
8839
|
+
'</table>',
|
|
8840
|
+
].join('');
|
|
8841
|
+
}
|
|
8842
|
+
function layout(table) {
|
|
8843
|
+
return {
|
|
8844
|
+
header: grid(Array.from(table.querySelectorAll(':scope > thead > tr')).filter(isDataRow)),
|
|
8845
|
+
body: grid(Array.from(table.querySelectorAll(':scope > tbody > tr, :scope > tbody > a.row-link')).filter(isDataRow)),
|
|
8846
|
+
};
|
|
8847
|
+
}
|
|
8848
|
+
/**
|
|
8849
|
+
* Maps rows onto a column grid. Cells covered by a rowspan repeat the spanning
|
|
8850
|
+
* cell so that every line has one value per column, matching how CSV export
|
|
8851
|
+
* flattens spans.
|
|
8852
|
+
*/
|
|
8853
|
+
function grid(rows) {
|
|
8854
|
+
const cells = rows.map(() => []);
|
|
8855
|
+
rows.forEach((row, rowIndex) => {
|
|
8856
|
+
let column = 0;
|
|
8857
|
+
for (const cell of dataCells(row)) {
|
|
8858
|
+
while (cells[rowIndex][column] !== undefined)
|
|
8859
|
+
column++;
|
|
8860
|
+
const rowSpan = Math.max(1, cell.rowSpan);
|
|
8861
|
+
const colSpan = Math.max(1, cell.colSpan);
|
|
8862
|
+
for (let r = rowIndex; r <= Math.min(rows.length - 1, rowIndex + rowSpan - 1); r++)
|
|
8863
|
+
for (let c = column; c < column + colSpan; c++)
|
|
8864
|
+
cells[r][c] = cell;
|
|
8865
|
+
column += colSpan;
|
|
8866
|
+
}
|
|
8867
|
+
});
|
|
8868
|
+
return cells;
|
|
8869
|
+
}
|
|
8870
|
+
function dataCells(row) {
|
|
8871
|
+
return Array.from(row.querySelectorAll(':scope > td, :scope > th')).filter(cell => !cell.matches(controlCellSelector));
|
|
8872
|
+
}
|
|
8873
|
+
/** Excludes the zero-state row, which spans every column. */
|
|
8874
|
+
function isDataRow(row) {
|
|
8875
|
+
return (row.querySelector(fillerRowSelector) === null &&
|
|
8876
|
+
dataCells(row).every(cell => cell.colSpan <= 1));
|
|
8877
|
+
}
|
|
8878
|
+
function selectedColumns(layouts, isSelected, endpoints) {
|
|
8879
|
+
const columns = new Set();
|
|
8880
|
+
for (const { header, body } of layouts)
|
|
8881
|
+
for (const row of [...header, ...body])
|
|
8882
|
+
row.forEach((cell, column) => {
|
|
8883
|
+
if (cell !== undefined && isSelected(cell))
|
|
8884
|
+
columns.add(column);
|
|
8885
|
+
});
|
|
8886
|
+
const touched = [...columns].sort((a, b) => a - b);
|
|
8887
|
+
// Both ends have to land in a cell to describe a span; anything else (a
|
|
8888
|
+
// select-all, an endpoint on a row rather than a cell) keeps every column.
|
|
8889
|
+
const span = endpoints
|
|
8890
|
+
.map(node => (node ? columnOf(layouts, node) : undefined))
|
|
8891
|
+
.filter((column) => column !== undefined);
|
|
8892
|
+
return span.length === endpoints.length && span.length > 1
|
|
8893
|
+
? touched.filter(column => column >= Math.min(...span) && column <= Math.max(...span))
|
|
8894
|
+
: touched;
|
|
8895
|
+
}
|
|
8896
|
+
function columnOf(layouts, node) {
|
|
8897
|
+
for (const { header, body } of layouts)
|
|
8898
|
+
for (const row of [...header, ...body]) {
|
|
8899
|
+
const column = row.findIndex(cell => (cell === null || cell === void 0 ? void 0 : cell.contains(node)) === true);
|
|
8900
|
+
if (column >= 0)
|
|
8901
|
+
return column;
|
|
8902
|
+
}
|
|
8903
|
+
return undefined;
|
|
8904
|
+
}
|
|
8905
|
+
function selectedCount(row, isSelected) {
|
|
8906
|
+
return row.filter(cell => cell !== undefined && isSelected(cell)).length;
|
|
8907
|
+
}
|
|
8908
|
+
function headerText(cell) {
|
|
8909
|
+
var _a;
|
|
8910
|
+
return text((_a = cell === null || cell === void 0 ? void 0 : cell.querySelector(headerLabelSelector)) !== null && _a !== void 0 ? _a : cell);
|
|
8911
|
+
}
|
|
8912
|
+
function text(cell) {
|
|
8913
|
+
return cell ? visibleText(cell).replace(/\s+/g, ' ').trim() : '';
|
|
8914
|
+
}
|
|
8915
|
+
/**
|
|
8916
|
+
* Template indentation lands in the DOM as newlines and runs of spaces, which
|
|
8917
|
+
* split a single row across several spreadsheet rows unless collapsed by the
|
|
8918
|
+
* caller. Comment anchors and screen-reader-only content are dropped, and
|
|
8919
|
+
* sibling nodes are separated so that adjacent elements do not run together.
|
|
8920
|
+
*/
|
|
8921
|
+
function visibleText(node) {
|
|
8922
|
+
var _a;
|
|
8923
|
+
if (node instanceof Text)
|
|
8924
|
+
return (_a = node.nodeValue) !== null && _a !== void 0 ? _a : '';
|
|
8925
|
+
if (node instanceof Element)
|
|
8926
|
+
return node.matches(assistiveTextSelector)
|
|
8927
|
+
? ''
|
|
8928
|
+
: Array.from(node.childNodes).map(visibleText).join(' ');
|
|
8929
|
+
return '';
|
|
8930
|
+
}
|
|
8931
|
+
function escapeHtml(value) {
|
|
8932
|
+
return value
|
|
8933
|
+
.replace(/&/g, '&')
|
|
8934
|
+
.replace(/</g, '<')
|
|
8935
|
+
.replace(/>/g, '>');
|
|
8936
|
+
}
|
|
8937
|
+
})(RivTableClipboard || (RivTableClipboard = {}));
|
|
8938
|
+
|
|
8698
8939
|
class TableComponent {
|
|
8699
8940
|
constructor(elementRef, zone) {
|
|
8700
8941
|
this.elementRef = elementRef;
|
|
@@ -8848,6 +9089,35 @@ class TableComponent {
|
|
|
8848
9089
|
keyUp(event) {
|
|
8849
9090
|
this.shift = event.shiftKey;
|
|
8850
9091
|
}
|
|
9092
|
+
// Rows with links render as `<a class="row-link">` rather than `<tr>`, which
|
|
9093
|
+
// the browser does not serialize as a table row. Copying is handled on the
|
|
9094
|
+
// document because a select-all dispatches the event from the selection root
|
|
9095
|
+
// rather than from within the table.
|
|
9096
|
+
onCopy(event) {
|
|
9097
|
+
const selection = document.getSelection();
|
|
9098
|
+
if (!event.clipboardData ||
|
|
9099
|
+
!selection ||
|
|
9100
|
+
selection.isCollapsed ||
|
|
9101
|
+
RivTableClipboard.isEditable(event.target))
|
|
9102
|
+
return;
|
|
9103
|
+
const ranges = Array.from({ length: selection.rangeCount }, (_, i) => selection.getRangeAt(i));
|
|
9104
|
+
const isSelected = (node) => ranges.some(range => range.intersectsNode(node));
|
|
9105
|
+
const host = this.elementRef.nativeElement;
|
|
9106
|
+
if (!RivTableClipboard.ownsSelection(host, isSelected))
|
|
9107
|
+
return;
|
|
9108
|
+
const payload = RivTableClipboard.extract(
|
|
9109
|
+
// A grouped table renders one table per group, and a cell may hold a
|
|
9110
|
+
// nested table that serializes itself.
|
|
9111
|
+
Array.from(host.querySelectorAll('table')).filter(table => table.closest(host.localName) === host), isSelected,
|
|
9112
|
+
// Where the drag started and ended, which narrows the copy to the dragged
|
|
9113
|
+
// columns rather than every column the range passes through.
|
|
9114
|
+
[selection.anchorNode, selection.focusNode]);
|
|
9115
|
+
if (!payload)
|
|
9116
|
+
return;
|
|
9117
|
+
event.clipboardData.setData('text/plain', payload.text);
|
|
9118
|
+
event.clipboardData.setData('text/html', payload.html);
|
|
9119
|
+
event.preventDefault();
|
|
9120
|
+
}
|
|
8851
9121
|
selectionChange(rowId, selected) {
|
|
8852
9122
|
var _a;
|
|
8853
9123
|
(_a = this.manager) === null || _a === void 0 ? void 0 : _a.actions.next({
|
|
@@ -8925,7 +9195,7 @@ class TableComponent {
|
|
|
8925
9195
|
}
|
|
8926
9196
|
}
|
|
8927
9197
|
TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
8928
|
-
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableComponent, selector: "riv-table", inputs: { manager: "manager" }, host: { listeners: { "document:keydown": "keyDown($event)", "document:keyup": "keyUp($event)" } }, queries: [{ propertyName: "cellTemplate", first: true, predicate: ["cell"], descendants: true }, { propertyName: "summaryTemplate", first: true, predicate: ["summary"], descendants: true }, { propertyName: "menuTemplate", first: true, predicate: ["menu"], descendants: true }, { propertyName: "selectionTemplate", first: true, predicate: ["selection"], descendants: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true }, { propertyName: "subheaderTemplate", first: true, predicate: ["subheader"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container *ngIf=\"selectionCalloutPosition | async; let position\">\n <ng-container *ngIf=\"s.selection.selectedCount > 0 && selectionTemplate\">\n <riv-callout\n *riv-overlay\n [anchor]=\"position\"\n [isModal]=\"false\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n [preferredPosition]=\"'top-right'\"\n >\n <ng-container\n *ngTemplateOutlet=\"selectionTemplate; context: { state: s }\"\n ></ng-container>\n </riv-callout>\n </ng-container>\n </ng-container>\n <div class=\"loading-container\">\n <header *ngIf=\"headerTemplate\">\n <ng-container\n *ngTemplateOutlet=\"headerTemplate; context: { state: s }\"\n ></ng-container>\n </header>\n <riv-loading-cover\n class=\"container-loader-wrapper\"\n [loading]=\"s.load.loading\"\n [errorMessage]=\"s.load.error ? getErrorMessage(s.load.error) : undefined\"\n >\n <div\n class=\"container\"\n [ngClass]=\"{\n 'container-ungrouped': !s.result.isGrouped,\n 'has-header': !s.result.isGrouped && headerTemplate,\n 'without-columns': s.display.columns.length === 0\n }\"\n (rivClientSize)=\"containerSize.next($event)\"\n >\n <riv-zero-state\n *ngIf=\"s.display.columns.length === 0\"\n class=\"no-columns-message\"\n [message]=\"\n 'All columns disabled. Enable at least one column to view table data.'\n \"\n ></riv-zero-state>\n <ng-container\n *ngFor=\"\n let group of s.result.isGrouped\n ? s.result.rowGroups\n : [s.result.rowsAsGroup];\n trackBy: trackByGroup;\n let last = last\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n subheaderTemplate || null;\n context: { state: s, group }\n \"\n ></ng-container>\n <div [ngClass]=\"{ 'subcontainer-grouped': s.result.isGrouped }\">\n <table>\n <thead>\n <tr>\n <th\n *ngIf=\"!!s.selection.allowSelection\"\n class=\"selection-head\"\n >\n <riv-sr-only>Select rows</riv-sr-only>\n <div\n *ngIf=\"\n s.selection.allowSelection !== 'individual' &&\n s.selection.allowSelection === true\n \"\n class=\"checkbox-wrapper\"\n >\n <riv-checkbox\n *ngIf=\"!s.result.isGrouped\"\n [value]=\"s.selection.isAllSelected === true\"\n [indeterminate]=\"\n s.selection.isAllSelected === 'indeterminate'\n \"\n (valueChange)=\"\n manager?.actions?.next({ type: 'allSelectedChange' })\n \"\n ariaLabel=\"Select all rows\"\n ></riv-checkbox>\n <riv-checkbox\n *ngIf=\"s.result.isGrouped\"\n [value]=\"group.selected === true\"\n [indeterminate]=\"group.selected === 'indeterminate'\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'groupSelectionChange',\n payload: group\n })\n \"\n ariaLabel=\"Select group rows\"\n ></riv-checkbox>\n </div>\n </th>\n <th\n *ngFor=\"let column of s.display.columns; let i = index\"\n [class.pinned]=\"column.pinned\"\n [style.left.px]=\"column.left\"\n [style.width.px]=\"getWidth(column)\"\n [attr.draggable]=\"s.display.columnsAreReorderable\"\n droppable=\"true\"\n class=\"drop-zone\"\n (dragstart)=\"dragStart(i, column.key)\"\n (dragenter)=\"$event.preventDefault(); dragOver(i)\"\n (drop)=\"drop(i, s.display.enabledCount)\"\n [class.dragged-over-left]=\"\n draggedOverColumnIdx === i &&\n draggedColumnIdx !== null &&\n draggedColumnIdx > i\n \"\n [class.dragged-over-right]=\"\n draggedOverColumnIdx === i &&\n draggedColumnIdx !== null &&\n draggedColumnIdx < i\n \"\n >\n <div\n *ngIf=\"\n !column.orderable &&\n !column.filterable &&\n !s.display.columnsAreFreezable &&\n !s.display.columnsAreHideable\n \"\n class=\"header-wrapper\"\n [class.left]=\"column.alignment === 'left'\"\n [class.right]=\"column.alignment === 'right'\"\n >\n {{ s.display.columnNameMap.get(column.key) }}\n </div>\n <riv-menu\n *ngIf=\"\n column.orderable ||\n column.filterable ||\n s.display.columnsAreFreezable ||\n s.display.columnsAreHideable\n \"\n >\n <ng-template #trigger>\n <button\n type=\"button\"\n class=\"header-wrapper\"\n [class.left]=\"column.alignment === 'left'\"\n [class.right]=\"column.alignment === 'right'\"\n [class.active]=\"s.query.order?.column === column.key\"\n >\n {{ s.display.columnNameMap.get(column.key) }}\n <span class=\"icon-container\">\n <riv-icon\n [size]=\"12\"\n [name]=\"\n s.query.order?.direction === 'desc'\n ? 'ArrowDown'\n : 'ArrowUp'\n \"\n ></riv-icon>\n </span>\n </button>\n <riv-table-header-resize-handle\n (dragResize)=\"setWidth(column.key, $event)\"\n ></riv-table-header-resize-handle>\n </ng-template>\n <ng-container *ngIf=\"column.orderable\">\n <button\n *ngIf=\"\n !(\n s.query.order?.column === column.key &&\n s.query.order?.direction === 'asc'\n )\n \"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: {\n direction: 'asc',\n column: column.key\n }\n })\n \"\n >\n Sort ascending\n </button>\n <button\n *ngIf=\"s.query.order?.column === column.key\"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: null\n })\n \"\n >\n Remove sort\n </button>\n <button\n *ngIf=\"\n !(\n s.query.order?.column === column.key &&\n s.query.order?.direction === 'desc'\n )\n \"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: {\n direction: 'desc',\n column: column.key\n }\n })\n \"\n >\n Sort descending\n </button>\n </ng-container>\n <div\n class=\"riv-divider\"\n *ngIf=\"column.orderable && column.filterable\"\n ></div>\n <button\n *ngIf=\"column.filterable\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'filterAdd',\n columnKey: column.key\n })\n \"\n >\n Add a filter\n </button>\n <div\n class=\"riv-divider\"\n *ngIf=\"\n (column.orderable || column.filterable) &&\n (s.display.columnsAreFreezable ||\n s.display.columnsAreHideable)\n \"\n ></div>\n <ng-container *ngIf=\"s.display.columnsAreFreezable\">\n <button\n *ngIf=\"!column.pinned\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnsFreezeUpToChange',\n freeze: true,\n index: i,\n source: 'headerMenu',\n column: column.key\n })\n \"\n >\n Freeze up to column\n </button>\n <button\n *ngIf=\"column.pinned\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnsFreezeUpToChange',\n freeze: false,\n index: 0,\n source: 'headerMenu',\n column: column.key\n })\n \"\n >\n Un-freeze columns\n </button>\n </ng-container>\n <button\n *ngIf=\"s.display.columnsAreHideable\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnEnabledChange',\n column: column.key,\n enabled: false,\n source: 'headerMenu'\n })\n \"\n >\n Hide column\n </button>\n </riv-menu>\n </th>\n <th *ngIf=\"menuTemplate\" class=\"menu-head\">\n <riv-sr-only>Menu</riv-sr-only>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngIf=\"s.result.totalMatchingRowCount > 0; else empty\"\n >\n <ng-container\n *ngFor=\"\n let row of group.rows;\n let rowIndex = index;\n trackBy: trackByRow\n \"\n >\n <ng-template #rowBody>\n <td\n *ngIf=\"\n s.selection.allowSelection === true ||\n s.selection.allowSelection === 'individual'\n \"\n class=\"selection-body\"\n (click)=\"$event.preventDefault()\"\n >\n <label\n class=\"checkbox-wrapper\"\n (click)=\"$event.stopPropagation()\"\n >\n <riv-checkbox\n [identifier]=\"'riv-table-selection-' + row.id\"\n [value]=\"row.selected\"\n (valueChange)=\"selectionChange(row.id, $event)\"\n ariaLabel=\"Select row\"\n ></riv-checkbox>\n </label>\n </td>\n <ng-container\n *ngFor=\"\n let column of s.display.columns;\n trackBy: trackByColumn\n \"\n >\n <ng-container\n *ngIf=\"\n s.display.cellRowSpan(rowIndex, column.key) as span\n \"\n >\n <td\n *ngIf=\"span > 0\"\n [attr.rowspan]=\"span\"\n [class.rs-right-border]=\"\n s.display.needsRightBorder(rowIndex, column.key)\n \"\n [class.pinned]=\"column.pinned\"\n [class.advanced]=\"column.dataType === 'advanced'\"\n [style.left.px]=\"column.left\"\n [style.text-align]=\"column.alignment\"\n (click)=\"handleClick($event, column)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTemplate || null;\n context: { row: row, column: column }\n \"\n ></ng-container>\n </td>\n </ng-container>\n </ng-container>\n <td\n *ngIf=\"menuTemplate\"\n class=\"menu-body\"\n (click)=\"\n $event.stopPropagation(); $event.preventDefault()\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n menuTemplate || null;\n context: { row: row }\n \"\n ></ng-container>\n </td>\n </ng-template>\n <ng-container *ngIf=\"row.rowLink; let rl\">\n <a\n *ngIf=\"isExternalRowLink(rl)\"\n [href]=\"rl.href\"\n draggable=\"false\"\n class=\"row-link\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n >\n <ng-container\n *ngTemplateOutlet=\"rowBody\"\n ></ng-container>\n </a>\n <a\n *ngIf=\"isInternalRowLink(rl)\"\n draggable=\"false\"\n [routerLink]=\"rl.routerLink\"\n [queryParams]=\"rl.queryParams\"\n [queryParamsHandling]=\"rl.queryParamsHandling\"\n class=\"row-link\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n [class.active]=\"rl.active\"\n >\n <ng-container\n *ngTemplateOutlet=\"rowBody\"\n ></ng-container>\n </a>\n </ng-container>\n <tr\n *ngIf=\"!row.rowLink\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n >\n <ng-container *ngTemplateOutlet=\"rowBody\"></ng-container>\n </tr>\n </ng-container>\n <tr *ngIf=\"s.display.customSummaryRow\">\n <td\n *ngFor=\"\n let column of s.display.columns;\n trackBy: trackByColumn\n \"\n [class.pinned]=\"column.pinned\"\n [class.advanced]=\"column.dataType === 'advanced'\"\n [style.left.px]=\"column.left\"\n [style.text-align]=\"column.alignment\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n summaryTemplate || null;\n context: { column: column }\n \"\n ></ng-container>\n </td>\n </tr>\n </ng-container>\n <ng-template #empty>\n <tr>\n <td [attr.colspan]=\"s.display.columns.length\">\n <riv-zero-state\n *ngIf=\"s.display.zeroStateMessage; let message\"\n [message]=\"message\"\n ></riv-zero-state>\n </td>\n </tr>\n </ng-template>\n </tbody>\n </table>\n </div>\n <div\n class=\"footer\"\n *ngIf=\"\n s.result.isGrouped &&\n group.totalMatchingRowCount > s.query.grouping.countPerGroup &&\n group.rows.length === s.query.grouping.countPerGroup\n \"\n >\n <span\n rivLink\n class=\"footer-link\"\n (click)=\"\n manager?.actions?.next({\n type: 'viewMoreKeyChange',\n viewMoreKey: group.groupData.key.toString()\n })\n \"\n >View all {{ group.totalMatchingRowCount }}</span\n >\n </div>\n <br *ngIf=\"!last\" />\n </ng-container>\n </div>\n <div *ngIf=\"s.query.pagination.showControls\" class=\"pagination\">\n <div class=\"page-size-controls\">\n <ng-container\n *ngIf=\"!s.result.isGrouped && !s.display.hidePageSizeSelector\"\n >\n <span> Results per page: </span>\n <riv-simple-select\n [selectedOption]=\"{\n id: s.query.pagination.pageSize.toString(),\n title: s.query.pagination.pageSize.toString(),\n value: s.query.pagination.pageSize\n }\"\n (selectedOptionChange)=\"\n manager?.actions?.next({\n type: 'pageSizeChange',\n size: $event?.value || 25\n })\n \"\n [optionGroups]=\"pageSizeOptions\"\n [size]=\"'small'\"\n [orderBy]=\"'source'\"\n ></riv-simple-select>\n </ng-container>\n </div>\n <span\n *ngIf=\"s.result.totalMatchingRowCount > 0 && !s.result.isGrouped\"\n class=\"page-data-indicator\"\n >\n {{ s.query.pagination.pageRowStart | rivNumber }}-{{\n s.query.pagination.pageRowEnd | rivNumber\n }}\n of\n {{ s.result.totalMatchingRowCount | rivNumber }}\n </span>\n <div\n *ngIf=\"s.query.pagination.showControls\"\n class=\"pagination-controls\"\n >\n <button\n rivButton\n [variant]=\"'basic'\"\n [size]=\"'small'\"\n [icon]=\"'ArrowLeft'\"\n type=\"button\"\n [disabled]=\"s.query.pagination.previous === null\"\n (click)=\"manager?.actions?.next({ type: 'previousPageNavigate' })\"\n ></button>\n <span\n *ngIf=\"s.query.pagination.pages[0] > 0\"\n class=\"truncated-pages left\"\n >\n …\n </span>\n <button\n *ngFor=\"let page of s.query.pagination.pages\"\n class=\"page\"\n type=\"button\"\n [disabled]=\"page === s.query.pagination.page\"\n (click)=\"manager?.actions?.next({ type: 'pageChange', page })\"\n >\n {{ page + 1 }}\n </button>\n <span\n *ngIf=\"\n s.query.pagination.pages[s.query.pagination.pages.length - 1] <\n s.query.pagination.pageCount - 1\n \"\n class=\"truncated-pages right\"\n >\n …\n </span>\n <button\n rivButton\n [variant]=\"'basic'\"\n [size]=\"'small'\"\n [icon]=\"'ArrowRight'\"\n type=\"button\"\n [disabled]=\"s.query.pagination.next === null\"\n (click)=\"manager?.actions?.next({ type: 'nextPageNavigate' })\"\n ></button>\n </div>\n </div>\n </riv-loading-cover>\n </div>\n</ng-container>\n", styles: [":host{display:flex;min-height:0}.no-columns-message{position:sticky;inset:0;z-index:var(--loadable-z-index);background-color:var(--surface-light-0)}riv-loading-cover,.loading-container{width:100%;display:grid;grid-template-rows:1fr auto;gap:0}header{border-width:var(--border-width) var(--border-width) 0 var(--border-width);border-style:solid;border-color:var(--border-light);border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium)}header:has(+ div > .subheader){border-bottom-width:var(--border-width);border-bottom-left-radius:var(--border-radius-medium);border-bottom-right-radius:var(--border-radius-medium);margin-bottom:var(--size-large)}header+.container>.subcontainer{border-top-left-radius:0;border-top-right-radius:0}.container-loader-wrapper{min-height:0}.container{overflow:auto}.container.without-columns{overflow:hidden;position:relative}.container-ungrouped{border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-medium)}.container-ungrouped.has-header{border-top-left-radius:0;border-top-right-radius:0}.subcontainer-grouped{overflow:auto;border:var(--border-width) solid var(--border-light);border-top-right-radius:var(--border-radius-medium);border-top-left-radius:var(--border-radius-medium)}.subcontainer-grouped:not(:has(+ .footer)){border-bottom-right-radius:var(--border-radius-medium);border-bottom-left-radius:var(--border-radius-medium)}table{border-collapse:separate;width:100%;table-layout:fixed}thead{position:sticky;top:0;z-index:var(--above-scroll-z-index)}th{border-bottom:var(--border-width) solid var(--border-light);background-color:var(--surface-light-1);position:relative}th:not(:last-child){border-right:var(--border-width) solid var(--border-light)}th.pinned{position:sticky;top:0;z-index:1}th.dragged-over-left:before,th.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}th.dragged-over-left:before{left:0}th.dragged-over-right:before{right:0}th.selection-head{width:var(--size-xxlarge);position:sticky;z-index:1;left:0;vertical-align:middle;height:calc(var(--base-grid-size) * 8 + var(--border-width))}.checkbox-wrapper{display:flex;justify-content:center;align-items:center}label.checkbox-wrapper{cursor:pointer;width:100%;height:100%}th.menu-head{width:var(--size-xxlarge);position:sticky;z-index:1;right:0}th>riv-menu{width:100%}.header-wrapper{font-size:var(--size-medium);font-weight:var(--font-weight-heavy);line-height:1;padding:var(--size-xsmall) var(--size-small);display:inline-flex;align-items:center;justify-content:center;width:100%;height:calc(var(--base-grid-size) * 8);white-space:nowrap}.header-wrapper.left{justify-content:flex-start}.header-wrapper.right{justify-content:flex-end}button.header-wrapper{transition:background-color var(--short-transition);cursor:pointer}button.header-wrapper:hover{background-color:var(--black-20)}button.header-wrapper .icon-container{overflow:hidden;display:inline-block;width:0;height:1em;opacity:0;padding-left:0;transition:width var(--medium-transition),opacity var(--medium-transition),color var(--medium-transition),padding-left var(--medium-transition)}button.header-wrapper.active .icon-container{width:calc(var(--base-grid-size) * 3.5);padding-left:var(--size-xsmall);opacity:1}button.header-wrapper:hover .icon-container{color:var(--type-light-low-contrast)}button.header-wrapper.active .icon-container{color:var(--brand)}a.row-link{display:table-row;text-decoration:none;color:inherit;-webkit-user-select:text;user-select:text}a.row-link td{transition:background-color var(--short-transition);-webkit-user-select:text;user-select:text}a.row-link:hover td{background-color:var(--surface-light-2)}a.row-link:active td{background-color:var(--surface-light-3)}td.rs-hover{background-color:var(--surface-light-2)}td{border-bottom:var(--border-width) solid var(--border-light);height:calc(var(--base-grid-size) * 8);padding:var(--size-xxsmall) var(--size-small);font:var(--body-small);vertical-align:middle;text-align:center;background-color:var(--surface-light-0)}tr.grayed td,a.row-link.grayed td{background-color:var(--gray-30)}tbody>*:last-child>td{border-bottom:none}td.pinned{position:sticky;z-index:1}td.pinned:not(:has(+ td.pinned)){border-right:var(--border-width) solid var(--border-light)}td.advanced,td.selection-body,td.menu-body{padding:0;vertical-align:middle}td.selection-body{position:sticky;z-index:1;left:0}td.menu-body{position:sticky;z-index:1;right:0}.pagination{margin-top:var(--size-small);display:flex;justify-content:space-between;gap:var(--size-large)}.page-size-controls,.pagination-controls{display:flex;align-items:center;gap:var(--size-xsmall)}.page-data-indicator{display:flex;align-items:center;flex-grow:1;justify-content:flex-end;font:var(--body-medium);color:var(--type-light-low-contrast)}.page-size-controls span{font:var(--body-medium)}.page{display:flex;align-items:center;justify-content:center;min-width:calc(var(--base-grid-size) * 7.5);height:calc(var(--base-grid-size) * 7.5);padding:var(--size-xxsmall);font:var(--input-medium);color:var(--purp-80);border-radius:var(--border-radius-small);transition:background-color var(--short-transition)}.page:hover,.page:disabled{background-color:var(--black-20)}.page:active:not(:disabled){background-color:var(--black-40)}.page:not(:disabled){cursor:pointer}.truncated-pages{color:var(--type-light-disabled)}.truncated-pages.left{padding-left:var(--size-small)}.truncated-pages.right{padding-right:var(--size-small)}.footer{background-color:var(--surface-light-1);border-bottom:var(--border-width) solid var(--border-light);border-left:var(--border-width) solid var(--border-light);border-right:var(--border-width) solid var(--border-light);border-bottom-left-radius:var(--border-radius-medium);border-bottom-right-radius:var(--border-radius-medium);text-align:right;padding:calc(var(--base-grid-size) / 2);font:var(--body-medium)}.footer-link{margin-right:var(--size-medium)}td[rowspan]:not([rowspan=\"1\"]){border-right:var(--border-width) solid var(--border-light)}td.rs-right-border{border-right:var(--border-width) solid var(--border-light)}a.row-link.active>td{background-color:var(--surface-light-selected)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ButtonComponent, selector: "[rivButton]", inputs: ["locked", "disabled", "loading", "full", "size", "variant", "icon", "iconPosition", "current"] }, { kind: "component", type: CalloutComponent, selector: "riv-callout", inputs: ["anchor", "isModal", "preferredPosition", "allowedPositions", "fallbackDirection", "showCaret", "theme"], outputs: ["close"] }, { kind: "component", type: CheckboxComponent, selector: "riv-checkbox", inputs: ["name", "identifier", "value", "checkedColorToken", "indeterminateColorToken", "checkboxTooltip", "indeterminate", "disabled", "required", "state", "errorMessage", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: IconComponent, selector: "riv-icon", inputs: ["name", "fillColor", "size", "customSize", "strokeWidth"] }, { kind: "component", type: LinkComponent, selector: "[rivLink]", inputs: ["disabled", "locked", "theme", "variant"] }, { kind: "component", type: LoadingCoverComponent, selector: "riv-loading-cover", inputs: ["loading", "loadingSize", "zIndexOverride", "errorMessage"] }, { kind: "component", type: MenuComponent, selector: "riv-menu", inputs: ["preferredPosition"] }, { kind: "component", type: MenuItemComponent, selector: "[riv-menu-item]", inputs: ["locked", "disabled", "variant"] }, { kind: "directive", type: OverlayDirective, selector: "[riv-overlay]" }, { kind: "component", type: SimpleSelectComponent, selector: "riv-simple-select", inputs: ["optionGroups", "selectedOption", "size", "disabled", "locked", "filterabilityOptions", "orderBy", "placeholder", "maxHeight", "maxWidth", "minHeight", "minWidth", "dividers", "preferredCalloutPosition", "allowedCalloutPositions"], outputs: ["selectedOptionChange"] }, { kind: "directive", type: SizeDirective, selector: "[rivClientSize]", outputs: ["rivClientSize"] }, { kind: "component", type: SrOnlyComponent, selector: "riv-sr-only" }, { kind: "component", type: TableHeaderResizeHandleComponent, selector: "riv-table-header-resize-handle", outputs: ["dragResize"] }, { kind: "component", type: ZeroStateComponent, selector: "riv-zero-state", inputs: ["message", "title", "icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: NumberPipe, name: "rivNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9198
|
+
TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableComponent, selector: "riv-table", inputs: { manager: "manager" }, host: { listeners: { "document:keydown": "keyDown($event)", "document:keyup": "keyUp($event)", "document:copy": "onCopy($event)" } }, queries: [{ propertyName: "cellTemplate", first: true, predicate: ["cell"], descendants: true }, { propertyName: "summaryTemplate", first: true, predicate: ["summary"], descendants: true }, { propertyName: "menuTemplate", first: true, predicate: ["menu"], descendants: true }, { propertyName: "selectionTemplate", first: true, predicate: ["selection"], descendants: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true }, { propertyName: "subheaderTemplate", first: true, predicate: ["subheader"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container *ngIf=\"selectionCalloutPosition | async; let position\">\n <ng-container *ngIf=\"s.selection.selectedCount > 0 && selectionTemplate\">\n <riv-callout\n *riv-overlay\n [anchor]=\"position\"\n [isModal]=\"false\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n [preferredPosition]=\"'top-right'\"\n >\n <ng-container\n *ngTemplateOutlet=\"selectionTemplate; context: { state: s }\"\n ></ng-container>\n </riv-callout>\n </ng-container>\n </ng-container>\n <div class=\"loading-container\">\n <header *ngIf=\"headerTemplate\">\n <ng-container\n *ngTemplateOutlet=\"headerTemplate; context: { state: s }\"\n ></ng-container>\n </header>\n <riv-loading-cover\n class=\"container-loader-wrapper\"\n [loading]=\"s.load.loading\"\n [errorMessage]=\"s.load.error ? getErrorMessage(s.load.error) : undefined\"\n >\n <div\n class=\"container\"\n [ngClass]=\"{\n 'container-ungrouped': !s.result.isGrouped,\n 'has-header': !s.result.isGrouped && headerTemplate,\n 'without-columns': s.display.columns.length === 0\n }\"\n (rivClientSize)=\"containerSize.next($event)\"\n >\n <riv-zero-state\n *ngIf=\"s.display.columns.length === 0\"\n class=\"no-columns-message\"\n [message]=\"\n 'All columns disabled. Enable at least one column to view table data.'\n \"\n ></riv-zero-state>\n <ng-container\n *ngFor=\"\n let group of s.result.isGrouped\n ? s.result.rowGroups\n : [s.result.rowsAsGroup];\n trackBy: trackByGroup;\n let last = last\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n subheaderTemplate || null;\n context: { state: s, group }\n \"\n ></ng-container>\n <div [ngClass]=\"{ 'subcontainer-grouped': s.result.isGrouped }\">\n <table>\n <thead>\n <tr>\n <th\n *ngIf=\"!!s.selection.allowSelection\"\n class=\"selection-head\"\n >\n <riv-sr-only>Select rows</riv-sr-only>\n <div\n *ngIf=\"\n s.selection.allowSelection !== 'individual' &&\n s.selection.allowSelection === true\n \"\n class=\"checkbox-wrapper\"\n >\n <riv-checkbox\n *ngIf=\"!s.result.isGrouped\"\n [value]=\"s.selection.isAllSelected === true\"\n [indeterminate]=\"\n s.selection.isAllSelected === 'indeterminate'\n \"\n (valueChange)=\"\n manager?.actions?.next({ type: 'allSelectedChange' })\n \"\n ariaLabel=\"Select all rows\"\n ></riv-checkbox>\n <riv-checkbox\n *ngIf=\"s.result.isGrouped\"\n [value]=\"group.selected === true\"\n [indeterminate]=\"group.selected === 'indeterminate'\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'groupSelectionChange',\n payload: group\n })\n \"\n ariaLabel=\"Select group rows\"\n ></riv-checkbox>\n </div>\n </th>\n <th\n *ngFor=\"let column of s.display.columns; let i = index\"\n [class.pinned]=\"column.pinned\"\n [style.left.px]=\"column.left\"\n [style.width.px]=\"getWidth(column)\"\n [attr.draggable]=\"s.display.columnsAreReorderable\"\n droppable=\"true\"\n class=\"drop-zone\"\n (dragstart)=\"dragStart(i, column.key)\"\n (dragenter)=\"$event.preventDefault(); dragOver(i)\"\n (drop)=\"drop(i, s.display.enabledCount)\"\n [class.dragged-over-left]=\"\n draggedOverColumnIdx === i &&\n draggedColumnIdx !== null &&\n draggedColumnIdx > i\n \"\n [class.dragged-over-right]=\"\n draggedOverColumnIdx === i &&\n draggedColumnIdx !== null &&\n draggedColumnIdx < i\n \"\n >\n <div\n *ngIf=\"\n !column.orderable &&\n !column.filterable &&\n !s.display.columnsAreFreezable &&\n !s.display.columnsAreHideable\n \"\n class=\"header-wrapper\"\n [class.left]=\"column.alignment === 'left'\"\n [class.right]=\"column.alignment === 'right'\"\n >\n {{ s.display.columnNameMap.get(column.key) }}\n </div>\n <riv-menu\n *ngIf=\"\n column.orderable ||\n column.filterable ||\n s.display.columnsAreFreezable ||\n s.display.columnsAreHideable\n \"\n >\n <ng-template #trigger>\n <button\n type=\"button\"\n class=\"header-wrapper\"\n [class.left]=\"column.alignment === 'left'\"\n [class.right]=\"column.alignment === 'right'\"\n [class.active]=\"s.query.order?.column === column.key\"\n >\n {{ s.display.columnNameMap.get(column.key) }}\n <span class=\"icon-container\">\n <riv-icon\n [size]=\"12\"\n [name]=\"\n s.query.order?.direction === 'desc'\n ? 'ArrowDown'\n : 'ArrowUp'\n \"\n ></riv-icon>\n </span>\n </button>\n <riv-table-header-resize-handle\n (dragResize)=\"setWidth(column.key, $event)\"\n ></riv-table-header-resize-handle>\n </ng-template>\n <ng-container *ngIf=\"column.orderable\">\n <button\n *ngIf=\"\n !(\n s.query.order?.column === column.key &&\n s.query.order?.direction === 'asc'\n )\n \"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: {\n direction: 'asc',\n column: column.key\n }\n })\n \"\n >\n Sort ascending\n </button>\n <button\n *ngIf=\"s.query.order?.column === column.key\"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: null\n })\n \"\n >\n Remove sort\n </button>\n <button\n *ngIf=\"\n !(\n s.query.order?.column === column.key &&\n s.query.order?.direction === 'desc'\n )\n \"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: {\n direction: 'desc',\n column: column.key\n }\n })\n \"\n >\n Sort descending\n </button>\n </ng-container>\n <div\n class=\"riv-divider\"\n *ngIf=\"column.orderable && column.filterable\"\n ></div>\n <button\n *ngIf=\"column.filterable\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'filterAdd',\n columnKey: column.key\n })\n \"\n >\n Add a filter\n </button>\n <div\n class=\"riv-divider\"\n *ngIf=\"\n (column.orderable || column.filterable) &&\n (s.display.columnsAreFreezable ||\n s.display.columnsAreHideable)\n \"\n ></div>\n <ng-container *ngIf=\"s.display.columnsAreFreezable\">\n <button\n *ngIf=\"!column.pinned\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnsFreezeUpToChange',\n freeze: true,\n index: i,\n source: 'headerMenu',\n column: column.key\n })\n \"\n >\n Freeze up to column\n </button>\n <button\n *ngIf=\"column.pinned\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnsFreezeUpToChange',\n freeze: false,\n index: 0,\n source: 'headerMenu',\n column: column.key\n })\n \"\n >\n Un-freeze columns\n </button>\n </ng-container>\n <button\n *ngIf=\"s.display.columnsAreHideable\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnEnabledChange',\n column: column.key,\n enabled: false,\n source: 'headerMenu'\n })\n \"\n >\n Hide column\n </button>\n </riv-menu>\n </th>\n <th *ngIf=\"menuTemplate\" class=\"menu-head\">\n <riv-sr-only>Menu</riv-sr-only>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngIf=\"s.result.totalMatchingRowCount > 0; else empty\"\n >\n <ng-container\n *ngFor=\"\n let row of group.rows;\n let rowIndex = index;\n trackBy: trackByRow\n \"\n >\n <ng-template #rowBody>\n <td\n *ngIf=\"\n s.selection.allowSelection === true ||\n s.selection.allowSelection === 'individual'\n \"\n class=\"selection-body\"\n (click)=\"$event.preventDefault()\"\n >\n <label\n class=\"checkbox-wrapper\"\n (click)=\"$event.stopPropagation()\"\n >\n <riv-checkbox\n [identifier]=\"'riv-table-selection-' + row.id\"\n [value]=\"row.selected\"\n (valueChange)=\"selectionChange(row.id, $event)\"\n ariaLabel=\"Select row\"\n ></riv-checkbox>\n </label>\n </td>\n <ng-container\n *ngFor=\"\n let column of s.display.columns;\n trackBy: trackByColumn\n \"\n >\n <ng-container\n *ngIf=\"\n s.display.cellRowSpan(rowIndex, column.key) as span\n \"\n >\n <td\n *ngIf=\"span > 0\"\n [attr.rowspan]=\"span\"\n [class.rs-right-border]=\"\n s.display.needsRightBorder(rowIndex, column.key)\n \"\n [class.pinned]=\"column.pinned\"\n [class.advanced]=\"column.dataType === 'advanced'\"\n [style.left.px]=\"column.left\"\n [style.text-align]=\"column.alignment\"\n (click)=\"handleClick($event, column)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTemplate || null;\n context: { row: row, column: column }\n \"\n ></ng-container>\n </td>\n </ng-container>\n </ng-container>\n <td\n *ngIf=\"menuTemplate\"\n class=\"menu-body\"\n (click)=\"\n $event.stopPropagation(); $event.preventDefault()\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n menuTemplate || null;\n context: { row: row }\n \"\n ></ng-container>\n </td>\n </ng-template>\n <ng-container *ngIf=\"row.rowLink; let rl\">\n <a\n *ngIf=\"isExternalRowLink(rl)\"\n [href]=\"rl.href\"\n draggable=\"false\"\n class=\"row-link\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n >\n <ng-container\n *ngTemplateOutlet=\"rowBody\"\n ></ng-container>\n </a>\n <a\n *ngIf=\"isInternalRowLink(rl)\"\n draggable=\"false\"\n [routerLink]=\"rl.routerLink\"\n [queryParams]=\"rl.queryParams\"\n [queryParamsHandling]=\"rl.queryParamsHandling\"\n class=\"row-link\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n [class.active]=\"rl.active\"\n >\n <ng-container\n *ngTemplateOutlet=\"rowBody\"\n ></ng-container>\n </a>\n </ng-container>\n <tr\n *ngIf=\"!row.rowLink\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n >\n <ng-container *ngTemplateOutlet=\"rowBody\"></ng-container>\n </tr>\n </ng-container>\n <tr *ngIf=\"s.display.customSummaryRow\">\n <td\n *ngFor=\"\n let column of s.display.columns;\n trackBy: trackByColumn\n \"\n [class.pinned]=\"column.pinned\"\n [class.advanced]=\"column.dataType === 'advanced'\"\n [style.left.px]=\"column.left\"\n [style.text-align]=\"column.alignment\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n summaryTemplate || null;\n context: { column: column }\n \"\n ></ng-container>\n </td>\n </tr>\n </ng-container>\n <ng-template #empty>\n <tr>\n <td [attr.colspan]=\"s.display.columns.length\">\n <riv-zero-state\n *ngIf=\"s.display.zeroStateMessage; let message\"\n [message]=\"message\"\n ></riv-zero-state>\n </td>\n </tr>\n </ng-template>\n </tbody>\n </table>\n </div>\n <div\n class=\"footer\"\n *ngIf=\"\n s.result.isGrouped &&\n group.totalMatchingRowCount > s.query.grouping.countPerGroup &&\n group.rows.length === s.query.grouping.countPerGroup\n \"\n >\n <span\n rivLink\n class=\"footer-link\"\n (click)=\"\n manager?.actions?.next({\n type: 'viewMoreKeyChange',\n viewMoreKey: group.groupData.key.toString()\n })\n \"\n >View all {{ group.totalMatchingRowCount }}</span\n >\n </div>\n <br *ngIf=\"!last\" />\n </ng-container>\n </div>\n <div *ngIf=\"s.query.pagination.showControls\" class=\"pagination\">\n <div class=\"page-size-controls\">\n <ng-container\n *ngIf=\"!s.result.isGrouped && !s.display.hidePageSizeSelector\"\n >\n <span> Results per page: </span>\n <riv-simple-select\n [selectedOption]=\"{\n id: s.query.pagination.pageSize.toString(),\n title: s.query.pagination.pageSize.toString(),\n value: s.query.pagination.pageSize\n }\"\n (selectedOptionChange)=\"\n manager?.actions?.next({\n type: 'pageSizeChange',\n size: $event?.value || 25\n })\n \"\n [optionGroups]=\"pageSizeOptions\"\n [size]=\"'small'\"\n [orderBy]=\"'source'\"\n ></riv-simple-select>\n </ng-container>\n </div>\n <span\n *ngIf=\"s.result.totalMatchingRowCount > 0 && !s.result.isGrouped\"\n class=\"page-data-indicator\"\n >\n {{ s.query.pagination.pageRowStart | rivNumber }}-{{\n s.query.pagination.pageRowEnd | rivNumber\n }}\n of\n {{ s.result.totalMatchingRowCount | rivNumber }}\n </span>\n <div\n *ngIf=\"s.query.pagination.showControls\"\n class=\"pagination-controls\"\n >\n <button\n rivButton\n [variant]=\"'basic'\"\n [size]=\"'small'\"\n [icon]=\"'ArrowLeft'\"\n type=\"button\"\n [disabled]=\"s.query.pagination.previous === null\"\n (click)=\"manager?.actions?.next({ type: 'previousPageNavigate' })\"\n ></button>\n <span\n *ngIf=\"s.query.pagination.pages[0] > 0\"\n class=\"truncated-pages left\"\n >\n …\n </span>\n <button\n *ngFor=\"let page of s.query.pagination.pages\"\n class=\"page\"\n type=\"button\"\n [disabled]=\"page === s.query.pagination.page\"\n (click)=\"manager?.actions?.next({ type: 'pageChange', page })\"\n >\n {{ page + 1 }}\n </button>\n <span\n *ngIf=\"\n s.query.pagination.pages[s.query.pagination.pages.length - 1] <\n s.query.pagination.pageCount - 1\n \"\n class=\"truncated-pages right\"\n >\n …\n </span>\n <button\n rivButton\n [variant]=\"'basic'\"\n [size]=\"'small'\"\n [icon]=\"'ArrowRight'\"\n type=\"button\"\n [disabled]=\"s.query.pagination.next === null\"\n (click)=\"manager?.actions?.next({ type: 'nextPageNavigate' })\"\n ></button>\n </div>\n </div>\n </riv-loading-cover>\n </div>\n</ng-container>\n", styles: [":host{display:flex;min-height:0}.no-columns-message{position:sticky;inset:0;z-index:var(--loadable-z-index);background-color:var(--surface-light-0)}riv-loading-cover,.loading-container{width:100%;display:grid;grid-template-rows:1fr auto;gap:0}header{border-width:var(--border-width) var(--border-width) 0 var(--border-width);border-style:solid;border-color:var(--border-light);border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium)}header:has(+ div > .subheader){border-bottom-width:var(--border-width);border-bottom-left-radius:var(--border-radius-medium);border-bottom-right-radius:var(--border-radius-medium);margin-bottom:var(--size-large)}header+.container>.subcontainer{border-top-left-radius:0;border-top-right-radius:0}.container-loader-wrapper{min-height:0}.container{overflow:auto}.container.without-columns{overflow:hidden;position:relative}.container-ungrouped{border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-medium)}.container-ungrouped.has-header{border-top-left-radius:0;border-top-right-radius:0}.subcontainer-grouped{overflow:auto;border:var(--border-width) solid var(--border-light);border-top-right-radius:var(--border-radius-medium);border-top-left-radius:var(--border-radius-medium)}.subcontainer-grouped:not(:has(+ .footer)){border-bottom-right-radius:var(--border-radius-medium);border-bottom-left-radius:var(--border-radius-medium)}table{border-collapse:separate;width:100%;table-layout:fixed}thead{position:sticky;top:0;z-index:var(--above-scroll-z-index)}th{border-bottom:var(--border-width) solid var(--border-light);background-color:var(--surface-light-1);position:relative}th:not(:last-child){border-right:var(--border-width) solid var(--border-light)}th.pinned{position:sticky;top:0;z-index:1}th.dragged-over-left:before,th.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}th.dragged-over-left:before{left:0}th.dragged-over-right:before{right:0}th.selection-head{width:var(--size-xxlarge);position:sticky;z-index:1;left:0;vertical-align:middle;height:calc(var(--base-grid-size) * 8 + var(--border-width))}.checkbox-wrapper{display:flex;justify-content:center;align-items:center}label.checkbox-wrapper{cursor:pointer;width:100%;height:100%}th.menu-head{width:var(--size-xxlarge);position:sticky;z-index:1;right:0}th>riv-menu{width:100%}.header-wrapper{font-size:var(--size-medium);font-weight:var(--font-weight-heavy);line-height:1;padding:var(--size-xsmall) var(--size-small);display:inline-flex;align-items:center;justify-content:center;width:100%;height:calc(var(--base-grid-size) * 8);white-space:nowrap}.header-wrapper.left{justify-content:flex-start}.header-wrapper.right{justify-content:flex-end}button.header-wrapper{transition:background-color var(--short-transition);cursor:pointer}button.header-wrapper:hover{background-color:var(--black-20)}button.header-wrapper .icon-container{overflow:hidden;display:inline-block;width:0;height:1em;opacity:0;padding-left:0;transition:width var(--medium-transition),opacity var(--medium-transition),color var(--medium-transition),padding-left var(--medium-transition)}button.header-wrapper.active .icon-container{width:calc(var(--base-grid-size) * 3.5);padding-left:var(--size-xsmall);opacity:1}button.header-wrapper:hover .icon-container{color:var(--type-light-low-contrast)}button.header-wrapper.active .icon-container{color:var(--brand)}a.row-link{display:table-row;text-decoration:none;color:inherit;-webkit-user-select:text;user-select:text}a.row-link td{transition:background-color var(--short-transition);-webkit-user-select:text;user-select:text}a.row-link:hover td{background-color:var(--surface-light-2)}a.row-link:active td{background-color:var(--surface-light-3)}td.rs-hover{background-color:var(--surface-light-2)}td{border-bottom:var(--border-width) solid var(--border-light);height:calc(var(--base-grid-size) * 8);padding:var(--size-xxsmall) var(--size-small);font:var(--body-small);vertical-align:middle;text-align:center;background-color:var(--surface-light-0)}tr.grayed td,a.row-link.grayed td{background-color:var(--gray-30)}tbody>*:last-child>td{border-bottom:none}td.pinned{position:sticky;z-index:1}td.pinned:not(:has(+ td.pinned)){border-right:var(--border-width) solid var(--border-light)}td.advanced,td.selection-body,td.menu-body{padding:0;vertical-align:middle}td.selection-body{position:sticky;z-index:1;left:0}td.menu-body{position:sticky;z-index:1;right:0}.pagination{margin-top:var(--size-small);display:flex;justify-content:space-between;gap:var(--size-large)}.page-size-controls,.pagination-controls{display:flex;align-items:center;gap:var(--size-xsmall)}.page-data-indicator{display:flex;align-items:center;flex-grow:1;justify-content:flex-end;font:var(--body-medium);color:var(--type-light-low-contrast)}.page-size-controls span{font:var(--body-medium)}.page{display:flex;align-items:center;justify-content:center;min-width:calc(var(--base-grid-size) * 7.5);height:calc(var(--base-grid-size) * 7.5);padding:var(--size-xxsmall);font:var(--input-medium);color:var(--purp-80);border-radius:var(--border-radius-small);transition:background-color var(--short-transition)}.page:hover,.page:disabled{background-color:var(--black-20)}.page:active:not(:disabled){background-color:var(--black-40)}.page:not(:disabled){cursor:pointer}.truncated-pages{color:var(--type-light-disabled)}.truncated-pages.left{padding-left:var(--size-small)}.truncated-pages.right{padding-right:var(--size-small)}.footer{background-color:var(--surface-light-1);border-bottom:var(--border-width) solid var(--border-light);border-left:var(--border-width) solid var(--border-light);border-right:var(--border-width) solid var(--border-light);border-bottom-left-radius:var(--border-radius-medium);border-bottom-right-radius:var(--border-radius-medium);text-align:right;padding:calc(var(--base-grid-size) / 2);font:var(--body-medium)}.footer-link{margin-right:var(--size-medium)}td[rowspan]:not([rowspan=\"1\"]){border-right:var(--border-width) solid var(--border-light)}td.rs-right-border{border-right:var(--border-width) solid var(--border-light)}a.row-link.active>td{background-color:var(--surface-light-selected)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ButtonComponent, selector: "[rivButton]", inputs: ["locked", "disabled", "loading", "full", "size", "variant", "icon", "iconPosition", "current"] }, { kind: "component", type: CalloutComponent, selector: "riv-callout", inputs: ["anchor", "isModal", "preferredPosition", "allowedPositions", "fallbackDirection", "showCaret", "theme"], outputs: ["close"] }, { kind: "component", type: CheckboxComponent, selector: "riv-checkbox", inputs: ["name", "identifier", "value", "checkedColorToken", "indeterminateColorToken", "checkboxTooltip", "indeterminate", "disabled", "required", "state", "errorMessage", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: IconComponent, selector: "riv-icon", inputs: ["name", "fillColor", "size", "customSize", "strokeWidth"] }, { kind: "component", type: LinkComponent, selector: "[rivLink]", inputs: ["disabled", "locked", "theme", "variant"] }, { kind: "component", type: LoadingCoverComponent, selector: "riv-loading-cover", inputs: ["loading", "loadingSize", "zIndexOverride", "errorMessage"] }, { kind: "component", type: MenuComponent, selector: "riv-menu", inputs: ["preferredPosition"] }, { kind: "component", type: MenuItemComponent, selector: "[riv-menu-item]", inputs: ["locked", "disabled", "variant"] }, { kind: "directive", type: OverlayDirective, selector: "[riv-overlay]" }, { kind: "component", type: SimpleSelectComponent, selector: "riv-simple-select", inputs: ["optionGroups", "selectedOption", "size", "disabled", "locked", "filterabilityOptions", "orderBy", "placeholder", "maxHeight", "maxWidth", "minHeight", "minWidth", "dividers", "preferredCalloutPosition", "allowedCalloutPositions"], outputs: ["selectedOptionChange"] }, { kind: "directive", type: SizeDirective, selector: "[rivClientSize]", outputs: ["rivClientSize"] }, { kind: "component", type: SrOnlyComponent, selector: "riv-sr-only" }, { kind: "component", type: TableHeaderResizeHandleComponent, selector: "riv-table-header-resize-handle", outputs: ["dragResize"] }, { kind: "component", type: ZeroStateComponent, selector: "riv-zero-state", inputs: ["message", "title", "icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: NumberPipe, name: "rivNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8929
9199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, decorators: [{
|
|
8930
9200
|
type: Component,
|
|
8931
9201
|
args: [{ selector: 'riv-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container *ngIf=\"selectionCalloutPosition | async; let position\">\n <ng-container *ngIf=\"s.selection.selectedCount > 0 && selectionTemplate\">\n <riv-callout\n *riv-overlay\n [anchor]=\"position\"\n [isModal]=\"false\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n [preferredPosition]=\"'top-right'\"\n >\n <ng-container\n *ngTemplateOutlet=\"selectionTemplate; context: { state: s }\"\n ></ng-container>\n </riv-callout>\n </ng-container>\n </ng-container>\n <div class=\"loading-container\">\n <header *ngIf=\"headerTemplate\">\n <ng-container\n *ngTemplateOutlet=\"headerTemplate; context: { state: s }\"\n ></ng-container>\n </header>\n <riv-loading-cover\n class=\"container-loader-wrapper\"\n [loading]=\"s.load.loading\"\n [errorMessage]=\"s.load.error ? getErrorMessage(s.load.error) : undefined\"\n >\n <div\n class=\"container\"\n [ngClass]=\"{\n 'container-ungrouped': !s.result.isGrouped,\n 'has-header': !s.result.isGrouped && headerTemplate,\n 'without-columns': s.display.columns.length === 0\n }\"\n (rivClientSize)=\"containerSize.next($event)\"\n >\n <riv-zero-state\n *ngIf=\"s.display.columns.length === 0\"\n class=\"no-columns-message\"\n [message]=\"\n 'All columns disabled. Enable at least one column to view table data.'\n \"\n ></riv-zero-state>\n <ng-container\n *ngFor=\"\n let group of s.result.isGrouped\n ? s.result.rowGroups\n : [s.result.rowsAsGroup];\n trackBy: trackByGroup;\n let last = last\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n subheaderTemplate || null;\n context: { state: s, group }\n \"\n ></ng-container>\n <div [ngClass]=\"{ 'subcontainer-grouped': s.result.isGrouped }\">\n <table>\n <thead>\n <tr>\n <th\n *ngIf=\"!!s.selection.allowSelection\"\n class=\"selection-head\"\n >\n <riv-sr-only>Select rows</riv-sr-only>\n <div\n *ngIf=\"\n s.selection.allowSelection !== 'individual' &&\n s.selection.allowSelection === true\n \"\n class=\"checkbox-wrapper\"\n >\n <riv-checkbox\n *ngIf=\"!s.result.isGrouped\"\n [value]=\"s.selection.isAllSelected === true\"\n [indeterminate]=\"\n s.selection.isAllSelected === 'indeterminate'\n \"\n (valueChange)=\"\n manager?.actions?.next({ type: 'allSelectedChange' })\n \"\n ariaLabel=\"Select all rows\"\n ></riv-checkbox>\n <riv-checkbox\n *ngIf=\"s.result.isGrouped\"\n [value]=\"group.selected === true\"\n [indeterminate]=\"group.selected === 'indeterminate'\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'groupSelectionChange',\n payload: group\n })\n \"\n ariaLabel=\"Select group rows\"\n ></riv-checkbox>\n </div>\n </th>\n <th\n *ngFor=\"let column of s.display.columns; let i = index\"\n [class.pinned]=\"column.pinned\"\n [style.left.px]=\"column.left\"\n [style.width.px]=\"getWidth(column)\"\n [attr.draggable]=\"s.display.columnsAreReorderable\"\n droppable=\"true\"\n class=\"drop-zone\"\n (dragstart)=\"dragStart(i, column.key)\"\n (dragenter)=\"$event.preventDefault(); dragOver(i)\"\n (drop)=\"drop(i, s.display.enabledCount)\"\n [class.dragged-over-left]=\"\n draggedOverColumnIdx === i &&\n draggedColumnIdx !== null &&\n draggedColumnIdx > i\n \"\n [class.dragged-over-right]=\"\n draggedOverColumnIdx === i &&\n draggedColumnIdx !== null &&\n draggedColumnIdx < i\n \"\n >\n <div\n *ngIf=\"\n !column.orderable &&\n !column.filterable &&\n !s.display.columnsAreFreezable &&\n !s.display.columnsAreHideable\n \"\n class=\"header-wrapper\"\n [class.left]=\"column.alignment === 'left'\"\n [class.right]=\"column.alignment === 'right'\"\n >\n {{ s.display.columnNameMap.get(column.key) }}\n </div>\n <riv-menu\n *ngIf=\"\n column.orderable ||\n column.filterable ||\n s.display.columnsAreFreezable ||\n s.display.columnsAreHideable\n \"\n >\n <ng-template #trigger>\n <button\n type=\"button\"\n class=\"header-wrapper\"\n [class.left]=\"column.alignment === 'left'\"\n [class.right]=\"column.alignment === 'right'\"\n [class.active]=\"s.query.order?.column === column.key\"\n >\n {{ s.display.columnNameMap.get(column.key) }}\n <span class=\"icon-container\">\n <riv-icon\n [size]=\"12\"\n [name]=\"\n s.query.order?.direction === 'desc'\n ? 'ArrowDown'\n : 'ArrowUp'\n \"\n ></riv-icon>\n </span>\n </button>\n <riv-table-header-resize-handle\n (dragResize)=\"setWidth(column.key, $event)\"\n ></riv-table-header-resize-handle>\n </ng-template>\n <ng-container *ngIf=\"column.orderable\">\n <button\n *ngIf=\"\n !(\n s.query.order?.column === column.key &&\n s.query.order?.direction === 'asc'\n )\n \"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: {\n direction: 'asc',\n column: column.key\n }\n })\n \"\n >\n Sort ascending\n </button>\n <button\n *ngIf=\"s.query.order?.column === column.key\"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: null\n })\n \"\n >\n Remove sort\n </button>\n <button\n *ngIf=\"\n !(\n s.query.order?.column === column.key &&\n s.query.order?.direction === 'desc'\n )\n \"\n riv-menu-item\n (click)=\"\n manager?.actions?.next({\n type: 'orderChange',\n source: 'headerMenu',\n payload: {\n direction: 'desc',\n column: column.key\n }\n })\n \"\n >\n Sort descending\n </button>\n </ng-container>\n <div\n class=\"riv-divider\"\n *ngIf=\"column.orderable && column.filterable\"\n ></div>\n <button\n *ngIf=\"column.filterable\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'filterAdd',\n columnKey: column.key\n })\n \"\n >\n Add a filter\n </button>\n <div\n class=\"riv-divider\"\n *ngIf=\"\n (column.orderable || column.filterable) &&\n (s.display.columnsAreFreezable ||\n s.display.columnsAreHideable)\n \"\n ></div>\n <ng-container *ngIf=\"s.display.columnsAreFreezable\">\n <button\n *ngIf=\"!column.pinned\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnsFreezeUpToChange',\n freeze: true,\n index: i,\n source: 'headerMenu',\n column: column.key\n })\n \"\n >\n Freeze up to column\n </button>\n <button\n *ngIf=\"column.pinned\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnsFreezeUpToChange',\n freeze: false,\n index: 0,\n source: 'headerMenu',\n column: column.key\n })\n \"\n >\n Un-freeze columns\n </button>\n </ng-container>\n <button\n *ngIf=\"s.display.columnsAreHideable\"\n riv-menu-item\n (click)=\"\n this.manager?.actions?.next({\n type: 'columnEnabledChange',\n column: column.key,\n enabled: false,\n source: 'headerMenu'\n })\n \"\n >\n Hide column\n </button>\n </riv-menu>\n </th>\n <th *ngIf=\"menuTemplate\" class=\"menu-head\">\n <riv-sr-only>Menu</riv-sr-only>\n </th>\n </tr>\n </thead>\n <tbody>\n <ng-container\n *ngIf=\"s.result.totalMatchingRowCount > 0; else empty\"\n >\n <ng-container\n *ngFor=\"\n let row of group.rows;\n let rowIndex = index;\n trackBy: trackByRow\n \"\n >\n <ng-template #rowBody>\n <td\n *ngIf=\"\n s.selection.allowSelection === true ||\n s.selection.allowSelection === 'individual'\n \"\n class=\"selection-body\"\n (click)=\"$event.preventDefault()\"\n >\n <label\n class=\"checkbox-wrapper\"\n (click)=\"$event.stopPropagation()\"\n >\n <riv-checkbox\n [identifier]=\"'riv-table-selection-' + row.id\"\n [value]=\"row.selected\"\n (valueChange)=\"selectionChange(row.id, $event)\"\n ariaLabel=\"Select row\"\n ></riv-checkbox>\n </label>\n </td>\n <ng-container\n *ngFor=\"\n let column of s.display.columns;\n trackBy: trackByColumn\n \"\n >\n <ng-container\n *ngIf=\"\n s.display.cellRowSpan(rowIndex, column.key) as span\n \"\n >\n <td\n *ngIf=\"span > 0\"\n [attr.rowspan]=\"span\"\n [class.rs-right-border]=\"\n s.display.needsRightBorder(rowIndex, column.key)\n \"\n [class.pinned]=\"column.pinned\"\n [class.advanced]=\"column.dataType === 'advanced'\"\n [style.left.px]=\"column.left\"\n [style.text-align]=\"column.alignment\"\n (click)=\"handleClick($event, column)\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n cellTemplate || null;\n context: { row: row, column: column }\n \"\n ></ng-container>\n </td>\n </ng-container>\n </ng-container>\n <td\n *ngIf=\"menuTemplate\"\n class=\"menu-body\"\n (click)=\"\n $event.stopPropagation(); $event.preventDefault()\n \"\n >\n <ng-container\n *ngTemplateOutlet=\"\n menuTemplate || null;\n context: { row: row }\n \"\n ></ng-container>\n </td>\n </ng-template>\n <ng-container *ngIf=\"row.rowLink; let rl\">\n <a\n *ngIf=\"isExternalRowLink(rl)\"\n [href]=\"rl.href\"\n draggable=\"false\"\n class=\"row-link\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n >\n <ng-container\n *ngTemplateOutlet=\"rowBody\"\n ></ng-container>\n </a>\n <a\n *ngIf=\"isInternalRowLink(rl)\"\n draggable=\"false\"\n [routerLink]=\"rl.routerLink\"\n [queryParams]=\"rl.queryParams\"\n [queryParamsHandling]=\"rl.queryParamsHandling\"\n class=\"row-link\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n [class.active]=\"rl.active\"\n >\n <ng-container\n *ngTemplateOutlet=\"rowBody\"\n ></ng-container>\n </a>\n </ng-container>\n <tr\n *ngIf=\"!row.rowLink\"\n [class.grayed]=\"s.display.rowsAreGrayed\"\n >\n <ng-container *ngTemplateOutlet=\"rowBody\"></ng-container>\n </tr>\n </ng-container>\n <tr *ngIf=\"s.display.customSummaryRow\">\n <td\n *ngFor=\"\n let column of s.display.columns;\n trackBy: trackByColumn\n \"\n [class.pinned]=\"column.pinned\"\n [class.advanced]=\"column.dataType === 'advanced'\"\n [style.left.px]=\"column.left\"\n [style.text-align]=\"column.alignment\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n summaryTemplate || null;\n context: { column: column }\n \"\n ></ng-container>\n </td>\n </tr>\n </ng-container>\n <ng-template #empty>\n <tr>\n <td [attr.colspan]=\"s.display.columns.length\">\n <riv-zero-state\n *ngIf=\"s.display.zeroStateMessage; let message\"\n [message]=\"message\"\n ></riv-zero-state>\n </td>\n </tr>\n </ng-template>\n </tbody>\n </table>\n </div>\n <div\n class=\"footer\"\n *ngIf=\"\n s.result.isGrouped &&\n group.totalMatchingRowCount > s.query.grouping.countPerGroup &&\n group.rows.length === s.query.grouping.countPerGroup\n \"\n >\n <span\n rivLink\n class=\"footer-link\"\n (click)=\"\n manager?.actions?.next({\n type: 'viewMoreKeyChange',\n viewMoreKey: group.groupData.key.toString()\n })\n \"\n >View all {{ group.totalMatchingRowCount }}</span\n >\n </div>\n <br *ngIf=\"!last\" />\n </ng-container>\n </div>\n <div *ngIf=\"s.query.pagination.showControls\" class=\"pagination\">\n <div class=\"page-size-controls\">\n <ng-container\n *ngIf=\"!s.result.isGrouped && !s.display.hidePageSizeSelector\"\n >\n <span> Results per page: </span>\n <riv-simple-select\n [selectedOption]=\"{\n id: s.query.pagination.pageSize.toString(),\n title: s.query.pagination.pageSize.toString(),\n value: s.query.pagination.pageSize\n }\"\n (selectedOptionChange)=\"\n manager?.actions?.next({\n type: 'pageSizeChange',\n size: $event?.value || 25\n })\n \"\n [optionGroups]=\"pageSizeOptions\"\n [size]=\"'small'\"\n [orderBy]=\"'source'\"\n ></riv-simple-select>\n </ng-container>\n </div>\n <span\n *ngIf=\"s.result.totalMatchingRowCount > 0 && !s.result.isGrouped\"\n class=\"page-data-indicator\"\n >\n {{ s.query.pagination.pageRowStart | rivNumber }}-{{\n s.query.pagination.pageRowEnd | rivNumber\n }}\n of\n {{ s.result.totalMatchingRowCount | rivNumber }}\n </span>\n <div\n *ngIf=\"s.query.pagination.showControls\"\n class=\"pagination-controls\"\n >\n <button\n rivButton\n [variant]=\"'basic'\"\n [size]=\"'small'\"\n [icon]=\"'ArrowLeft'\"\n type=\"button\"\n [disabled]=\"s.query.pagination.previous === null\"\n (click)=\"manager?.actions?.next({ type: 'previousPageNavigate' })\"\n ></button>\n <span\n *ngIf=\"s.query.pagination.pages[0] > 0\"\n class=\"truncated-pages left\"\n >\n …\n </span>\n <button\n *ngFor=\"let page of s.query.pagination.pages\"\n class=\"page\"\n type=\"button\"\n [disabled]=\"page === s.query.pagination.page\"\n (click)=\"manager?.actions?.next({ type: 'pageChange', page })\"\n >\n {{ page + 1 }}\n </button>\n <span\n *ngIf=\"\n s.query.pagination.pages[s.query.pagination.pages.length - 1] <\n s.query.pagination.pageCount - 1\n \"\n class=\"truncated-pages right\"\n >\n …\n </span>\n <button\n rivButton\n [variant]=\"'basic'\"\n [size]=\"'small'\"\n [icon]=\"'ArrowRight'\"\n type=\"button\"\n [disabled]=\"s.query.pagination.next === null\"\n (click)=\"manager?.actions?.next({ type: 'nextPageNavigate' })\"\n ></button>\n </div>\n </div>\n </riv-loading-cover>\n </div>\n</ng-container>\n", styles: [":host{display:flex;min-height:0}.no-columns-message{position:sticky;inset:0;z-index:var(--loadable-z-index);background-color:var(--surface-light-0)}riv-loading-cover,.loading-container{width:100%;display:grid;grid-template-rows:1fr auto;gap:0}header{border-width:var(--border-width) var(--border-width) 0 var(--border-width);border-style:solid;border-color:var(--border-light);border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium)}header:has(+ div > .subheader){border-bottom-width:var(--border-width);border-bottom-left-radius:var(--border-radius-medium);border-bottom-right-radius:var(--border-radius-medium);margin-bottom:var(--size-large)}header+.container>.subcontainer{border-top-left-radius:0;border-top-right-radius:0}.container-loader-wrapper{min-height:0}.container{overflow:auto}.container.without-columns{overflow:hidden;position:relative}.container-ungrouped{border:var(--border-width) solid var(--border-light);border-radius:var(--border-radius-medium)}.container-ungrouped.has-header{border-top-left-radius:0;border-top-right-radius:0}.subcontainer-grouped{overflow:auto;border:var(--border-width) solid var(--border-light);border-top-right-radius:var(--border-radius-medium);border-top-left-radius:var(--border-radius-medium)}.subcontainer-grouped:not(:has(+ .footer)){border-bottom-right-radius:var(--border-radius-medium);border-bottom-left-radius:var(--border-radius-medium)}table{border-collapse:separate;width:100%;table-layout:fixed}thead{position:sticky;top:0;z-index:var(--above-scroll-z-index)}th{border-bottom:var(--border-width) solid var(--border-light);background-color:var(--surface-light-1);position:relative}th:not(:last-child){border-right:var(--border-width) solid var(--border-light)}th.pinned{position:sticky;top:0;z-index:1}th.dragged-over-left:before,th.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}th.dragged-over-left:before{left:0}th.dragged-over-right:before{right:0}th.selection-head{width:var(--size-xxlarge);position:sticky;z-index:1;left:0;vertical-align:middle;height:calc(var(--base-grid-size) * 8 + var(--border-width))}.checkbox-wrapper{display:flex;justify-content:center;align-items:center}label.checkbox-wrapper{cursor:pointer;width:100%;height:100%}th.menu-head{width:var(--size-xxlarge);position:sticky;z-index:1;right:0}th>riv-menu{width:100%}.header-wrapper{font-size:var(--size-medium);font-weight:var(--font-weight-heavy);line-height:1;padding:var(--size-xsmall) var(--size-small);display:inline-flex;align-items:center;justify-content:center;width:100%;height:calc(var(--base-grid-size) * 8);white-space:nowrap}.header-wrapper.left{justify-content:flex-start}.header-wrapper.right{justify-content:flex-end}button.header-wrapper{transition:background-color var(--short-transition);cursor:pointer}button.header-wrapper:hover{background-color:var(--black-20)}button.header-wrapper .icon-container{overflow:hidden;display:inline-block;width:0;height:1em;opacity:0;padding-left:0;transition:width var(--medium-transition),opacity var(--medium-transition),color var(--medium-transition),padding-left var(--medium-transition)}button.header-wrapper.active .icon-container{width:calc(var(--base-grid-size) * 3.5);padding-left:var(--size-xsmall);opacity:1}button.header-wrapper:hover .icon-container{color:var(--type-light-low-contrast)}button.header-wrapper.active .icon-container{color:var(--brand)}a.row-link{display:table-row;text-decoration:none;color:inherit;-webkit-user-select:text;user-select:text}a.row-link td{transition:background-color var(--short-transition);-webkit-user-select:text;user-select:text}a.row-link:hover td{background-color:var(--surface-light-2)}a.row-link:active td{background-color:var(--surface-light-3)}td.rs-hover{background-color:var(--surface-light-2)}td{border-bottom:var(--border-width) solid var(--border-light);height:calc(var(--base-grid-size) * 8);padding:var(--size-xxsmall) var(--size-small);font:var(--body-small);vertical-align:middle;text-align:center;background-color:var(--surface-light-0)}tr.grayed td,a.row-link.grayed td{background-color:var(--gray-30)}tbody>*:last-child>td{border-bottom:none}td.pinned{position:sticky;z-index:1}td.pinned:not(:has(+ td.pinned)){border-right:var(--border-width) solid var(--border-light)}td.advanced,td.selection-body,td.menu-body{padding:0;vertical-align:middle}td.selection-body{position:sticky;z-index:1;left:0}td.menu-body{position:sticky;z-index:1;right:0}.pagination{margin-top:var(--size-small);display:flex;justify-content:space-between;gap:var(--size-large)}.page-size-controls,.pagination-controls{display:flex;align-items:center;gap:var(--size-xsmall)}.page-data-indicator{display:flex;align-items:center;flex-grow:1;justify-content:flex-end;font:var(--body-medium);color:var(--type-light-low-contrast)}.page-size-controls span{font:var(--body-medium)}.page{display:flex;align-items:center;justify-content:center;min-width:calc(var(--base-grid-size) * 7.5);height:calc(var(--base-grid-size) * 7.5);padding:var(--size-xxsmall);font:var(--input-medium);color:var(--purp-80);border-radius:var(--border-radius-small);transition:background-color var(--short-transition)}.page:hover,.page:disabled{background-color:var(--black-20)}.page:active:not(:disabled){background-color:var(--black-40)}.page:not(:disabled){cursor:pointer}.truncated-pages{color:var(--type-light-disabled)}.truncated-pages.left{padding-left:var(--size-small)}.truncated-pages.right{padding-right:var(--size-small)}.footer{background-color:var(--surface-light-1);border-bottom:var(--border-width) solid var(--border-light);border-left:var(--border-width) solid var(--border-light);border-right:var(--border-width) solid var(--border-light);border-bottom-left-radius:var(--border-radius-medium);border-bottom-right-radius:var(--border-radius-medium);text-align:right;padding:calc(var(--base-grid-size) / 2);font:var(--body-medium)}.footer-link{margin-right:var(--size-medium)}td[rowspan]:not([rowspan=\"1\"]){border-right:var(--border-width) solid var(--border-light)}td.rs-right-border{border-right:var(--border-width) solid var(--border-light)}a.row-link.active>td{background-color:var(--surface-light-selected)}\n"] }]
|
|
@@ -8955,6 +9225,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
8955
9225
|
}], keyUp: [{
|
|
8956
9226
|
type: HostListener,
|
|
8957
9227
|
args: ['document:keyup', ['$event']]
|
|
9228
|
+
}], onCopy: [{
|
|
9229
|
+
type: HostListener,
|
|
9230
|
+
args: ['document:copy', ['$event']]
|
|
8958
9231
|
}] } });
|
|
8959
9232
|
|
|
8960
9233
|
class VisibilityDirective {
|