@skyux/lists 5.1.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/bundles/skyux-lists-testing.umd.js +16 -16
- package/bundles/skyux-lists.umd.js +127 -88
- package/documentation.json +259 -20
- package/esm2015/index.js +22 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/{modules → lib/modules}/filter/filter-button.component.js +4 -4
- package/esm2015/lib/modules/filter/filter-button.component.js.map +1 -0
- package/esm2015/lib/modules/filter/filter-inline-item.component.js +18 -0
- package/esm2015/lib/modules/filter/filter-inline-item.component.js.map +1 -0
- package/esm2015/lib/modules/filter/filter-inline.component.js +18 -0
- package/esm2015/lib/modules/filter/filter-inline.component.js.map +1 -0
- package/esm2015/lib/modules/filter/filter-summary-item.component.js +50 -0
- package/esm2015/lib/modules/filter/filter-summary-item.component.js.map +1 -0
- package/esm2015/lib/modules/filter/filter-summary.component.js +20 -0
- package/esm2015/lib/modules/filter/filter-summary.component.js.map +1 -0
- package/esm2015/lib/modules/filter/filter.module.js +61 -0
- package/esm2015/lib/modules/filter/filter.module.js.map +1 -0
- package/esm2015/lib/modules/infinite-scroll/infinite-scroll-dom-adapter.service.js +93 -0
- package/esm2015/lib/modules/infinite-scroll/infinite-scroll-dom-adapter.service.js.map +1 -0
- package/esm2015/lib/modules/infinite-scroll/infinite-scroll.component.js +115 -0
- package/esm2015/lib/modules/infinite-scroll/infinite-scroll.component.js.map +1 -0
- package/esm2015/lib/modules/infinite-scroll/infinite-scroll.module.js +20 -0
- package/esm2015/lib/modules/infinite-scroll/infinite-scroll.module.js.map +1 -0
- package/esm2015/lib/modules/paging/paging.component.js +127 -0
- package/esm2015/lib/modules/paging/paging.component.js.map +1 -0
- package/esm2015/lib/modules/paging/paging.module.js +34 -0
- package/esm2015/lib/modules/paging/paging.module.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater-adapter.service.js +69 -0
- package/esm2015/lib/modules/repeater/repeater-adapter.service.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater-item-content.component.js +17 -0
- package/esm2015/lib/modules/repeater/repeater-item-content.component.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater-item-context-menu.component.js +20 -0
- package/esm2015/lib/modules/repeater/repeater-item-context-menu.component.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater-item-title.component.js +17 -0
- package/esm2015/lib/modules/repeater/repeater-item-title.component.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater-item.component.js +389 -0
- package/esm2015/lib/modules/repeater/repeater-item.component.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater.component.js +262 -0
- package/esm2015/lib/modules/repeater/repeater.component.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater.module.js +69 -0
- package/esm2015/lib/modules/repeater/repeater.module.js.map +1 -0
- package/esm2015/lib/modules/repeater/repeater.service.js +72 -0
- package/esm2015/lib/modules/repeater/repeater.service.js.map +1 -0
- package/esm2015/lib/modules/shared/sky-lists-resources.module.js +80 -0
- package/esm2015/lib/modules/shared/sky-lists-resources.module.js.map +1 -0
- package/esm2015/{modules → lib/modules}/sort/sort-item.component.js +6 -5
- package/esm2015/lib/modules/sort/sort-item.component.js.map +1 -0
- package/esm2015/{modules → lib/modules}/sort/sort-menu-heading.component.js +4 -4
- package/esm2015/lib/modules/sort/sort-menu-heading.component.js.map +1 -0
- package/esm2015/{modules → lib/modules}/sort/sort.component.js +4 -4
- package/esm2015/lib/modules/sort/sort.component.js.map +1 -0
- package/esm2015/lib/modules/sort/sort.module.js +50 -0
- package/esm2015/lib/modules/sort/sort.module.js.map +1 -0
- package/esm2015/lib/modules/sort/sort.service.js +20 -0
- package/esm2015/lib/modules/sort/sort.service.js.map +1 -0
- package/esm2015/skyux-lists.js +2 -2
- package/esm2015/skyux-lists.js.map +1 -0
- package/esm2015/testing/filter/filter-fixture-button.js +1 -1
- package/esm2015/testing/filter/filter-fixture-button.js.map +1 -0
- package/esm2015/testing/filter/filter-fixture-summary.js +1 -1
- package/esm2015/testing/filter/filter-fixture-summary.js.map +1 -0
- package/esm2015/testing/filter/filter-testing.module.js +5 -5
- package/esm2015/testing/filter/filter-testing.module.js.map +1 -0
- package/esm2015/testing/filter/lists-filter-fixture-button.js +1 -1
- package/esm2015/testing/filter/lists-filter-fixture-button.js.map +1 -0
- package/esm2015/testing/infinite-scroll/infinite-scroll-fixture.js +1 -1
- package/esm2015/testing/infinite-scroll/infinite-scroll-fixture.js.map +1 -0
- package/esm2015/testing/infinite-scroll/infinite-scroll-testing.module.js +5 -5
- package/esm2015/testing/infinite-scroll/infinite-scroll-testing.module.js.map +1 -0
- package/esm2015/testing/paging/paging-fixture-button.js +1 -1
- package/esm2015/testing/paging/paging-fixture-button.js.map +1 -0
- package/esm2015/testing/paging/paging-fixture.js +1 -1
- package/esm2015/testing/paging/paging-fixture.js.map +1 -0
- package/esm2015/testing/paging/paging-testing.module.js +5 -5
- package/esm2015/testing/paging/paging-testing.module.js.map +1 -0
- package/esm2015/testing/public-api.js +1 -1
- package/esm2015/testing/public-api.js.map +1 -0
- package/esm2015/testing/skyux-lists-testing.js +1 -1
- package/esm2015/testing/skyux-lists-testing.js.map +1 -0
- package/esm2015/testing/sort/sort-fixture-menu-item.js +1 -1
- package/esm2015/testing/sort/sort-fixture-menu-item.js.map +1 -0
- package/esm2015/testing/sort/sort-fixture-menu.js +1 -1
- package/esm2015/testing/sort/sort-fixture-menu.js.map +1 -0
- package/esm2015/testing/sort/sort-fixture.js +1 -1
- package/esm2015/testing/sort/sort-fixture.js.map +1 -0
- package/esm2015/testing/sort/sort-testing.module.js +5 -5
- package/esm2015/testing/sort/sort-testing.module.js.map +1 -0
- package/fesm2015/skyux-lists-testing.js +16 -16
- package/fesm2015/skyux-lists-testing.js.map +1 -1
- package/fesm2015/skyux-lists.js +154 -115
- package/fesm2015/skyux-lists.js.map +1 -1
- package/index.d.ts +19 -0
- package/{modules → lib/modules}/filter/filter-button.component.d.ts +0 -0
- package/{modules → lib/modules}/filter/filter-inline-item.component.d.ts +0 -0
- package/{modules → lib/modules}/filter/filter-inline.component.d.ts +0 -0
- package/{modules → lib/modules}/filter/filter-summary-item.component.d.ts +0 -0
- package/{modules → lib/modules}/filter/filter-summary.component.d.ts +0 -0
- package/{modules → lib/modules}/filter/filter.module.d.ts +0 -0
- package/{modules → lib/modules}/infinite-scroll/infinite-scroll-dom-adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/infinite-scroll/infinite-scroll.component.d.ts +0 -0
- package/{modules → lib/modules}/infinite-scroll/infinite-scroll.module.d.ts +0 -0
- package/{modules → lib/modules}/paging/paging.component.d.ts +1 -1
- package/{modules → lib/modules}/paging/paging.module.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater-adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater-item-content.component.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater-item-context-menu.component.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater-item-title.component.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater-item.component.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater.component.d.ts +2 -2
- package/{modules → lib/modules}/repeater/repeater.module.d.ts +0 -0
- package/{modules → lib/modules}/repeater/repeater.service.d.ts +0 -0
- package/{modules → lib/modules}/shared/sky-lists-resources.module.d.ts +0 -0
- package/{modules → lib/modules}/sort/sort-item.component.d.ts +0 -0
- package/{modules → lib/modules}/sort/sort-menu-heading.component.d.ts +0 -0
- package/{modules → lib/modules}/sort/sort.component.d.ts +0 -0
- package/{modules → lib/modules}/sort/sort.module.d.ts +0 -0
- package/{modules → lib/modules}/sort/sort.service.d.ts +0 -0
- package/package.json +26 -12
- package/skyux-lists.d.ts +1 -1
- package/LICENSE +0 -21
- package/esm2015/modules/filter/filter-inline-item.component.js +0 -18
- package/esm2015/modules/filter/filter-inline.component.js +0 -18
- package/esm2015/modules/filter/filter-summary-item.component.js +0 -50
- package/esm2015/modules/filter/filter-summary.component.js +0 -20
- package/esm2015/modules/filter/filter.module.js +0 -61
- package/esm2015/modules/infinite-scroll/infinite-scroll-dom-adapter.service.js +0 -92
- package/esm2015/modules/infinite-scroll/infinite-scroll.component.js +0 -115
- package/esm2015/modules/infinite-scroll/infinite-scroll.module.js +0 -20
- package/esm2015/modules/paging/paging.component.js +0 -127
- package/esm2015/modules/paging/paging.module.js +0 -34
- package/esm2015/modules/repeater/repeater-adapter.service.js +0 -68
- package/esm2015/modules/repeater/repeater-item-content.component.js +0 -17
- package/esm2015/modules/repeater/repeater-item-context-menu.component.js +0 -20
- package/esm2015/modules/repeater/repeater-item-title.component.js +0 -17
- package/esm2015/modules/repeater/repeater-item.component.js +0 -386
- package/esm2015/modules/repeater/repeater.component.js +0 -261
- package/esm2015/modules/repeater/repeater.module.js +0 -69
- package/esm2015/modules/repeater/repeater.service.js +0 -72
- package/esm2015/modules/shared/sky-lists-resources.module.js +0 -41
- package/esm2015/modules/sort/sort.module.js +0 -50
- package/esm2015/modules/sort/sort.service.js +0 -20
- package/esm2015/public-api.js +0 -22
- package/public-api.d.ts +0 -19
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { ChangeDetectorRef, Component, ContentChild, ContentChildren, ElementRef, EventEmitter, HostBinding, Input, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core';
|
|
2
|
+
import { skyAnimationSlide } from '@skyux/animations';
|
|
3
|
+
import { SkyLibResourcesService } from '@skyux/i18n';
|
|
4
|
+
import { forkJoin as observableForkJoin, Subject } from 'rxjs';
|
|
5
|
+
import { takeUntil } from 'rxjs/operators';
|
|
6
|
+
import { SkyRepeaterAdapterService } from './repeater-adapter.service';
|
|
7
|
+
import { SkyRepeaterItemContentComponent } from './repeater-item-content.component';
|
|
8
|
+
import { SkyRepeaterItemContextMenuComponent } from './repeater-item-context-menu.component';
|
|
9
|
+
import { SkyRepeaterService } from './repeater.service';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "./repeater.service";
|
|
12
|
+
import * as i2 from "./repeater-adapter.service";
|
|
13
|
+
import * as i3 from "@skyux/i18n";
|
|
14
|
+
import * as i4 from "@skyux/inline-form";
|
|
15
|
+
import * as i5 from "@skyux/indicators";
|
|
16
|
+
import * as i6 from "@skyux/forms";
|
|
17
|
+
import * as i7 from "@angular/common";
|
|
18
|
+
let nextContentId = 0;
|
|
19
|
+
/**
|
|
20
|
+
* Creates an individual repeater item.
|
|
21
|
+
*/
|
|
22
|
+
export class SkyRepeaterItemComponent {
|
|
23
|
+
constructor(repeaterService, changeDetector, adapterService, elementRef, resourceService) {
|
|
24
|
+
this.repeaterService = repeaterService;
|
|
25
|
+
this.changeDetector = changeDetector;
|
|
26
|
+
this.adapterService = adapterService;
|
|
27
|
+
this.elementRef = elementRef;
|
|
28
|
+
this.resourceService = resourceService;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates whether users can change the order of the repeater item.
|
|
31
|
+
* The repeater component's `reorderable` property must also be set to `true`.
|
|
32
|
+
*/
|
|
33
|
+
this.reorderable = false;
|
|
34
|
+
/**
|
|
35
|
+
* Indicates whether to display a checkbox in the left of the repeater item.
|
|
36
|
+
*/
|
|
37
|
+
this.selectable = false;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates whether to display an inline form within the repeater.
|
|
40
|
+
* Users can toggle between displaying and hiding the inline form.
|
|
41
|
+
*/
|
|
42
|
+
this.showInlineForm = false;
|
|
43
|
+
/**
|
|
44
|
+
* Fires when users collapse the repeater item.
|
|
45
|
+
*/
|
|
46
|
+
this.collapse = new EventEmitter();
|
|
47
|
+
/**
|
|
48
|
+
* Fires when users expand the repeater item.
|
|
49
|
+
*/
|
|
50
|
+
this.expand = new EventEmitter();
|
|
51
|
+
/**
|
|
52
|
+
* Fires when the repeater includes an inline form and users close it. This event emits
|
|
53
|
+
* [a `SkyInlineFormCloseArgs` type](https://developer.blackbaud.com/skyux/components/inline-form#skyinlineformcloseargs-properties).
|
|
54
|
+
*/
|
|
55
|
+
this.inlineFormClose = new EventEmitter();
|
|
56
|
+
/**
|
|
57
|
+
* Fires when users select or clear the checkbox for the repeater item.
|
|
58
|
+
*/
|
|
59
|
+
this.isSelectedChange = new EventEmitter();
|
|
60
|
+
this.contentId = `sky-repeater-item-content-${++nextContentId}`;
|
|
61
|
+
this.hasItemContent = false;
|
|
62
|
+
this.isActive = false;
|
|
63
|
+
this.keyboardReorderingEnabled = false;
|
|
64
|
+
this.ngUnsubscribe = new Subject();
|
|
65
|
+
this._isCollapsible = true;
|
|
66
|
+
this._isExpanded = true;
|
|
67
|
+
this._isSelected = false;
|
|
68
|
+
this.slideForExpanded(false);
|
|
69
|
+
observableForkJoin([
|
|
70
|
+
this.resourceService.getString('skyux_repeater_item_reorder_cancel'),
|
|
71
|
+
this.resourceService.getString('skyux_repeater_item_reorder_finish'),
|
|
72
|
+
this.resourceService.getString('skyux_repeater_item_reorder_instructions'),
|
|
73
|
+
this.resourceService.getString('skyux_repeater_item_reorder_operation'),
|
|
74
|
+
this.resourceService.getString('skyux_repeater_item_reorder_moved'),
|
|
75
|
+
]).subscribe((translatedStrings) => {
|
|
76
|
+
this.reorderCancelText = translatedStrings[0];
|
|
77
|
+
this.reorderFinishText = translatedStrings[1];
|
|
78
|
+
this.reorderStateDescription = translatedStrings[2];
|
|
79
|
+
this.reorderInstructions = translatedStrings[3];
|
|
80
|
+
this.reorderMovedText = translatedStrings[4];
|
|
81
|
+
this.reorderButtonLabel = this.reorderInstructions;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Indicates whether the repeater item is expanded.
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
set isExpanded(value) {
|
|
89
|
+
this.updateForExpanded(value, true);
|
|
90
|
+
}
|
|
91
|
+
get isExpanded() {
|
|
92
|
+
return this._isExpanded;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Indicates whether the repeater item's checkbox is selected.
|
|
96
|
+
* When users select the repeater item, the specified property on your model is updated accordingly.
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
set isSelected(value) {
|
|
100
|
+
if (value !== this._isSelected) {
|
|
101
|
+
this._isSelected = value;
|
|
102
|
+
this.isSelectedChange.emit(this._isSelected);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
get isSelected() {
|
|
106
|
+
return this._isSelected;
|
|
107
|
+
}
|
|
108
|
+
set isCollapsible(value) {
|
|
109
|
+
if (this.isCollapsible !== value) {
|
|
110
|
+
this._isCollapsible = value;
|
|
111
|
+
/*istanbul ignore else */
|
|
112
|
+
if (!value) {
|
|
113
|
+
this.updateForExpanded(true, false);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
this.changeDetector.markForCheck();
|
|
117
|
+
}
|
|
118
|
+
get isCollapsible() {
|
|
119
|
+
return this._isCollapsible;
|
|
120
|
+
}
|
|
121
|
+
get repeaterGroupClass() {
|
|
122
|
+
return 'sky-repeater-item-group-' + this.repeaterService.repeaterGroupId;
|
|
123
|
+
}
|
|
124
|
+
ngOnInit() {
|
|
125
|
+
this.repeaterService.registerItem(this);
|
|
126
|
+
this.repeaterService.activeItemChange
|
|
127
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
128
|
+
.subscribe((item) => {
|
|
129
|
+
const newIsActiveValue = this === item;
|
|
130
|
+
if (newIsActiveValue !== this.isActive) {
|
|
131
|
+
this.isActive = newIsActiveValue;
|
|
132
|
+
this.changeDetector.markForCheck();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
ngAfterViewInit() {
|
|
137
|
+
this.hasItemContent = this.repeaterItemContentComponents.length > 0;
|
|
138
|
+
this.updateExpandOnContentChange();
|
|
139
|
+
}
|
|
140
|
+
ngOnDestroy() {
|
|
141
|
+
this.collapse.complete();
|
|
142
|
+
this.expand.complete();
|
|
143
|
+
this.inlineFormClose.complete();
|
|
144
|
+
this.isSelectedChange.complete();
|
|
145
|
+
this.ngUnsubscribe.next();
|
|
146
|
+
this.ngUnsubscribe.complete();
|
|
147
|
+
this.repeaterService.unregisterItem(this);
|
|
148
|
+
}
|
|
149
|
+
headerClick() {
|
|
150
|
+
if (this.isCollapsible) {
|
|
151
|
+
this.updateForExpanded(!this.isExpanded, true);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
chevronDirectionChange(direction) {
|
|
155
|
+
this.updateForExpanded(direction === 'up', true);
|
|
156
|
+
}
|
|
157
|
+
onRepeaterItemClick(event) {
|
|
158
|
+
// Only activate item if clicking on the title, content, or parent item div.
|
|
159
|
+
// This will avoid accidental activations when clicking inside interactive elements like
|
|
160
|
+
// the expand/collapse chevron, dropdown, inline-delete, etc...
|
|
161
|
+
if (event.target === this.itemRef.nativeElement ||
|
|
162
|
+
this.itemContentRef.nativeElement.contains(event.target) ||
|
|
163
|
+
this.itemHeaderRef.nativeElement.contains(event.target)) {
|
|
164
|
+
this.repeaterService.activateItem(this);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
updateForExpanded(value, animate) {
|
|
168
|
+
if (this.isCollapsible === false && value === false) {
|
|
169
|
+
console.warn(`Setting isExpanded to false when the repeater item is not collapsible
|
|
170
|
+
will have no effect.`);
|
|
171
|
+
}
|
|
172
|
+
else if (this._isExpanded !== value) {
|
|
173
|
+
this._isExpanded = value;
|
|
174
|
+
if (this._isExpanded) {
|
|
175
|
+
this.expand.emit();
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.collapse.emit();
|
|
179
|
+
}
|
|
180
|
+
this.repeaterService.onItemCollapseStateChange(this);
|
|
181
|
+
this.slideForExpanded(animate);
|
|
182
|
+
this.changeDetector.markForCheck();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
onCheckboxChange(value) {
|
|
186
|
+
this.isSelected = value.checked;
|
|
187
|
+
}
|
|
188
|
+
onInlineFormClose(inlineFormCloseArgs) {
|
|
189
|
+
this.inlineFormClose.emit(inlineFormCloseArgs);
|
|
190
|
+
}
|
|
191
|
+
moveToTop(event) {
|
|
192
|
+
event.stopPropagation();
|
|
193
|
+
this.adapterService.moveItemUp(this.elementRef.nativeElement, true);
|
|
194
|
+
this.adapterService.focusElement(event.target);
|
|
195
|
+
this.repeaterService.registerOrderChange();
|
|
196
|
+
}
|
|
197
|
+
onReorderHandleKeyDown(event) {
|
|
198
|
+
/*istanbul ignore else */
|
|
199
|
+
if (event.key) {
|
|
200
|
+
switch (event.key.toLowerCase()) {
|
|
201
|
+
case ' ':
|
|
202
|
+
case 'enter':
|
|
203
|
+
this.keyboardToggleReorder();
|
|
204
|
+
event.preventDefault();
|
|
205
|
+
event.stopPropagation();
|
|
206
|
+
break;
|
|
207
|
+
case 'escape':
|
|
208
|
+
/* istanbul ignore else */
|
|
209
|
+
if (this.keyboardReorderingEnabled) {
|
|
210
|
+
this.keyboardReorderingEnabled = false;
|
|
211
|
+
this.revertReorderSteps();
|
|
212
|
+
this.reorderButtonLabel =
|
|
213
|
+
this.reorderCancelText + ' ' + this.reorderInstructions;
|
|
214
|
+
this.adapterService.focusElement(event.target);
|
|
215
|
+
event.preventDefault();
|
|
216
|
+
event.stopPropagation();
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
case 'arrowup':
|
|
220
|
+
if (this.keyboardReorderingEnabled) {
|
|
221
|
+
this.keyboardReorderUp();
|
|
222
|
+
event.preventDefault();
|
|
223
|
+
event.stopPropagation();
|
|
224
|
+
this.repeaterService.registerOrderChange();
|
|
225
|
+
}
|
|
226
|
+
break;
|
|
227
|
+
case 'arrowdown':
|
|
228
|
+
/* istanbul ignore else */
|
|
229
|
+
if (this.keyboardReorderingEnabled) {
|
|
230
|
+
this.keyboardReorderDown();
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
event.stopPropagation();
|
|
233
|
+
this.repeaterService.registerOrderChange();
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
case 'arrowleft':
|
|
237
|
+
case 'arrowright':
|
|
238
|
+
/* istanbul ignore else */
|
|
239
|
+
if (this.keyboardReorderingEnabled) {
|
|
240
|
+
event.preventDefault();
|
|
241
|
+
event.stopPropagation();
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
/* istanbul ignore next */
|
|
245
|
+
default:
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
onReorderHandleBlur(event) {
|
|
251
|
+
this.keyboardReorderingEnabled = false;
|
|
252
|
+
this.revertReorderSteps();
|
|
253
|
+
this.reorderButtonLabel = this.reorderInstructions;
|
|
254
|
+
this.reorderState = undefined;
|
|
255
|
+
}
|
|
256
|
+
onItemKeyDown(event) {
|
|
257
|
+
/*istanbul ignore else */
|
|
258
|
+
if (event.key) {
|
|
259
|
+
switch (event.key.toLowerCase()) {
|
|
260
|
+
case ' ':
|
|
261
|
+
case 'enter':
|
|
262
|
+
/* istanbul ignore else */
|
|
263
|
+
/* Sanity check */
|
|
264
|
+
// Space/enter should never execute unless focused on the parent item element.
|
|
265
|
+
if (event.target === this.itemRef.nativeElement) {
|
|
266
|
+
if (this.selectable) {
|
|
267
|
+
this.isSelected = !this.isSelected;
|
|
268
|
+
}
|
|
269
|
+
this.repeaterService.activateItem(this);
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
/* istanbul ignore next */
|
|
274
|
+
default:
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
slideForExpanded(animate) {
|
|
280
|
+
this.slideDirection = this.isExpanded ? 'down' : 'up';
|
|
281
|
+
}
|
|
282
|
+
keyboardReorderUp() {
|
|
283
|
+
this.reorderCurrentIndex = this.adapterService.moveItemUp(this.elementRef.nativeElement);
|
|
284
|
+
this.reorderSteps--;
|
|
285
|
+
this.adapterService.focusElement(this.grabHandle);
|
|
286
|
+
this.keyboardReorderingEnabled = true;
|
|
287
|
+
this.reorderButtonLabel = `${this.reorderMovedText} ${this.reorderCurrentIndex + 1}`;
|
|
288
|
+
}
|
|
289
|
+
keyboardReorderDown() {
|
|
290
|
+
this.reorderCurrentIndex = this.adapterService.moveItemDown(this.elementRef.nativeElement);
|
|
291
|
+
this.reorderSteps++;
|
|
292
|
+
this.adapterService.focusElement(this.grabHandle);
|
|
293
|
+
this.keyboardReorderingEnabled = true;
|
|
294
|
+
this.reorderButtonLabel = `${this.reorderMovedText} ${this.reorderCurrentIndex + 1}`;
|
|
295
|
+
}
|
|
296
|
+
keyboardToggleReorder() {
|
|
297
|
+
this.keyboardReorderingEnabled = !this.keyboardReorderingEnabled;
|
|
298
|
+
this.reorderSteps = 0;
|
|
299
|
+
if (this.keyboardReorderingEnabled) {
|
|
300
|
+
this.reorderState = this.reorderStateDescription;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
this.reorderState = `${this.reorderFinishText} ${this.reorderCurrentIndex + 1} ${this.reorderInstructions}`;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
revertReorderSteps() {
|
|
307
|
+
if (this.reorderSteps < 0) {
|
|
308
|
+
this.adapterService.moveItemDown(this.elementRef.nativeElement, Math.abs(this.reorderSteps));
|
|
309
|
+
}
|
|
310
|
+
else if (this.reorderSteps > 0) {
|
|
311
|
+
this.adapterService.moveItemUp(this.elementRef.nativeElement, false, this.reorderSteps);
|
|
312
|
+
}
|
|
313
|
+
this.repeaterService.registerOrderChange();
|
|
314
|
+
}
|
|
315
|
+
updateExpandOnContentChange() {
|
|
316
|
+
this.repeaterItemContentComponents.changes
|
|
317
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
318
|
+
.subscribe(() => {
|
|
319
|
+
this.hasItemContent = this.repeaterItemContentComponents.length > 0;
|
|
320
|
+
/* istanbul ignore next */
|
|
321
|
+
this.isCollapsible =
|
|
322
|
+
this.hasItemContent && this.repeaterService.expandMode !== 'none';
|
|
323
|
+
/* istanbul ignore else */
|
|
324
|
+
if (this.repeaterService.expandMode === 'single') {
|
|
325
|
+
this.repeaterService.onItemCollapseStateChange(this);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
SkyRepeaterItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemComponent, deps: [{ token: i1.SkyRepeaterService }, { token: i0.ChangeDetectorRef }, { token: i2.SkyRepeaterAdapterService }, { token: i0.ElementRef }, { token: i3.SkyLibResourcesService }], target: i0.ɵɵFactoryTarget.Component });
|
|
331
|
+
SkyRepeaterItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRepeaterItemComponent, selector: "sky-repeater-item", inputs: { itemName: "itemName", inlineFormConfig: "inlineFormConfig", inlineFormTemplate: "inlineFormTemplate", isExpanded: "isExpanded", isSelected: "isSelected", reorderable: "reorderable", selectable: "selectable", showInlineForm: "showInlineForm", tag: "tag" }, outputs: { collapse: "collapse", expand: "expand", inlineFormClose: "inlineFormClose", isSelectedChange: "isSelectedChange" }, host: { properties: { "class": "this.repeaterGroupClass" } }, queries: [{ propertyName: "contextMenu", first: true, predicate: SkyRepeaterItemContextMenuComponent, descendants: true, read: ElementRef }, { propertyName: "repeaterItemContentComponents", predicate: SkyRepeaterItemContentComponent }], viewQueries: [{ propertyName: "grabHandle", first: true, predicate: ["grabHandle"], descendants: true, read: ElementRef }, { propertyName: "itemContentRef", first: true, predicate: ["itemContentRef"], descendants: true, read: ElementRef }, { propertyName: "itemHeaderRef", first: true, predicate: ["itemHeaderRef"], descendants: true, read: ElementRef }, { propertyName: "itemRef", first: true, predicate: ["itemRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n class=\"sky-repeater-item sky-padding-even-default\"\n role=\"option\"\n [attr.aria-label]=\"itemName\"\n [attr.aria-selected]=\"selectable ? isSelected : null\"\n [ngClass]=\"{\n 'sky-repeater-item-active': isActive,\n 'sky-repeater-item-collapsible': isCollapsible,\n 'sky-repeater-item-selected': isSelected\n }\"\n (click)=\"onRepeaterItemClick($event)\"\n (keydown)=\"onItemKeyDown($event)\"\n #itemRef\n>\n <div #inlineDelete>\n <ng-content select=\"sky-inline-delete\"></ng-content>\n </div>\n\n <ng-container *ngIf=\"inlineFormTemplate\">\n <sky-inline-form\n [config]=\"inlineFormConfig\"\n [showForm]=\"showInlineForm\"\n [template]=\"inlineFormTemplate\"\n (close)=\"onInlineFormClose($event)\"\n >\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemLeft\"></ng-container>\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemRight\"></ng-container>\n </sky-inline-form>\n </ng-container>\n\n <ng-container *ngIf=\"!inlineFormTemplate\">\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemLeft\"></ng-container>\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemRight\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #skyRepeaterItemLeft>\n <div class=\"sky-repeater-item-left\">\n <ng-container *ngIf=\"reorderable\">\n <span\n aria-live=\"assertive\"\n class=\"sky-screen-reader-only\"\n [id]=\"contentId + '-reorder-state'\"\n >\n {{ reorderState }}\n </span>\n <span\n class=\"sky-screen-reader-only\"\n [id]=\"contentId + '-reorder-instructions'\"\n >{{ reorderButtonLabel }}</span\n >\n <button\n class=\"sky-btn sky-tile-tools-control sky-repeater-item-grab-handle\"\n type=\"button\"\n [attr.aria-describedby]=\"contentId + '-reorder-instructions'\"\n [attr.aria-label]=\"\n itemName\n ? ('skyux_repeater_item_reorder_label' | skyLibResources: itemName)\n : ('skyux_repeater_item_reorder_label_default' | skyLibResources)\n \"\n (blur)=\"onReorderHandleBlur($event)\"\n (keydown)=\"onReorderHandleKeyDown($event)\"\n #grabHandle\n >\n <sky-icon icon=\"arrows-v\"></sky-icon>\n </button>\n </ng-container>\n <sky-checkbox\n *ngIf=\"selectable\"\n class=\"sky-repeater-item-checkbox\"\n [checked]=\"isSelected\"\n [label]=\"\n itemName\n ? ('skyux_repeater_item_checkbox_label' | skyLibResources: itemName)\n : ('skyux_repeater_item_checkbox_label_default' | skyLibResources)\n \"\n (change)=\"onCheckboxChange($event)\"\n >\n </sky-checkbox>\n <div\n class=\"sky-repeater-item-context-menu\"\n [hidden]=\"contextMenuEl.children.length === 0\"\n #contextMenuEl\n >\n <ng-content select=\"sky-repeater-item-context-menu\"></ng-content>\n </div>\n </div>\n</ng-template>\n\n<ng-template #skyRepeaterItemRight>\n <div class=\"sky-repeater-item-right\" #itemHeaderRef>\n <div\n class=\"sky-repeater-item-header\"\n [hidden]=\"titleRef.children.length === 0\"\n (click)=\"headerClick()\"\n >\n <div class=\"sky-repeater-item-title sky-emphasized\" #titleRef>\n <ng-content select=\"sky-repeater-item-title\"></ng-content>\n </div>\n <button\n *ngIf=\"reorderable\"\n class=\"sky-btn sky-btn-link sky-repeater-item-reorder-top\"\n type=\"button\"\n [attr.aria-label]=\"\n itemName\n ? ('skyux_repeater_item_reorder_top_label'\n | skyLibResources: itemName)\n : ('skyux_repeater_item_reorder_top_label_default'\n | skyLibResources)\n \"\n (click)=\"moveToTop($event)\"\n >\n <sky-icon icon=\"arrow-circle-up\"></sky-icon>\n {{ 'skyux_repeater_item_reorder_top' | skyLibResources }}\n </button>\n <div *ngIf=\"isCollapsible\" class=\"sky-repeater-item-chevron\">\n <sky-chevron\n [ariaControls]=\"contentId\"\n [ariaLabel]=\"\n itemName\n ? ('skyux_repeater_item_expand' | skyLibResources: itemName)\n : ('skyux_repeater_item_expand_default' | skyLibResources)\n \"\n [direction]=\"isExpanded ? 'up' : 'down'\"\n (directionChange)=\"chevronDirectionChange($event)\"\n >\n </sky-chevron>\n </div>\n <!-- Used for when the chevron is hidden to ensure that the right side is the same height as the left.-->\n <div\n *ngIf=\"!isCollapsible && !contextMenu\"\n class=\"sky-repeater-item-chevron-placeholder\"\n ></div>\n <!-- Used to ensure that the right side is the same height as the left.-->\n <div\n *ngIf=\"contextMenu\"\n class=\"sky-repeater-item-chevron-placeholder-with-context\"\n ></div>\n </div>\n <div\n class=\"sky-repeater-item-content\"\n [id]=\"contentId\"\n [@skyAnimationSlide]=\"slideDirection\"\n #itemContentRef\n >\n <ng-content select=\"sky-repeater-item-content\"></ng-content>\n </div>\n </div>\n</ng-template>\n", styles: ["sky-repeater-item .sky-repeater-item{display:flex;border-bottom:1px dotted #cdcfd2;padding-top:0;position:relative;transition:box-shadow .15s;align-items:flex-start}sky-repeater-item .sky-repeater-item sky-inline-form{display:block;width:100%}sky-repeater-item .sky-repeater-item sky-inline-form>:first-child,sky-repeater-item .sky-repeater-item sky-inline-form .sky-slide-dissolve-first,sky-repeater-item .sky-repeater-item sky-inline-form .sky-slide-dissolve-last{display:flex;flex:1 0 auto;width:100%}sky-repeater-item .sky-repeater-item sky-inline-form .sky-slide-dissolve-last{padding-top:10px}sky-repeater-item .sky-repeater-item.sky-repeater-item-active{background-color:#eeeeef;color:#212327;padding-left:6px;border-left:4px solid #00b4f1}sky-repeater-item .sky-repeater-item.sky-repeater-item-active .sky-inline-delete{margin-left:-4px;width:calc(100% + 4px)}sky-repeater-item .sky-repeater-item-left{display:flex;padding-top:10px;align-items:center}sky-repeater-item .sky-repeater-item-left sky-checkbox{display:flex}sky-repeater-item .sky-repeater-item-right{max-width:100%;flex-grow:1;align-self:center}sky-repeater-item .sky-repeater-item-header{align-items:center;display:flex;padding-top:10px}sky-repeater-item .sky-repeater-item-chevron{margin-left:10px}sky-repeater-item .sky-repeater-item-chevron-placeholder{height:24px}sky-repeater-item .sky-repeater-item-chevron-placeholder-with-context{height:29px}sky-repeater-item .sky-repeater-item-context-menu{padding:0 10px 0 0}sky-repeater-item .sky-repeater-item-checkbox{padding:0 5px 0 0}sky-repeater-item .sky-repeater-item-selected{background-color:#f1eef6;transition:background-color .15s}sky-repeater-item .sky-repeater-item-title{margin:0;flex-grow:1;line-height:1.1;color:#212327}sky-repeater-item sky-repeater-item-content{display:block;margin:10px 0 0}sky-repeater-item .sky-repeater-item-collapsible .sky-repeater-item-header{cursor:pointer}sky-repeater-item .sky-repeater-item-collapsible .sky-repeater-item-content{padding-right:34px}sky-repeater-item .sky-repeater-item-collapsed .sky-repeater-item-content{display:none}sky-repeater-item .sky-repeater-item-grab-handle{color:#cdcfd2;cursor:pointer;border:0;width:24px;height:24px;cursor:grab;cursor:-moz-grab;padding:0;margin-right:10px}sky-repeater-item .sky-repeater-item-grab-handle:hover{color:#979ba2;transition:color .15s}sky-repeater-item.sky-repeater-item-dragging.gu-mirror{opacity:initial;-ms-filter:initial;filter:initial;background-color:#fff;box-shadow:0 0 5px #0000004d}sky-repeater-item.sky-repeater-item-dragging.gu-transit .sky-repeater-item{background-color:#d8d8d8}sky-repeater-item.sky-repeater-item-dragging.gu-transit .sky-repeater-item .sky-repeater-item-left,sky-repeater-item.sky-repeater-item-dragging.gu-transit .sky-repeater-item .sky-repeater-item-right{visibility:hidden}sky-repeater-item.sky-repeater-item-dragging .sky-repeater-item-grab-handle{cursor:grabbing;cursor:-webkit-grabbing}.sky-theme-modern sky-repeater-item .sky-repeater-item{padding-bottom:20px}.sky-theme-modern sky-repeater-item .sky-repeater-item.sky-repeater-item-active{background-color:transparent;border-left-color:#1870b8}.sky-theme-modern sky-repeater-item .sky-repeater-item:focus,.sky-theme-modern sky-repeater-item .sky-repeater-item:active:focus{outline:solid 2px #1870B8;outline-offset:-2px}.sky-theme-modern sky-repeater-item .sky-repeater-item:focus:not(:active){box-shadow:0 1px 8px #0000004d}.sky-theme-modern sky-repeater-item .sky-repeater-item-header[hidden]+.sky-repeater-item-content sky-repeater-item-content{margin:20px 0 0}.sky-theme-modern sky-repeater-item .sky-repeater-item-header,.sky-theme-modern sky-repeater-item .sky-repeater-item-left{padding-top:20px}.sky-theme-modern sky-repeater-item sky-inline-form .sky-slide-dissolve-last{padding-top:20px}.sky-theme-modern.sky-theme-mode-dark sky-repeater-item .sky-repeater-item{border-bottom-color:#686c73}.sky-theme-modern.sky-theme-mode-dark sky-repeater-item .sky-repeater-item.sky-repeater-item-active{color:#fbfcfe}.sky-theme-modern.sky-theme-mode-dark sky-repeater-item .sky-repeater-item-title{color:#fbfcfe}\n"], components: [{ type: i4.λ1, selector: "sky-inline-form", inputs: ["config", "template", "showForm"], outputs: ["close"] }, { type: i5.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i6.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i5.λ2, selector: "sky-chevron", inputs: ["ariaControls", "ariaLabel", "direction", "disabled"], outputs: ["directionChange"] }], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i3.SkyLibResourcesPipe }, animations: [skyAnimationSlide], encapsulation: i0.ViewEncapsulation.None });
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemComponent, decorators: [{
|
|
333
|
+
type: Component,
|
|
334
|
+
args: [{
|
|
335
|
+
selector: 'sky-repeater-item',
|
|
336
|
+
styleUrls: ['./repeater-item.component.scss'],
|
|
337
|
+
templateUrl: './repeater-item.component.html',
|
|
338
|
+
animations: [skyAnimationSlide],
|
|
339
|
+
encapsulation: ViewEncapsulation.None,
|
|
340
|
+
}]
|
|
341
|
+
}], ctorParameters: function () { return [{ type: i1.SkyRepeaterService }, { type: i0.ChangeDetectorRef }, { type: i2.SkyRepeaterAdapterService }, { type: i0.ElementRef }, { type: i3.SkyLibResourcesService }]; }, propDecorators: { itemName: [{
|
|
342
|
+
type: Input
|
|
343
|
+
}], inlineFormConfig: [{
|
|
344
|
+
type: Input
|
|
345
|
+
}], inlineFormTemplate: [{
|
|
346
|
+
type: Input
|
|
347
|
+
}], isExpanded: [{
|
|
348
|
+
type: Input
|
|
349
|
+
}], isSelected: [{
|
|
350
|
+
type: Input
|
|
351
|
+
}], reorderable: [{
|
|
352
|
+
type: Input
|
|
353
|
+
}], selectable: [{
|
|
354
|
+
type: Input
|
|
355
|
+
}], showInlineForm: [{
|
|
356
|
+
type: Input
|
|
357
|
+
}], tag: [{
|
|
358
|
+
type: Input
|
|
359
|
+
}], collapse: [{
|
|
360
|
+
type: Output
|
|
361
|
+
}], expand: [{
|
|
362
|
+
type: Output
|
|
363
|
+
}], inlineFormClose: [{
|
|
364
|
+
type: Output
|
|
365
|
+
}], isSelectedChange: [{
|
|
366
|
+
type: Output
|
|
367
|
+
}], contextMenu: [{
|
|
368
|
+
type: ContentChild,
|
|
369
|
+
args: [SkyRepeaterItemContextMenuComponent, { read: ElementRef }]
|
|
370
|
+
}], repeaterGroupClass: [{
|
|
371
|
+
type: HostBinding,
|
|
372
|
+
args: ['class']
|
|
373
|
+
}], grabHandle: [{
|
|
374
|
+
type: ViewChild,
|
|
375
|
+
args: ['grabHandle', { read: ElementRef }]
|
|
376
|
+
}], itemContentRef: [{
|
|
377
|
+
type: ViewChild,
|
|
378
|
+
args: ['itemContentRef', { read: ElementRef }]
|
|
379
|
+
}], itemHeaderRef: [{
|
|
380
|
+
type: ViewChild,
|
|
381
|
+
args: ['itemHeaderRef', { read: ElementRef }]
|
|
382
|
+
}], itemRef: [{
|
|
383
|
+
type: ViewChild,
|
|
384
|
+
args: ['itemRef', { read: ElementRef }]
|
|
385
|
+
}], repeaterItemContentComponents: [{
|
|
386
|
+
type: ContentChildren,
|
|
387
|
+
args: [SkyRepeaterItemContentComponent]
|
|
388
|
+
}] } });
|
|
389
|
+
//# sourceMappingURL=repeater-item.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeater-item.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item.component.ts","../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,UAAU,EACV,YAAY,EACZ,WAAW,EACX,KAAK,EAGL,MAAM,EACN,SAAS,EACT,WAAW,EACX,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAOrD,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;;;;;;;;;AAExD,IAAI,aAAa,GAAW,CAAC,CAAC;AAE9B;;GAEG;AAQH,MAAM,OAAO,wBAAwB;IA0LnC,YACU,eAAmC,EACnC,cAAiC,EACjC,cAAyC,EACzC,UAAsB,EACtB,eAAuC;QAJvC,oBAAe,GAAf,eAAe,CAAoB;QACnC,mBAAc,GAAd,cAAc,CAAmB;QACjC,mBAAc,GAAd,cAAc,CAA2B;QACzC,eAAU,GAAV,UAAU,CAAY;QACtB,oBAAe,GAAf,eAAe,CAAwB;QAtIjD;;;WAGG;QAEI,gBAAW,GAAY,KAAK,CAAC;QAEpC;;WAEG;QAEI,eAAU,GAAY,KAAK,CAAC;QAEnC;;;WAGG;QAEI,mBAAc,GAAY,KAAK,CA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AC7B,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,WAAW,EAAE,gCAAgC;oBAC7C,UAAU,EAAE,CAAC,iBAAiB,CAAC;oBAC/B,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;+OAWQ,QAAQ;sBADd,KAAK;gBASC,gBAAgB;sBADtB,KAAK;gBAQC,kBAAkB;sBADxB,KAAK;gBAQK,UAAU;sBADpB,KAAK;gBAeK,UAAU;sBADpB,KAAK;gBAiBC,WAAW;sBADjB,KAAK;gBAOC,UAAU;sBADhB,KAAK;gBAQC,cAAc;sBADpB,KAAK;gBASC,GAAG;sBADT,KAAK;gBAOC,QAAQ;sBADd,MAAM;gBAOA,MAAM;sBADZ,MAAM;gBAQA,eAAe;sBADrB,MAAM;gBAOA,gBAAgB;sBADtB,MAAM;gBAIA,WAAW;sBADjB,YAAY;uBAAC,mCAAmC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAmCnE,kBAAkB;sBADrB,WAAW;uBAAC,OAAO;gBAMZ,UAAU;sBADjB,SAAS;uBAAC,YAAY,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAIrC,cAAc;sBADrB,SAAS;uBAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAIzC,aAAa;sBADpB,SAAS;uBAAC,eAAe,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAIxC,OAAO;sBADd,SAAS;uBAAC,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAIlC,6BAA6B;sBADpC,eAAe;uBAAC,+BAA+B","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n ElementRef,\n EventEmitter,\n HostBinding,\n Input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { skyAnimationSlide } from '@skyux/animations';\n\nimport { SkyCheckboxChange } from '@skyux/forms';\n\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport {\n SkyInlineFormCloseArgs,\n SkyInlineFormConfig,\n} from '@skyux/inline-form';\n\nimport { forkJoin as observableForkJoin, Subject } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyRepeaterAdapterService } from './repeater-adapter.service';\n\nimport { SkyRepeaterItemContentComponent } from './repeater-item-content.component';\n\nimport { SkyRepeaterItemContextMenuComponent } from './repeater-item-context-menu.component';\n\nimport { SkyRepeaterService } from './repeater.service';\n\nlet nextContentId: number = 0;\n\n/**\n * Creates an individual repeater item.\n */\n@Component({\n selector: 'sky-repeater-item',\n styleUrls: ['./repeater-item.component.scss'],\n templateUrl: './repeater-item.component.html',\n animations: [skyAnimationSlide],\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyRepeaterItemComponent\n implements OnDestroy, OnInit, AfterViewInit\n{\n /**\n * Specifies a human-readable name for the repeater item that is available for multiple purposes,\n * such as accessibility and instrumentation. For example, the component uses the name to\n * construct ARIA labels for the repeater item controls\n * to [support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n */\n @Input()\n public itemName: string;\n\n /**\n * Specifies configuration options for the buttons to display on an inline form\n * within the repeater. This property accepts\n * [a `SkyInlineFormConfig` object](https://developer.blackbaud.com/skyux/components/inline-form#skyinlineformconfig-properties).\n */\n @Input()\n public inlineFormConfig: SkyInlineFormConfig;\n\n /**\n * Specifies [an Angular `TemplateRef`](https://angular.io/api/core/TemplateRef) to use\n * as a template to instantiate an inline form within the repeater.\n */\n @Input()\n public inlineFormTemplate: TemplateRef<any>;\n\n /**\n * Indicates whether the repeater item is expanded.\n * @default true\n */\n @Input()\n public set isExpanded(value: boolean) {\n this.updateForExpanded(value, true);\n }\n\n public get isExpanded(): boolean {\n return this._isExpanded;\n }\n\n /**\n * Indicates whether the repeater item's checkbox is selected.\n * When users select the repeater item, the specified property on your model is updated accordingly.\n * @default false\n */\n @Input()\n public set isSelected(value: boolean) {\n if (value !== this._isSelected) {\n this._isSelected = value;\n this.isSelectedChange.emit(this._isSelected);\n }\n }\n\n public get isSelected(): boolean {\n return this._isSelected;\n }\n\n /**\n * Indicates whether users can change the order of the repeater item.\n * The repeater component's `reorderable` property must also be set to `true`.\n */\n @Input()\n public reorderable: boolean = false;\n\n /**\n * Indicates whether to display a checkbox in the left of the repeater item.\n */\n @Input()\n public selectable: boolean = false;\n\n /**\n * Indicates whether to display an inline form within the repeater.\n * Users can toggle between displaying and hiding the inline form.\n */\n @Input()\n public showInlineForm: boolean = false;\n\n /**\n * Specifies an object that the repeater component returns for this repeater item\n * when the `orderChange` event fires. This is required\n * if you set the `reorderable` property to `true`.\n */\n @Input()\n public tag: any;\n\n /**\n * Fires when users collapse the repeater item.\n */\n @Output()\n public collapse = new EventEmitter<void>();\n\n /**\n * Fires when users expand the repeater item.\n */\n @Output()\n public expand = new EventEmitter<void>();\n\n /**\n * Fires when the repeater includes an inline form and users close it. This event emits\n * [a `SkyInlineFormCloseArgs` type](https://developer.blackbaud.com/skyux/components/inline-form#skyinlineformcloseargs-properties).\n */\n @Output()\n public inlineFormClose = new EventEmitter<SkyInlineFormCloseArgs>();\n\n /**\n * Fires when users select or clear the checkbox for the repeater item.\n */\n @Output()\n public isSelectedChange = new EventEmitter<boolean>();\n\n @ContentChild(SkyRepeaterItemContextMenuComponent, { read: ElementRef })\n public contextMenu: ElementRef;\n\n public contentId: string = `sky-repeater-item-content-${++nextContentId}`;\n\n public hasItemContent: boolean = false;\n\n public isActive: boolean = false;\n\n public set isCollapsible(value: boolean) {\n if (this.isCollapsible !== value) {\n this._isCollapsible = value;\n\n /*istanbul ignore else */\n if (!value) {\n this.updateForExpanded(true, false);\n }\n }\n\n this.changeDetector.markForCheck();\n }\n\n public get isCollapsible(): boolean {\n return this._isCollapsible;\n }\n\n public keyboardReorderingEnabled: boolean = false;\n\n public reorderButtonLabel: string;\n\n public reorderState: string;\n\n public slideDirection: string;\n\n @HostBinding('class')\n get repeaterGroupClass(): string {\n return 'sky-repeater-item-group-' + this.repeaterService.repeaterGroupId;\n }\n\n @ViewChild('grabHandle', { read: ElementRef })\n private grabHandle: ElementRef;\n\n @ViewChild('itemContentRef', { read: ElementRef })\n private itemContentRef: ElementRef;\n\n @ViewChild('itemHeaderRef', { read: ElementRef })\n private itemHeaderRef: ElementRef;\n\n @ViewChild('itemRef', { read: ElementRef })\n private itemRef: ElementRef;\n\n @ContentChildren(SkyRepeaterItemContentComponent)\n private repeaterItemContentComponents: QueryList<SkyRepeaterItemContentComponent>;\n\n private ngUnsubscribe = new Subject<void>();\n\n private reorderCancelText: string;\n\n private reorderCurrentIndex: number;\n\n private reorderFinishText: string;\n\n private reorderInstructions: string;\n\n private reorderMovedText: string;\n\n private reorderStateDescription: string;\n\n private reorderSteps: number;\n\n private _isCollapsible = true;\n\n private _isExpanded = true;\n\n private _isSelected = false;\n\n constructor(\n private repeaterService: SkyRepeaterService,\n private changeDetector: ChangeDetectorRef,\n private adapterService: SkyRepeaterAdapterService,\n private elementRef: ElementRef,\n private resourceService: SkyLibResourcesService\n ) {\n this.slideForExpanded(false);\n\n observableForkJoin([\n this.resourceService.getString('skyux_repeater_item_reorder_cancel'),\n this.resourceService.getString('skyux_repeater_item_reorder_finish'),\n this.resourceService.getString(\n 'skyux_repeater_item_reorder_instructions'\n ),\n this.resourceService.getString('skyux_repeater_item_reorder_operation'),\n this.resourceService.getString('skyux_repeater_item_reorder_moved'),\n ]).subscribe((translatedStrings: string[]) => {\n this.reorderCancelText = translatedStrings[0];\n this.reorderFinishText = translatedStrings[1];\n this.reorderStateDescription = translatedStrings[2];\n this.reorderInstructions = translatedStrings[3];\n this.reorderMovedText = translatedStrings[4];\n this.reorderButtonLabel = this.reorderInstructions;\n });\n }\n\n public ngOnInit(): void {\n this.repeaterService.registerItem(this);\n this.repeaterService.activeItemChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((item: SkyRepeaterItemComponent) => {\n const newIsActiveValue = this === item;\n if (newIsActiveValue !== this.isActive) {\n this.isActive = newIsActiveValue;\n this.changeDetector.markForCheck();\n }\n });\n }\n\n public ngAfterViewInit(): void {\n this.hasItemContent = this.repeaterItemContentComponents.length > 0;\n this.updateExpandOnContentChange();\n }\n\n public ngOnDestroy(): void {\n this.collapse.complete();\n this.expand.complete();\n this.inlineFormClose.complete();\n this.isSelectedChange.complete();\n\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this.repeaterService.unregisterItem(this);\n }\n\n public headerClick(): void {\n if (this.isCollapsible) {\n this.updateForExpanded(!this.isExpanded, true);\n }\n }\n\n public chevronDirectionChange(direction: string): void {\n this.updateForExpanded(direction === 'up', true);\n }\n\n public onRepeaterItemClick(event: MouseEvent): void {\n // Only activate item if clicking on the title, content, or parent item div.\n // This will avoid accidental activations when clicking inside interactive elements like\n // the expand/collapse chevron, dropdown, inline-delete, etc...\n if (\n event.target === this.itemRef.nativeElement ||\n this.itemContentRef.nativeElement.contains(event.target) ||\n this.itemHeaderRef.nativeElement.contains(event.target)\n ) {\n this.repeaterService.activateItem(this);\n }\n }\n\n public updateForExpanded(value: boolean, animate: boolean): void {\n if (this.isCollapsible === false && value === false) {\n console.warn(\n `Setting isExpanded to false when the repeater item is not collapsible\n will have no effect.`\n );\n } else if (this._isExpanded !== value) {\n this._isExpanded = value;\n\n if (this._isExpanded) {\n this.expand.emit();\n } else {\n this.collapse.emit();\n }\n\n this.repeaterService.onItemCollapseStateChange(this);\n this.slideForExpanded(animate);\n this.changeDetector.markForCheck();\n }\n }\n\n public onCheckboxChange(value: SkyCheckboxChange): void {\n this.isSelected = value.checked;\n }\n\n public onInlineFormClose(inlineFormCloseArgs: SkyInlineFormCloseArgs): void {\n this.inlineFormClose.emit(inlineFormCloseArgs);\n }\n\n public moveToTop(event: Event): void {\n event.stopPropagation();\n this.adapterService.moveItemUp(this.elementRef.nativeElement, true);\n this.adapterService.focusElement(<HTMLElement>event.target);\n this.repeaterService.registerOrderChange();\n }\n\n public onReorderHandleKeyDown(event: KeyboardEvent): void {\n /*istanbul ignore else */\n if (event.key) {\n switch (event.key.toLowerCase()) {\n case ' ':\n case 'enter':\n this.keyboardToggleReorder();\n event.preventDefault();\n event.stopPropagation();\n break;\n\n case 'escape':\n /* istanbul ignore else */\n if (this.keyboardReorderingEnabled) {\n this.keyboardReorderingEnabled = false;\n this.revertReorderSteps();\n this.reorderButtonLabel =\n this.reorderCancelText + ' ' + this.reorderInstructions;\n this.adapterService.focusElement(<HTMLElement>event.target);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n\n case 'arrowup':\n if (this.keyboardReorderingEnabled) {\n this.keyboardReorderUp();\n event.preventDefault();\n event.stopPropagation();\n this.repeaterService.registerOrderChange();\n }\n break;\n\n case 'arrowdown':\n /* istanbul ignore else */\n if (this.keyboardReorderingEnabled) {\n this.keyboardReorderDown();\n event.preventDefault();\n event.stopPropagation();\n this.repeaterService.registerOrderChange();\n }\n break;\n\n case 'arrowleft':\n case 'arrowright':\n /* istanbul ignore else */\n if (this.keyboardReorderingEnabled) {\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n\n /* istanbul ignore next */\n default:\n break;\n }\n }\n }\n\n public onReorderHandleBlur(event: any): void {\n this.keyboardReorderingEnabled = false;\n this.revertReorderSteps();\n this.reorderButtonLabel = this.reorderInstructions;\n this.reorderState = undefined;\n }\n\n public onItemKeyDown(event: KeyboardEvent): void {\n /*istanbul ignore else */\n if (event.key) {\n switch (event.key.toLowerCase()) {\n case ' ':\n case 'enter':\n /* istanbul ignore else */\n /* Sanity check */\n // Space/enter should never execute unless focused on the parent item element.\n if (event.target === this.itemRef.nativeElement) {\n if (this.selectable) {\n this.isSelected = !this.isSelected;\n }\n this.repeaterService.activateItem(this);\n event.preventDefault();\n }\n break;\n\n /* istanbul ignore next */\n default:\n break;\n }\n }\n }\n\n private slideForExpanded(animate: boolean): void {\n this.slideDirection = this.isExpanded ? 'down' : 'up';\n }\n\n private keyboardReorderUp(): void {\n this.reorderCurrentIndex = this.adapterService.moveItemUp(\n this.elementRef.nativeElement\n );\n this.reorderSteps--;\n this.adapterService.focusElement(this.grabHandle);\n this.keyboardReorderingEnabled = true;\n this.reorderButtonLabel = `${this.reorderMovedText} ${\n this.reorderCurrentIndex + 1\n }`;\n }\n\n private keyboardReorderDown(): void {\n this.reorderCurrentIndex = this.adapterService.moveItemDown(\n this.elementRef.nativeElement\n );\n this.reorderSteps++;\n this.adapterService.focusElement(this.grabHandle);\n this.keyboardReorderingEnabled = true;\n this.reorderButtonLabel = `${this.reorderMovedText} ${\n this.reorderCurrentIndex + 1\n }`;\n }\n\n private keyboardToggleReorder(): void {\n this.keyboardReorderingEnabled = !this.keyboardReorderingEnabled;\n this.reorderSteps = 0;\n\n if (this.keyboardReorderingEnabled) {\n this.reorderState = this.reorderStateDescription;\n } else {\n this.reorderState = `${this.reorderFinishText} ${\n this.reorderCurrentIndex + 1\n } ${this.reorderInstructions}`;\n }\n }\n\n private revertReorderSteps(): void {\n if (this.reorderSteps < 0) {\n this.adapterService.moveItemDown(\n this.elementRef.nativeElement,\n Math.abs(this.reorderSteps)\n );\n } else if (this.reorderSteps > 0) {\n this.adapterService.moveItemUp(\n this.elementRef.nativeElement,\n false,\n this.reorderSteps\n );\n }\n this.repeaterService.registerOrderChange();\n }\n\n private updateExpandOnContentChange(): void {\n this.repeaterItemContentComponents.changes\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.hasItemContent = this.repeaterItemContentComponents.length > 0;\n /* istanbul ignore next */\n this.isCollapsible =\n this.hasItemContent && this.repeaterService.expandMode !== 'none';\n /* istanbul ignore else */\n if (this.repeaterService.expandMode === 'single') {\n this.repeaterService.onItemCollapseStateChange(this);\n }\n });\n }\n}\n","<div\n class=\"sky-repeater-item sky-padding-even-default\"\n role=\"option\"\n [attr.aria-label]=\"itemName\"\n [attr.aria-selected]=\"selectable ? isSelected : null\"\n [ngClass]=\"{\n 'sky-repeater-item-active': isActive,\n 'sky-repeater-item-collapsible': isCollapsible,\n 'sky-repeater-item-selected': isSelected\n }\"\n (click)=\"onRepeaterItemClick($event)\"\n (keydown)=\"onItemKeyDown($event)\"\n #itemRef\n>\n <div #inlineDelete>\n <ng-content select=\"sky-inline-delete\"></ng-content>\n </div>\n\n <ng-container *ngIf=\"inlineFormTemplate\">\n <sky-inline-form\n [config]=\"inlineFormConfig\"\n [showForm]=\"showInlineForm\"\n [template]=\"inlineFormTemplate\"\n (close)=\"onInlineFormClose($event)\"\n >\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemLeft\"></ng-container>\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemRight\"></ng-container>\n </sky-inline-form>\n </ng-container>\n\n <ng-container *ngIf=\"!inlineFormTemplate\">\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemLeft\"></ng-container>\n <ng-container *ngTemplateOutlet=\"skyRepeaterItemRight\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #skyRepeaterItemLeft>\n <div class=\"sky-repeater-item-left\">\n <ng-container *ngIf=\"reorderable\">\n <span\n aria-live=\"assertive\"\n class=\"sky-screen-reader-only\"\n [id]=\"contentId + '-reorder-state'\"\n >\n {{ reorderState }}\n </span>\n <span\n class=\"sky-screen-reader-only\"\n [id]=\"contentId + '-reorder-instructions'\"\n >{{ reorderButtonLabel }}</span\n >\n <button\n class=\"sky-btn sky-tile-tools-control sky-repeater-item-grab-handle\"\n type=\"button\"\n [attr.aria-describedby]=\"contentId + '-reorder-instructions'\"\n [attr.aria-label]=\"\n itemName\n ? ('skyux_repeater_item_reorder_label' | skyLibResources: itemName)\n : ('skyux_repeater_item_reorder_label_default' | skyLibResources)\n \"\n (blur)=\"onReorderHandleBlur($event)\"\n (keydown)=\"onReorderHandleKeyDown($event)\"\n #grabHandle\n >\n <sky-icon icon=\"arrows-v\"></sky-icon>\n </button>\n </ng-container>\n <sky-checkbox\n *ngIf=\"selectable\"\n class=\"sky-repeater-item-checkbox\"\n [checked]=\"isSelected\"\n [label]=\"\n itemName\n ? ('skyux_repeater_item_checkbox_label' | skyLibResources: itemName)\n : ('skyux_repeater_item_checkbox_label_default' | skyLibResources)\n \"\n (change)=\"onCheckboxChange($event)\"\n >\n </sky-checkbox>\n <div\n class=\"sky-repeater-item-context-menu\"\n [hidden]=\"contextMenuEl.children.length === 0\"\n #contextMenuEl\n >\n <ng-content select=\"sky-repeater-item-context-menu\"></ng-content>\n </div>\n </div>\n</ng-template>\n\n<ng-template #skyRepeaterItemRight>\n <div class=\"sky-repeater-item-right\" #itemHeaderRef>\n <div\n class=\"sky-repeater-item-header\"\n [hidden]=\"titleRef.children.length === 0\"\n (click)=\"headerClick()\"\n >\n <div class=\"sky-repeater-item-title sky-emphasized\" #titleRef>\n <ng-content select=\"sky-repeater-item-title\"></ng-content>\n </div>\n <button\n *ngIf=\"reorderable\"\n class=\"sky-btn sky-btn-link sky-repeater-item-reorder-top\"\n type=\"button\"\n [attr.aria-label]=\"\n itemName\n ? ('skyux_repeater_item_reorder_top_label'\n | skyLibResources: itemName)\n : ('skyux_repeater_item_reorder_top_label_default'\n | skyLibResources)\n \"\n (click)=\"moveToTop($event)\"\n >\n <sky-icon icon=\"arrow-circle-up\"></sky-icon>\n {{ 'skyux_repeater_item_reorder_top' | skyLibResources }}\n </button>\n <div *ngIf=\"isCollapsible\" class=\"sky-repeater-item-chevron\">\n <sky-chevron\n [ariaControls]=\"contentId\"\n [ariaLabel]=\"\n itemName\n ? ('skyux_repeater_item_expand' | skyLibResources: itemName)\n : ('skyux_repeater_item_expand_default' | skyLibResources)\n \"\n [direction]=\"isExpanded ? 'up' : 'down'\"\n (directionChange)=\"chevronDirectionChange($event)\"\n >\n </sky-chevron>\n </div>\n <!-- Used for when the chevron is hidden to ensure that the right side is the same height as the left.-->\n <div\n *ngIf=\"!isCollapsible && !contextMenu\"\n class=\"sky-repeater-item-chevron-placeholder\"\n ></div>\n <!-- Used to ensure that the right side is the same height as the left.-->\n <div\n *ngIf=\"contextMenu\"\n class=\"sky-repeater-item-chevron-placeholder-with-context\"\n ></div>\n </div>\n <div\n class=\"sky-repeater-item-content\"\n [id]=\"contentId\"\n [@skyAnimationSlide]=\"slideDirection\"\n #itemContentRef\n >\n <ng-content select=\"sky-repeater-item-content\"></ng-content>\n </div>\n </div>\n</ng-template>\n"]}
|