@gravitee/ui-particles-angular 7.28.9 → 7.29.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/esm2020/lib/gio-license/gio-license-dialog/gio-license-dialog.component.mjs +42 -0
- package/esm2020/lib/gio-license/gio-license-dialog/gio-license-dialog.module.mjs +38 -0
- package/esm2020/lib/gio-license/gio-license.directive.mjs +84 -0
- package/esm2020/lib/gio-license/gio-license.module.mjs +37 -0
- package/esm2020/lib/gio-license/gio-license.service.mjs +76 -0
- package/esm2020/lib/gio-license/gio-license.testing.module.mjs +95 -0
- package/esm2020/lib/gio-pipe/gio.pipe.module.mjs +32 -0
- package/esm2020/lib/gio-pipe/safe.pipe.mjs +52 -0
- package/esm2020/lib/public-api.mjs +9 -1
- package/fesm2015/gravitee-ui-particles-angular.mjs +417 -2
- package/fesm2015/gravitee-ui-particles-angular.mjs.map +1 -1
- package/fesm2020/gravitee-ui-particles-angular.mjs +412 -2
- package/fesm2020/gravitee-ui-particles-angular.mjs.map +1 -1
- package/lib/gio-license/gio-license-dialog/gio-license-dialog.component.d.ts +16 -0
- package/lib/gio-license/gio-license-dialog/gio-license-dialog.module.d.ts +12 -0
- package/lib/gio-license/gio-license.directive.d.ts +20 -0
- package/lib/gio-license/gio-license.module.d.ts +10 -0
- package/lib/gio-license/gio-license.service.d.ts +44 -0
- package/lib/gio-license/gio-license.testing.module.d.ts +23 -0
- package/lib/gio-pipe/gio.pipe.module.d.ts +7 -0
- package/lib/gio-pipe/safe.pipe.d.ts +10 -0
- package/lib/public-api.d.ts +8 -0
- package/package.json +1 -1
|
@@ -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 { Injectable, SecurityContext, APP_ID, Component, Inject, Input, NgModule, EventEmitter, HostBinding, Output, HostListener, Optional, Self, ViewChild, Directive, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, Host, ContentChild, InjectionToken } from '@angular/core';
|
|
4
|
+
import { Injectable, SecurityContext, APP_ID, Component, Inject, Input, NgModule, EventEmitter, HostBinding, Output, HostListener, Optional, Self, ViewChild, Directive, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, ContentChildren, Host, ContentChild, InjectionToken, Pipe } from '@angular/core';
|
|
5
5
|
import * as i4 from '@angular/common/http';
|
|
6
6
|
import { HttpClientModule } from '@angular/common/http';
|
|
7
7
|
import { shareReplay, switchMap, catchError, takeUntil, tap, startWith, map, distinctUntilChanged, debounce, delay, filter, take, debounceTime } from 'rxjs/operators';
|
|
@@ -55,6 +55,7 @@ import * as i4$1 from '@angular/material/tooltip';
|
|
|
55
55
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
56
56
|
import * as i3$4 from '@angular/cdk/clipboard';
|
|
57
57
|
import { ClipboardModule } from '@angular/cdk/clipboard';
|
|
58
|
+
import { action } from '@storybook/addon-actions';
|
|
58
59
|
|
|
59
60
|
/*
|
|
60
61
|
* Copyright (C) 2023 The Gravitee team (http://gravitee.io)
|
|
@@ -5337,6 +5338,415 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5337
5338
|
}]
|
|
5338
5339
|
}] });
|
|
5339
5340
|
|
|
5341
|
+
/*
|
|
5342
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5343
|
+
*
|
|
5344
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5345
|
+
* you may not use this file except in compliance with the License.
|
|
5346
|
+
* You may obtain a copy of the License at
|
|
5347
|
+
*
|
|
5348
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5349
|
+
*
|
|
5350
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5351
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5352
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5353
|
+
* See the License for the specific language governing permissions and
|
|
5354
|
+
* limitations under the License.
|
|
5355
|
+
*/
|
|
5356
|
+
class SafePipe {
|
|
5357
|
+
constructor(sanitizer) {
|
|
5358
|
+
this.sanitizer = sanitizer;
|
|
5359
|
+
}
|
|
5360
|
+
transform(value, type) {
|
|
5361
|
+
if (!value) {
|
|
5362
|
+
return '';
|
|
5363
|
+
}
|
|
5364
|
+
switch (type) {
|
|
5365
|
+
// No Sonar because the bypass is deliberate and should only be used with safe data
|
|
5366
|
+
case 'html':
|
|
5367
|
+
return this.sanitizer.bypassSecurityTrustHtml(value); // NOSONAR
|
|
5368
|
+
case 'style':
|
|
5369
|
+
return this.sanitizer.bypassSecurityTrustStyle(value); // NOSONAR
|
|
5370
|
+
case 'script':
|
|
5371
|
+
return this.sanitizer.bypassSecurityTrustScript(value); // NOSONAR
|
|
5372
|
+
case 'url':
|
|
5373
|
+
return this.sanitizer.bypassSecurityTrustUrl(value); // NOSONAR
|
|
5374
|
+
case 'resourceUrl':
|
|
5375
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(value); // NOSONAR
|
|
5376
|
+
default:
|
|
5377
|
+
throw new Error(`Invalid safe type specified: ${type}`);
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
}
|
|
5381
|
+
SafePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SafePipe, deps: [{ token: i3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
5382
|
+
SafePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SafePipe, name: "safe" });
|
|
5383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SafePipe, decorators: [{
|
|
5384
|
+
type: Pipe,
|
|
5385
|
+
args: [{
|
|
5386
|
+
name: 'safe',
|
|
5387
|
+
}]
|
|
5388
|
+
}], ctorParameters: function () { return [{ type: i3.DomSanitizer }]; } });
|
|
5389
|
+
|
|
5390
|
+
/*
|
|
5391
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5392
|
+
*
|
|
5393
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5394
|
+
* you may not use this file except in compliance with the License.
|
|
5395
|
+
* You may obtain a copy of the License at
|
|
5396
|
+
*
|
|
5397
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5398
|
+
*
|
|
5399
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5400
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5401
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5402
|
+
* See the License for the specific language governing permissions and
|
|
5403
|
+
* limitations under the License.
|
|
5404
|
+
*/
|
|
5405
|
+
class GioSafePipeModule {
|
|
5406
|
+
}
|
|
5407
|
+
GioSafePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSafePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5408
|
+
GioSafePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSafePipeModule, declarations: [SafePipe], exports: [SafePipe] });
|
|
5409
|
+
GioSafePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSafePipeModule, imports: [[]] });
|
|
5410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioSafePipeModule, decorators: [{
|
|
5411
|
+
type: NgModule,
|
|
5412
|
+
args: [{
|
|
5413
|
+
imports: [],
|
|
5414
|
+
declarations: [SafePipe],
|
|
5415
|
+
exports: [SafePipe],
|
|
5416
|
+
}]
|
|
5417
|
+
}] });
|
|
5418
|
+
|
|
5419
|
+
/*
|
|
5420
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5421
|
+
*
|
|
5422
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5423
|
+
* you may not use this file except in compliance with the License.
|
|
5424
|
+
* You may obtain a copy of the License at
|
|
5425
|
+
*
|
|
5426
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5427
|
+
*
|
|
5428
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5429
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5430
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5431
|
+
* See the License for the specific language governing permissions and
|
|
5432
|
+
* limitations under the License.
|
|
5433
|
+
*/
|
|
5434
|
+
class GioLicenseDialogComponent {
|
|
5435
|
+
constructor(dialogRef, dialogData) {
|
|
5436
|
+
this.dialogRef = dialogRef;
|
|
5437
|
+
this.featureInfo = dialogData?.featureInfo;
|
|
5438
|
+
this.trialURL = dialogData?.trialURL;
|
|
5439
|
+
}
|
|
5440
|
+
onClose() {
|
|
5441
|
+
this.dialogRef.close();
|
|
5442
|
+
}
|
|
5443
|
+
}
|
|
5444
|
+
GioLicenseDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
5445
|
+
GioLicenseDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: GioLicenseDialogComponent, selector: "gio-license-dialog", ngImport: i0, template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"gio-license-dialog__title\">\n <mat-icon class=\"gio-license-dialog__title__cancel\"></mat-icon>\n <button mat-icon-button [attr.aria-label]=\"'Close'\" (click)=\"onClose()\">\n <mat-icon class=\"gio-license-dialog__title__cancel\" svgIcon=\"gio:cancel\"> </mat-icon>\n </button>\n</div>\n\n<mat-dialog-content class=\"gio-license-dialog__content\">\n <img class=\"gio-license-dialog__content__image\" [src]=\"featureInfo.image\" [alt]=\"featureInfo.title || 'Unlock Gravitee Enterprise'\" />\n <h2 class=\"gio-license-dialog__content__title\" [innerHTML]=\"featureInfo.title || 'Unlock Gravitee Enterprise' | safe : 'html'\"></h2>\n <div class=\"gio-license-dialog__content__description\" [innerHTML]=\"featureInfo.description | safe : 'html'\"></div>\n <div class=\"gio-license-dialog__content__action\">\n <a class=\"gio-license-dialog__content__action__button\" mat-stroked-button color=\"accent\" target=\"_blank\" [href]=\"trialURL\">\n Request an enterprise license <mat-icon svgIcon=\"gio:external-link\"></mat-icon>\n </a>\n <div class=\"gio-license-dialog__content__action__info\">14 days trial</div>\n </div>\n</mat-dialog-content>\n", styles: [".gio-license-dialog__title{display:flex;justify-content:space-between}.gio-license-dialog__title__cancel{width:24px;height:24px;color:#8e8f9c}.gio-license-dialog__content{display:flex;width:600px;flex-direction:column;align-items:center;justify-content:center;padding:0}.gio-license-dialog__content__title{margin:0 0 24px;font:600 26px/36px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal}.gio-license-dialog__content__description{padding:0 50px 32px;color:#606274;font-weight:500;line-height:24px;text-align:center}.gio-license-dialog__content__action{display:flex;flex-direction:column;align-items:center;padding:0 40px}.gio-license-dialog__content__action__button{width:250px}.gio-license-dialog__content__action__info{margin-top:10px;color:#606274;text-align:center}\n"], components: [{ type: i1$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i2.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }], pipes: { "safe": SafePipe } });
|
|
5446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDialogComponent, decorators: [{
|
|
5447
|
+
type: Component,
|
|
5448
|
+
args: [{ selector: 'gio-license-dialog', template: "<!--\n\n Copyright (C) 2015 The Gravitee team (http://gravitee.io)\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n<div class=\"gio-license-dialog__title\">\n <mat-icon class=\"gio-license-dialog__title__cancel\"></mat-icon>\n <button mat-icon-button [attr.aria-label]=\"'Close'\" (click)=\"onClose()\">\n <mat-icon class=\"gio-license-dialog__title__cancel\" svgIcon=\"gio:cancel\"> </mat-icon>\n </button>\n</div>\n\n<mat-dialog-content class=\"gio-license-dialog__content\">\n <img class=\"gio-license-dialog__content__image\" [src]=\"featureInfo.image\" [alt]=\"featureInfo.title || 'Unlock Gravitee Enterprise'\" />\n <h2 class=\"gio-license-dialog__content__title\" [innerHTML]=\"featureInfo.title || 'Unlock Gravitee Enterprise' | safe : 'html'\"></h2>\n <div class=\"gio-license-dialog__content__description\" [innerHTML]=\"featureInfo.description | safe : 'html'\"></div>\n <div class=\"gio-license-dialog__content__action\">\n <a class=\"gio-license-dialog__content__action__button\" mat-stroked-button color=\"accent\" target=\"_blank\" [href]=\"trialURL\">\n Request an enterprise license <mat-icon svgIcon=\"gio:external-link\"></mat-icon>\n </a>\n <div class=\"gio-license-dialog__content__action__info\">14 days trial</div>\n </div>\n</mat-dialog-content>\n", styles: [".gio-license-dialog__title{display:flex;justify-content:space-between}.gio-license-dialog__title__cancel{width:24px;height:24px;color:#8e8f9c}.gio-license-dialog__content{display:flex;width:600px;flex-direction:column;align-items:center;justify-content:center;padding:0}.gio-license-dialog__content__title{margin:0 0 24px;font:600 26px/36px Golos UI,Roboto,Helvetica Neue,sans-serif;letter-spacing:normal}.gio-license-dialog__content__description{padding:0 50px 32px;color:#606274;font-weight:500;line-height:24px;text-align:center}.gio-license-dialog__content__action{display:flex;flex-direction:column;align-items:center;padding:0 40px}.gio-license-dialog__content__action__button{width:250px}.gio-license-dialog__content__action__info{margin-top:10px;color:#606274;text-align:center}\n"] }]
|
|
5449
|
+
}], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
|
|
5450
|
+
type: Inject,
|
|
5451
|
+
args: [MAT_DIALOG_DATA]
|
|
5452
|
+
}] }]; } });
|
|
5453
|
+
|
|
5454
|
+
class GioLicenseService {
|
|
5455
|
+
constructor(http, licenseConfiguration, matDialog) {
|
|
5456
|
+
this.http = http;
|
|
5457
|
+
this.licenseConfiguration = licenseConfiguration;
|
|
5458
|
+
this.matDialog = matDialog;
|
|
5459
|
+
this.loadLicense$ = this.http.get(licenseConfiguration.resourceURL).pipe(shareReplay(1));
|
|
5460
|
+
}
|
|
5461
|
+
getLicense$() {
|
|
5462
|
+
return this.loadLicense$;
|
|
5463
|
+
}
|
|
5464
|
+
isMissingFeature$(licenseOptions) {
|
|
5465
|
+
if (licenseOptions?.deployed === false) {
|
|
5466
|
+
return of(true);
|
|
5467
|
+
}
|
|
5468
|
+
if (licenseOptions?.feature == null || licenseOptions?.deployed === true) {
|
|
5469
|
+
return of(false);
|
|
5470
|
+
}
|
|
5471
|
+
return this.getLicense$().pipe(map(license => license == null || license.features.find(feat => feat === licenseOptions.feature) == null));
|
|
5472
|
+
}
|
|
5473
|
+
getFeatureInfo(licenseOptions) {
|
|
5474
|
+
if (!licenseOptions.feature) {
|
|
5475
|
+
throw new Error(`feature is undefined`);
|
|
5476
|
+
}
|
|
5477
|
+
const featureInfo = this.licenseConfiguration.featureInfoData[licenseOptions.feature];
|
|
5478
|
+
if (!featureInfo) {
|
|
5479
|
+
throw new Error(`Unknown Feature value ${licenseOptions.feature}. Expected one of ${Object.keys(this.licenseConfiguration.featureInfoData)}`);
|
|
5480
|
+
}
|
|
5481
|
+
return featureInfo;
|
|
5482
|
+
}
|
|
5483
|
+
getTrialURL(licenseOptions) {
|
|
5484
|
+
if (!licenseOptions.feature) {
|
|
5485
|
+
throw new Error(`feature is undefined`);
|
|
5486
|
+
}
|
|
5487
|
+
let url = `https://gravitee.io/self-hosted-trial?utm_source=${this.licenseConfiguration.utmSource}&utm_medium=${licenseOptions.feature}&utm_campaign=${this.licenseConfiguration.utmCampaign}`;
|
|
5488
|
+
if (licenseOptions.context) {
|
|
5489
|
+
url += `&utm_content=${licenseOptions.context}`;
|
|
5490
|
+
}
|
|
5491
|
+
return url;
|
|
5492
|
+
}
|
|
5493
|
+
openDialog(licenseOptions, event) {
|
|
5494
|
+
event?.stopPropagation();
|
|
5495
|
+
event?.preventDefault();
|
|
5496
|
+
const featureInfo = this.getFeatureInfo(licenseOptions);
|
|
5497
|
+
const trialURL = this.getTrialURL(licenseOptions);
|
|
5498
|
+
return this.matDialog
|
|
5499
|
+
.open(GioLicenseDialogComponent, {
|
|
5500
|
+
data: {
|
|
5501
|
+
featureInfo,
|
|
5502
|
+
trialURL,
|
|
5503
|
+
},
|
|
5504
|
+
role: 'alertdialog',
|
|
5505
|
+
id: 'gioLicenseDialog',
|
|
5506
|
+
})
|
|
5507
|
+
.afterClosed()
|
|
5508
|
+
.subscribe();
|
|
5509
|
+
}
|
|
5510
|
+
}
|
|
5511
|
+
GioLicenseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseService, deps: [{ token: i4.HttpClient }, { token: 'LicenseConfiguration' }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5512
|
+
GioLicenseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseService, providedIn: 'root' });
|
|
5513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseService, decorators: [{
|
|
5514
|
+
type: Injectable,
|
|
5515
|
+
args: [{
|
|
5516
|
+
providedIn: 'root',
|
|
5517
|
+
}]
|
|
5518
|
+
}], ctorParameters: function () { return [{ type: i4.HttpClient }, { type: undefined, decorators: [{
|
|
5519
|
+
type: Inject,
|
|
5520
|
+
args: ['LicenseConfiguration']
|
|
5521
|
+
}] }, { type: i1$2.MatDialog }]; } });
|
|
5522
|
+
|
|
5523
|
+
/*
|
|
5524
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5525
|
+
*
|
|
5526
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5527
|
+
* you may not use this file except in compliance with the License.
|
|
5528
|
+
* You may obtain a copy of the License at
|
|
5529
|
+
*
|
|
5530
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5531
|
+
*
|
|
5532
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5533
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5534
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5535
|
+
* See the License for the specific language governing permissions and
|
|
5536
|
+
* limitations under the License.
|
|
5537
|
+
*/
|
|
5538
|
+
class GioLicenseDirective {
|
|
5539
|
+
constructor(licenseService, matDialog, elRef) {
|
|
5540
|
+
this.licenseService = licenseService;
|
|
5541
|
+
this.matDialog = matDialog;
|
|
5542
|
+
this.elRef = elRef;
|
|
5543
|
+
this.gioLicense = {};
|
|
5544
|
+
this.featureInfo = {};
|
|
5545
|
+
this.trialURL = '';
|
|
5546
|
+
this.unsubscribe$ = new Subject();
|
|
5547
|
+
this.onClick = this.click.bind(this);
|
|
5548
|
+
}
|
|
5549
|
+
ngOnInit() {
|
|
5550
|
+
this.licenseService
|
|
5551
|
+
.isMissingFeature$(this.gioLicense)
|
|
5552
|
+
.pipe(tap(() => {
|
|
5553
|
+
this.elRef.nativeElement.removeEventListener('click', this.onClick, true);
|
|
5554
|
+
}), filter(notAllowed => this.gioLicense != null && notAllowed), map(() => this.licenseService.getFeatureInfo(this.gioLicense)), tap(featureInfo => {
|
|
5555
|
+
this.featureInfo = featureInfo;
|
|
5556
|
+
this.elRef.nativeElement.addEventListener('click', this.onClick, true);
|
|
5557
|
+
}), takeUntil(this.unsubscribe$))
|
|
5558
|
+
.subscribe();
|
|
5559
|
+
if (this.gioLicense?.feature) {
|
|
5560
|
+
this.trialURL = this.licenseService.getTrialURL(this.gioLicense);
|
|
5561
|
+
}
|
|
5562
|
+
}
|
|
5563
|
+
ngOnDestroy() {
|
|
5564
|
+
this.elRef.nativeElement.removeEventListener('click', this.onClick, true);
|
|
5565
|
+
this.unsubscribe$.next(false);
|
|
5566
|
+
this.unsubscribe$.unsubscribe();
|
|
5567
|
+
}
|
|
5568
|
+
click($event) {
|
|
5569
|
+
$event.preventDefault();
|
|
5570
|
+
$event.stopPropagation();
|
|
5571
|
+
this.matDialog
|
|
5572
|
+
.open(GioLicenseDialogComponent, {
|
|
5573
|
+
data: {
|
|
5574
|
+
featureInfo: this.featureInfo,
|
|
5575
|
+
trialURL: this.trialURL,
|
|
5576
|
+
},
|
|
5577
|
+
role: 'alertdialog',
|
|
5578
|
+
id: 'gioLicenseDialog',
|
|
5579
|
+
})
|
|
5580
|
+
.afterClosed()
|
|
5581
|
+
.pipe(tap(confirmed => {
|
|
5582
|
+
action('confirmed?')(confirmed);
|
|
5583
|
+
}))
|
|
5584
|
+
.subscribe();
|
|
5585
|
+
return false;
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
GioLicenseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDirective, deps: [{ token: GioLicenseService }, { token: i1$2.MatDialog }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5589
|
+
GioLicenseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: GioLicenseDirective, selector: "[gioLicense]", inputs: { gioLicense: "gioLicense" }, ngImport: i0 });
|
|
5590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDirective, decorators: [{
|
|
5591
|
+
type: Directive,
|
|
5592
|
+
args: [{
|
|
5593
|
+
selector: '[gioLicense]',
|
|
5594
|
+
}]
|
|
5595
|
+
}], ctorParameters: function () { return [{ type: GioLicenseService }, { type: i1$2.MatDialog }, { type: i0.ElementRef }]; }, propDecorators: { gioLicense: [{
|
|
5596
|
+
type: Input
|
|
5597
|
+
}] } });
|
|
5598
|
+
|
|
5599
|
+
/*
|
|
5600
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5601
|
+
*
|
|
5602
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5603
|
+
* you may not use this file except in compliance with the License.
|
|
5604
|
+
* You may obtain a copy of the License at
|
|
5605
|
+
*
|
|
5606
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5607
|
+
*
|
|
5608
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5609
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5610
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5611
|
+
* See the License for the specific language governing permissions and
|
|
5612
|
+
* limitations under the License.
|
|
5613
|
+
*/
|
|
5614
|
+
class GioLicenseDialogModule {
|
|
5615
|
+
}
|
|
5616
|
+
GioLicenseDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5617
|
+
GioLicenseDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDialogModule, declarations: [GioLicenseDialogComponent], imports: [CommonModule, MatDialogModule, GioIconsModule, MatButtonModule, GioSafePipeModule], exports: [GioLicenseDialogComponent] });
|
|
5618
|
+
GioLicenseDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDialogModule, imports: [[CommonModule, MatDialogModule, GioIconsModule, MatButtonModule, GioSafePipeModule]] });
|
|
5619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseDialogModule, decorators: [{
|
|
5620
|
+
type: NgModule,
|
|
5621
|
+
args: [{
|
|
5622
|
+
imports: [CommonModule, MatDialogModule, GioIconsModule, MatButtonModule, GioSafePipeModule],
|
|
5623
|
+
declarations: [GioLicenseDialogComponent],
|
|
5624
|
+
exports: [GioLicenseDialogComponent],
|
|
5625
|
+
entryComponents: [GioLicenseDialogComponent],
|
|
5626
|
+
}]
|
|
5627
|
+
}] });
|
|
5628
|
+
|
|
5629
|
+
/*
|
|
5630
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5631
|
+
*
|
|
5632
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5633
|
+
* you may not use this file except in compliance with the License.
|
|
5634
|
+
* You may obtain a copy of the License at
|
|
5635
|
+
*
|
|
5636
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5637
|
+
*
|
|
5638
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5639
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5640
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5641
|
+
* See the License for the specific language governing permissions and
|
|
5642
|
+
* limitations under the License.
|
|
5643
|
+
*/
|
|
5644
|
+
class GioLicenseModule {
|
|
5645
|
+
}
|
|
5646
|
+
GioLicenseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5647
|
+
GioLicenseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseModule, declarations: [GioLicenseDirective], imports: [CommonModule, MatDialogModule, GioLicenseDialogModule], exports: [GioLicenseDirective] });
|
|
5648
|
+
GioLicenseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseModule, providers: [GioLicenseService], imports: [[CommonModule, MatDialogModule, GioLicenseDialogModule]] });
|
|
5649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseModule, decorators: [{
|
|
5650
|
+
type: NgModule,
|
|
5651
|
+
args: [{
|
|
5652
|
+
imports: [CommonModule, MatDialogModule, GioLicenseDialogModule],
|
|
5653
|
+
declarations: [GioLicenseDirective],
|
|
5654
|
+
exports: [GioLicenseDirective],
|
|
5655
|
+
providers: [GioLicenseService],
|
|
5656
|
+
}]
|
|
5657
|
+
}] });
|
|
5658
|
+
|
|
5659
|
+
/*
|
|
5660
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
5661
|
+
*
|
|
5662
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5663
|
+
* you may not use this file except in compliance with the License.
|
|
5664
|
+
* You may obtain a copy of the License at
|
|
5665
|
+
*
|
|
5666
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5667
|
+
*
|
|
5668
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5669
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5670
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5671
|
+
* See the License for the specific language governing permissions and
|
|
5672
|
+
* limitations under the License.
|
|
5673
|
+
*/
|
|
5674
|
+
const LICENSE_CONFIGURATION_TESTING = {
|
|
5675
|
+
resourceURL: 'https://url.test:3000/license',
|
|
5676
|
+
utmSource: 'oss_utm_source_test',
|
|
5677
|
+
utmCampaign: 'oss_utm_campaign_test',
|
|
5678
|
+
featureInfoData: {
|
|
5679
|
+
foobar: {
|
|
5680
|
+
image: 'assets/gio-icons.svg',
|
|
5681
|
+
description: 'Foobar feature description',
|
|
5682
|
+
title: 'FOOBAR',
|
|
5683
|
+
},
|
|
5684
|
+
},
|
|
5685
|
+
};
|
|
5686
|
+
class GioLicenseTestingModule {
|
|
5687
|
+
static with(license) {
|
|
5688
|
+
return {
|
|
5689
|
+
ngModule: GioLicenseTestingModule,
|
|
5690
|
+
providers: [
|
|
5691
|
+
{
|
|
5692
|
+
provide: 'LicenseConfiguration',
|
|
5693
|
+
useValue: LICENSE_CONFIGURATION_TESTING,
|
|
5694
|
+
},
|
|
5695
|
+
{
|
|
5696
|
+
provide: GioLicenseService,
|
|
5697
|
+
useValue: {
|
|
5698
|
+
isMissingFeature$: () => of(!license),
|
|
5699
|
+
getFeatureInfo: () => ({}),
|
|
5700
|
+
getTrialURL: () => '',
|
|
5701
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5702
|
+
openDialog: () => { },
|
|
5703
|
+
},
|
|
5704
|
+
},
|
|
5705
|
+
],
|
|
5706
|
+
};
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
GioLicenseTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5710
|
+
GioLicenseTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseTestingModule });
|
|
5711
|
+
GioLicenseTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseTestingModule, providers: [
|
|
5712
|
+
{
|
|
5713
|
+
provide: 'LicenseConfiguration',
|
|
5714
|
+
useValue: LICENSE_CONFIGURATION_TESTING,
|
|
5715
|
+
},
|
|
5716
|
+
{
|
|
5717
|
+
provide: GioLicenseService,
|
|
5718
|
+
useValue: {
|
|
5719
|
+
isMissingFeature$: () => of(true),
|
|
5720
|
+
getFeatureInfo: () => ({}),
|
|
5721
|
+
getTrialURL: () => '',
|
|
5722
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5723
|
+
openDialog: () => { },
|
|
5724
|
+
},
|
|
5725
|
+
},
|
|
5726
|
+
], imports: [[]] });
|
|
5727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: GioLicenseTestingModule, decorators: [{
|
|
5728
|
+
type: NgModule,
|
|
5729
|
+
args: [{
|
|
5730
|
+
imports: [],
|
|
5731
|
+
providers: [
|
|
5732
|
+
{
|
|
5733
|
+
provide: 'LicenseConfiguration',
|
|
5734
|
+
useValue: LICENSE_CONFIGURATION_TESTING,
|
|
5735
|
+
},
|
|
5736
|
+
{
|
|
5737
|
+
provide: GioLicenseService,
|
|
5738
|
+
useValue: {
|
|
5739
|
+
isMissingFeature$: () => of(true),
|
|
5740
|
+
getFeatureInfo: () => ({}),
|
|
5741
|
+
getTrialURL: () => '',
|
|
5742
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5743
|
+
openDialog: () => { },
|
|
5744
|
+
},
|
|
5745
|
+
},
|
|
5746
|
+
],
|
|
5747
|
+
}]
|
|
5748
|
+
}] });
|
|
5749
|
+
|
|
5340
5750
|
/*
|
|
5341
5751
|
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
|
|
5342
5752
|
*
|
|
@@ -5373,5 +5783,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
5373
5783
|
* Generated bundle index. Do not edit.
|
|
5374
5784
|
*/
|
|
5375
5785
|
|
|
5376
|
-
export { GIO_DIALOG_WIDTH, GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR, GioAsciidoctorComponent, GioAsciidoctorModule, GioAsciidoctorService, GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBaseFormFocusInvalidDirective, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioButtonFocusInvalidButtonDirective, GioClipboardCopyIconComponent, GioClipboardCopyWrapperComponent, GioClipboardModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidFormDirective, GioFormFocusInvalidIgnoreDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioLoaderComponent, GioLoaderModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective, GioMonacoEditorHarness, GioMonacoEditorModule, GioPrismJsService, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, NewFile };
|
|
5786
|
+
export { GIO_DIALOG_WIDTH, GIO_FORM_FOCUS_INVALID_IGNORE_SELECTOR, GioAsciidoctorComponent, GioAsciidoctorModule, GioAsciidoctorService, GioAvatarComponent, GioAvatarModule, GioBannerActionDirective, GioBannerBodyDirective, GioBannerComponent, GioBannerErrorComponent, GioBannerInfoComponent, GioBannerModule, GioBannerSuccessComponent, GioBannerWarningComponent, GioBaseFormFocusInvalidDirective, GioBreadcrumbComponent, GioBreadcrumbItemDirective, GioBreadcrumbModule, GioButtonFocusInvalidButtonDirective, GioClipboardCopyIconComponent, GioClipboardCopyWrapperComponent, GioClipboardModule, GioConfirmAndValidateDialogComponent, GioConfirmAndValidateDialogHarness, GioConfirmAndValidateDialogModule, GioConfirmDialogComponent, GioConfirmDialogHarness, GioConfirmDialogModule, GioFormFilePickerAddButtonComponent, GioFormFilePickerComponent, GioFormFilePickerEmptyComponent, GioFormFilePickerInputHarness, GioFormFilePickerLabelComponent, GioFormFilePickerModule, GioFormFocusInvalidFormDirective, GioFormFocusInvalidIgnoreDirective, GioFormFocusInvalidModule, GioFormHeadersComponent, GioFormHeadersHarness, GioFormHeadersModule, GioFormJsonSchemaComponent, GioFormJsonSchemaModule, GioFormLabelComponent, GioFormPrefixDirective, GioFormSlideToggleComponent, GioFormSlideToggleDirective, GioFormSlideToggleModule, GioFormTagsInputComponent, GioFormTagsInputHarness, GioFormTagsInputModule, GioIconsModule, GioLicenseDialogComponent, GioLicenseDialogModule, GioLicenseDirective, GioLicenseModule, GioLicenseService, GioLicenseTestingModule, GioLoaderComponent, GioLoaderModule, GioMatConfigModule, GioMenuComponent, GioMenuFooterComponent, GioMenuHeaderComponent, GioMenuItemComponent, GioMenuListComponent, GioMenuModule, GioMenuSelectorComponent, GioMenuSelectorHarness, GioMenuService, GioMonacoEditorComponent, GioMonacoEditorFormFieldDirective, GioMonacoEditorHarness, GioMonacoEditorModule, GioPrismJsService, GioSafePipeModule, GioSaveBarComponent, GioSaveBarHarness, GioSaveBarModule, GioSubmenuComponent, GioSubmenuGroupComponent, GioSubmenuItemComponent, GioSubmenuModule, GioSubmenuTitleDirective, GioTopBarComponent, GioTopBarContentComponent, GioTopBarLinkComponent, GioTopBarLinkModule, GioTopBarMenuComponent, GioTopBarMenuModule, GioTopBarModule, LICENSE_CONFIGURATION_TESTING, NewFile, SafePipe };
|
|
5377
5787
|
//# sourceMappingURL=gravitee-ui-particles-angular.mjs.map
|