@corto-ai/gds-angular 2.1.3-dev.1 → 2.1.3-test.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/fesm2022/corto-ai-gds-angular.mjs +353 -111
- package/fesm2022/corto-ai-gds-angular.mjs.map +1 -1
- package/package.json +12 -3
- package/types/corto-ai-gds-angular.d.ts +81 -40
package/README.md
CHANGED
|
@@ -30,11 +30,11 @@ If you plan to only use the stylesheet/fonts for this library, we recommend impl
|
|
|
30
30
|
|
|
31
31
|
## CDN Assets
|
|
32
32
|
|
|
33
|
-
- All brands combined: <https://cdn.
|
|
34
|
-
- Acctivity: <https://cdn.
|
|
35
|
-
- CORTO: <https://cdn.
|
|
36
|
-
- LawY: <https://cdn.
|
|
37
|
-
- LEAP: <https://cdn.
|
|
33
|
+
- All brands combined: <https://cdn.test.cortoaws.com/style/gds/2.1.3-test.2/all.css>
|
|
34
|
+
- Acctivity: <https://cdn.test.cortoaws.com/style/gds/2.1.3-test.2/acctivity.css>
|
|
35
|
+
- CORTO: <https://cdn.test.cortoaws.com/style/gds/2.1.3-test.2/corto.css>
|
|
36
|
+
- LawY: <https://cdn.test.cortoaws.com/style/gds/2.1.3-test.2/lawy.css>
|
|
37
|
+
- LEAP: <https://cdn.test.cortoaws.com/style/gds/2.1.3-test.2/leap.css>
|
|
38
38
|
|
|
39
39
|
## Library `@layer`s
|
|
40
40
|
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, signal, Injector, input, viewChild, effect, afterNextRender, ChangeDetectionStrategy, Component, model, booleanAttribute, computed, ElementRef, output, Directive, contentChild, DestroyRef, Renderer2, Input, ChangeDetectorRef, EventEmitter, NgZone, Output, DOCUMENT, HostBinding,
|
|
2
|
+
import { Injectable, inject, signal, Injector, input, viewChild, effect, afterNextRender, ChangeDetectionStrategy, Component, model, booleanAttribute, computed, ElementRef, output, Directive, contentChild, DestroyRef, Renderer2, InjectionToken, Input, ChangeDetectorRef, EventEmitter, NgZone, Output, DOCUMENT, HostBinding, EnvironmentInjector, ApplicationRef, createComponent, Pipe, contentChildren, ViewEncapsulation, untracked, ViewContainerRef, runInInjectionContext, TemplateRef, numberAttribute, HostListener, provideAppInitializer, NgModule } from '@angular/core';
|
|
3
3
|
import { injectRegisterIcons, SvgIconRegistry, SvgIconComponent, provideSvgIconsConfig } from '@ngneat/svg-icon';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import * as i1 from '@ngneat/helipopper';
|
|
6
6
|
import { TippyDirective } from '@ngneat/helipopper';
|
|
7
7
|
import { NgClass, NgTemplateOutlet, TitleCasePipe, DOCUMENT as DOCUMENT$1, CommonModule } from '@angular/common';
|
|
8
8
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { Subject, tap, debounceTime, fromEvent, take } from 'rxjs';
|
|
10
|
-
import {
|
|
11
|
-
import { BrandEnum, GdsContextMenuItemVariantEnum } from '@corto/utils/types';
|
|
9
|
+
import { Subject, tap, debounceTime, fromEvent, take, map } from 'rxjs';
|
|
10
|
+
import { format, intervalToDuration } from 'date-fns';
|
|
12
11
|
import * as i1$2 from '@angular/cdk/a11y';
|
|
13
12
|
import { FocusKeyManager, CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
|
|
14
13
|
import * as i1$1 from '@angular/cdk/menu';
|
|
15
14
|
import { CdkMenuItem, CdkMenuTrigger, CdkMenuItemCheckbox, MENU_TRIGGER, CdkMenu, CdkTargetMenuAim } from '@angular/cdk/menu';
|
|
16
15
|
import { FormField } from '@angular/forms/signals';
|
|
17
16
|
import { v4 } from 'uuid';
|
|
18
|
-
import { format, intervalToDuration } from 'date-fns';
|
|
19
17
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
20
18
|
import * as i1$3 from '@ngx-translate/core';
|
|
21
19
|
import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
22
|
-
import {
|
|
20
|
+
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
23
21
|
import { MAT_DATE_LOCALE, provideNativeDateAdapter } from '@angular/material/core';
|
|
24
22
|
import * as i1$4 from '@angular/material/datepicker';
|
|
25
23
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
@@ -27,8 +25,7 @@ import * as i1$5 from '@angular/forms';
|
|
|
27
25
|
import { FormsModule } from '@angular/forms';
|
|
28
26
|
import * as i2 from '@ng-select/ng-select';
|
|
29
27
|
import { NgSelectComponent, NgLabelTemplateDirective, NgMultiLabelTemplateDirective, NgFooterTemplateDirective, NgClearButtonTemplateDirective, NgOptionTemplateDirective, NgPlaceholderTemplateDirective, NgSelectModule } from '@ng-select/ng-select';
|
|
30
|
-
import {
|
|
31
|
-
import { computedPrevious } from '@corto/utils/signals';
|
|
28
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
32
29
|
import * as i1$6 from 'ngx-toastr';
|
|
33
30
|
import { ToastNoAnimation, provideToastr } from 'ngx-toastr';
|
|
34
31
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
@@ -3877,6 +3874,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
3877
3874
|
}, template: "<div\n class=\"\n gds-display-flex\n gds-flex-column\n gds-gap-xs\n \"\n [ngClass]=\"{ 'gds-gap-xs': state() === 'expanded' }\"\n>\n <div class=\"\n gds-align-items-center\n gds-display-flex\n gds-gap-2xs\n \">\n <gds-icon\n [key]=\"iconKey()\"\n class=\"\n gds-icon-size-xs\n gds-text-primary-primary\n \"\n />\n <span class=\"\n gds-text-body-strong\n gds-text-primary-primary\n label\n \"> {{ label() }} </span>\n @if (btnLabel()) {\n <button\n gds-button\n variant=\"primary\"\n (clicked)=\"actionBtnClick.emit()\"\n >\n {{ btnLabel() }}\n </button>\n }\n <button\n gds-icon-button\n size=\"small\"\n class=\"gds-background-none\"\n aria-label=\"Close\"\n (clicked)=\"state.set('hidden')\"\n >\n <gds-icon\n class=\"\n gds-icon-size-3xs\n icon\n \"\n key=\"line-dismiss\"\n />\n </button>\n </div>\n @if (contentExpanded()) {\n <div\n class=\"content\"\n animate.enter=\"gds-expand-vertical\"\n >\n <ng-content />\n </div>\n }\n</div>\n", styles: ["@layer design-system{:host{--banner-radius: var(--gds-borderRadius-sm)}:host[expanded]{--banner-radius: var(--gds-borderRadius-md)}:host{padding:var(--gds-spacing-2xs);width:100%;background:var(--gds-palette-background-chat);border-radius:var(--banner-radius);display:block}:host[hidden]{display:none}:host .label{margin-right:auto}:host .content{overflow:hidden}}\n"] }]
|
|
3878
3875
|
}], propDecorators: { iconKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconKey", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], btnLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "btnLabel", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }, { type: i0.Output, args: ["stateChange"] }], actionBtnClick: [{ type: i0.Output, args: ["actionBtnClick"] }] } });
|
|
3879
3876
|
|
|
3877
|
+
const DEBOUNCE_DURATION = {
|
|
3878
|
+
instant: 0, // prevent duplicate events that arrive at the exact same time
|
|
3879
|
+
userInput: 300, // user interactions (keyboard input, clicking, etc.)
|
|
3880
|
+
userInputLong: 1000, // longer duration for user interactions that may take more time
|
|
3881
|
+
browserEvent: 300, // browser dispatched events (ResizeObserver, OnScroll, etc.)
|
|
3882
|
+
loadingTimeout: 1000, // invoke an action if loading takes longer than this duration
|
|
3883
|
+
pubsubEvent: 300,
|
|
3884
|
+
pubsubEventLong: 1000
|
|
3885
|
+
};
|
|
3886
|
+
|
|
3880
3887
|
class GdsBreadcrumbsComponent {
|
|
3881
3888
|
ellipsisTmpl = contentChild('ellipsisTmpl', ...(ngDevMode ? [{ debugName: "ellipsisTmpl" }] : /* istanbul ignore next */ []));
|
|
3882
3889
|
path = viewChild('path', ...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
|
|
@@ -3957,6 +3964,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
3957
3964
|
args: [{ selector: 'gds-breadcrumbs', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #ellipsis\n class=\"gds-breadcrumbs_ellipsis-container\"\n>\n <ng-container *ngTemplateOutlet=\"ellipsisTmpl() ?? defaultEllipsisTmpl\" />\n</div>\n<div\n #path\n class=\"gds-breadcrumbs_container\"\n>\n <ng-content />\n</div>\n\n<ng-template #defaultEllipsisTmpl> ... </ng-template>\n", styles: ["@layer design-system{:host{width:100%;display:flex}:host .gds-breadcrumbs_container{display:flex;align-items:center;flex:1;min-width:0}:host .gds-breadcrumbs_ellipsis-container{display:flex;align-items:center;max-width:fit-content;max-height:fit-content}}\n"] }]
|
|
3958
3965
|
}], ctorParameters: () => [], propDecorators: { ellipsisTmpl: [{ type: i0.ContentChild, args: ['ellipsisTmpl', { isSignal: true }] }], path: [{ type: i0.ViewChild, args: ['path', { isSignal: true }] }], ellipsis: [{ type: i0.ViewChild, args: ['ellipsis', { isSignal: true }] }] } });
|
|
3959
3966
|
|
|
3967
|
+
const gdsButtonVariants = ['default', 'primary', 'invisible'];
|
|
3968
|
+
const gdsButtonSizes = ['small', 'default', 'medium', 'large'];
|
|
3969
|
+
|
|
3970
|
+
const ngSelectDropdownPositions = ['auto', 'bottom', 'top', 'left', 'right'];
|
|
3971
|
+
|
|
3972
|
+
const gdsDropdownPositionsX = ['auto', 'left', 'right'];
|
|
3973
|
+
const gdsDropdownPositionsY = ['auto', 'top', 'bottom'];
|
|
3974
|
+
|
|
3975
|
+
const CDN_URL = new InjectionToken('CDN_URL', {
|
|
3976
|
+
factory: () => 'https://cdn.cortoaws.com'
|
|
3977
|
+
});
|
|
3978
|
+
|
|
3979
|
+
const gdsUserPromptSecondaryTextVariants = ['default', 'error'];
|
|
3980
|
+
|
|
3981
|
+
// NOTE: Duplicated from libs/utils/src/types/brand.ts — keep in sync.
|
|
3982
|
+
const GDS_BRANDS = {
|
|
3983
|
+
Corto: 'corto',
|
|
3984
|
+
CortoDark: 'corto dark',
|
|
3985
|
+
LawY: 'lawy',
|
|
3986
|
+
Acctivity: 'acctivity',
|
|
3987
|
+
Leap: 'leap',
|
|
3988
|
+
StandardIntegration: 'standardIntegration'
|
|
3989
|
+
};
|
|
3990
|
+
// Back-compat alias: keeps `import { BrandEnum } from '@corto/gds'` working (see GettingStarted.mdx)
|
|
3991
|
+
// without it being a second nominal `enum`. Exported in both the value and type namespace so both
|
|
3992
|
+
// `BrandEnum.Leap` (value) and `brand: BrandEnum` (type) keep working.
|
|
3993
|
+
const BrandEnum = GDS_BRANDS;
|
|
3994
|
+
|
|
3995
|
+
var GdsContextMenuItemVariantEnum;
|
|
3996
|
+
(function (GdsContextMenuItemVariantEnum) {
|
|
3997
|
+
GdsContextMenuItemVariantEnum["Default"] = "default";
|
|
3998
|
+
GdsContextMenuItemVariantEnum["Radio"] = "radio";
|
|
3999
|
+
GdsContextMenuItemVariantEnum["Check"] = "check";
|
|
4000
|
+
GdsContextMenuItemVariantEnum["Indent"] = "indent";
|
|
4001
|
+
GdsContextMenuItemVariantEnum["DoubleIndent"] = "double-indent";
|
|
4002
|
+
GdsContextMenuItemVariantEnum["Heading"] = "heading";
|
|
4003
|
+
GdsContextMenuItemVariantEnum["Switch"] = "switch";
|
|
4004
|
+
})(GdsContextMenuItemVariantEnum || (GdsContextMenuItemVariantEnum = {}));
|
|
4005
|
+
|
|
3960
4006
|
const chipTypes = [
|
|
3961
4007
|
'current',
|
|
3962
4008
|
'in progress',
|
|
@@ -4046,20 +4092,99 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4046
4092
|
type: Input
|
|
4047
4093
|
}] } });
|
|
4048
4094
|
|
|
4095
|
+
const formatDate = (value, option) => {
|
|
4096
|
+
if (!value) {
|
|
4097
|
+
return undefined;
|
|
4098
|
+
}
|
|
4099
|
+
const isString = typeof value === 'string';
|
|
4100
|
+
if (isString && isNaN(Date.parse(value))) {
|
|
4101
|
+
return undefined;
|
|
4102
|
+
}
|
|
4103
|
+
const dateValue = isString ? new Date(value) : value;
|
|
4104
|
+
return format(dateValue, option);
|
|
4105
|
+
};
|
|
4106
|
+
const shortDate = (value) => formatDate(value, 'P');
|
|
4107
|
+
const shortDateTime = (value) => formatDate(value, 'Pp');
|
|
4108
|
+
const transformDateFormat = (value) => {
|
|
4109
|
+
let dateFormat = value;
|
|
4110
|
+
if (value.includes('yyyy')) {
|
|
4111
|
+
dateFormat = dateFormat.replace('yyyy', 'yy');
|
|
4112
|
+
}
|
|
4113
|
+
else if (value.includes('yy')) {
|
|
4114
|
+
dateFormat = dateFormat.replace('yy', 'y');
|
|
4115
|
+
}
|
|
4116
|
+
if (value.includes('MMMM')) {
|
|
4117
|
+
dateFormat = dateFormat.replace('MMMM', 'MM');
|
|
4118
|
+
}
|
|
4119
|
+
else if (value.includes('MMM')) {
|
|
4120
|
+
dateFormat = dateFormat.replace('MMM', 'M');
|
|
4121
|
+
}
|
|
4122
|
+
else if (value.includes('MM')) {
|
|
4123
|
+
dateFormat = dateFormat.replace('MM', 'mm');
|
|
4124
|
+
}
|
|
4125
|
+
else if (value.includes('M')) {
|
|
4126
|
+
dateFormat = dateFormat.replace('M', 'm');
|
|
4127
|
+
}
|
|
4128
|
+
return dateFormat;
|
|
4129
|
+
};
|
|
4130
|
+
const transformSecondsToDuration = (seconds) => {
|
|
4131
|
+
const duration = intervalToDuration({ start: 0, end: seconds * 1000 });
|
|
4132
|
+
const zeroPad = (val) => String(val).padStart(2, '0');
|
|
4133
|
+
const hours = (duration.days ?? 0) * 24 + (duration.hours ?? 0);
|
|
4134
|
+
const minutes = duration.minutes ?? 0;
|
|
4135
|
+
const secs = duration.seconds ?? 0;
|
|
4136
|
+
return [hours, minutes, secs].map(zeroPad).join(':');
|
|
4137
|
+
};
|
|
4138
|
+
const transformDurationToSeconds = (duration) => {
|
|
4139
|
+
const [hour, minute, second] = duration.split(':');
|
|
4140
|
+
return +hour * 3600 + +minute * 60 + +second;
|
|
4141
|
+
};
|
|
4142
|
+
// can't just use Date.toISOString() as that takes into account
|
|
4143
|
+
// the time zone, so it was using the incorrect date
|
|
4144
|
+
const formatToISO = (date) => {
|
|
4145
|
+
if (!date) {
|
|
4146
|
+
return undefined;
|
|
4147
|
+
}
|
|
4148
|
+
return format(date, "yyyy-MM-dd'T'HH:mm:ss.sss'Z'");
|
|
4149
|
+
};
|
|
4150
|
+
const parseLocalizedDate = (dateString) => {
|
|
4151
|
+
if (navigator.language === 'en-US') {
|
|
4152
|
+
return new Date(dateString);
|
|
4153
|
+
}
|
|
4154
|
+
// parse dd/MM/yyyy date strings for use with Date
|
|
4155
|
+
const split = dateString.split('/');
|
|
4156
|
+
if (split.length !== 3) {
|
|
4157
|
+
throw new Error(`Invalid date ${dateString}`);
|
|
4158
|
+
}
|
|
4159
|
+
const [day, month, year] = split;
|
|
4160
|
+
return new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4163
|
+
const getIconsByPrefix = (prefix) => Object.values(icons).reduce((acc, curr) => {
|
|
4164
|
+
if (curr.name.startsWith(prefix)) {
|
|
4165
|
+
acc.push(curr.name);
|
|
4166
|
+
return acc;
|
|
4167
|
+
}
|
|
4168
|
+
return acc;
|
|
4169
|
+
}, []);
|
|
4170
|
+
|
|
4171
|
+
const GDS_BRAND_VALUES = Object.values(GDS_BRANDS);
|
|
4172
|
+
const isGdsBrand = (value) => value !== null && value !== undefined && GDS_BRAND_VALUES.includes(value);
|
|
4173
|
+
|
|
4049
4174
|
class OnBrandChanged {
|
|
4050
4175
|
#observer;
|
|
4051
4176
|
#cdr = inject(ChangeDetectorRef);
|
|
4052
|
-
brand = signal(
|
|
4053
|
-
brandIsExternal = computed(() => [
|
|
4177
|
+
brand = signal(GDS_BRANDS.Corto, ...(ngDevMode ? [{ debugName: "brand" }] : /* istanbul ignore next */ []));
|
|
4178
|
+
brandIsExternal = computed(() => [GDS_BRANDS.StandardIntegration, GDS_BRANDS.Leap].includes(this.brand()), ...(ngDevMode ? [{ debugName: "brandIsExternal" }] : /* istanbul ignore next */ []));
|
|
4054
4179
|
constructor() {
|
|
4055
|
-
this
|
|
4180
|
+
this.#setBrandFromDocument();
|
|
4056
4181
|
this.onBrandChanged?.();
|
|
4057
4182
|
}
|
|
4058
4183
|
ngOnInit() {
|
|
4059
4184
|
this.#observer = new MutationObserver((mutations) => {
|
|
4060
4185
|
mutations.forEach((mutation) => {
|
|
4061
4186
|
if (mutation.type === 'attributes' && mutation.attributeName === 'brand') {
|
|
4062
|
-
this
|
|
4187
|
+
this.#setBrandFromDocument();
|
|
4063
4188
|
this.onBrandChanged?.();
|
|
4064
4189
|
this.#cdr.markForCheck();
|
|
4065
4190
|
}
|
|
@@ -4067,6 +4192,10 @@ class OnBrandChanged {
|
|
|
4067
4192
|
});
|
|
4068
4193
|
this.#observer.observe(document.body, { attributes: true, attributeFilter: ['brand'] });
|
|
4069
4194
|
}
|
|
4195
|
+
#setBrandFromDocument() {
|
|
4196
|
+
const documentBrand = document.body.getAttribute('brand');
|
|
4197
|
+
this.brand.set(isGdsBrand(documentBrand) ? documentBrand : GDS_BRANDS.Corto);
|
|
4198
|
+
}
|
|
4070
4199
|
ngOnDestroy() {
|
|
4071
4200
|
if (this.#observer) {
|
|
4072
4201
|
this.#observer.disconnect();
|
|
@@ -4386,7 +4515,7 @@ class GdsTooltipComponent extends OnBrandChanged {
|
|
|
4386
4515
|
open = input(false, { ...(ngDevMode ? { debugName: "open" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4387
4516
|
maxWidth = input('100vw', ...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
|
|
4388
4517
|
appendTo = input(this.#document.body, ...(ngDevMode ? [{ debugName: "appendTo" }] : /* istanbul ignore next */ []));
|
|
4389
|
-
tooltipVariation = computed(() => (this.brand() ===
|
|
4518
|
+
tooltipVariation = computed(() => (this.brand() === GDS_BRANDS.CortoDark ? 'dark' : 'light'), ...(ngDevMode ? [{ debugName: "tooltipVariation" }] : /* istanbul ignore next */ []));
|
|
4390
4519
|
tippyDirective = viewChild.required(TippyDirective);
|
|
4391
4520
|
span = viewChild.required('span');
|
|
4392
4521
|
get isOverflowing() {
|
|
@@ -4425,8 +4554,8 @@ class GdsChipComponent extends OnBrandChanged {
|
|
|
4425
4554
|
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : /* istanbul ignore next */ []));
|
|
4426
4555
|
rounded = input(false, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
4427
4556
|
dismissed = new EventEmitter();
|
|
4428
|
-
#backgroundKey = computed(() => (this.brand() ===
|
|
4429
|
-
#textKey = computed(() => (this.brand() ===
|
|
4557
|
+
#backgroundKey = computed(() => (this.brand() === GDS_BRANDS.CortoDark ? 'dark' : 'light'), ...(ngDevMode ? [{ debugName: "#backgroundKey" }] : /* istanbul ignore next */ []));
|
|
4558
|
+
#textKey = computed(() => (this.brand() === GDS_BRANDS.CortoDark ? 'light' : 'dark'), ...(ngDevMode ? [{ debugName: "#textKey" }] : /* istanbul ignore next */ []));
|
|
4430
4559
|
#chipColor = computed(() => this.#getColor(this.color() ?? this.text()), ...(ngDevMode ? [{ debugName: "#chipColor" }] : /* istanbul ignore next */ []));
|
|
4431
4560
|
background = computed(() => GdsChipColorsMap[this.#chipColor()][this.#backgroundKey()], ...(ngDevMode ? [{ debugName: "background" }] : /* istanbul ignore next */ []));
|
|
4432
4561
|
textColor = computed(() => GdsChipColorsMap[this.#chipColor()][this.#textKey()], ...(ngDevMode ? [{ debugName: "textColor" }] : /* istanbul ignore next */ []));
|
|
@@ -4631,7 +4760,7 @@ class GdsContextMenuBaseDirective extends OnBrandChanged {
|
|
|
4631
4760
|
size = input('default', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4632
4761
|
selected = signal(false).asReadonly();
|
|
4633
4762
|
hasChildren = signal(false).asReadonly();
|
|
4634
|
-
tooltipVariation = computed(() => (this.brand() ===
|
|
4763
|
+
tooltipVariation = computed(() => (this.brand() === GDS_BRANDS.CortoDark ? 'dark' : 'light'), ...(ngDevMode ? [{ debugName: "tooltipVariation" }] : /* istanbul ignore next */ []));
|
|
4635
4764
|
variantIcon = computed(() => {
|
|
4636
4765
|
switch (this.variant()) {
|
|
4637
4766
|
case 'check':
|
|
@@ -4908,82 +5037,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
4908
5037
|
type: Output
|
|
4909
5038
|
}] } });
|
|
4910
5039
|
|
|
4911
|
-
const formatDate = (value, option) => {
|
|
4912
|
-
if (!value) {
|
|
4913
|
-
return undefined;
|
|
4914
|
-
}
|
|
4915
|
-
const isString = typeof value === 'string';
|
|
4916
|
-
if (isString && isNaN(Date.parse(value))) {
|
|
4917
|
-
return undefined;
|
|
4918
|
-
}
|
|
4919
|
-
const dateValue = isString ? new Date(value) : value;
|
|
4920
|
-
return format(dateValue, option);
|
|
4921
|
-
};
|
|
4922
|
-
const shortDate = (value) => formatDate(value, 'P');
|
|
4923
|
-
const shortDateTime = (value) => formatDate(value, 'Pp');
|
|
4924
|
-
const transformDateFormat = (value) => {
|
|
4925
|
-
let dateFormat = value;
|
|
4926
|
-
if (value.includes('yyyy')) {
|
|
4927
|
-
dateFormat = dateFormat.replace('yyyy', 'yy');
|
|
4928
|
-
}
|
|
4929
|
-
else if (value.includes('yy')) {
|
|
4930
|
-
dateFormat = dateFormat.replace('yy', 'y');
|
|
4931
|
-
}
|
|
4932
|
-
if (value.includes('MMMM')) {
|
|
4933
|
-
dateFormat = dateFormat.replace('MMMM', 'MM');
|
|
4934
|
-
}
|
|
4935
|
-
else if (value.includes('MMM')) {
|
|
4936
|
-
dateFormat = dateFormat.replace('MMM', 'M');
|
|
4937
|
-
}
|
|
4938
|
-
else if (value.includes('MM')) {
|
|
4939
|
-
dateFormat = dateFormat.replace('MM', 'mm');
|
|
4940
|
-
}
|
|
4941
|
-
else if (value.includes('M')) {
|
|
4942
|
-
dateFormat = dateFormat.replace('M', 'm');
|
|
4943
|
-
}
|
|
4944
|
-
return dateFormat;
|
|
4945
|
-
};
|
|
4946
|
-
const transformSecondsToDuration = (seconds) => {
|
|
4947
|
-
const duration = intervalToDuration({ start: 0, end: seconds * 1000 });
|
|
4948
|
-
const zeroPad = (val) => String(val).padStart(2, '0');
|
|
4949
|
-
const hours = (duration.days ?? 0) * 24 + (duration.hours ?? 0);
|
|
4950
|
-
const minutes = duration.minutes ?? 0;
|
|
4951
|
-
const secs = duration.seconds ?? 0;
|
|
4952
|
-
return [hours, minutes, secs].map(zeroPad).join(':');
|
|
4953
|
-
};
|
|
4954
|
-
const transformDurationToSeconds = (duration) => {
|
|
4955
|
-
const [hour, minute, second] = duration.split(':');
|
|
4956
|
-
return +hour * 3600 + +minute * 60 + +second;
|
|
4957
|
-
};
|
|
4958
|
-
// can't just use Date.toISOString() as that takes into account
|
|
4959
|
-
// the time zone, so it was using the incorrect date
|
|
4960
|
-
const formatToISO = (date) => {
|
|
4961
|
-
if (!date) {
|
|
4962
|
-
return undefined;
|
|
4963
|
-
}
|
|
4964
|
-
return format(date, "yyyy-MM-dd'T'HH:mm:ss.sss'Z'");
|
|
4965
|
-
};
|
|
4966
|
-
const parseLocalizedDate = (dateString) => {
|
|
4967
|
-
if (navigator.language === 'en-US') {
|
|
4968
|
-
return new Date(dateString);
|
|
4969
|
-
}
|
|
4970
|
-
// parse dd/MM/yyyy date strings for use with Date
|
|
4971
|
-
const split = dateString.split('/');
|
|
4972
|
-
if (split.length !== 3) {
|
|
4973
|
-
throw new Error(`Invalid date ${dateString}`);
|
|
4974
|
-
}
|
|
4975
|
-
const [day, month, year] = split;
|
|
4976
|
-
return new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
|
|
4977
|
-
};
|
|
4978
|
-
|
|
4979
|
-
const getIconsByPrefix = (prefix) => Object.values(icons).reduce((acc, curr) => {
|
|
4980
|
-
if (curr.name.startsWith(prefix)) {
|
|
4981
|
-
acc.push(curr.name);
|
|
4982
|
-
return acc;
|
|
4983
|
-
}
|
|
4984
|
-
return acc;
|
|
4985
|
-
}, []);
|
|
4986
|
-
|
|
4987
5040
|
class GdsDatePipe {
|
|
4988
5041
|
transform(value, option) {
|
|
4989
5042
|
if (option === 'short+time') {
|
|
@@ -5143,6 +5196,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
5143
5196
|
type: Output
|
|
5144
5197
|
}] } });
|
|
5145
5198
|
|
|
5199
|
+
// NOTE: Duplicated from libs/utils/src/services/device-detector-signal-service.ts — keep in sync.
|
|
5200
|
+
class DeviceDetectorSignalService extends DeviceDetectorService {
|
|
5201
|
+
resizeObservable$ = fromEvent(window, 'resize');
|
|
5202
|
+
resizeSubscription$;
|
|
5203
|
+
userAgentSignal = signal(navigator.userAgent, ...(ngDevMode ? [{ debugName: "userAgentSignal" }] : /* istanbul ignore next */ []));
|
|
5204
|
+
constructor() {
|
|
5205
|
+
super();
|
|
5206
|
+
this.resizeSubscription$ = this.resizeObservable$
|
|
5207
|
+
.pipe(takeUntilDestroyed())
|
|
5208
|
+
.pipe(debounceTime(DEBOUNCE_DURATION.browserEvent))
|
|
5209
|
+
.subscribe(() => {
|
|
5210
|
+
this.userAgentSignal.set(navigator.userAgent);
|
|
5211
|
+
});
|
|
5212
|
+
}
|
|
5213
|
+
isMobile = computed(() => super.isMobile(this.userAgentSignal()), ...(ngDevMode ? [{ debugName: "isMobile" }] : /* istanbul ignore next */ []));
|
|
5214
|
+
isTablet = computed(() => super.isTablet(this.userAgentSignal()), ...(ngDevMode ? [{ debugName: "isTablet" }] : /* istanbul ignore next */ []));
|
|
5215
|
+
isDesktop = computed(() => super.isDesktop(this.userAgentSignal()), ...(ngDevMode ? [{ debugName: "isDesktop" }] : /* istanbul ignore next */ []));
|
|
5216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DeviceDetectorSignalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5217
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DeviceDetectorSignalService, providedIn: 'root' });
|
|
5218
|
+
}
|
|
5219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DeviceDetectorSignalService, decorators: [{
|
|
5220
|
+
type: Injectable,
|
|
5221
|
+
args: [{ providedIn: 'root' }]
|
|
5222
|
+
}], ctorParameters: () => [] });
|
|
5223
|
+
|
|
5146
5224
|
class GdsDropdownComponent {
|
|
5147
5225
|
#deviceDetectorSvc = inject(DeviceDetectorSignalService);
|
|
5148
5226
|
#elementRef = inject(ElementRef);
|
|
@@ -5238,20 +5316,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
5238
5316
|
}, encapsulation: ViewEncapsulation.None, template: "<div class=\"\n content\n gds-background-white\n gds-display-flex\n gds-gap-2xs\n gds-padding-block-3xs\n\">\n <ng-content />\n</div>\n<div\n class=\"\n cancel\n gds-align-items-center\n gds-background-white\n gds-height-xl\n gds-justify-content-center\n gds-padding-block-3xs\n gds-padding-inline-sm\n gds-text-body-strong\n gds-text-primary\n gds-width-100-parent\n \"\n cdkMenuItem\n>\n <span>{{ 'Core.Button.Cancel' | translate }}</span>\n</div>\n", styles: ["@layer design-system{gds-dropdown .content{overflow:hidden;border-radius:var(--gds-borderRadius-sm);box-shadow:var(--gds-shadow-default);flex-direction:column}gds-dropdown .content[horizontal]{flex-direction:row}gds-dropdown .content{padding-inline:5px}gds-dropdown .cancel{display:none;border-radius:var(--gds-borderRadius-sm);border-bottom-left-radius:var(--gds-borderRadius-2xl);border-bottom-right-radius:var(--gds-borderRadius-2xl);box-shadow:var(--gds-shadow-default)}gds-dropdown[isMobile]{width:100%;margin-block-end:var(--gds-spacing-md);margin-inline:var(--gds-spacing-2xs);display:flex;flex-direction:column;gap:var(--gds-spacing-3xs)}gds-dropdown[isMobile] .content{width:100%;border-top-left-radius:var(--gds-borderRadius-2xl);border-top-right-radius:var(--gds-borderRadius-2xl)}gds-dropdown[isMobile] .cancel{display:flex}.cdk-overlay-container:has(gds-dropdown[isMobile]){display:grid;pointer-events:none;inset:0}.cdk-overlay-container:has(gds-dropdown[isMobile]):before{background-color:var(--gds-pattern-overlay-background-default);inset:0;content:\"\";position:absolute;pointer-events:auto}.cdk-overlay-container:has(gds-dropdown[isMobile]) .cdk-overlay-connected-position-bounding-box{grid-area:1/-1}.cdk-overlay-container:has(gds-dropdown[isMobile]) .cdk-overlay-connected-position-bounding-box:not(:last-of-type){display:none}.cdk-overlay-container:has(gds-dropdown[isMobile]) .cdk-overlay-pane{position:unset!important;transform:unset!important;align-items:center!important}.cdk-overlay-container:has(gds-dropdown[isMobile]):has(gds-dropdown) .cdk-overlay-connected-position-bounding-box{flex-direction:column-reverse!important}}\n"] }]
|
|
5239
5317
|
}], ctorParameters: () => [], propDecorators: { triggerElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerElement", required: false }] }], horizontal: [{ type: i0.Input, args: [{ isSignal: true, alias: "horizontal", required: false }] }], preventMobileStyling: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventMobileStyling", required: false }] }], allowDefaultTabBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowDefaultTabBehavior", required: false }] }], items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CdkMenuItem), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
5240
5318
|
|
|
5241
|
-
const gdsButtonVariants = ['default', 'primary', 'invisible'];
|
|
5242
|
-
const gdsButtonSizes = ['small', 'default', 'medium', 'large'];
|
|
5243
|
-
|
|
5244
|
-
const ngSelectDropdownPositions = ['auto', 'bottom', 'top', 'left', 'right'];
|
|
5245
|
-
|
|
5246
|
-
const gdsDropdownPositionsX = ['auto', 'left', 'right'];
|
|
5247
|
-
const gdsDropdownPositionsY = ['auto', 'top', 'bottom'];
|
|
5248
|
-
|
|
5249
|
-
const CDN_URL = new InjectionToken('CDN_URL', {
|
|
5250
|
-
factory: () => 'https://cdn.cortoaws.com'
|
|
5251
|
-
});
|
|
5252
|
-
|
|
5253
|
-
const gdsUserPromptSecondaryTextVariants = ['default', 'error'];
|
|
5254
|
-
|
|
5255
5319
|
class GdsEmptyStateComponent extends OnBrandChanged {
|
|
5256
5320
|
#cdnUrl = inject(CDN_URL);
|
|
5257
5321
|
variant = input('info-circle', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
@@ -5259,9 +5323,9 @@ class GdsEmptyStateComponent extends OnBrandChanged {
|
|
|
5259
5323
|
compact = input(false, { ...(ngDevMode ? { debugName: "compact" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
5260
5324
|
#supportedBrand = computed(() => {
|
|
5261
5325
|
switch (this.brand()) {
|
|
5262
|
-
case
|
|
5263
|
-
case
|
|
5264
|
-
return
|
|
5326
|
+
case GDS_BRANDS.StandardIntegration:
|
|
5327
|
+
case GDS_BRANDS.CortoDark:
|
|
5328
|
+
return GDS_BRANDS.Corto;
|
|
5265
5329
|
default:
|
|
5266
5330
|
return this.brand();
|
|
5267
5331
|
}
|
|
@@ -6205,6 +6269,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6205
6269
|
}, template: "<gds-dialog-overlay />\n<dialog\n gds-dialog\n class=\"dialog\"\n type=\"slide-left\"\n>\n <ng-template #layoutTmpl>\n <ng-template #container />\n </ng-template>\n</dialog>\n", styles: ["@layer design-system{:host{position:fixed;inset:0}:host .overlay{opacity:.25}:host .dialog{max-width:unset;width:unset;display:flex;flex-direction:column}}\n"] }]
|
|
6206
6270
|
}], propDecorators: { container: [{ type: i0.ViewChild, args: ['container', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
6207
6271
|
|
|
6272
|
+
const computedPrevious = (s) => {
|
|
6273
|
+
let current = null;
|
|
6274
|
+
let previous = untracked(() => s()); // initial value is the current value
|
|
6275
|
+
return computed(() => {
|
|
6276
|
+
current = s();
|
|
6277
|
+
const result = previous;
|
|
6278
|
+
previous = current;
|
|
6279
|
+
return result;
|
|
6280
|
+
});
|
|
6281
|
+
};
|
|
6282
|
+
|
|
6283
|
+
// NOTE: Duplicated from libs/utils/src/types/app.constants.ts (SCREEN_SIZE_BREAKPOINTS only) — keep in sync.
|
|
6284
|
+
// sizes from libs/gds/public/assets/scss/_mixins.scss:65-72
|
|
6285
|
+
const SCREEN_SIZE_BREAKPOINTS = {
|
|
6286
|
+
XS: 0,
|
|
6287
|
+
SM: 600,
|
|
6288
|
+
MD: 900,
|
|
6289
|
+
LG: 1200,
|
|
6290
|
+
XL: 1440
|
|
6291
|
+
};
|
|
6292
|
+
|
|
6293
|
+
// NOTE: Duplicated from libs/utils/src/functions/screen-breakpoints.ts — keep in sync.
|
|
6294
|
+
const getScreenSize$ = (breakpoint) => inject(BreakpointObserver)
|
|
6295
|
+
.observe(`(max-width: ${SCREEN_SIZE_BREAKPOINTS[breakpoint]}px)`)
|
|
6296
|
+
.pipe(map((result) => result.matches));
|
|
6297
|
+
const getScreenSizeSignal = (breakpoint) => toSignal(getScreenSize$(breakpoint), { initialValue: false });
|
|
6298
|
+
|
|
6208
6299
|
class GdsCollapsibleAsideLayoutComponent {
|
|
6209
6300
|
#dialogSvc = inject(GdsDialogService);
|
|
6210
6301
|
collapsed = input(undefined, { ...(ngDevMode ? { debugName: "collapsed" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -6334,6 +6425,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
6334
6425
|
}, template: "<ul class=\"\n gds-display-flex\n gds-flex-column\n gds-gap-2xs\n gds-margin-0\n gds-padding-0\n\">\n <ng-content />\n</ul>\n<ul class=\"\n gds-display-flex\n gds-flex-column\n gds-gap-2xs\n gds-margin-0\n gds-margin-block-start-auto\n gds-padding-0\n\">\n <ng-content select=\"[menu-bottom]\" />\n</ul>\n", styles: ["@layer design-system{:host{box-shadow:-3px 0 4px #00000012 inset;border-right:.5px solid var(--gds-palette-border-default)}}\n"] }]
|
|
6335
6426
|
}] });
|
|
6336
6427
|
|
|
6428
|
+
const CDK_MENU_CONNECTED_POSITIONS = [
|
|
6429
|
+
{
|
|
6430
|
+
originX: 'center',
|
|
6431
|
+
originY: 'bottom',
|
|
6432
|
+
overlayX: 'center',
|
|
6433
|
+
overlayY: 'top',
|
|
6434
|
+
offsetY: 4
|
|
6435
|
+
},
|
|
6436
|
+
{
|
|
6437
|
+
originX: 'center',
|
|
6438
|
+
originY: 'top',
|
|
6439
|
+
overlayX: 'center',
|
|
6440
|
+
overlayY: 'bottom',
|
|
6441
|
+
offsetY: -4
|
|
6442
|
+
},
|
|
6443
|
+
{
|
|
6444
|
+
originX: 'end',
|
|
6445
|
+
originY: 'bottom',
|
|
6446
|
+
overlayX: 'end',
|
|
6447
|
+
overlayY: 'top',
|
|
6448
|
+
offsetY: 4
|
|
6449
|
+
},
|
|
6450
|
+
{
|
|
6451
|
+
originX: 'end',
|
|
6452
|
+
originY: 'top',
|
|
6453
|
+
overlayX: 'end',
|
|
6454
|
+
overlayY: 'bottom',
|
|
6455
|
+
offsetY: -4
|
|
6456
|
+
}
|
|
6457
|
+
];
|
|
6458
|
+
const CDK_MENU_CONNECTED_POSITIONS_TOP = [
|
|
6459
|
+
{
|
|
6460
|
+
originX: 'center',
|
|
6461
|
+
originY: 'top',
|
|
6462
|
+
overlayX: 'center',
|
|
6463
|
+
overlayY: 'bottom',
|
|
6464
|
+
offsetY: -4
|
|
6465
|
+
},
|
|
6466
|
+
{
|
|
6467
|
+
originX: 'center',
|
|
6468
|
+
originY: 'bottom',
|
|
6469
|
+
overlayX: 'center',
|
|
6470
|
+
overlayY: 'top',
|
|
6471
|
+
offsetY: 4
|
|
6472
|
+
},
|
|
6473
|
+
{
|
|
6474
|
+
originX: 'end',
|
|
6475
|
+
originY: 'bottom',
|
|
6476
|
+
overlayX: 'end',
|
|
6477
|
+
overlayY: 'top',
|
|
6478
|
+
offsetY: 4
|
|
6479
|
+
},
|
|
6480
|
+
{
|
|
6481
|
+
originX: 'end',
|
|
6482
|
+
originY: 'top',
|
|
6483
|
+
overlayX: 'end',
|
|
6484
|
+
overlayY: 'bottom',
|
|
6485
|
+
offsetY: -4
|
|
6486
|
+
}
|
|
6487
|
+
];
|
|
6488
|
+
/** for use when the context menu is close to the right side of the container
|
|
6489
|
+
* so that it doesn't go over the edge, per UX
|
|
6490
|
+
*/
|
|
6491
|
+
const CDK_MENU_CONNECTED_POSITIONS_CONTAINER_RIGHT = [
|
|
6492
|
+
{
|
|
6493
|
+
originX: 'end',
|
|
6494
|
+
originY: 'bottom',
|
|
6495
|
+
overlayX: 'end',
|
|
6496
|
+
overlayY: 'top',
|
|
6497
|
+
offsetY: 4
|
|
6498
|
+
},
|
|
6499
|
+
{
|
|
6500
|
+
originX: 'end',
|
|
6501
|
+
originY: 'top',
|
|
6502
|
+
overlayX: 'end',
|
|
6503
|
+
overlayY: 'bottom',
|
|
6504
|
+
offsetY: -4
|
|
6505
|
+
}
|
|
6506
|
+
];
|
|
6507
|
+
/** for use when the context menu is close to the left side of the container
|
|
6508
|
+
* so that it doesn't go over the edge, per UX
|
|
6509
|
+
*/
|
|
6510
|
+
const CDK_MENU_CONNECTED_POSITIONS_CONTAINER_LEFT = [
|
|
6511
|
+
{
|
|
6512
|
+
originX: 'start',
|
|
6513
|
+
originY: 'bottom',
|
|
6514
|
+
overlayX: 'start',
|
|
6515
|
+
overlayY: 'top',
|
|
6516
|
+
offsetY: 4
|
|
6517
|
+
},
|
|
6518
|
+
{
|
|
6519
|
+
originX: 'start',
|
|
6520
|
+
originY: 'top',
|
|
6521
|
+
overlayX: 'start',
|
|
6522
|
+
overlayY: 'bottom',
|
|
6523
|
+
offsetY: -4
|
|
6524
|
+
}
|
|
6525
|
+
];
|
|
6526
|
+
|
|
6337
6527
|
class GdsNestedSelectComponent extends GdsSignalFormContainer {
|
|
6338
6528
|
#injector = inject(Injector);
|
|
6339
6529
|
#directive = inject(CdkMenuTrigger);
|
|
@@ -7846,9 +8036,61 @@ const provideToaster = (customOptions = {}) => {
|
|
|
7846
8036
|
return provideToastr({ ...defaultOptions, ...customOptions });
|
|
7847
8037
|
};
|
|
7848
8038
|
|
|
8039
|
+
const OPERATING_SYSTEM = {
|
|
8040
|
+
windows: 'windows',
|
|
8041
|
+
mac: 'mac',
|
|
8042
|
+
other: 'other'
|
|
8043
|
+
};
|
|
8044
|
+
const BROWSER = {
|
|
8045
|
+
chrome: 'chrome',
|
|
8046
|
+
firefox: 'firefox',
|
|
8047
|
+
safari: 'safari',
|
|
8048
|
+
edge: 'edge',
|
|
8049
|
+
opera: 'opera',
|
|
8050
|
+
// applewebkit is utilized by Mac Word add-ins
|
|
8051
|
+
applewebkit: 'applewebkit',
|
|
8052
|
+
other: 'other'
|
|
8053
|
+
};
|
|
8054
|
+
|
|
8055
|
+
// NOTE: Duplicated from libs/utils/src/functions/navigator-detection.functions.ts — keep in sync.
|
|
8056
|
+
const getOperatingSystem = () => {
|
|
8057
|
+
const userAgent = navigator.userAgent;
|
|
8058
|
+
if (userAgent.includes('Win')) {
|
|
8059
|
+
return OPERATING_SYSTEM.windows;
|
|
8060
|
+
}
|
|
8061
|
+
else if (userAgent.includes('Mac')) {
|
|
8062
|
+
return OPERATING_SYSTEM.mac;
|
|
8063
|
+
}
|
|
8064
|
+
return OPERATING_SYSTEM.other;
|
|
8065
|
+
};
|
|
8066
|
+
const getBrowser = () => {
|
|
8067
|
+
const userAgent = navigator.userAgent;
|
|
8068
|
+
// The order of these are essential because certain browsers such as Edge use the
|
|
8069
|
+
// chrome browser engine and include both "Chrome" and "Edg/" in the userAgent.
|
|
8070
|
+
if (userAgent.includes('Edg/')) {
|
|
8071
|
+
return BROWSER.edge;
|
|
8072
|
+
}
|
|
8073
|
+
else if (userAgent.includes('Opera') || userAgent.includes('OPR')) {
|
|
8074
|
+
return BROWSER.opera;
|
|
8075
|
+
}
|
|
8076
|
+
else if (userAgent.includes('Chrome')) {
|
|
8077
|
+
return BROWSER.chrome;
|
|
8078
|
+
}
|
|
8079
|
+
else if (userAgent.includes('Firefox')) {
|
|
8080
|
+
return BROWSER.firefox;
|
|
8081
|
+
}
|
|
8082
|
+
else if (userAgent.includes('Safari')) {
|
|
8083
|
+
return BROWSER.safari;
|
|
8084
|
+
}
|
|
8085
|
+
else if (userAgent.includes('AppleWebKit')) {
|
|
8086
|
+
return BROWSER.applewebkit;
|
|
8087
|
+
}
|
|
8088
|
+
return BROWSER.other;
|
|
8089
|
+
};
|
|
8090
|
+
|
|
7849
8091
|
class GdsModule {
|
|
7850
8092
|
static forRoot({ brand, env }) {
|
|
7851
|
-
document.body.setAttribute('brand',
|
|
8093
|
+
document.body.setAttribute('brand', brand ?? GDS_BRANDS.Corto);
|
|
7852
8094
|
document.body.setAttribute('operating-system', getOperatingSystem());
|
|
7853
8095
|
document.body.setAttribute('browser', getBrowser());
|
|
7854
8096
|
let cdnUrl = 'https://cdn.cortoaws.com';
|
|
@@ -7952,5 +8194,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
7952
8194
|
* Generated bundle index. Do not edit.
|
|
7953
8195
|
*/
|
|
7954
8196
|
|
|
7955
|
-
export { CDN_URL, CONTACT_INITIALS_REGEX, GDS_EMPTY_STATE_VARIANTS, GdsAccountingService, GdsAutoRoundCurrencyDirective, GdsAutofocusDirective, GdsAvatarComponent, GdsBadgeColorType, GdsBadgeComponent, GdsBadgeVariantType, GdsBannerComponent, GdsBreadcrumbsComponent, GdsBuildOptionConfigPipe, GdsButtonComponent, GdsButtonRadioOptionComponent, GdsChatExpandableListComponent, GdsChatPromptComponent, GdsChatSuggestionComponent, GdsCheckboxComponent, GdsChipColorsMap, GdsChipComponent, GdsCollapsibleAsideLayoutComponent, GdsCompositeOptionPrimaryDirective, GdsCompositeOptionSecondaryDirective, GdsContextMenuHeadingComponent, GdsContextMenuItemComponent, GdsContextMenuSwitchComponent, GdsDateInputComponent, GdsDatePipe, GdsDialogBaseDirective, GdsDialogComponent, GdsDialogOverlayComponent, GdsDialogService, GdsDoctypeService, GdsDoctypeToIconPipe, GdsDocumentItemComponent, GdsDropdownComponent, GdsEmptyStateComponent, GdsFeatureBlockComponent, GdsFeedbackButtonComponent, GdsFileUploadComponent, GdsFilenameToIconPipe, GdsFilterChipComponent, GdsFocusOnInitDirective, GdsFormControlComponent, GdsHistoryComponent, GdsIconButtonComponent, GdsIconComponent, GdsIconDoctypeComponent, GdsIconService, GdsInputAutocompleteDirective, GdsItemDisplayComponent, GdsKeyboardNavigationHost, GdsKeyboardNavigationItem, GdsListboxCompositeOptionDirective, GdsListboxDirective, GdsListboxOptionDirective, GdsLoadingCarouselComponent, GdsMapArrayToRadioOptionsPipe, GdsMathFloorPipe, GdsMathMaxPipe, GdsMathMinPipe, GdsMessageInputComponent, GdsModule, GdsNativeInputDirective, GdsNativeTextareaDirective, GdsNavAsideComponent, GdsNavAsideItemComponent, GdsNestedSelectComponent, GdsProgressBarComponent, GdsRadioComponent, GdsRadioOptionDirective, GdsReferenceComponent, GdsReferenceLinkComponent, GdsRegexFilterDirective, GdsResizedDirective, GdsResizedEvent, GdsResponseComponent, GdsScrollOutOfViewDirective, GdsScrollOutOfViewScrollStatus, GdsScrollOutOfViewService, GdsScrollToBottomDirective, GdsScrollToFirstInvalidDirective, GdsSearchBarComponent, GdsSelectComponent, GdsSelectOnFocusDirective, GdsSidebarItemBodyComponent, GdsSidebarItemComponent, GdsSkeletonLoadingComponent, GdsSliderComponent, GdsSpinnerComponent, GdsSplitButtonComponent, GdsSvgIconPipe, GdsSwitchComponent, GdsTextInputComponent, GdsTextareaComponent, GdsTimelineItemComponent, GdsToastComponent, GdsTooltipComponent, GdsTreeViewListItemComponent, GdsUserPromptService, GdsVirtualScrollListboxDirective, MapperPipe, OnBrandChanged, RoundMode, TreeViewListItemDirective, chipColor, chipSize, chipTypes, chipWidth, formatToISO, gdsButtonSizes, gdsButtonVariants, gdsDropdownPositionsX, gdsDropdownPositionsY, gdsSelectWidths, gdsServices, gdsUserPromptSecondaryTextVariants, getIconsByPrefix, ngSelectDropdownPositions, parseLocalizedDate, provideToaster, shortDate, shortDateTime, transformDateFormat, transformDurationToSeconds, transformSecondsToDuration };
|
|
8197
|
+
export { BrandEnum, CDN_URL, CONTACT_INITIALS_REGEX, GDS_BRANDS, GDS_EMPTY_STATE_VARIANTS, GdsAccountingService, GdsAutoRoundCurrencyDirective, GdsAutofocusDirective, GdsAvatarComponent, GdsBadgeColorType, GdsBadgeComponent, GdsBadgeVariantType, GdsBannerComponent, GdsBreadcrumbsComponent, GdsBuildOptionConfigPipe, GdsButtonComponent, GdsButtonRadioOptionComponent, GdsChatExpandableListComponent, GdsChatPromptComponent, GdsChatSuggestionComponent, GdsCheckboxComponent, GdsChipColorsMap, GdsChipComponent, GdsCollapsibleAsideLayoutComponent, GdsCompositeOptionPrimaryDirective, GdsCompositeOptionSecondaryDirective, GdsContextMenuHeadingComponent, GdsContextMenuItemComponent, GdsContextMenuItemVariantEnum, GdsContextMenuSwitchComponent, GdsDateInputComponent, GdsDatePipe, GdsDialogBaseDirective, GdsDialogComponent, GdsDialogOverlayComponent, GdsDialogService, GdsDoctypeService, GdsDoctypeToIconPipe, GdsDocumentItemComponent, GdsDropdownComponent, GdsEmptyStateComponent, GdsFeatureBlockComponent, GdsFeedbackButtonComponent, GdsFileUploadComponent, GdsFilenameToIconPipe, GdsFilterChipComponent, GdsFocusOnInitDirective, GdsFormControlComponent, GdsHistoryComponent, GdsIconButtonComponent, GdsIconComponent, GdsIconDoctypeComponent, GdsIconService, GdsInputAutocompleteDirective, GdsItemDisplayComponent, GdsKeyboardNavigationHost, GdsKeyboardNavigationItem, GdsListboxCompositeOptionDirective, GdsListboxDirective, GdsListboxOptionDirective, GdsLoadingCarouselComponent, GdsMapArrayToRadioOptionsPipe, GdsMathFloorPipe, GdsMathMaxPipe, GdsMathMinPipe, GdsMessageInputComponent, GdsModule, GdsNativeInputDirective, GdsNativeTextareaDirective, GdsNavAsideComponent, GdsNavAsideItemComponent, GdsNestedSelectComponent, GdsProgressBarComponent, GdsRadioComponent, GdsRadioOptionDirective, GdsReferenceComponent, GdsReferenceLinkComponent, GdsRegexFilterDirective, GdsResizedDirective, GdsResizedEvent, GdsResponseComponent, GdsScrollOutOfViewDirective, GdsScrollOutOfViewScrollStatus, GdsScrollOutOfViewService, GdsScrollToBottomDirective, GdsScrollToFirstInvalidDirective, GdsSearchBarComponent, GdsSelectComponent, GdsSelectOnFocusDirective, GdsSidebarItemBodyComponent, GdsSidebarItemComponent, GdsSkeletonLoadingComponent, GdsSliderComponent, GdsSpinnerComponent, GdsSplitButtonComponent, GdsSvgIconPipe, GdsSwitchComponent, GdsTextInputComponent, GdsTextareaComponent, GdsTimelineItemComponent, GdsToastComponent, GdsTooltipComponent, GdsTreeViewListItemComponent, GdsUserPromptService, GdsVirtualScrollListboxDirective, MapperPipe, OnBrandChanged, RoundMode, TreeViewListItemDirective, chipColor, chipSize, chipTypes, chipWidth, formatToISO, gdsButtonSizes, gdsButtonVariants, gdsDropdownPositionsX, gdsDropdownPositionsY, gdsSelectWidths, gdsServices, gdsUserPromptSecondaryTextVariants, getIconsByPrefix, isGdsBrand, ngSelectDropdownPositions, parseLocalizedDate, provideToaster, shortDate, shortDateTime, transformDateFormat, transformDurationToSeconds, transformSecondsToDuration };
|
|
7956
8198
|
//# sourceMappingURL=corto-ai-gds-angular.mjs.map
|