@coolon/angular-ui-powerups 16.1.0-aplpha.126 → 16.1.0-aplpha.128
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/assets/draw.scss +20 -0
- package/assets/layout.scss +3 -0
- package/assets/styles.scss +2 -0
- package/assets/tabs.scss +14 -0
- package/esm2022/lib/components/tables/renderer/default-cell-renderer/default-cell-renderer.component.mjs +3 -3
- package/esm2022/lib/directives/highlight.pipe.mjs +8 -5
- package/esm2022/lib/place/guards/place.guard.mjs +5 -5
- package/esm2022/lib/place/place-auth-service.mjs +5 -5
- package/esm2022/lib/place/place-router.mjs +3 -3
- package/fesm2022/coolon-angular-ui-powerups.mjs +19 -17
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/place-auth-service.d.ts +4 -4
- package/lib/place/place-router.d.ts +2 -2
- package/package.json +2 -2
|
@@ -45,7 +45,7 @@ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl
|
|
|
45
45
|
import { __decorate, __metadata, __param } from 'tslib';
|
|
46
46
|
import * as i1 from '@angular/platform-browser';
|
|
47
47
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
48
|
-
import { isEmpty, isString, isFunction, isNil, isInteger, isObject, isEqual, join, last, first, uniq, findLast, isNumber, isNaN as isNaN$1 } from 'lodash-es';
|
|
48
|
+
import { escape, isEmpty, isString, isFunction, isNil, isInteger, isObject, isEqual, join, last, first, uniq, findLast, isNumber, isNaN as isNaN$1 } from 'lodash-es';
|
|
49
49
|
import { marked } from 'marked';
|
|
50
50
|
import { MemoizeGet, lang as lang$1, assert as assert$1, Stringy, Klass, Opts } from '@coolon/typescript-utilities';
|
|
51
51
|
import { Enum } from 'typescript-string-enums';
|
|
@@ -498,19 +498,21 @@ class HighlightPipe extends GarbageCollector {
|
|
|
498
498
|
this.dispose();
|
|
499
499
|
}
|
|
500
500
|
transform(value, searchModel) {
|
|
501
|
+
const sanitisedValue = escape(value);
|
|
502
|
+
console.log(sanitisedValue);
|
|
501
503
|
const model = searchModel ?? this.highlightContext?.aupHighlightTextModel;
|
|
502
504
|
const searchText = model?.value;
|
|
503
505
|
if (isEmpty(searchText) || !isString(value)) {
|
|
504
|
-
return
|
|
506
|
+
return sanitisedValue;
|
|
505
507
|
}
|
|
506
508
|
// Match in a case insensitive manner
|
|
507
509
|
const re = new RegExp(escapeStringRegexp(searchText), 'gi');
|
|
508
|
-
const match =
|
|
510
|
+
const match = sanitisedValue.match(re);
|
|
509
511
|
// If there's no match, just return the original value.
|
|
510
512
|
if (!match) {
|
|
511
|
-
return
|
|
513
|
+
return sanitisedValue;
|
|
512
514
|
}
|
|
513
|
-
const result =
|
|
515
|
+
const result = sanitisedValue.replace(re, '<mark>' + match[0] + '</mark>');
|
|
514
516
|
return this.sanitizer.bypassSecurityTrustHtml(result);
|
|
515
517
|
}
|
|
516
518
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: HighlightPipe, deps: [{ token: i1.DomSanitizer }, { token: HighlightTextModelDirective, optional: true }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
@@ -3545,11 +3547,11 @@ class DefaultCellRendererComponent {
|
|
|
3545
3547
|
return this._value;
|
|
3546
3548
|
}
|
|
3547
3549
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DefaultCellRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3548
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: DefaultCellRendererComponent, selector: "aup-default-cell-renderer", inputs: { value: "value" }, ngImport: i0, template: "<span [innerHTML]=\"value?.toString()| aupHighlight\"></span>\n", styles: [""], dependencies: [{ kind: "pipe", type: HighlightPipe, name: "aupHighlight" }] });
|
|
3550
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: DefaultCellRendererComponent, selector: "aup-default-cell-renderer", inputs: { value: "value" }, ngImport: i0, template: "<span [innerHTML]=\"value?.toString() | aupHighlight\"></span>\n", styles: [""], dependencies: [{ kind: "pipe", type: HighlightPipe, name: "aupHighlight" }] });
|
|
3549
3551
|
}
|
|
3550
3552
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DefaultCellRendererComponent, decorators: [{
|
|
3551
3553
|
type: Component,
|
|
3552
|
-
args: [{ selector: "aup-default-cell-renderer", template: "<span [innerHTML]=\"value?.toString()| aupHighlight\"></span>\n" }]
|
|
3554
|
+
args: [{ selector: "aup-default-cell-renderer", template: "<span [innerHTML]=\"value?.toString() | aupHighlight\"></span>\n" }]
|
|
3553
3555
|
}], propDecorators: { value: [{
|
|
3554
3556
|
type: Input
|
|
3555
3557
|
}] } });
|
|
@@ -8660,12 +8662,12 @@ class PlaceAuthService extends GarbageCollector {
|
|
|
8660
8662
|
await toPromise(this, this._authZReady$);
|
|
8661
8663
|
await this.enabledPlaceChecker.waitUntilReady(placeDef);
|
|
8662
8664
|
}
|
|
8663
|
-
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
8664
|
-
const redirect = this.authNOptions.redirectTo(activatedRoute, state);
|
|
8665
|
+
async getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
8666
|
+
const redirect = await this.authNOptions.redirectTo(activatedRoute, state);
|
|
8665
8667
|
return redirect instanceof Visit ? redirect : Visit.goto(redirect);
|
|
8666
8668
|
}
|
|
8667
|
-
getAuthorisationFailureRedirectOptions(component) {
|
|
8668
|
-
return this.authZOptions.redirectTo(component).map(it => it instanceof Visit ? it : Visit.goto(it));
|
|
8669
|
+
async getAuthorisationFailureRedirectOptions(component) {
|
|
8670
|
+
return (await this.authZOptions.redirectTo(component)).map(it => it instanceof Visit ? it : Visit.goto(it));
|
|
8669
8671
|
}
|
|
8670
8672
|
isAuthenticated() {
|
|
8671
8673
|
return this.accessGuard$.value.isAuthenticated();
|
|
@@ -9156,10 +9158,10 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9156
9158
|
postponeRoutingUntil(condition$) {
|
|
9157
9159
|
this._ready$.setDelegate(condition$);
|
|
9158
9160
|
}
|
|
9159
|
-
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
9161
|
+
async getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
9160
9162
|
return this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
9161
9163
|
}
|
|
9162
|
-
getAuthorisationFailureRedirectOptions(component) {
|
|
9164
|
+
async getAuthorisationFailureRedirectOptions(component) {
|
|
9163
9165
|
return this.authService.getAuthorisationFailureRedirectOptions(component);
|
|
9164
9166
|
}
|
|
9165
9167
|
get navigationSession() {
|
|
@@ -12276,7 +12278,7 @@ class PlaceGuard {
|
|
|
12276
12278
|
await this.placeRouter.authService.waitUntilAuthenticationReady();
|
|
12277
12279
|
const authenticated = this.authService.isAuthenticated();
|
|
12278
12280
|
if (!authenticated) {
|
|
12279
|
-
const redirect = this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
12281
|
+
const redirect = await this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
12280
12282
|
// const nextPlaceDef = this.getPlaceDefinition(redirect);
|
|
12281
12283
|
if (redirect.requiresAuthentication()) {
|
|
12282
12284
|
lang.illegalState(`onAuthenticationFailure hook returned place ${redirect.toDebugString()} that requires authentication.`);
|
|
@@ -12285,7 +12287,7 @@ class PlaceGuard {
|
|
|
12285
12287
|
}
|
|
12286
12288
|
await this.authService.waitUntilAuthorisationReadyFor(placeDefinition);
|
|
12287
12289
|
if (!this.authService.isAuthorised(placeDefinition)) {
|
|
12288
|
-
const nextRedirect = this.findBestAuthenticatedAlternative(placeDefinition, activatedRoute);
|
|
12290
|
+
const nextRedirect = await this.findBestAuthenticatedAlternative(placeDefinition, activatedRoute);
|
|
12289
12291
|
return this.createUrlTree(nextRedirect);
|
|
12290
12292
|
}
|
|
12291
12293
|
}
|
|
@@ -12329,7 +12331,7 @@ class PlaceGuard {
|
|
|
12329
12331
|
return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);
|
|
12330
12332
|
}
|
|
12331
12333
|
}
|
|
12332
|
-
findBestAuthenticatedAlternative(placeDefinition, activatedRoute) {
|
|
12334
|
+
async findBestAuthenticatedAlternative(placeDefinition, activatedRoute) {
|
|
12333
12335
|
let currentPlace = placeDefinition;
|
|
12334
12336
|
while (!currentPlace.isRoot()) {
|
|
12335
12337
|
currentPlace = currentPlace.parent;
|
|
@@ -12339,7 +12341,7 @@ class PlaceGuard {
|
|
|
12339
12341
|
}
|
|
12340
12342
|
}
|
|
12341
12343
|
// Couldn't find an authorised ancestor so we check if there are router level defined alternatives
|
|
12342
|
-
const alternativeRoutes = this.placeRouter.getAuthorisationFailureRedirectOptions(activatedRoute.component);
|
|
12344
|
+
const alternativeRoutes = await this.placeRouter.getAuthorisationFailureRedirectOptions(activatedRoute.component);
|
|
12343
12345
|
if (alternativeRoutes.length < 1) {
|
|
12344
12346
|
return lang.illegalState(`onAuthorisationFailure hook didn't return any alternate places`);
|
|
12345
12347
|
}
|