@skyux/pages 5.8.2 → 5.9.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/bundles/skyux-pages.umd.js +455 -45
- package/documentation.json +182 -274
- package/esm2015/index.js +2 -0
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/modules/action-hub/action-hub-recent-links-resolve.pipe.js +100 -0
- package/esm2015/lib/modules/action-hub/action-hub-recent-links-resolve.pipe.js.map +1 -0
- package/esm2015/lib/modules/action-hub/action-hub-related-links-sort.pipe.js +29 -0
- package/esm2015/lib/modules/action-hub/action-hub-related-links-sort.pipe.js.map +1 -0
- package/esm2015/lib/modules/action-hub/action-hub.component.js +4 -41
- package/esm2015/lib/modules/action-hub/action-hub.component.js.map +1 -1
- package/esm2015/lib/modules/action-hub/action-hub.module.js +6 -0
- package/esm2015/lib/modules/action-hub/action-hub.module.js.map +1 -1
- package/esm2015/lib/modules/action-hub/types/page-links-input.js +2 -0
- package/esm2015/lib/modules/action-hub/types/page-links-input.js.map +1 -0
- package/esm2015/lib/modules/action-hub/types/recent-links-input.js +2 -0
- package/esm2015/lib/modules/action-hub/types/recent-links-input.js.map +1 -0
- package/esm2015/lib/modules/action-hub/types/recent-links-resolved.js +2 -0
- package/esm2015/lib/modules/action-hub/types/recent-links-resolved.js.map +1 -0
- package/esm2015/lib/modules/link-list/link-list.component.js.map +1 -1
- package/fesm2015/skyux-pages.js +129 -41
- package/fesm2015/skyux-pages.js.map +1 -1
- package/index.d.ts +2 -0
- package/lib/modules/action-hub/action-hub-recent-links-resolve.pipe.d.ts +15 -0
- package/lib/modules/action-hub/action-hub-related-links-sort.pipe.d.ts +8 -0
- package/lib/modules/action-hub/action-hub.component.d.ts +4 -5
- package/lib/modules/action-hub/action-hub.module.d.ts +14 -12
- package/lib/modules/action-hub/types/page-links-input.d.ts +2 -0
- package/lib/modules/action-hub/types/recent-links-input.d.ts +6 -0
- package/lib/modules/action-hub/types/recent-links-resolved.d.ts +2 -0
- package/lib/modules/link-list/link-list.component.d.ts +2 -2
- package/package.json +6 -6
package/esm2015/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './lib/modules/action-hub/action-hub.module';
|
|
2
2
|
export * from './lib/modules/action-hub/types/action-hub-needs-attention';
|
|
3
3
|
export * from './lib/modules/action-hub/types/page-link';
|
|
4
|
+
export * from './lib/modules/action-hub/types/page-links-input';
|
|
4
5
|
export * from './lib/modules/action-hub/types/recent-link';
|
|
6
|
+
export * from './lib/modules/action-hub/types/recent-links-input';
|
|
5
7
|
export * from './lib/modules/page-header/page-header.module';
|
|
6
8
|
// Components and directives must be exported to support Angular's "partial" Ivy compiler.
|
|
7
9
|
// Obscure names are used to indicate types are not part of the public API.
|
package/esm2015/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/pages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAE7D,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,4BAA4B,IAAI,EAAE,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,4BAA4B,IAAI,EAAE,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,sBAAsB,IAAI,EAAE,EAAE,MAAM,iDAAiD,CAAC","sourcesContent":["export * from './lib/modules/action-hub/action-hub.module';\nexport * from './lib/modules/action-hub/types/action-hub-needs-attention';\nexport * from './lib/modules/action-hub/types/page-link';\nexport * from './lib/modules/action-hub/types/recent-link';\nexport * from './lib/modules/page-header/page-header.module';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyActionHubComponent as λ1 } from './lib/modules/action-hub/action-hub.component';\nexport { SkyActionHubButtonsComponent as λ2 } from './lib/modules/action-hub/action-hub-buttons.component';\nexport { SkyActionHubContentComponent as λ3 } from './lib/modules/action-hub/action-hub-content.component';\nexport { SkyPageHeaderComponent as λ4 } from './lib/modules/page-header/page-header.component';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/pages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,0CAA0C,CAAC;AACzD,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,8CAA8C,CAAC;AAE7D,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,4BAA4B,IAAI,EAAE,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,4BAA4B,IAAI,EAAE,EAAE,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,sBAAsB,IAAI,EAAE,EAAE,MAAM,iDAAiD,CAAC","sourcesContent":["export * from './lib/modules/action-hub/action-hub.module';\nexport * from './lib/modules/action-hub/types/action-hub-needs-attention';\nexport * from './lib/modules/action-hub/types/page-link';\nexport * from './lib/modules/action-hub/types/page-links-input';\nexport * from './lib/modules/action-hub/types/recent-link';\nexport * from './lib/modules/action-hub/types/recent-links-input';\nexport * from './lib/modules/page-header/page-header.module';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyActionHubComponent as λ1 } from './lib/modules/action-hub/action-hub.component';\nexport { SkyActionHubButtonsComponent as λ2 } from './lib/modules/action-hub/action-hub-buttons.component';\nexport { SkyActionHubContentComponent as λ3 } from './lib/modules/action-hub/action-hub-content.component';\nexport { SkyPageHeaderComponent as λ4 } from './lib/modules/page-header/page-header.component';\n"]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
var _SkyActionHubRecentLinksResolvePipe_instances, _SkyActionHubRecentLinksResolvePipe_currentRecentLinks, _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes, _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
+
import { ChangeDetectorRef, Optional, Pipe, } from '@angular/core';
|
|
4
|
+
import { SkyRecentlyAccessedService, } from '@skyux/router';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { takeUntil } from 'rxjs/operators';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "@skyux/router";
|
|
9
|
+
const RECENTLY_ACCESSED_LIMIT = 5;
|
|
10
|
+
function getRecentLinksSorted(recentLinks) {
|
|
11
|
+
if (recentLinks === 'loading') {
|
|
12
|
+
return 'loading';
|
|
13
|
+
}
|
|
14
|
+
if (!recentLinks || recentLinks.length === 0) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
return recentLinks
|
|
18
|
+
.slice(0)
|
|
19
|
+
.sort((a, b) => {
|
|
20
|
+
const aTime = a.lastAccessed instanceof Date
|
|
21
|
+
? a.lastAccessed.toISOString()
|
|
22
|
+
: a.lastAccessed;
|
|
23
|
+
const bTime = b.lastAccessed instanceof Date
|
|
24
|
+
? b.lastAccessed.toISOString()
|
|
25
|
+
: b.lastAccessed;
|
|
26
|
+
if (aTime === bTime) {
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
return aTime > bTime ? -1 : 1;
|
|
30
|
+
})
|
|
31
|
+
.slice(0, RECENTLY_ACCESSED_LIMIT);
|
|
32
|
+
}
|
|
33
|
+
export class SkyActionHubRecentLinksResolvePipe {
|
|
34
|
+
constructor(changeDetector, recentlyAccessedSvc) {
|
|
35
|
+
this.changeDetector = changeDetector;
|
|
36
|
+
this.recentlyAccessedSvc = recentlyAccessedSvc;
|
|
37
|
+
_SkyActionHubRecentLinksResolvePipe_instances.add(this);
|
|
38
|
+
_SkyActionHubRecentLinksResolvePipe_currentRecentLinks.set(this, void 0);
|
|
39
|
+
_SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved.set(this, []);
|
|
40
|
+
_SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub.set(this, void 0);
|
|
41
|
+
_SkyActionHubRecentLinksResolvePipe_ngUnsubscribe.set(this, new Subject());
|
|
42
|
+
}
|
|
43
|
+
transform(recentLinks) {
|
|
44
|
+
if (recentLinks !== __classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinks, "f")) {
|
|
45
|
+
if (__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, "f")) {
|
|
46
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, "f").unsubscribe();
|
|
47
|
+
}
|
|
48
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinks, recentLinks, "f");
|
|
49
|
+
const getLinksArgs = recentLinks;
|
|
50
|
+
if (getLinksArgs === null || getLinksArgs === void 0 ? void 0 : getLinksArgs.requestedRoutes) {
|
|
51
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes).call(this, getLinksArgs);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, recentLinks);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return __classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved, "f");
|
|
58
|
+
}
|
|
59
|
+
ngOnDestroy() {
|
|
60
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, "f").next();
|
|
61
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, "f").complete();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
_SkyActionHubRecentLinksResolvePipe_currentRecentLinks = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_instances = new WeakSet(), _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes = function _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes(args) {
|
|
65
|
+
if (this.recentlyAccessedSvc) {
|
|
66
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, 'loading');
|
|
67
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, this.recentlyAccessedSvc
|
|
68
|
+
.getLinks(args)
|
|
69
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, "f")))
|
|
70
|
+
.subscribe((result) => {
|
|
71
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, undefined, "f");
|
|
72
|
+
const recentLinks = result.links.map((item) => ({
|
|
73
|
+
label: item.label,
|
|
74
|
+
lastAccessed: item.lastAccessed,
|
|
75
|
+
permalink: {
|
|
76
|
+
url: item.url,
|
|
77
|
+
},
|
|
78
|
+
}));
|
|
79
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, recentLinks);
|
|
80
|
+
}), "f");
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, []);
|
|
84
|
+
}
|
|
85
|
+
}, _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved = function _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved(recentLinksResolved) {
|
|
86
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved, getRecentLinksSorted(recentLinksResolved), "f");
|
|
87
|
+
this.changeDetector.markForCheck();
|
|
88
|
+
};
|
|
89
|
+
SkyActionHubRecentLinksResolvePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRecentLinksResolvePipe, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.SkyRecentlyAccessedService, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
90
|
+
SkyActionHubRecentLinksResolvePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRecentLinksResolvePipe, name: "skyActionHubRecentLinksResolve", pure: false });
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRecentLinksResolvePipe, decorators: [{
|
|
92
|
+
type: Pipe,
|
|
93
|
+
args: [{
|
|
94
|
+
name: 'skyActionHubRecentLinksResolve',
|
|
95
|
+
pure: false,
|
|
96
|
+
}]
|
|
97
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.SkyRecentlyAccessedService, decorators: [{
|
|
98
|
+
type: Optional
|
|
99
|
+
}] }]; } });
|
|
100
|
+
//# sourceMappingURL=action-hub-recent-links-resolve.pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-hub-recent-links-resolve.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub-recent-links-resolve.pipe.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,iBAAiB,EAEjB,QAAQ,EACR,IAAI,GAEL,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAgB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;;;AAM3C,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,SAAS,oBAAoB,CAC3B,WAAmC;IAEnC,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5C,OAAO,EAAE,CAAC;KACX;IACD,OAAO,WAAW;SACf,KAAK,CAAC,CAAC,CAAC;SACR,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,MAAM,KAAK,GACT,CAAC,CAAC,YAAY,YAAY,IAAI;YAC5B,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE;YAC9B,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;QACrB,MAAM,KAAK,GACT,CAAC,CAAC,YAAY,YAAY,IAAI;YAC5B,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE;YAC9B,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;QACrB,IAAI,KAAK,KAAK,KAAK,EAAE;YACnB,OAAO,CAAC,CAAC;SACV;QACD,OAAO,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC;AACvC,CAAC;AAMD,MAAM,OAAO,kCAAkC;IAW7C,YACU,cAAiC,EACrB,mBAAgD;QAD5D,mBAAc,GAAd,cAAc,CAAmB;QACrB,wBAAmB,GAAnB,mBAAmB,CAA6B;;QAVtE,yEAAyC;QAEzC,yEAAsD,EAAE,EAAC;QAEzD,0EAAmC;QAEnC,4DAAiB,IAAI,OAAO,EAAQ,EAAC;IAKlC,CAAC;IAEG,SAAS,CAAC,WAAgC;QAC/C,IAAI,WAAW,KAAK,uBAAA,IAAI,8DAAoB,EAAE;YAC5C,IAAI,uBAAA,IAAI,+DAAqB,EAAE;gBAC7B,uBAAA,IAAI,+DAAqB,CAAC,WAAW,EAAE,CAAC;aACzC;YAED,uBAAA,IAAI,0DAAuB,WAAW,MAAA,CAAC;YAEvC,MAAM,YAAY,GAAG,WAA8C,CAAC;YAEpE,IAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,eAAe,EAAE;gBACjC,uBAAA,IAAI,iHAAwB,MAA5B,IAAI,EAAyB,YAAY,CAAC,CAAC;aAC5C;iBAAM;gBACL,uBAAA,IAAI,oHAA2B,MAA/B,IAAI,EAA4B,WAAqC,CAAC,CAAC;aACxE;SACF;QAED,OAAO,uBAAA,IAAI,sEAA4B,CAAC;IAC1C,CAAC;IAEM,WAAW;QAChB,uBAAA,IAAI,yDAAe,CAAC,IAAI,EAAE,CAAC;QAC3B,uBAAA,IAAI,yDAAe,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;;oeAEuB,IAAqC;IAC3D,IAAI,IAAI,CAAC,mBAAmB,EAAE;QAC5B,uBAAA,IAAI,oHAA2B,MAA/B,IAAI,EAA4B,SAAS,CAAC,CAAC;QAE3C,uBAAA,IAAI,2DAAwB,IAAI,CAAC,mBAAmB;aACjD,QAAQ,CAAC,IAAI,CAAC;aACd,IAAI,CAAC,SAAS,CAAC,uBAAA,IAAI,yDAAe,CAAC,CAAC;aACpC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;YACpB,uBAAA,IAAI,2DAAwB,SAAS,MAAA,CAAC;YAEtC,MAAM,WAAW,GAAoB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC/D,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,SAAS,EAAE;oBACT,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CAAC,CAAC;YAEJ,uBAAA,IAAI,oHAA2B,MAA/B,IAAI,EAA4B,WAAW,CAAC,CAAC;QAC/C,CAAC,CAAC,MAAA,CAAC;KACN;SAAM;QACL,uBAAA,IAAI,oHAA2B,MAA/B,IAAI,EAA4B,EAAE,CAAC,CAAC;KACrC;AACH,CAAC,yIAGC,mBAA2C;IAE3C,uBAAA,IAAI,kEACF,oBAAoB,CAAC,mBAAmB,CAAC,MAAA,CAAC;IAE5C,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;AACrC,CAAC;gIAzEU,kCAAkC;8HAAlC,kCAAkC;4FAAlC,kCAAkC;kBAJ9C,IAAI;mBAAC;oBACJ,IAAI,EAAE,gCAAgC;oBACtC,IAAI,EAAE,KAAK;iBACZ;;0BAcI,QAAQ","sourcesContent":["import {\n ChangeDetectorRef,\n OnDestroy,\n Optional,\n Pipe,\n PipeTransform,\n} from '@angular/core';\nimport {\n SkyRecentlyAccessedGetLinksArgs,\n SkyRecentlyAccessedService,\n} from '@skyux/router';\n\nimport { Subject, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyRecentLink } from './types/recent-link';\nimport { SkyRecentLinksInput } from './types/recent-links-input';\nimport { SkyRecentLinksResolved } from './types/recent-links-resolved';\n\nconst RECENTLY_ACCESSED_LIMIT = 5;\n\nfunction getRecentLinksSorted(\n recentLinks: SkyRecentLinksResolved\n): SkyRecentLinksResolved {\n if (recentLinks === 'loading') {\n return 'loading';\n }\n if (!recentLinks || recentLinks.length === 0) {\n return [];\n }\n return recentLinks\n .slice(0)\n .sort((a, b) => {\n const aTime =\n a.lastAccessed instanceof Date\n ? a.lastAccessed.toISOString()\n : a.lastAccessed;\n const bTime =\n b.lastAccessed instanceof Date\n ? b.lastAccessed.toISOString()\n : b.lastAccessed;\n if (aTime === bTime) {\n return 0;\n }\n return aTime > bTime ? -1 : 1;\n })\n .slice(0, RECENTLY_ACCESSED_LIMIT);\n}\n\n@Pipe({\n name: 'skyActionHubRecentLinksResolve',\n pure: false,\n})\nexport class SkyActionHubRecentLinksResolvePipe\n implements PipeTransform, OnDestroy\n{\n #currentRecentLinks: SkyRecentLinksInput;\n\n #currentRecentLinksResolved: SkyRecentLinksResolved = [];\n\n #recentlyAccessedSub: Subscription;\n\n #ngUnsubscribe = new Subject<void>();\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n @Optional() private recentlyAccessedSvc?: SkyRecentlyAccessedService\n ) {}\n\n public transform(recentLinks: SkyRecentLinksInput): SkyRecentLinksResolved {\n if (recentLinks !== this.#currentRecentLinks) {\n if (this.#recentlyAccessedSub) {\n this.#recentlyAccessedSub.unsubscribe();\n }\n\n this.#currentRecentLinks = recentLinks;\n\n const getLinksArgs = recentLinks as SkyRecentlyAccessedGetLinksArgs;\n\n if (getLinksArgs?.requestedRoutes) {\n this.#resolveRequestedRoutes(getLinksArgs);\n } else {\n this.#updateRecentLinksResolved(recentLinks as SkyRecentLinksResolved);\n }\n }\n\n return this.#currentRecentLinksResolved;\n }\n\n public ngOnDestroy(): void {\n this.#ngUnsubscribe.next();\n this.#ngUnsubscribe.complete();\n }\n\n #resolveRequestedRoutes(args: SkyRecentlyAccessedGetLinksArgs): void {\n if (this.recentlyAccessedSvc) {\n this.#updateRecentLinksResolved('loading');\n\n this.#recentlyAccessedSub = this.recentlyAccessedSvc\n .getLinks(args)\n .pipe(takeUntil(this.#ngUnsubscribe))\n .subscribe((result) => {\n this.#recentlyAccessedSub = undefined;\n\n const recentLinks: SkyRecentLink[] = result.links.map((item) => ({\n label: item.label,\n lastAccessed: item.lastAccessed,\n permalink: {\n url: item.url,\n },\n }));\n\n this.#updateRecentLinksResolved(recentLinks);\n });\n } else {\n this.#updateRecentLinksResolved([]);\n }\n }\n\n #updateRecentLinksResolved(\n recentLinksResolved: SkyRecentLinksResolved\n ): void {\n this.#currentRecentLinksResolved =\n getRecentLinksSorted(recentLinksResolved);\n\n this.changeDetector.markForCheck();\n }\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class SkyActionHubRelatedLinksSortPipe {
|
|
4
|
+
transform(relatedLinks) {
|
|
5
|
+
if (relatedLinks === 'loading') {
|
|
6
|
+
return 'loading';
|
|
7
|
+
}
|
|
8
|
+
if (!relatedLinks || relatedLinks.length === 0) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
return relatedLinks.slice(0).sort((a, b) => {
|
|
12
|
+
const aLabel = a.label.trim().toUpperCase();
|
|
13
|
+
const bLabel = b.label.trim().toUpperCase();
|
|
14
|
+
if (aLabel === bLabel) {
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
return aLabel < bLabel ? -1 : 1;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
SkyActionHubRelatedLinksSortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRelatedLinksSortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
22
|
+
SkyActionHubRelatedLinksSortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRelatedLinksSortPipe, name: "skyActionHubRelatedLinksSort" });
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRelatedLinksSortPipe, decorators: [{
|
|
24
|
+
type: Pipe,
|
|
25
|
+
args: [{
|
|
26
|
+
name: 'skyActionHubRelatedLinksSort',
|
|
27
|
+
}]
|
|
28
|
+
}] });
|
|
29
|
+
//# sourceMappingURL=action-hub-related-links-sort.pipe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-hub-related-links-sort.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub-related-links-sort.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAOpD,MAAM,OAAO,gCAAgC;IACpC,SAAS,CAAC,YAA+B;QAC9C,IAAI,YAAY,KAAK,SAAS,EAAE;YAC9B,OAAO,SAAS,CAAC;SAClB;QACD,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9C,OAAO,EAAE,CAAC;SACX;QACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACzC,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC5C,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC5C,IAAI,MAAM,KAAK,MAAM,EAAE;gBACrB,OAAO,CAAC,CAAC;aACV;YACD,OAAO,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;;8HAhBU,gCAAgC;4HAAhC,gCAAgC;4FAAhC,gCAAgC;kBAH5C,IAAI;mBAAC;oBACJ,IAAI,EAAE,8BAA8B;iBACrC","sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\nimport { SkyPageLinksInput } from './types/page-links-input';\n\n@Pipe({\n name: 'skyActionHubRelatedLinksSort',\n})\nexport class SkyActionHubRelatedLinksSortPipe implements PipeTransform {\n public transform(relatedLinks: SkyPageLinksInput): SkyPageLinksInput {\n if (relatedLinks === 'loading') {\n return 'loading';\n }\n if (!relatedLinks || relatedLinks.length === 0) {\n return [];\n }\n return relatedLinks.slice(0).sort((a, b) => {\n const aLabel = a.label.trim().toUpperCase();\n const bLabel = b.label.trim().toUpperCase();\n if (aLabel === bLabel) {\n return 0;\n }\n return aLabel < bLabel ? -1 : 1;\n });\n }\n}\n"]}
|
|
@@ -7,7 +7,9 @@ import * as i4 from "../needs-attention/needs-attention.component";
|
|
|
7
7
|
import * as i5 from "../link-list/link-list.component";
|
|
8
8
|
import * as i6 from "@skyux/theme";
|
|
9
9
|
import * as i7 from "@angular/common";
|
|
10
|
-
import * as i8 from "
|
|
10
|
+
import * as i8 from "./action-hub-related-links-sort.pipe";
|
|
11
|
+
import * as i9 from "@skyux/i18n";
|
|
12
|
+
import * as i10 from "./action-hub-recent-links-resolve.pipe";
|
|
11
13
|
/**
|
|
12
14
|
* Creates an action hub to direct user attention to important
|
|
13
15
|
* actions and provide quick access to common tasks.
|
|
@@ -32,48 +34,9 @@ export class SkyActionHubComponent {
|
|
|
32
34
|
*/
|
|
33
35
|
this.title = '';
|
|
34
36
|
}
|
|
35
|
-
getRecentLinksSorted(recentLinks, limit) {
|
|
36
|
-
if (recentLinks === 'loading') {
|
|
37
|
-
return 'loading';
|
|
38
|
-
}
|
|
39
|
-
if (!recentLinks || recentLinks.length === 0) {
|
|
40
|
-
return [];
|
|
41
|
-
}
|
|
42
|
-
return recentLinks
|
|
43
|
-
.slice(0)
|
|
44
|
-
.sort((a, b) => {
|
|
45
|
-
const aTime = a.lastAccessed instanceof Date
|
|
46
|
-
? a.lastAccessed.toISOString()
|
|
47
|
-
: a.lastAccessed;
|
|
48
|
-
const bTime = b.lastAccessed instanceof Date
|
|
49
|
-
? b.lastAccessed.toISOString()
|
|
50
|
-
: b.lastAccessed;
|
|
51
|
-
if (aTime === bTime) {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
return aTime > bTime ? -1 : 1;
|
|
55
|
-
})
|
|
56
|
-
.slice(0, limit);
|
|
57
|
-
}
|
|
58
|
-
getRelatedLinksSorted(relatedLinks) {
|
|
59
|
-
if (relatedLinks === 'loading') {
|
|
60
|
-
return 'loading';
|
|
61
|
-
}
|
|
62
|
-
if (!relatedLinks || relatedLinks.length === 0) {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
return relatedLinks.slice(0).sort((a, b) => {
|
|
66
|
-
const aLabel = a.label.trim().toUpperCase();
|
|
67
|
-
const bLabel = b.label.trim().toUpperCase();
|
|
68
|
-
if (aLabel === bLabel) {
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
return aLabel < bLabel ? -1 : 1;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
37
|
}
|
|
75
38
|
SkyActionHubComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
76
|
-
SkyActionHubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyActionHubComponent, selector: "sky-action-hub", inputs: { needsAttention: "needsAttention", parentLink: "parentLink", recentLinks: "recentLinks", relatedLinks: "relatedLinks", title: "title" }, ngImport: i0, template: "<ng-template #loadingTemplateRef>\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n</ng-template>\n<sky-fluid-grid>\n <sky-row>\n <sky-column>\n <sky-page-header\n [pageTitle]=\"title\"\n [parentLink]=\"parentLink\"\n ></sky-page-header>\n </sky-column>\n </sky-row>\n <sky-row>\n <sky-column screenLarge=\"9\" screenXSmall=\"12\">\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-buttons\"></ng-content>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-container\n *ngIf=\"\n needsAttention === 'loading';\n then loadingTemplateRef;\n else needsAttentionTemplateRef\n \"\n ></ng-container>\n <ng-template #needsAttentionTemplateRef>\n <sky-needs-attention [items]=\"needsAttention\"></sky-needs-attention>\n </ng-template>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-content\"></ng-content>\n </div>\n </sky-column>\n <sky-column screenLarge=\"3\" screenXSmall=\"12\">\n <sky-link-list\n [links]=\"
|
|
39
|
+
SkyActionHubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyActionHubComponent, selector: "sky-action-hub", inputs: { needsAttention: "needsAttention", parentLink: "parentLink", recentLinks: "recentLinks", relatedLinks: "relatedLinks", title: "title" }, ngImport: i0, template: "<ng-template #loadingTemplateRef>\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n</ng-template>\n<sky-fluid-grid>\n <sky-row>\n <sky-column>\n <sky-page-header\n [pageTitle]=\"title\"\n [parentLink]=\"parentLink\"\n ></sky-page-header>\n </sky-column>\n </sky-row>\n <sky-row>\n <sky-column screenLarge=\"9\" screenXSmall=\"12\">\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-buttons\"></ng-content>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-container\n *ngIf=\"\n needsAttention === 'loading';\n then loadingTemplateRef;\n else needsAttentionTemplateRef\n \"\n ></ng-container>\n <ng-template #needsAttentionTemplateRef>\n <sky-needs-attention [items]=\"needsAttention\"></sky-needs-attention>\n </ng-template>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-content\"></ng-content>\n </div>\n </sky-column>\n <sky-column screenLarge=\"3\" screenXSmall=\"12\">\n <sky-link-list\n [links]=\"relatedLinks | skyActionHubRelatedLinksSort\"\n [title]=\"'sky_action_hub_related_links' | skyLibResources\"\n ></sky-link-list>\n <sky-link-list\n [links]=\"recentLinks | skyActionHubRecentLinksResolve\"\n [title]=\"'sky_action_hub_recent_links' | skyLibResources\"\n ></sky-link-list>\n </sky-column>\n </sky-row>\n</sky-fluid-grid>\n", components: [{ type: i1.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }, { type: i2.λ22, selector: "sky-fluid-grid", inputs: ["disableMargin", "gutterSize"] }, { type: i2.λ23, selector: "sky-row", inputs: ["reverseColumnOrder"] }, { type: i2.λ24, selector: "sky-column", inputs: ["screenXSmall", "screenSmall", "screenMedium", "screenLarge"] }, { type: i3.SkyPageHeaderComponent, selector: "sky-page-header", inputs: ["parentLink", "pageTitle"] }, { type: i4.SkyNeedsAttentionComponent, selector: "sky-needs-attention", inputs: ["items"] }, { type: i5.SkyLinkListComponent, selector: "sky-link-list", inputs: ["links", "title"] }], directives: [{ type: i6.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "skyActionHubRelatedLinksSort": i8.SkyActionHubRelatedLinksSortPipe, "skyLibResources": i9.SkyLibResourcesPipe, "skyActionHubRecentLinksResolve": i10.SkyActionHubRecentLinksResolvePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
77
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubComponent, decorators: [{
|
|
78
41
|
type: Component,
|
|
79
42
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-hub.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub.component.ts","../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"action-hub.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub.component.ts","../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;;;;;;;;AAO1E;;;GAGG;AAMH,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QAEI,mBAAc,GAA6C,EAAE,CAAC;QAQrE;;WAEG;QAEI,gBAAW,GAAwB,EAAE,CAAC;QAE7C;;WAEG;QAEI,iBAAY,GAAsB,EAAE,CAAC;QAE5C;;;WAGG;QAEI,UAAK,GAAG,EAAE,CAAC;KACnB;;mHA/BY,qBAAqB;uGAArB,qBAAqB,wMChBlC,q2DA8DA;4FD9Ca,qBAAqB;kBALjC,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;oBAC1B,WAAW,EAAE,6BAA6B;oBAC1C,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAMQ,cAAc;sBADpB,KAAK;gBAOC,UAAU;sBADhB,KAAK;gBAOC,WAAW;sBADjB,KAAK;gBAOC,YAAY;sBADlB,KAAK;gBAQC,KAAK;sBADX,KAAK","sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nimport { SkyActionHubNeedsAttention } from './types/action-hub-needs-attention';\nimport { SkyPageLink } from './types/page-link';\nimport { SkyPageLinksInput } from './types/page-links-input';\nimport { SkyRecentLinksInput } from './types/recent-links-input';\n\n/**\n * Creates an action hub to direct user attention to important\n * actions and provide quick access to common tasks.\n */\n@Component({\n selector: 'sky-action-hub',\n templateUrl: './action-hub.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyActionHubComponent {\n /**\n * Provides a list of actions that users must perform based on business requirements or best practices, or `\"loading\"` to display a wait indicator.\n */\n @Input()\n public needsAttention: SkyActionHubNeedsAttention[] | 'loading' = [];\n\n /**\n * Links back to a parent page.\n */\n @Input()\n public parentLink: SkyPageLink;\n\n /**\n * Provides a list of recently accessed links, or `\"loading\"` to display a wait indicator.\n */\n @Input()\n public recentLinks: SkyRecentLinksInput = [];\n\n /**\n * Provides a list of related links, or `\"loading\"` to display a wait indicator.\n */\n @Input()\n public relatedLinks: SkyPageLinksInput = [];\n\n /**\n * Specifies the page title.\n * @default \"\"\n */\n @Input()\n public title = '';\n}\n","<ng-template #loadingTemplateRef>\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n</ng-template>\n<sky-fluid-grid>\n <sky-row>\n <sky-column>\n <sky-page-header\n [pageTitle]=\"title\"\n [parentLink]=\"parentLink\"\n ></sky-page-header>\n </sky-column>\n </sky-row>\n <sky-row>\n <sky-column screenLarge=\"9\" screenXSmall=\"12\">\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-buttons\"></ng-content>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-container\n *ngIf=\"\n needsAttention === 'loading';\n then loadingTemplateRef;\n else needsAttentionTemplateRef\n \"\n ></ng-container>\n <ng-template #needsAttentionTemplateRef>\n <sky-needs-attention [items]=\"needsAttention\"></sky-needs-attention>\n </ng-template>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-content\"></ng-content>\n </div>\n </sky-column>\n <sky-column screenLarge=\"3\" screenXSmall=\"12\">\n <sky-link-list\n [links]=\"relatedLinks | skyActionHubRelatedLinksSort\"\n [title]=\"'sky_action_hub_related_links' | skyLibResources\"\n ></sky-link-list>\n <sky-link-list\n [links]=\"recentLinks | skyActionHubRecentLinksResolve\"\n [title]=\"'sky_action_hub_recent_links' | skyLibResources\"\n ></sky-link-list>\n </sky-column>\n </sky-row>\n</sky-fluid-grid>\n"]}
|
|
@@ -12,6 +12,8 @@ import { SkyPageHeaderModule } from '../page-header/page-header.module';
|
|
|
12
12
|
import { SkyPagesResourcesModule } from '../shared/sky-pages-resources.module';
|
|
13
13
|
import { SkyActionHubButtonsComponent } from './action-hub-buttons.component';
|
|
14
14
|
import { SkyActionHubContentComponent } from './action-hub-content.component';
|
|
15
|
+
import { SkyActionHubRecentLinksResolvePipe } from './action-hub-recent-links-resolve.pipe';
|
|
16
|
+
import { SkyActionHubRelatedLinksSortPipe } from './action-hub-related-links-sort.pipe';
|
|
15
17
|
import { SkyActionHubComponent } from './action-hub.component';
|
|
16
18
|
import * as i0 from "@angular/core";
|
|
17
19
|
export class SkyActionHubModule {
|
|
@@ -20,6 +22,8 @@ SkyActionHubModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versi
|
|
|
20
22
|
SkyActionHubModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubModule, declarations: [SkyActionHubButtonsComponent,
|
|
21
23
|
SkyActionHubComponent,
|
|
22
24
|
SkyActionHubContentComponent,
|
|
25
|
+
SkyActionHubRecentLinksResolvePipe,
|
|
26
|
+
SkyActionHubRelatedLinksSortPipe,
|
|
23
27
|
SkyNeedsAttentionComponent,
|
|
24
28
|
SkyLinkListComponent], imports: [CommonModule,
|
|
25
29
|
SkyPagesResourcesModule,
|
|
@@ -73,6 +77,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
73
77
|
SkyActionHubButtonsComponent,
|
|
74
78
|
SkyActionHubComponent,
|
|
75
79
|
SkyActionHubContentComponent,
|
|
80
|
+
SkyActionHubRecentLinksResolvePipe,
|
|
81
|
+
SkyActionHubRelatedLinksSortPipe,
|
|
76
82
|
SkyNeedsAttentionComponent,
|
|
77
83
|
SkyLinkListComponent,
|
|
78
84
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-hub.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;;
|
|
1
|
+
{"version":3,"file":"action-hub.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/action-hub/action-hub.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;;AAiC/D,MAAM,OAAO,kBAAkB;;gHAAlB,kBAAkB;iHAAlB,kBAAkB,iBAd3B,4BAA4B;QAC5B,qBAAqB;QACrB,4BAA4B;QAC5B,kCAAkC;QAClC,gCAAgC;QAChC,0BAA0B;QAC1B,oBAAoB,aArBpB,YAAY;QACZ,uBAAuB;QACvB,YAAY;QACZ,qBAAqB;QACrB,gBAAgB;QAChB,kBAAkB;QAClB,aAAa;QACb,aAAa;QACb,gBAAgB;QAChB,mBAAmB;QACnB,cAAc;QACd,aAAa;QACb,aAAa,aAYb,4BAA4B;QAC5B,qBAAqB;QACrB,4BAA4B;iHAGnB,kBAAkB,YA9BpB;YACP,YAAY;YACZ,uBAAuB;YACvB,YAAY;YACZ,qBAAqB;YACrB,gBAAgB;YAChB,kBAAkB;YAClB,aAAa;YACb,aAAa;YACb,gBAAgB;YAChB,mBAAmB;YACnB,cAAc;YACd,aAAa;YACb,aAAa;SACd;4FAgBU,kBAAkB;kBA/B9B,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,YAAY;wBACZ,uBAAuB;wBACvB,YAAY;wBACZ,qBAAqB;wBACrB,gBAAgB;wBAChB,kBAAkB;wBAClB,aAAa;wBACb,aAAa;wBACb,gBAAgB;wBAChB,mBAAmB;wBACnB,cAAc;wBACd,aAAa;wBACb,aAAa;qBACd;oBACD,YAAY,EAAE;wBACZ,4BAA4B;wBAC5B,qBAAqB;wBACrB,4BAA4B;wBAC5B,kCAAkC;wBAClC,gCAAgC;wBAChC,0BAA0B;wBAC1B,oBAAoB;qBACrB;oBACD,OAAO,EAAE;wBACP,4BAA4B;wBAC5B,qBAAqB;wBACrB,4BAA4B;qBAC7B;iBACF","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport {\n SkyIconModule,\n SkyKeyInfoModule,\n SkyWaitModule,\n} from '@skyux/indicators';\nimport { SkyActionButtonModule, SkyFluidGridModule } from '@skyux/layout';\nimport { SkyAppLinkModule, SkyHrefModule } from '@skyux/router';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyLinkListComponent } from '../link-list/link-list.component';\nimport { SkyNeedsAttentionComponent } from '../needs-attention/needs-attention.component';\nimport { SkyPageHeaderModule } from '../page-header/page-header.module';\nimport { SkyPagesResourcesModule } from '../shared/sky-pages-resources.module';\n\nimport { SkyActionHubButtonsComponent } from './action-hub-buttons.component';\nimport { SkyActionHubContentComponent } from './action-hub-content.component';\nimport { SkyActionHubRecentLinksResolvePipe } from './action-hub-recent-links-resolve.pipe';\nimport { SkyActionHubRelatedLinksSortPipe } from './action-hub-related-links-sort.pipe';\nimport { SkyActionHubComponent } from './action-hub.component';\n\n@NgModule({\n imports: [\n CommonModule,\n SkyPagesResourcesModule,\n RouterModule,\n SkyActionButtonModule,\n SkyAppLinkModule,\n SkyFluidGridModule,\n SkyI18nModule,\n SkyIconModule,\n SkyKeyInfoModule,\n SkyPageHeaderModule,\n SkyThemeModule,\n SkyWaitModule,\n SkyHrefModule,\n ],\n declarations: [\n SkyActionHubButtonsComponent,\n SkyActionHubComponent,\n SkyActionHubContentComponent,\n SkyActionHubRecentLinksResolvePipe,\n SkyActionHubRelatedLinksSortPipe,\n SkyNeedsAttentionComponent,\n SkyLinkListComponent,\n ],\n exports: [\n SkyActionHubButtonsComponent,\n SkyActionHubComponent,\n SkyActionHubContentComponent,\n ],\n})\nexport class SkyActionHubModule {}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-links-input.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/pages/src/lib/modules/action-hub/types/page-links-input.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyPageLink } from './page-link';\n\nexport type SkyPageLinksInput = SkyPageLink[] | 'loading' | undefined;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent-links-input.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/pages/src/lib/modules/action-hub/types/recent-links-input.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyRecentlyAccessedGetLinksArgs } from '@skyux/router';\n\nimport { SkyRecentLink } from './recent-link';\n\n/**\n * Recently accessed links to display in a link list component.\n */\nexport type SkyRecentLinksInput =\n | SkyRecentLink[]\n | 'loading'\n | SkyRecentlyAccessedGetLinksArgs\n | undefined;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent-links-resolved.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/pages/src/lib/modules/action-hub/types/recent-links-resolved.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyRecentLink } from './recent-link';\n\nexport type SkyRecentLinksResolved = SkyRecentLink[] | 'loading' | undefined;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-list.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/link-list/link-list.component.ts","../../../../../../../../libs/components/pages/src/lib/modules/link-list/link-list.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;;AASjD,MAAM,OAAO,oBAAoB;;kHAApB,oBAAoB;sGAApB,oBAAoB,iGCTjC,2yDAoDA;4FD3Ca,oBAAoB;kBALhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,eAAe;oBACzB,WAAW,EAAE,4BAA4B;oBACzC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;8BAGQ,KAAK;sBADX,KAAK;gBAIC,KAAK;sBADX,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport {
|
|
1
|
+
{"version":3,"file":"link-list.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/pages/src/lib/modules/link-list/link-list.component.ts","../../../../../../../../libs/components/pages/src/lib/modules/link-list/link-list.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;;AASjD,MAAM,OAAO,oBAAoB;;kHAApB,oBAAoB;sGAApB,oBAAoB,iGCTjC,2yDAoDA;4FD3Ca,oBAAoB;kBALhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,eAAe;oBACzB,WAAW,EAAE,4BAA4B;oBACzC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;8BAGQ,KAAK;sBADX,KAAK;gBAIC,KAAK;sBADX,KAAK","sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport { SkyPageLinksInput } from '../action-hub/types/page-links-input';\n\n@Component({\n selector: 'sky-link-list',\n templateUrl: './link-list.component.html',\n styleUrls: ['./link-list.component.scss'],\n})\nexport class SkyLinkListComponent {\n @Input()\n public links: SkyPageLinksInput;\n\n @Input()\n public title: string;\n}\n","<ng-container\n *ngIf=\"links === 'loading'; then loadingTemplateRef; else linksTemplateRef\"\n></ng-container>\n\n<ng-template #headingTemplateRef>\n <h2 class=\"sky-font-heading-4 sky-margin-stacked-sm\">\n {{ title }}\n </h2>\n</ng-template>\n<ng-template #loadingTemplateRef>\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n <ng-container [ngTemplateOutlet]=\"headingTemplateRef\"></ng-container>\n</ng-template>\n<ng-template #linksTemplateRef>\n <ng-container *ngIf=\"links?.length > 0\">\n <ng-container [ngTemplateOutlet]=\"headingTemplateRef\"></ng-container>\n <ul\n class=\"sky-link-list\"\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xl': 'modern'\n }\"\n >\n <li\n *ngFor=\"let link of links\"\n [skyThemeClass]=\"{\n 'sky-margin-stacked-default': 'default',\n 'sky-margin-stacked-sm': 'modern'\n }\"\n >\n <a *ngIf=\"link.permalink.url\" [skyHref]=\"link.permalink.url\">\n {{ link.label }}\n </a>\n <a\n *ngIf=\"link.permalink.route\"\n [skyAppLink]=\"link.permalink.route.commands\"\n [queryParams]=\"link.permalink.route.extras?.queryParams\"\n [queryParamsHandling]=\"\n link.permalink.route.extras?.queryParamsHandling\n \"\n [fragment]=\"link.permalink.route.extras?.fragment\"\n [preserveFragment]=\"link.permalink.route.extras?.preserveFragment\"\n [skipLocationChange]=\"link.permalink.route.extras?.skipLocationChange\"\n [replaceUrl]=\"link.permalink.route.extras?.replaceUrl\"\n [state]=\"link.permalink.route.extras?.state\"\n >\n {{ link.label }}\n </a>\n </li>\n </ul>\n </ng-container>\n</ng-template>\n"]}
|
package/fesm2015/skyux-pages.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i2$1 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, Input, NgModule, ChangeDetectionStrategy } from '@angular/core';
|
|
4
|
+
import { Component, Input, NgModule, Pipe, Optional, ChangeDetectionStrategy } from '@angular/core';
|
|
5
5
|
import { RouterModule } from '@angular/router';
|
|
6
6
|
import * as i6 from '@skyux/i18n';
|
|
7
7
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
@@ -13,6 +13,9 @@ import * as i4 from '@skyux/router';
|
|
|
13
13
|
import { SkyAppLinkModule, SkyHrefModule } from '@skyux/router';
|
|
14
14
|
import * as i3 from '@skyux/theme';
|
|
15
15
|
import { SkyThemeModule } from '@skyux/theme';
|
|
16
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib';
|
|
17
|
+
import { Subject } from 'rxjs';
|
|
18
|
+
import { takeUntil } from 'rxjs/operators';
|
|
16
19
|
|
|
17
20
|
class SkyLinkListComponent {
|
|
18
21
|
}
|
|
@@ -185,6 +188,126 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
185
188
|
}]
|
|
186
189
|
}] });
|
|
187
190
|
|
|
191
|
+
var _SkyActionHubRecentLinksResolvePipe_instances, _SkyActionHubRecentLinksResolvePipe_currentRecentLinks, _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes, _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved;
|
|
192
|
+
const RECENTLY_ACCESSED_LIMIT = 5;
|
|
193
|
+
function getRecentLinksSorted(recentLinks) {
|
|
194
|
+
if (recentLinks === 'loading') {
|
|
195
|
+
return 'loading';
|
|
196
|
+
}
|
|
197
|
+
if (!recentLinks || recentLinks.length === 0) {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
return recentLinks
|
|
201
|
+
.slice(0)
|
|
202
|
+
.sort((a, b) => {
|
|
203
|
+
const aTime = a.lastAccessed instanceof Date
|
|
204
|
+
? a.lastAccessed.toISOString()
|
|
205
|
+
: a.lastAccessed;
|
|
206
|
+
const bTime = b.lastAccessed instanceof Date
|
|
207
|
+
? b.lastAccessed.toISOString()
|
|
208
|
+
: b.lastAccessed;
|
|
209
|
+
if (aTime === bTime) {
|
|
210
|
+
return 0;
|
|
211
|
+
}
|
|
212
|
+
return aTime > bTime ? -1 : 1;
|
|
213
|
+
})
|
|
214
|
+
.slice(0, RECENTLY_ACCESSED_LIMIT);
|
|
215
|
+
}
|
|
216
|
+
class SkyActionHubRecentLinksResolvePipe {
|
|
217
|
+
constructor(changeDetector, recentlyAccessedSvc) {
|
|
218
|
+
this.changeDetector = changeDetector;
|
|
219
|
+
this.recentlyAccessedSvc = recentlyAccessedSvc;
|
|
220
|
+
_SkyActionHubRecentLinksResolvePipe_instances.add(this);
|
|
221
|
+
_SkyActionHubRecentLinksResolvePipe_currentRecentLinks.set(this, void 0);
|
|
222
|
+
_SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved.set(this, []);
|
|
223
|
+
_SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub.set(this, void 0);
|
|
224
|
+
_SkyActionHubRecentLinksResolvePipe_ngUnsubscribe.set(this, new Subject());
|
|
225
|
+
}
|
|
226
|
+
transform(recentLinks) {
|
|
227
|
+
if (recentLinks !== __classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinks, "f")) {
|
|
228
|
+
if (__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, "f")) {
|
|
229
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, "f").unsubscribe();
|
|
230
|
+
}
|
|
231
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinks, recentLinks, "f");
|
|
232
|
+
const getLinksArgs = recentLinks;
|
|
233
|
+
if (getLinksArgs === null || getLinksArgs === void 0 ? void 0 : getLinksArgs.requestedRoutes) {
|
|
234
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes).call(this, getLinksArgs);
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, recentLinks);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return __classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved, "f");
|
|
241
|
+
}
|
|
242
|
+
ngOnDestroy() {
|
|
243
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, "f").next();
|
|
244
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, "f").complete();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
_SkyActionHubRecentLinksResolvePipe_currentRecentLinks = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe = new WeakMap(), _SkyActionHubRecentLinksResolvePipe_instances = new WeakSet(), _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes = function _SkyActionHubRecentLinksResolvePipe_resolveRequestedRoutes(args) {
|
|
248
|
+
if (this.recentlyAccessedSvc) {
|
|
249
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, 'loading');
|
|
250
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, this.recentlyAccessedSvc
|
|
251
|
+
.getLinks(args)
|
|
252
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_ngUnsubscribe, "f")))
|
|
253
|
+
.subscribe((result) => {
|
|
254
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_recentlyAccessedSub, undefined, "f");
|
|
255
|
+
const recentLinks = result.links.map((item) => ({
|
|
256
|
+
label: item.label,
|
|
257
|
+
lastAccessed: item.lastAccessed,
|
|
258
|
+
permalink: {
|
|
259
|
+
url: item.url,
|
|
260
|
+
},
|
|
261
|
+
}));
|
|
262
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, recentLinks);
|
|
263
|
+
}), "f");
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
__classPrivateFieldGet(this, _SkyActionHubRecentLinksResolvePipe_instances, "m", _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved).call(this, []);
|
|
267
|
+
}
|
|
268
|
+
}, _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved = function _SkyActionHubRecentLinksResolvePipe_updateRecentLinksResolved(recentLinksResolved) {
|
|
269
|
+
__classPrivateFieldSet(this, _SkyActionHubRecentLinksResolvePipe_currentRecentLinksResolved, getRecentLinksSorted(recentLinksResolved), "f");
|
|
270
|
+
this.changeDetector.markForCheck();
|
|
271
|
+
};
|
|
272
|
+
SkyActionHubRecentLinksResolvePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRecentLinksResolvePipe, deps: [{ token: i0.ChangeDetectorRef }, { token: i4.SkyRecentlyAccessedService, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
273
|
+
SkyActionHubRecentLinksResolvePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRecentLinksResolvePipe, name: "skyActionHubRecentLinksResolve", pure: false });
|
|
274
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRecentLinksResolvePipe, decorators: [{
|
|
275
|
+
type: Pipe,
|
|
276
|
+
args: [{
|
|
277
|
+
name: 'skyActionHubRecentLinksResolve',
|
|
278
|
+
pure: false,
|
|
279
|
+
}]
|
|
280
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i4.SkyRecentlyAccessedService, decorators: [{
|
|
281
|
+
type: Optional
|
|
282
|
+
}] }]; } });
|
|
283
|
+
|
|
284
|
+
class SkyActionHubRelatedLinksSortPipe {
|
|
285
|
+
transform(relatedLinks) {
|
|
286
|
+
if (relatedLinks === 'loading') {
|
|
287
|
+
return 'loading';
|
|
288
|
+
}
|
|
289
|
+
if (!relatedLinks || relatedLinks.length === 0) {
|
|
290
|
+
return [];
|
|
291
|
+
}
|
|
292
|
+
return relatedLinks.slice(0).sort((a, b) => {
|
|
293
|
+
const aLabel = a.label.trim().toUpperCase();
|
|
294
|
+
const bLabel = b.label.trim().toUpperCase();
|
|
295
|
+
if (aLabel === bLabel) {
|
|
296
|
+
return 0;
|
|
297
|
+
}
|
|
298
|
+
return aLabel < bLabel ? -1 : 1;
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
SkyActionHubRelatedLinksSortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRelatedLinksSortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
303
|
+
SkyActionHubRelatedLinksSortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRelatedLinksSortPipe, name: "skyActionHubRelatedLinksSort" });
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubRelatedLinksSortPipe, decorators: [{
|
|
305
|
+
type: Pipe,
|
|
306
|
+
args: [{
|
|
307
|
+
name: 'skyActionHubRelatedLinksSort',
|
|
308
|
+
}]
|
|
309
|
+
}] });
|
|
310
|
+
|
|
188
311
|
/**
|
|
189
312
|
* Creates an action hub to direct user attention to important
|
|
190
313
|
* actions and provide quick access to common tasks.
|
|
@@ -209,48 +332,9 @@ class SkyActionHubComponent {
|
|
|
209
332
|
*/
|
|
210
333
|
this.title = '';
|
|
211
334
|
}
|
|
212
|
-
getRecentLinksSorted(recentLinks, limit) {
|
|
213
|
-
if (recentLinks === 'loading') {
|
|
214
|
-
return 'loading';
|
|
215
|
-
}
|
|
216
|
-
if (!recentLinks || recentLinks.length === 0) {
|
|
217
|
-
return [];
|
|
218
|
-
}
|
|
219
|
-
return recentLinks
|
|
220
|
-
.slice(0)
|
|
221
|
-
.sort((a, b) => {
|
|
222
|
-
const aTime = a.lastAccessed instanceof Date
|
|
223
|
-
? a.lastAccessed.toISOString()
|
|
224
|
-
: a.lastAccessed;
|
|
225
|
-
const bTime = b.lastAccessed instanceof Date
|
|
226
|
-
? b.lastAccessed.toISOString()
|
|
227
|
-
: b.lastAccessed;
|
|
228
|
-
if (aTime === bTime) {
|
|
229
|
-
return 0;
|
|
230
|
-
}
|
|
231
|
-
return aTime > bTime ? -1 : 1;
|
|
232
|
-
})
|
|
233
|
-
.slice(0, limit);
|
|
234
|
-
}
|
|
235
|
-
getRelatedLinksSorted(relatedLinks) {
|
|
236
|
-
if (relatedLinks === 'loading') {
|
|
237
|
-
return 'loading';
|
|
238
|
-
}
|
|
239
|
-
if (!relatedLinks || relatedLinks.length === 0) {
|
|
240
|
-
return [];
|
|
241
|
-
}
|
|
242
|
-
return relatedLinks.slice(0).sort((a, b) => {
|
|
243
|
-
const aLabel = a.label.trim().toUpperCase();
|
|
244
|
-
const bLabel = b.label.trim().toUpperCase();
|
|
245
|
-
if (aLabel === bLabel) {
|
|
246
|
-
return 0;
|
|
247
|
-
}
|
|
248
|
-
return aLabel < bLabel ? -1 : 1;
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
335
|
}
|
|
252
336
|
SkyActionHubComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
253
|
-
SkyActionHubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyActionHubComponent, selector: "sky-action-hub", inputs: { needsAttention: "needsAttention", parentLink: "parentLink", recentLinks: "recentLinks", relatedLinks: "relatedLinks", title: "title" }, ngImport: i0, template: "<ng-template #loadingTemplateRef>\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n</ng-template>\n<sky-fluid-grid>\n <sky-row>\n <sky-column>\n <sky-page-header\n [pageTitle]=\"title\"\n [parentLink]=\"parentLink\"\n ></sky-page-header>\n </sky-column>\n </sky-row>\n <sky-row>\n <sky-column screenLarge=\"9\" screenXSmall=\"12\">\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-buttons\"></ng-content>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-container\n *ngIf=\"\n needsAttention === 'loading';\n then loadingTemplateRef;\n else needsAttentionTemplateRef\n \"\n ></ng-container>\n <ng-template #needsAttentionTemplateRef>\n <sky-needs-attention [items]=\"needsAttention\"></sky-needs-attention>\n </ng-template>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-content\"></ng-content>\n </div>\n </sky-column>\n <sky-column screenLarge=\"3\" screenXSmall=\"12\">\n <sky-link-list\n [links]=\"
|
|
337
|
+
SkyActionHubComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyActionHubComponent, selector: "sky-action-hub", inputs: { needsAttention: "needsAttention", parentLink: "parentLink", recentLinks: "recentLinks", relatedLinks: "relatedLinks", title: "title" }, ngImport: i0, template: "<ng-template #loadingTemplateRef>\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n</ng-template>\n<sky-fluid-grid>\n <sky-row>\n <sky-column>\n <sky-page-header\n [pageTitle]=\"title\"\n [parentLink]=\"parentLink\"\n ></sky-page-header>\n </sky-column>\n </sky-row>\n <sky-row>\n <sky-column screenLarge=\"9\" screenXSmall=\"12\">\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-buttons\"></ng-content>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-container\n *ngIf=\"\n needsAttention === 'loading';\n then loadingTemplateRef;\n else needsAttentionTemplateRef\n \"\n ></ng-container>\n <ng-template #needsAttentionTemplateRef>\n <sky-needs-attention [items]=\"needsAttention\"></sky-needs-attention>\n </ng-template>\n </div>\n\n <div\n [skyThemeClass]=\"{\n 'sky-margin-stacked-separate': 'default',\n 'sky-margin-stacked-xxl': 'modern'\n }\"\n >\n <ng-content select=\"sky-action-hub-content\"></ng-content>\n </div>\n </sky-column>\n <sky-column screenLarge=\"3\" screenXSmall=\"12\">\n <sky-link-list\n [links]=\"relatedLinks | skyActionHubRelatedLinksSort\"\n [title]=\"'sky_action_hub_related_links' | skyLibResources\"\n ></sky-link-list>\n <sky-link-list\n [links]=\"recentLinks | skyActionHubRecentLinksResolve\"\n [title]=\"'sky_action_hub_recent_links' | skyLibResources\"\n ></sky-link-list>\n </sky-column>\n </sky-row>\n</sky-fluid-grid>\n", components: [{ type: i2.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }, { type: i1.λ22, selector: "sky-fluid-grid", inputs: ["disableMargin", "gutterSize"] }, { type: i1.λ23, selector: "sky-row", inputs: ["reverseColumnOrder"] }, { type: i1.λ24, selector: "sky-column", inputs: ["screenXSmall", "screenSmall", "screenMedium", "screenLarge"] }, { type: SkyPageHeaderComponent, selector: "sky-page-header", inputs: ["parentLink", "pageTitle"] }, { type: SkyNeedsAttentionComponent, selector: "sky-needs-attention", inputs: ["items"] }, { type: SkyLinkListComponent, selector: "sky-link-list", inputs: ["links", "title"] }], directives: [{ type: i3.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "skyActionHubRelatedLinksSort": SkyActionHubRelatedLinksSortPipe, "skyLibResources": i6.SkyLibResourcesPipe, "skyActionHubRecentLinksResolve": SkyActionHubRecentLinksResolvePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
254
338
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubComponent, decorators: [{
|
|
255
339
|
type: Component,
|
|
256
340
|
args: [{
|
|
@@ -276,6 +360,8 @@ SkyActionHubModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versi
|
|
|
276
360
|
SkyActionHubModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyActionHubModule, declarations: [SkyActionHubButtonsComponent,
|
|
277
361
|
SkyActionHubComponent,
|
|
278
362
|
SkyActionHubContentComponent,
|
|
363
|
+
SkyActionHubRecentLinksResolvePipe,
|
|
364
|
+
SkyActionHubRelatedLinksSortPipe,
|
|
279
365
|
SkyNeedsAttentionComponent,
|
|
280
366
|
SkyLinkListComponent], imports: [CommonModule,
|
|
281
367
|
SkyPagesResourcesModule,
|
|
@@ -329,6 +415,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
329
415
|
SkyActionHubButtonsComponent,
|
|
330
416
|
SkyActionHubComponent,
|
|
331
417
|
SkyActionHubContentComponent,
|
|
418
|
+
SkyActionHubRecentLinksResolvePipe,
|
|
419
|
+
SkyActionHubRelatedLinksSortPipe,
|
|
332
420
|
SkyNeedsAttentionComponent,
|
|
333
421
|
SkyLinkListComponent,
|
|
334
422
|
],
|