@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,127 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@skyux/indicators";
|
|
4
|
+
import * as i2 from "@angular/common";
|
|
5
|
+
import * as i3 from "@skyux/theme";
|
|
6
|
+
import * as i4 from "@skyux/i18n";
|
|
7
|
+
export class SkyPagingComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the page number of the current page. Page numbers start at 1 and increment.
|
|
11
|
+
*/
|
|
12
|
+
this.currentPage = 1;
|
|
13
|
+
/**
|
|
14
|
+
* Specifies the total number of items across all pages.
|
|
15
|
+
*/
|
|
16
|
+
this.itemCount = 0;
|
|
17
|
+
/**
|
|
18
|
+
* Specifies the maximum number of pages to display in the pagination control.
|
|
19
|
+
*/
|
|
20
|
+
this.maxPages = 5;
|
|
21
|
+
/**
|
|
22
|
+
* Specifies the number of items to display per page.
|
|
23
|
+
*/
|
|
24
|
+
this.pageSize = 10;
|
|
25
|
+
/**
|
|
26
|
+
* Fires when the current page changes and emits the new current page.
|
|
27
|
+
*/
|
|
28
|
+
this.currentPageChange = new EventEmitter();
|
|
29
|
+
this.displayedPages = [];
|
|
30
|
+
this.pageCount = 0;
|
|
31
|
+
}
|
|
32
|
+
ngOnChanges(changes) {
|
|
33
|
+
this.setPage(this.currentPage);
|
|
34
|
+
}
|
|
35
|
+
setPage(pageNumber) {
|
|
36
|
+
let previousPage = this.currentPage;
|
|
37
|
+
this.setPageCount();
|
|
38
|
+
if (pageNumber < 1 || this.pageCount < 1) {
|
|
39
|
+
this.currentPage = 1;
|
|
40
|
+
}
|
|
41
|
+
else if (pageNumber > this.pageCount) {
|
|
42
|
+
this.currentPage = this.pageCount;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.currentPage = pageNumber;
|
|
46
|
+
}
|
|
47
|
+
this.setDisplayedPages();
|
|
48
|
+
if (previousPage !== this.currentPage) {
|
|
49
|
+
this.currentPageChange.emit(this.currentPage);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
nextPage() {
|
|
53
|
+
this.setPage(this.currentPage + 1);
|
|
54
|
+
}
|
|
55
|
+
previousPage() {
|
|
56
|
+
this.setPage(this.currentPage - 1);
|
|
57
|
+
}
|
|
58
|
+
get isPreviousButtonDisabled() {
|
|
59
|
+
return this.currentPage === 1;
|
|
60
|
+
}
|
|
61
|
+
get isNextButtonDisabled() {
|
|
62
|
+
return this.currentPage === this.pageCount;
|
|
63
|
+
}
|
|
64
|
+
getDisplayedPageNumbers(pageCount, maxDisplayedPages, pageNumber) {
|
|
65
|
+
let pageIndex = pageNumber - 1;
|
|
66
|
+
let pageBounds = Math.floor(maxDisplayedPages / 2);
|
|
67
|
+
let upperBound = pageIndex + pageBounds;
|
|
68
|
+
let lowerBound = pageIndex - pageBounds;
|
|
69
|
+
if (maxDisplayedPages % 2 !== 0) {
|
|
70
|
+
upperBound += 1;
|
|
71
|
+
}
|
|
72
|
+
// Wrap negative values to increase the upperbound
|
|
73
|
+
if (lowerBound < 0) {
|
|
74
|
+
upperBound -= lowerBound;
|
|
75
|
+
lowerBound = 0;
|
|
76
|
+
}
|
|
77
|
+
// Wrap overflow to decrease the lowerbound
|
|
78
|
+
if (upperBound > pageCount) {
|
|
79
|
+
lowerBound -= upperBound - pageCount;
|
|
80
|
+
upperBound = pageCount;
|
|
81
|
+
}
|
|
82
|
+
// If both are the same ignore everything else and just display it all
|
|
83
|
+
if (pageCount < maxDisplayedPages) {
|
|
84
|
+
lowerBound = 0;
|
|
85
|
+
upperBound = pageCount;
|
|
86
|
+
}
|
|
87
|
+
let displayedPageNumbers = [];
|
|
88
|
+
for (let i = lowerBound; i < upperBound; i++) {
|
|
89
|
+
displayedPageNumbers.push(i + 1);
|
|
90
|
+
}
|
|
91
|
+
return displayedPageNumbers;
|
|
92
|
+
}
|
|
93
|
+
setPageCount() {
|
|
94
|
+
if (this.itemCount === 0 || this.pageSize === 0) {
|
|
95
|
+
this.pageCount = 0;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.pageCount = Math.ceil(this.itemCount / this.pageSize);
|
|
99
|
+
}
|
|
100
|
+
setDisplayedPages() {
|
|
101
|
+
this.displayedPages = this.getDisplayedPageNumbers(this.pageCount, this.maxPages, this.currentPage);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
SkyPagingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPagingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
105
|
+
SkyPagingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyPagingComponent, selector: "sky-paging", inputs: { currentPage: "currentPage", itemCount: "itemCount", maxPages: "maxPages", pageSize: "pageSize", pagingLabel: "pagingLabel" }, outputs: { currentPageChange: "currentPageChange" }, usesOnChanges: true, ngImport: i0, template: "<nav\n *ngIf=\"pageCount > 1\"\n class=\"sky-paging\"\n [attr.aria-label]=\"pagingLabel || ('skyux_paging_label' | skyLibResources)\"\n>\n <ul>\n <li>\n <button\n class=\"\n sky-btn sky-btn-default sky-paging-btn sky-paging-btn-previous sky-box\n \"\n sky-cmp-id=\"previous\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_paging_previous' | skyLibResources\"\n [disabled]=\"isPreviousButtonDisabled\"\n (click)=\"previousPage()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"caret-left\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-left\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </li>\n <li *ngFor=\"let pageNumber of displayedPages\" class=\"sky-list-paging-link\">\n <button\n class=\"sky-btn sky-btn-default sky-paging-btn sky-box\"\n type=\"button\"\n [attr.aria-current]=\"currentPage === pageNumber ? 'page' : null\"\n [attr.sky-cmp-id]=\"pageNumber\"\n [disabled]=\"currentPage === pageNumber\"\n [ngClass]=\"{ 'sky-paging-current': currentPage === pageNumber }\"\n (click)=\"setPage(pageNumber)\"\n >\n {{ pageNumber }}\n </button>\n </li>\n <li>\n <button\n class=\"\n sky-btn sky-btn-default sky-paging-btn sky-paging-btn-next sky-box\n \"\n sky-cmp-id=\"next\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_paging_next' | skyLibResources\"\n [disabled]=\"isNextButtonDisabled\"\n (click)=\"nextPage()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"caret-right\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-right\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </li>\n </ul>\n</nav>\n", styles: [":host{display:block}ul{margin:15px 0 0;display:inline-block;padding-left:0;border-radius:4px}li{display:inline}.sky-paging-btn{border-top:1px solid #e2e3e4;border-right:1px solid #e2e3e4;border-bottom:1px solid #e2e3e4;border-left:1px solid #e2e3e4;border-radius:0;background-color:#fff;color:inherit;float:left;margin-left:-1px;padding:4px 10px;text-decoration:none;line-height:1.428571429;font-size:15px;cursor:pointer}.sky-paging-btn.sky-paging-caret{transform:none}.sky-paging-btn.sky-paging-current,.sky-paging-btn.sky-paging-current:disabled,.sky-paging-btn.sky-paging-current[disabled]{background-color:#eeeeef;cursor:default;color:inherit;opacity:1}.sky-paging-btn:hover{background-color:#d4d4d6}.sky-paging-btn:disabled{color:#686c73;cursor:not-allowed;pointer-events:none}.sky-paging-btn.sky-paging-btn-previous,.sky-paging-btn.sky-paging-btn-next{padding-left:8.5px;padding-right:8.5px}:host-context(.sky-theme-modern) .sky-paging-btn{background-color:transparent;border:none;box-shadow:none;border-radius:6px;margin-right:10px;padding:3px 10px}:host-context(.sky-theme-modern) .sky-paging-btn:hover{background-color:transparent;border:solid 1px #1870B8;padding:2px 9px;z-index:1}:host-context(.sky-theme-modern) .sky-paging-btn:active,:host-context(.sky-theme-modern) .sky-paging-btn:focus{border:solid 2px #1870B8;color:#212327;padding:1px 8px}:host-context(.sky-theme-modern) .sky-paging-btn:focus:not(:active){outline:none;box-shadow:0 1px 3px #0000004d}:host-context(.sky-theme-modern) .sky-paging-current{background-color:#c1e8fb;border:solid 1px #1870B8;padding:2px 9px}.sky-theme-modern .sky-paging-btn{background-color:transparent;border:none;box-shadow:none;border-radius:6px;margin-right:10px;padding:3px 10px}.sky-theme-modern .sky-paging-btn:hover{background-color:transparent;border:solid 1px #1870B8;padding:2px 9px;z-index:1}.sky-theme-modern .sky-paging-btn:active,.sky-theme-modern .sky-paging-btn:focus{border:solid 2px #1870B8;color:#212327;padding:1px 8px}.sky-theme-modern .sky-paging-btn:focus:not(:active){outline:none;box-shadow:0 1px 3px #0000004d}.sky-theme-modern .sky-paging-current{background-color:#c1e8fb;border:solid 1px #1870B8;padding:2px 9px}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-paging-btn:active,:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-paging-btn:focus{color:#fbfcfe}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-paging-current{background-color:#1870b8}.sky-theme-modern.sky-theme-mode-dark .sky-paging-btn:active,.sky-theme-modern.sky-theme-mode-dark .sky-paging-btn:focus{color:#fbfcfe}.sky-theme-modern.sky-theme-mode-dark .sky-paging-current{background-color:#1870b8}\n"], components: [{ type: i1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "skyLibResources": i4.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPagingComponent, decorators: [{
|
|
107
|
+
type: Component,
|
|
108
|
+
args: [{
|
|
109
|
+
selector: 'sky-paging',
|
|
110
|
+
templateUrl: './paging.component.html',
|
|
111
|
+
styleUrls: ['./paging.component.scss'],
|
|
112
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
113
|
+
}]
|
|
114
|
+
}], propDecorators: { currentPage: [{
|
|
115
|
+
type: Input
|
|
116
|
+
}], itemCount: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}], maxPages: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], pageSize: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}], pagingLabel: [{
|
|
123
|
+
type: Input
|
|
124
|
+
}], currentPageChange: [{
|
|
125
|
+
type: Output
|
|
126
|
+
}] } });
|
|
127
|
+
//# sourceMappingURL=paging.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paging.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/paging/paging.component.ts","../../../../../../../../libs/components/lists/src/lib/modules/paging/paging.component.html"],"names":[],"mappings":"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","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n} from '@angular/core';\n\n@Component({\n selector: 'sky-paging',\n templateUrl: './paging.component.html',\n styleUrls: ['./paging.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyPagingComponent implements OnChanges {\n /**\n * Specifies the page number of the current page. Page numbers start at 1 and increment.\n */\n @Input()\n public currentPage: number = 1;\n\n /**\n * Specifies the total number of items across all pages.\n */\n @Input()\n public itemCount: number = 0;\n\n /**\n * Specifies the maximum number of pages to display in the pagination control.\n */\n @Input()\n public maxPages: number = 5;\n\n /**\n * Specifies the number of items to display per page.\n */\n @Input()\n public pageSize: number = 10;\n\n /**\n * Specifies a label for the pagination control when an application includes\n * multiple paging components on the same page. The label should be unique and descriptive\n * to help users of assistive technology differentiate pagination controls\n * and understand what each one does.\n * @default \"Pagination\"\n */\n @Input()\n public pagingLabel: string;\n\n /**\n * Fires when the current page changes and emits the new current page.\n */\n @Output()\n public currentPageChange: EventEmitter<number> = new EventEmitter<number>();\n\n public displayedPages: Array<number> = [];\n\n public pageCount: number = 0;\n\n public ngOnChanges(changes: SimpleChanges): void {\n this.setPage(this.currentPage);\n }\n\n public setPage(pageNumber: number): void {\n let previousPage = this.currentPage;\n\n this.setPageCount();\n\n if (pageNumber < 1 || this.pageCount < 1) {\n this.currentPage = 1;\n } else if (pageNumber > this.pageCount) {\n this.currentPage = this.pageCount;\n } else {\n this.currentPage = pageNumber;\n }\n\n this.setDisplayedPages();\n\n if (previousPage !== this.currentPage) {\n this.currentPageChange.emit(this.currentPage);\n }\n }\n\n public nextPage(): void {\n this.setPage(this.currentPage + 1);\n }\n\n public previousPage(): void {\n this.setPage(this.currentPage - 1);\n }\n\n public get isPreviousButtonDisabled(): boolean {\n return this.currentPage === 1;\n }\n\n public get isNextButtonDisabled(): boolean {\n return this.currentPage === this.pageCount;\n }\n\n private getDisplayedPageNumbers(\n pageCount: number,\n maxDisplayedPages: number,\n pageNumber: number\n ): Array<number> {\n let pageIndex = pageNumber - 1;\n let pageBounds = Math.floor(maxDisplayedPages / 2);\n\n let upperBound = pageIndex + pageBounds;\n let lowerBound = pageIndex - pageBounds;\n if (maxDisplayedPages % 2 !== 0) {\n upperBound += 1;\n }\n\n // Wrap negative values to increase the upperbound\n if (lowerBound < 0) {\n upperBound -= lowerBound;\n lowerBound = 0;\n }\n // Wrap overflow to decrease the lowerbound\n if (upperBound > pageCount) {\n lowerBound -= upperBound - pageCount;\n upperBound = pageCount;\n }\n\n // If both are the same ignore everything else and just display it all\n if (pageCount < maxDisplayedPages) {\n lowerBound = 0;\n upperBound = pageCount;\n }\n\n let displayedPageNumbers: Array<number> = [];\n for (let i = lowerBound; i < upperBound; i++) {\n displayedPageNumbers.push(i + 1);\n }\n return displayedPageNumbers;\n }\n\n private setPageCount(): void {\n if (this.itemCount === 0 || this.pageSize === 0) {\n this.pageCount = 0;\n return;\n }\n\n this.pageCount = Math.ceil(this.itemCount / this.pageSize);\n }\n\n private setDisplayedPages(): void {\n this.displayedPages = this.getDisplayedPageNumbers(\n this.pageCount,\n this.maxPages,\n this.currentPage\n );\n }\n}\n","<nav\n *ngIf=\"pageCount > 1\"\n class=\"sky-paging\"\n [attr.aria-label]=\"pagingLabel || ('skyux_paging_label' | skyLibResources)\"\n>\n <ul>\n <li>\n <button\n class=\"\n sky-btn sky-btn-default sky-paging-btn sky-paging-btn-previous sky-box\n \"\n sky-cmp-id=\"previous\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_paging_previous' | skyLibResources\"\n [disabled]=\"isPreviousButtonDisabled\"\n (click)=\"previousPage()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"caret-left\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-left\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </li>\n <li *ngFor=\"let pageNumber of displayedPages\" class=\"sky-list-paging-link\">\n <button\n class=\"sky-btn sky-btn-default sky-paging-btn sky-box\"\n type=\"button\"\n [attr.aria-current]=\"currentPage === pageNumber ? 'page' : null\"\n [attr.sky-cmp-id]=\"pageNumber\"\n [disabled]=\"currentPage === pageNumber\"\n [ngClass]=\"{ 'sky-paging-current': currentPage === pageNumber }\"\n (click)=\"setPage(pageNumber)\"\n >\n {{ pageNumber }}\n </button>\n </li>\n <li>\n <button\n class=\"\n sky-btn sky-btn-default sky-paging-btn sky-paging-btn-next sky-box\n \"\n sky-cmp-id=\"next\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_paging_next' | skyLibResources\"\n [disabled]=\"isNextButtonDisabled\"\n (click)=\"nextPage()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"caret-right\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"chevron-right\"\n iconType=\"skyux\"\n ></sky-icon>\n </button>\n </li>\n </ul>\n</nav>\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { SkyIconModule } from '@skyux/indicators';
|
|
4
|
+
import { SkyThemeModule } from '@skyux/theme';
|
|
5
|
+
import { SkyListsResourcesModule } from '../shared/sky-lists-resources.module';
|
|
6
|
+
import { SkyPagingComponent } from './paging.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export class SkyPagingModule {
|
|
9
|
+
}
|
|
10
|
+
SkyPagingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
11
|
+
SkyPagingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPagingModule, declarations: [SkyPagingComponent], imports: [CommonModule,
|
|
12
|
+
SkyIconModule,
|
|
13
|
+
SkyListsResourcesModule,
|
|
14
|
+
SkyThemeModule], exports: [SkyPagingComponent] });
|
|
15
|
+
SkyPagingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPagingModule, imports: [[
|
|
16
|
+
CommonModule,
|
|
17
|
+
SkyIconModule,
|
|
18
|
+
SkyListsResourcesModule,
|
|
19
|
+
SkyThemeModule,
|
|
20
|
+
]] });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPagingModule, decorators: [{
|
|
22
|
+
type: NgModule,
|
|
23
|
+
args: [{
|
|
24
|
+
declarations: [SkyPagingComponent],
|
|
25
|
+
imports: [
|
|
26
|
+
CommonModule,
|
|
27
|
+
SkyIconModule,
|
|
28
|
+
SkyListsResourcesModule,
|
|
29
|
+
SkyThemeModule,
|
|
30
|
+
],
|
|
31
|
+
exports: [SkyPagingComponent],
|
|
32
|
+
}]
|
|
33
|
+
}] });
|
|
34
|
+
//# sourceMappingURL=paging.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paging.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/paging/paging.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;;AAYxD,MAAM,OAAO,eAAe;;6GAAf,eAAe;8GAAf,eAAe,iBATX,kBAAkB,aAE/B,YAAY;QACZ,aAAa;QACb,uBAAuB;QACvB,cAAc,aAEN,kBAAkB;8GAEjB,eAAe,YARjB;YACP,YAAY;YACZ,aAAa;YACb,uBAAuB;YACvB,cAAc;SACf;4FAGU,eAAe;kBAV3B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,uBAAuB;wBACvB,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B","sourcesContent":["import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { SkyIconModule } from '@skyux/indicators';\n\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyListsResourcesModule } from '../shared/sky-lists-resources.module';\n\nimport { SkyPagingComponent } from './paging.component';\n\n@NgModule({\n declarations: [SkyPagingComponent],\n imports: [\n CommonModule,\n SkyIconModule,\n SkyListsResourcesModule,\n SkyThemeModule,\n ],\n exports: [SkyPagingComponent],\n})\nexport class SkyPagingModule {}\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ElementRef, Injectable } from '@angular/core';
|
|
2
|
+
import { SkyRepeaterService } from './repeater.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./repeater.service";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export class SkyRepeaterAdapterService {
|
|
9
|
+
constructor(repeaterService) {
|
|
10
|
+
this.repeaterService = repeaterService;
|
|
11
|
+
}
|
|
12
|
+
get repeaterItemGroupSelector() {
|
|
13
|
+
return '.sky-repeater-item-group-' + this.repeaterService.repeaterGroupId;
|
|
14
|
+
}
|
|
15
|
+
focusElement(element) {
|
|
16
|
+
if (element instanceof ElementRef) {
|
|
17
|
+
element.nativeElement.focus();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
element.focus();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
setRepeaterHost(hostRef) {
|
|
24
|
+
this.host = hostRef;
|
|
25
|
+
}
|
|
26
|
+
getRepeaterItemIndex(element) {
|
|
27
|
+
return this.getRepeaterItemArray().indexOf(element);
|
|
28
|
+
}
|
|
29
|
+
moveItemUp(element, top = false, steps = 1) {
|
|
30
|
+
const index = this.getRepeaterItemIndex(element);
|
|
31
|
+
if (index === 0) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let newIndex = index - steps;
|
|
35
|
+
if (top || newIndex < 0) {
|
|
36
|
+
newIndex = 0;
|
|
37
|
+
}
|
|
38
|
+
return this.moveItem(element, index, newIndex);
|
|
39
|
+
}
|
|
40
|
+
moveItemDown(element, steps = 1) {
|
|
41
|
+
const itemArray = this.getRepeaterItemArray();
|
|
42
|
+
const index = this.getRepeaterItemIndex(element);
|
|
43
|
+
if (index === itemArray.length - steps) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let newIndex = index + steps;
|
|
47
|
+
return this.moveItem(element, index, newIndex);
|
|
48
|
+
}
|
|
49
|
+
moveItem(element, oldIndex, newIndex) {
|
|
50
|
+
const repeaterDiv = this.host.nativeElement.querySelector('.sky-repeater');
|
|
51
|
+
repeaterDiv.removeChild(element);
|
|
52
|
+
const nextSibling = repeaterDiv.querySelectorAll(this.repeaterItemGroupSelector)[newIndex];
|
|
53
|
+
repeaterDiv.insertBefore(element, nextSibling);
|
|
54
|
+
this.repeaterService.reorderItem(oldIndex, newIndex);
|
|
55
|
+
return newIndex;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Returns an array of the immediate repeater item descendants. Excludes nested repeater items.
|
|
59
|
+
*/
|
|
60
|
+
getRepeaterItemArray() {
|
|
61
|
+
return Array.from(this.host.nativeElement.querySelectorAll(this.repeaterItemGroupSelector));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
SkyRepeaterAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterAdapterService, deps: [{ token: i1.SkyRepeaterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
65
|
+
SkyRepeaterAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterAdapterService });
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterAdapterService, decorators: [{
|
|
67
|
+
type: Injectable
|
|
68
|
+
}], ctorParameters: function () { return [{ type: i1.SkyRepeaterService }]; } });
|
|
69
|
+
//# sourceMappingURL=repeater-adapter.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeater-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;;;AAExD;;GAEG;AAEH,MAAM,OAAO,yBAAyB;IAOpC,YAAoB,eAAmC;QAAnC,oBAAe,GAAf,eAAe,CAAoB;IAAG,CAAC;IAN3D,IAAY,yBAAyB;QACnC,OAAO,2BAA2B,GAAG,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC;IAC5E,CAAC;IAMM,YAAY,CAAC,OAAiC;QACnD,IAAI,OAAO,YAAY,UAAU,EAAE;YACjC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;SAC/B;aAAM;YACL,OAAO,CAAC,KAAK,EAAE,CAAC;SACjB;IACH,CAAC;IAEM,eAAe,CAAC,OAAmB;QACxC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,CAAC;IAEM,oBAAoB,CAAC,OAAoB;QAC9C,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAEM,UAAU,CAAC,OAAoB,EAAE,GAAG,GAAG,KAAK,EAAE,KAAK,GAAG,CAAC;QAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEjD,IAAI,KAAK,KAAK,CAAC,EAAE;YACf,OAAO;SACR;QAED,IAAI,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;QAE7B,IAAI,GAAG,IAAI,QAAQ,GAAG,CAAC,EAAE;YACvB,QAAQ,GAAG,CAAC,CAAC;SACd;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IAEM,YAAY,CAAC,OAAoB,EAAE,KAAK,GAAG,CAAC;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEjD,IAAI,KAAK,KAAK,SAAS,CAAC,MAAM,GAAG,KAAK,EAAE;YACtC,OAAO;SACR;QAED,IAAI,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;QAE7B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IAEO,QAAQ,CACd,OAAoB,EACpB,QAAgB,EAChB,QAAgB;QAEhB,MAAM,WAAW,GACf,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAEzD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,WAAW,GAAG,WAAW,CAAC,gBAAgB,CAC9C,IAAI,CAAC,yBAAyB,CAC/B,CAAC,QAAQ,CAAC,CAAC;QAEZ,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC/C,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAErD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACK,oBAAoB;QAC1B,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,IAAI,CAAC,yBAAyB,CAAC,CACzE,CAAC;IACJ,CAAC;;uHAhFU,yBAAyB;2HAAzB,yBAAyB;4FAAzB,yBAAyB;kBADrC,UAAU","sourcesContent":["import { ElementRef, Injectable } from '@angular/core';\n\nimport { SkyRepeaterService } from './repeater.service';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyRepeaterAdapterService {\n private get repeaterItemGroupSelector(): string {\n return '.sky-repeater-item-group-' + this.repeaterService.repeaterGroupId;\n }\n\n private host: ElementRef;\n\n constructor(private repeaterService: SkyRepeaterService) {}\n\n public focusElement(element: ElementRef | HTMLElement): void {\n if (element instanceof ElementRef) {\n element.nativeElement.focus();\n } else {\n element.focus();\n }\n }\n\n public setRepeaterHost(hostRef: ElementRef): void {\n this.host = hostRef;\n }\n\n public getRepeaterItemIndex(element: HTMLElement): number {\n return this.getRepeaterItemArray().indexOf(element);\n }\n\n public moveItemUp(element: HTMLElement, top = false, steps = 1): number {\n const index = this.getRepeaterItemIndex(element);\n\n if (index === 0) {\n return;\n }\n\n let newIndex = index - steps;\n\n if (top || newIndex < 0) {\n newIndex = 0;\n }\n\n return this.moveItem(element, index, newIndex);\n }\n\n public moveItemDown(element: HTMLElement, steps = 1): number {\n const itemArray = this.getRepeaterItemArray();\n const index = this.getRepeaterItemIndex(element);\n\n if (index === itemArray.length - steps) {\n return;\n }\n\n let newIndex = index + steps;\n\n return this.moveItem(element, index, newIndex);\n }\n\n private moveItem(\n element: HTMLElement,\n oldIndex: number,\n newIndex: number\n ): number {\n const repeaterDiv: HTMLElement =\n this.host.nativeElement.querySelector('.sky-repeater');\n\n repeaterDiv.removeChild(element);\n const nextSibling = repeaterDiv.querySelectorAll(\n this.repeaterItemGroupSelector\n )[newIndex];\n\n repeaterDiv.insertBefore(element, nextSibling);\n this.repeaterService.reorderItem(oldIndex, newIndex);\n\n return newIndex;\n }\n\n /**\n * Returns an array of the immediate repeater item descendants. Excludes nested repeater items.\n */\n private getRepeaterItemArray() {\n return Array.from(\n this.host.nativeElement.querySelectorAll(this.repeaterItemGroupSelector)\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Displays content text when the repeater is expanded.
|
|
5
|
+
*/
|
|
6
|
+
export class SkyRepeaterItemContentComponent {
|
|
7
|
+
}
|
|
8
|
+
SkyRepeaterItemContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9
|
+
SkyRepeaterItemContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRepeaterItemContentComponent, selector: "sky-repeater-item-content", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemContentComponent, decorators: [{
|
|
11
|
+
type: Component,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: 'sky-repeater-item-content',
|
|
14
|
+
templateUrl: './repeater-item-content.component.html',
|
|
15
|
+
}]
|
|
16
|
+
}] });
|
|
17
|
+
//# sourceMappingURL=repeater-item-content.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeater-item-content.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item-content.component.ts","../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item-content.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAE1C;;GAEG;AAKH,MAAM,OAAO,+BAA+B;;6HAA/B,+BAA+B;iHAA/B,+BAA+B,iECT5C,6BACA;4FDQa,+BAA+B;kBAJ3C,SAAS;mBAAC;oBACT,QAAQ,EAAE,2BAA2B;oBACrC,WAAW,EAAE,wCAAwC;iBACtD","sourcesContent":["import { Component } from '@angular/core';\n\n/**\n * Displays content text when the repeater is expanded.\n */\n@Component({\n selector: 'sky-repeater-item-content',\n templateUrl: './repeater-item-content.component.html',\n})\nexport class SkyRepeaterItemContentComponent {}\n","<ng-content></ng-content>\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Wraps and styles a
|
|
5
|
+
* [`skyux-dropdown` component](https://developer.blackbaud.com/skyux-popovers/docs/dropdown).
|
|
6
|
+
*/
|
|
7
|
+
/* istanbul ignore next */
|
|
8
|
+
/* Code coverage having problems with no statements in classes */
|
|
9
|
+
export class SkyRepeaterItemContextMenuComponent {
|
|
10
|
+
}
|
|
11
|
+
SkyRepeaterItemContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12
|
+
SkyRepeaterItemContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRepeaterItemContextMenuComponent, selector: "sky-repeater-item-context-menu", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemContextMenuComponent, decorators: [{
|
|
14
|
+
type: Component,
|
|
15
|
+
args: [{
|
|
16
|
+
selector: 'sky-repeater-item-context-menu',
|
|
17
|
+
templateUrl: './repeater-item-context-menu.component.html',
|
|
18
|
+
}]
|
|
19
|
+
}] });
|
|
20
|
+
//# sourceMappingURL=repeater-item-context-menu.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeater-item-context-menu.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item-context-menu.component.ts","../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item-context-menu.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAE1C;;;GAGG;AAKH,0BAA0B;AAC1B,iEAAiE;AACjE,MAAM,OAAO,mCAAmC;;iIAAnC,mCAAmC;qHAAnC,mCAAmC,sECZhD,6BACA;4FDWa,mCAAmC;kBAN/C,SAAS;mBAAC;oBACT,QAAQ,EAAE,gCAAgC;oBAC1C,WAAW,EAAE,6CAA6C;iBAC3D","sourcesContent":["import { Component } from '@angular/core';\n\n/**\n * Wraps and styles a\n * [`skyux-dropdown` component](https://developer.blackbaud.com/skyux-popovers/docs/dropdown).\n */\n@Component({\n selector: 'sky-repeater-item-context-menu',\n templateUrl: './repeater-item-context-menu.component.html',\n})\n/* istanbul ignore next */\n/* Code coverage having problems with no statements in classes */\nexport class SkyRepeaterItemContextMenuComponent {}\n","<ng-content></ng-content>\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Displays a header inside the repeater item.
|
|
5
|
+
*/
|
|
6
|
+
export class SkyRepeaterItemTitleComponent {
|
|
7
|
+
}
|
|
8
|
+
SkyRepeaterItemTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9
|
+
SkyRepeaterItemTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyRepeaterItemTitleComponent, selector: "sky-repeater-item-title", ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyRepeaterItemTitleComponent, decorators: [{
|
|
11
|
+
type: Component,
|
|
12
|
+
args: [{
|
|
13
|
+
selector: 'sky-repeater-item-title',
|
|
14
|
+
templateUrl: './repeater-item-title.component.html',
|
|
15
|
+
}]
|
|
16
|
+
}] });
|
|
17
|
+
//# sourceMappingURL=repeater-item-title.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repeater-item-title.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item-title.component.ts","../../../../../../../../libs/components/lists/src/lib/modules/repeater/repeater-item-title.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAE1C;;GAEG;AAKH,MAAM,OAAO,6BAA6B;;2HAA7B,6BAA6B;+GAA7B,6BAA6B,+DCT1C,6BACA;4FDQa,6BAA6B;kBAJzC,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,WAAW,EAAE,sCAAsC;iBACpD","sourcesContent":["import { Component } from '@angular/core';\n\n/**\n * Displays a header inside the repeater item.\n */\n@Component({\n selector: 'sky-repeater-item-title',\n templateUrl: './repeater-item-title.component.html',\n})\nexport class SkyRepeaterItemTitleComponent {}\n","<ng-content></ng-content>\n"]}
|