@progressio_resources/gravity-design-system 1.0.6 → 1.0.8
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/components/gravity-button/gravity-button.component.mjs +22 -0
- package/esm2020/lib/components/gravity-calendar/gravity-calendar.component.mjs +90 -0
- package/esm2020/lib/components/gravity-checkbox/gravity-checkbox.component.mjs +23 -0
- package/esm2020/lib/components/gravity-dropdown-list/gravity-dropdown-list.component.mjs +43 -0
- package/esm2020/lib/components/gravity-icon/gravity-icon.component.mjs +14 -0
- package/esm2020/lib/components/gravity-radio-button/gravity-radio-button.component.mjs +30 -0
- package/esm2020/lib/components/gravity-switch/gravity-switch.component.mjs +17 -0
- package/esm2020/lib/components/gravity-text-field/gravity-text-field.component.mjs +62 -0
- package/esm2020/lib/gravity-design-system.module.mjs +81 -6
- package/esm2020/lib/vendor/gravity-tooltip/gravity-tooltip.component.mjs +205 -0
- package/esm2020/lib/vendor/gravity-tooltip/gravity-tooltip.directive.mjs +480 -0
- package/esm2020/lib/vendor/gravity-tooltip/gravity-tooltip.module.mjs +41 -0
- package/esm2020/lib/vendor/gravity-tooltip/index.mjs +4 -0
- package/esm2020/lib/vendor/gravity-tooltip/options.interface.mjs +2 -0
- package/esm2020/lib/vendor/gravity-tooltip/options.mjs +38 -0
- package/esm2020/lib/vendor/gravity-tooltip/options.service.mjs +7 -0
- package/esm2020/public-api.mjs +12 -3
- package/fesm2015/progressio_resources-gravity-design-system.mjs +1100 -28
- package/fesm2015/progressio_resources-gravity-design-system.mjs.map +1 -1
- package/fesm2020/progressio_resources-gravity-design-system.mjs +1098 -28
- package/fesm2020/progressio_resources-gravity-design-system.mjs.map +1 -1
- package/lib/components/gravity-button/gravity-button.component.d.ts +18 -0
- package/lib/components/gravity-calendar/gravity-calendar.component.d.ts +40 -0
- package/lib/components/gravity-checkbox/gravity-checkbox.component.d.ts +8 -0
- package/lib/components/gravity-dropdown-list/gravity-dropdown-list.component.d.ts +36 -0
- package/lib/components/gravity-icon/gravity-icon.component.d.ts +6 -0
- package/lib/components/gravity-radio-button/gravity-radio-button.component.d.ts +13 -0
- package/lib/components/gravity-switch/gravity-switch.component.d.ts +6 -0
- package/lib/components/gravity-text-field/gravity-text-field.component.d.ts +35 -0
- package/lib/gravity-design-system.module.d.ts +17 -2
- package/lib/vendor/gravity-tooltip/gravity-tooltip.component.d.ts +42 -0
- package/lib/vendor/gravity-tooltip/gravity-tooltip.directive.d.ts +112 -0
- package/lib/vendor/gravity-tooltip/gravity-tooltip.module.d.ts +12 -0
- package/lib/vendor/gravity-tooltip/index.d.ts +3 -0
- package/lib/vendor/gravity-tooltip/options.d.ts +24 -0
- package/lib/vendor/gravity-tooltip/options.interface.d.ts +40 -0
- package/lib/vendor/gravity-tooltip/options.service.d.ts +7 -0
- package/package.json +9 -2
- package/public-api.d.ts +9 -2
- package/src/lib/assets/icons/calendar.svg +14 -0
- package/src/lib/assets/icons/check.svg +3 -0
- package/src/lib/assets/icons/copy.svg +8 -0
- package/src/lib/assets/icons/download.svg +7 -0
- package/src/lib/assets/icons/edit.svg +8 -0
- package/src/lib/assets/icons/eye_closed.svg +8 -0
- package/src/lib/assets/icons/eye_open.svg +6 -0
- package/src/lib/assets/icons/forgot_password.svg +7 -0
- package/src/lib/assets/icons/lock.svg +6 -0
- package/src/lib/assets/icons/logout.svg +9 -0
- package/src/lib/assets/icons/mail.svg +6 -0
- package/src/lib/assets/icons/radio-off.svg +3 -0
- package/src/lib/assets/icons/radio-on.svg +3 -0
- package/src/lib/assets/icons/search.svg +8 -0
- package/src/lib/assets/icons/settings.svg +12 -0
- package/src/lib/assets/icons/show_less.svg +6 -0
- package/src/lib/assets/icons/show_more.svg +6 -0
- package/src/lib/assets/icons/uncheck.svg +3 -0
- package/src/lib/assets/icons/user.svg +6 -0
- package/src/lib/assets/icons/x.svg +6 -0
- package/src/lib/assets/json/icons.json +91 -0
- package/src/lib/styles/_card_highlight.scss +40 -0
- package/src/lib/styles/_datepicker.scss +101 -0
- package/src/lib/styles/_link.scss +25 -0
- package/src/lib/styles/_shared.scss +19 -0
- package/src/lib/styles/fundamentals/colors/themes/_hero.theme.scss +13 -10
- package/src/lib/styles/fundamentals/colors/tokens/_hero.tokens.scss +15 -13
- package/src/lib/styles/fundamentals/typography/_hero.typography.scss +0 -1
- package/src/lib/styles/gravity-design-system.scss +6 -0
- package/src/lib/styles/overwrite/pretty-checkbox/_core.scss +120 -0
- package/src/lib/styles/overwrite/pretty-checkbox/_variables.scss +39 -0
- package/src/lib/styles/overwrite/pretty-checkbox/elements/default/_outline.scss +41 -0
- package/src/lib/styles/overwrite/pretty-checkbox/elements/switch/_fill.scss +7 -0
- package/src/lib/styles/overwrite/pretty-checkbox/elements/switch/_general.scss +47 -0
- package/src/lib/styles/overwrite/pretty-checkbox/elements/switch/_mixin.scss +15 -0
- package/src/lib/styles/overwrite/pretty-checkbox/pretty-checkbox.scss +29 -0
- package/src/lib/vendor/gravity-tooltip/gravity-tooltip.component.html +9 -0
- package/src/lib/vendor/gravity-tooltip/gravity-tooltip.component.sass +134 -0
- package/src/lib/vendor/gravity-tooltip/gravity-tooltip.component.ts +215 -0
- package/src/lib/vendor/gravity-tooltip/gravity-tooltip.directive.ts +506 -0
- package/src/lib/vendor/gravity-tooltip/gravity-tooltip.module.ts +33 -0
- package/src/lib/vendor/gravity-tooltip/index.ts +3 -0
- package/src/lib/vendor/gravity-tooltip/options.interface.ts +37 -0
- package/src/lib/vendor/gravity-tooltip/options.service.ts +8 -0
- package/src/lib/vendor/gravity-tooltip/options.ts +38 -0
- package/esm2020/lib/gravity-design-system.component.mjs +0 -19
- package/esm2020/lib/gravity-design-system.service.mjs +0 -11
- package/lib/gravity-design-system.component.d.ts +0 -5
- package/lib/gravity-design-system.service.d.ts +0 -5
|
@@ -1,45 +1,1117 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Component, Input, EventEmitter, Output, ViewChild, HostBinding, HostListener, InjectionToken, Directive, Optional, Inject, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i3 from '@angular/forms';
|
|
6
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i1 from 'angular-svg-icon';
|
|
8
|
+
import { AngularSvgIconModule } from 'angular-svg-icon';
|
|
9
|
+
import * as i4 from '@ng-select/ng-select';
|
|
10
|
+
import { NgSelectModule } from '@ng-select/ng-select';
|
|
11
|
+
import * as i2$1 from 'angular-svg-icon-preloader';
|
|
12
|
+
import { AngularSvgIconPreloaderModule } from 'angular-svg-icon-preloader';
|
|
13
|
+
import * as i3$1 from '@ng-bootstrap/ng-bootstrap';
|
|
14
|
+
import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap';
|
|
15
|
+
import * as i1$1 from 'ngx-pretty-checkbox';
|
|
16
|
+
import { NgxPrettyCheckboxModule } from 'ngx-pretty-checkbox';
|
|
3
17
|
|
|
4
|
-
class
|
|
18
|
+
class GravityButtonComponent {
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
this.data.isLoading = false;
|
|
21
|
+
this.data.disabled = false;
|
|
22
|
+
if (this.data.icon) {
|
|
23
|
+
this.data.icon.placement = this.data.icon.placement ? this.data.icon.placement : 'left';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
5
26
|
}
|
|
6
|
-
|
|
7
|
-
GravityDesignSystemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityDesignSystemService, providedIn: 'root' });
|
|
8
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type:
|
|
9
|
-
type:
|
|
10
|
-
args: [{ providedIn: 'root' }]
|
|
11
|
-
}]
|
|
27
|
+
GravityButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
+
GravityButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityButtonComponent, selector: "gravity-button", inputs: { data: "data" }, ngImport: i0, template: "<button [attr.data-cy]=\"data.cypressTag\" class=\"gravity-button-{{data.type}} gravity-size-{{data.size}}\"\n [disabled]=\"data.disabled\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <ng-content></ng-content>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n</button>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n", styles: [".gravity-button,.gravity-button-style,.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,.gravity-button-alternative:not([disabled]),.gravity-button-negative:not([disabled]),.gravity-button-positive:not([disabled]),.gravity-button-tertiary:not([disabled]),.gravity-button-secondary:not([disabled]),.gravity-button-primary:not([disabled]){align-items:center;display:flex;border-style:solid;border-width:.125rem;border-radius:.625rem;box-shadow:0 3px 6px #00000029;font-size:.9375rem;font-weight:700;height:var(--button-height);justify-content:center;min-width:-moz-fit-content;min-width:fit-content;width:11rem}.gravity-button.gravity-size-md,.gravity-size-md.gravity-button-style,.gravity-size-md.gravity-button-disabled:not([disabled]),.gravity-size-md.gravity-button-alternative:not([disabled]),.gravity-size-md.gravity-button-negative:not([disabled]),.gravity-size-md.gravity-button-positive:not([disabled]),.gravity-size-md.gravity-button-tertiary:not([disabled]),.gravity-size-md.gravity-button-secondary:not([disabled]),.gravity-size-md.gravity-button-primary:not([disabled]){--button-height: 2.75rem}.gravity-button.gravity-size-sm,.gravity-size-sm.gravity-button-style,.gravity-size-sm.gravity-button-disabled:not([disabled]),.gravity-size-sm.gravity-button-alternative:not([disabled]),.gravity-size-sm.gravity-button-negative:not([disabled]),.gravity-size-sm.gravity-button-positive:not([disabled]),.gravity-size-sm.gravity-button-tertiary:not([disabled]),.gravity-size-sm.gravity-button-secondary:not([disabled]),.gravity-size-sm.gravity-button-primary:not([disabled]){--button-height: 2rem}.gravity-button svg-icon,.gravity-button-style svg-icon,.gravity-button-disabled:not([disabled]) svg-icon,.gravity-button[disabled] svg-icon,[disabled].gravity-button-style svg-icon,.gravity-button-alternative:not([disabled]) svg-icon,.gravity-button-negative:not([disabled]) svg-icon,.gravity-button-positive:not([disabled]) svg-icon,.gravity-button-tertiary:not([disabled]) svg-icon,.gravity-button-secondary:not([disabled]) svg-icon,.gravity-button-primary:not([disabled]) svg-icon{height:1rem;line-height:0;width:1rem}.gravity-button svg-icon.placement-left,.gravity-button-style svg-icon.placement-left,.gravity-button-disabled:not([disabled]) svg-icon.placement-left,.gravity-button-alternative:not([disabled]) svg-icon.placement-left,.gravity-button-negative:not([disabled]) svg-icon.placement-left,.gravity-button-positive:not([disabled]) svg-icon.placement-left,.gravity-button-tertiary:not([disabled]) svg-icon.placement-left,.gravity-button-secondary:not([disabled]) svg-icon.placement-left,.gravity-button-primary:not([disabled]) svg-icon.placement-left{margin-right:.5rem}.gravity-button svg-icon.placement-right,.gravity-button-style svg-icon.placement-right,.gravity-button-disabled:not([disabled]) svg-icon.placement-right,.gravity-button-alternative:not([disabled]) svg-icon.placement-right,.gravity-button-negative:not([disabled]) svg-icon.placement-right,.gravity-button-positive:not([disabled]) svg-icon.placement-right,.gravity-button-tertiary:not([disabled]) svg-icon.placement-right,.gravity-button-secondary:not([disabled]) svg-icon.placement-right,.gravity-button-primary:not([disabled]) svg-icon.placement-right{margin-left:.5rem}.gravity-button-style,.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,.gravity-button-alternative:not([disabled]),.gravity-button-negative:not([disabled]),.gravity-button-positive:not([disabled]),.gravity-button-tertiary:not([disabled]),.gravity-button-secondary:not([disabled]),.gravity-button-primary:not([disabled]){background-color:var(--button-background-color);border-color:var(--button-border-color)}.gravity-button-style,.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,.gravity-button-alternative:not([disabled]),.gravity-button-negative:not([disabled]),.gravity-button-positive:not([disabled]),.gravity-button-tertiary:not([disabled]),.gravity-button-secondary:not([disabled]),.gravity-button-primary:not([disabled]),.gravity-button-style p,.gravity-button-disabled:not([disabled]) p,.gravity-button[disabled] p,[disabled].gravity-button-style p,.gravity-button-alternative:not([disabled]) p,.gravity-button-negative:not([disabled]) p,.gravity-button-positive:not([disabled]) p,.gravity-button-tertiary:not([disabled]) p,.gravity-button-secondary:not([disabled]) p,.gravity-button-primary:not([disabled]) p{color:var(--button-text-color)}.gravity-button-style svg-icon ::ng-deep svg,.gravity-button-disabled:not([disabled]) svg-icon ::ng-deep svg,.gravity-button[disabled] svg-icon ::ng-deep svg,[disabled].gravity-button-style svg-icon ::ng-deep svg,.gravity-button-alternative:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-negative:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-positive:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-tertiary:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-secondary:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-primary:not([disabled]) svg-icon ::ng-deep svg{--icon-color: var(--button-text-color)}.gravity-button-primary:not([disabled]){--button-background-color: var(--bg-button-active-primary);--button-border-color: var(--bg-button-active-primary);--button-text-color: var(--on-bg-button-active-primary)}.gravity-button-primary:not([disabled]):hover{--button-background-color: var(--bg-button-hover-primary);--button-border-color: var(--bg-button-hover-primary);--button-text-color: var(--on-bg-button-hover-primary)}.gravity-button-primary:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-primary);--button-border-color: var(--bg-button-pressed-primary);--button-text-color: var(--on-bg-button-pressed-primary)}.gravity-button-secondary:not([disabled]){--button-background-color: var(--bg-button-active-secondary);--button-border-color: var(--outline-button-active-secondary);--button-text-color: var(--on-bg-button-active-secondary)}.gravity-button-secondary:not([disabled]):hover{--button-background-color: var(--bg-button-hover-secondary);--button-border-color: var(--outline-button-hover-secondary);--button-text-color: var(--on-bg-button-hover-secondary)}.gravity-button-secondary:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-secondary);--button-border-color: var(--outline-button-pressed-secondary);--button-text-color: var(--on-bg-button-pressed-secondary)}.gravity-button-tertiary:not([disabled]){--button-background-color: var(--bg-button-active-tertiary);--button-border-color: var(--bg-button-active-tertiary);--button-text-color: var(--on-bg-button-active-tertiary)}.gravity-button-tertiary:not([disabled]):hover{--button-background-color: var(--bg-button-hover-tertiary);--button-border-color: var(--bg-button-hover-tertiary);--button-text-color: var(--on-bg-button-hover-tertiary)}.gravity-button-tertiary:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-tertiary);--button-border-color: var(--bg-button-pressed-tertiary);--button-text-color: var(--on-bg-button-pressed-tertiary)}.gravity-button-positive:not([disabled]){--button-background-color: var(--bg-button-active-positive);--button-border-color: var(--bg-button-active-positive);--button-text-color: var(--on-bg-button-active-positive)}.gravity-button-positive:not([disabled]):hover{--button-background-color: var(--bg-button-hover-positive);--button-border-color: var(--bg-button-hover-positive);--button-text-color: var(--on-bg-button-hover-positive)}.gravity-button-positive:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-positive);--button-border-color: var(--bg-button-pressed-positive);--button-text-color: var(--on-bg-button-pressed-positive)}.gravity-button-negative:not([disabled]){--button-background-color: var(--bg-button-active-negative);--button-border-color: var(--bg-button-active-negative);--button-text-color: var(--on-bg-button-active-negative)}.gravity-button-negative:not([disabled]):hover{--button-background-color: var(--bg-button-hover-negative);--button-border-color: var(--bg-button-hover-negative);--button-text-color: var(--on-bg-button-hover-negative)}.gravity-button-negative:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-negative);--button-border-color: var(--bg-button-pressed-negative);--button-text-color: var(--on-bg-button-pressed-negative)}.gravity-button-alternative:not([disabled]){--button-background-color: var(--bg-button-active-alternative);--button-border-color: var(--bg-button-active-alternative);--button-text-color: var(--on-bg-button-active-alternative)}.gravity-button-alternative:not([disabled]):hover{--button-background-color: var(--bg-button-hover-alternative);--button-border-color: var(--bg-button-hover-alternative);--button-text-color: var(--on-bg-button-hover-alternative)}.gravity-button-alternative:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-alternative);--button-border-color: var(--bg-button-pressed-alternative);--button-text-color: var(--on-bg-button-pressed-alternative)}.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,[disabled].gravity-button-primary:not([disabled]),[disabled].gravity-button-secondary:not([disabled]),[disabled].gravity-button-tertiary:not([disabled]),[disabled].gravity-button-positive:not([disabled]),[disabled].gravity-button-negative:not([disabled]),[disabled].gravity-button-alternative:not([disabled]){--button-background-color: var(--bg-button-disabled);--button-border-color: var(--bg-button-disabled);--button-text-color: var(--on-bg-button-disabled);cursor:default}\n"], dependencies: [{ kind: "component", type: i1.SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "applyCss", "svgClass", "class", "viewBox", "svgAriaLabel", "svgStyle"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityButtonComponent, decorators: [{
|
|
30
|
+
type: Component,
|
|
31
|
+
args: [{ selector: 'gravity-button', template: "<button [attr.data-cy]=\"data.cypressTag\" class=\"gravity-button-{{data.type}} gravity-size-{{data.size}}\"\n [disabled]=\"data.disabled\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <ng-content></ng-content>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n</button>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n", styles: [".gravity-button,.gravity-button-style,.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,.gravity-button-alternative:not([disabled]),.gravity-button-negative:not([disabled]),.gravity-button-positive:not([disabled]),.gravity-button-tertiary:not([disabled]),.gravity-button-secondary:not([disabled]),.gravity-button-primary:not([disabled]){align-items:center;display:flex;border-style:solid;border-width:.125rem;border-radius:.625rem;box-shadow:0 3px 6px #00000029;font-size:.9375rem;font-weight:700;height:var(--button-height);justify-content:center;min-width:-moz-fit-content;min-width:fit-content;width:11rem}.gravity-button.gravity-size-md,.gravity-size-md.gravity-button-style,.gravity-size-md.gravity-button-disabled:not([disabled]),.gravity-size-md.gravity-button-alternative:not([disabled]),.gravity-size-md.gravity-button-negative:not([disabled]),.gravity-size-md.gravity-button-positive:not([disabled]),.gravity-size-md.gravity-button-tertiary:not([disabled]),.gravity-size-md.gravity-button-secondary:not([disabled]),.gravity-size-md.gravity-button-primary:not([disabled]){--button-height: 2.75rem}.gravity-button.gravity-size-sm,.gravity-size-sm.gravity-button-style,.gravity-size-sm.gravity-button-disabled:not([disabled]),.gravity-size-sm.gravity-button-alternative:not([disabled]),.gravity-size-sm.gravity-button-negative:not([disabled]),.gravity-size-sm.gravity-button-positive:not([disabled]),.gravity-size-sm.gravity-button-tertiary:not([disabled]),.gravity-size-sm.gravity-button-secondary:not([disabled]),.gravity-size-sm.gravity-button-primary:not([disabled]){--button-height: 2rem}.gravity-button svg-icon,.gravity-button-style svg-icon,.gravity-button-disabled:not([disabled]) svg-icon,.gravity-button[disabled] svg-icon,[disabled].gravity-button-style svg-icon,.gravity-button-alternative:not([disabled]) svg-icon,.gravity-button-negative:not([disabled]) svg-icon,.gravity-button-positive:not([disabled]) svg-icon,.gravity-button-tertiary:not([disabled]) svg-icon,.gravity-button-secondary:not([disabled]) svg-icon,.gravity-button-primary:not([disabled]) svg-icon{height:1rem;line-height:0;width:1rem}.gravity-button svg-icon.placement-left,.gravity-button-style svg-icon.placement-left,.gravity-button-disabled:not([disabled]) svg-icon.placement-left,.gravity-button-alternative:not([disabled]) svg-icon.placement-left,.gravity-button-negative:not([disabled]) svg-icon.placement-left,.gravity-button-positive:not([disabled]) svg-icon.placement-left,.gravity-button-tertiary:not([disabled]) svg-icon.placement-left,.gravity-button-secondary:not([disabled]) svg-icon.placement-left,.gravity-button-primary:not([disabled]) svg-icon.placement-left{margin-right:.5rem}.gravity-button svg-icon.placement-right,.gravity-button-style svg-icon.placement-right,.gravity-button-disabled:not([disabled]) svg-icon.placement-right,.gravity-button-alternative:not([disabled]) svg-icon.placement-right,.gravity-button-negative:not([disabled]) svg-icon.placement-right,.gravity-button-positive:not([disabled]) svg-icon.placement-right,.gravity-button-tertiary:not([disabled]) svg-icon.placement-right,.gravity-button-secondary:not([disabled]) svg-icon.placement-right,.gravity-button-primary:not([disabled]) svg-icon.placement-right{margin-left:.5rem}.gravity-button-style,.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,.gravity-button-alternative:not([disabled]),.gravity-button-negative:not([disabled]),.gravity-button-positive:not([disabled]),.gravity-button-tertiary:not([disabled]),.gravity-button-secondary:not([disabled]),.gravity-button-primary:not([disabled]){background-color:var(--button-background-color);border-color:var(--button-border-color)}.gravity-button-style,.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,.gravity-button-alternative:not([disabled]),.gravity-button-negative:not([disabled]),.gravity-button-positive:not([disabled]),.gravity-button-tertiary:not([disabled]),.gravity-button-secondary:not([disabled]),.gravity-button-primary:not([disabled]),.gravity-button-style p,.gravity-button-disabled:not([disabled]) p,.gravity-button[disabled] p,[disabled].gravity-button-style p,.gravity-button-alternative:not([disabled]) p,.gravity-button-negative:not([disabled]) p,.gravity-button-positive:not([disabled]) p,.gravity-button-tertiary:not([disabled]) p,.gravity-button-secondary:not([disabled]) p,.gravity-button-primary:not([disabled]) p{color:var(--button-text-color)}.gravity-button-style svg-icon ::ng-deep svg,.gravity-button-disabled:not([disabled]) svg-icon ::ng-deep svg,.gravity-button[disabled] svg-icon ::ng-deep svg,[disabled].gravity-button-style svg-icon ::ng-deep svg,.gravity-button-alternative:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-negative:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-positive:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-tertiary:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-secondary:not([disabled]) svg-icon ::ng-deep svg,.gravity-button-primary:not([disabled]) svg-icon ::ng-deep svg{--icon-color: var(--button-text-color)}.gravity-button-primary:not([disabled]){--button-background-color: var(--bg-button-active-primary);--button-border-color: var(--bg-button-active-primary);--button-text-color: var(--on-bg-button-active-primary)}.gravity-button-primary:not([disabled]):hover{--button-background-color: var(--bg-button-hover-primary);--button-border-color: var(--bg-button-hover-primary);--button-text-color: var(--on-bg-button-hover-primary)}.gravity-button-primary:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-primary);--button-border-color: var(--bg-button-pressed-primary);--button-text-color: var(--on-bg-button-pressed-primary)}.gravity-button-secondary:not([disabled]){--button-background-color: var(--bg-button-active-secondary);--button-border-color: var(--outline-button-active-secondary);--button-text-color: var(--on-bg-button-active-secondary)}.gravity-button-secondary:not([disabled]):hover{--button-background-color: var(--bg-button-hover-secondary);--button-border-color: var(--outline-button-hover-secondary);--button-text-color: var(--on-bg-button-hover-secondary)}.gravity-button-secondary:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-secondary);--button-border-color: var(--outline-button-pressed-secondary);--button-text-color: var(--on-bg-button-pressed-secondary)}.gravity-button-tertiary:not([disabled]){--button-background-color: var(--bg-button-active-tertiary);--button-border-color: var(--bg-button-active-tertiary);--button-text-color: var(--on-bg-button-active-tertiary)}.gravity-button-tertiary:not([disabled]):hover{--button-background-color: var(--bg-button-hover-tertiary);--button-border-color: var(--bg-button-hover-tertiary);--button-text-color: var(--on-bg-button-hover-tertiary)}.gravity-button-tertiary:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-tertiary);--button-border-color: var(--bg-button-pressed-tertiary);--button-text-color: var(--on-bg-button-pressed-tertiary)}.gravity-button-positive:not([disabled]){--button-background-color: var(--bg-button-active-positive);--button-border-color: var(--bg-button-active-positive);--button-text-color: var(--on-bg-button-active-positive)}.gravity-button-positive:not([disabled]):hover{--button-background-color: var(--bg-button-hover-positive);--button-border-color: var(--bg-button-hover-positive);--button-text-color: var(--on-bg-button-hover-positive)}.gravity-button-positive:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-positive);--button-border-color: var(--bg-button-pressed-positive);--button-text-color: var(--on-bg-button-pressed-positive)}.gravity-button-negative:not([disabled]){--button-background-color: var(--bg-button-active-negative);--button-border-color: var(--bg-button-active-negative);--button-text-color: var(--on-bg-button-active-negative)}.gravity-button-negative:not([disabled]):hover{--button-background-color: var(--bg-button-hover-negative);--button-border-color: var(--bg-button-hover-negative);--button-text-color: var(--on-bg-button-hover-negative)}.gravity-button-negative:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-negative);--button-border-color: var(--bg-button-pressed-negative);--button-text-color: var(--on-bg-button-pressed-negative)}.gravity-button-alternative:not([disabled]){--button-background-color: var(--bg-button-active-alternative);--button-border-color: var(--bg-button-active-alternative);--button-text-color: var(--on-bg-button-active-alternative)}.gravity-button-alternative:not([disabled]):hover{--button-background-color: var(--bg-button-hover-alternative);--button-border-color: var(--bg-button-hover-alternative);--button-text-color: var(--on-bg-button-hover-alternative)}.gravity-button-alternative:not([disabled]).pressed{--button-background-color: var(--bg-button-pressed-alternative);--button-border-color: var(--bg-button-pressed-alternative);--button-text-color: var(--on-bg-button-pressed-alternative)}.gravity-button-disabled:not([disabled]),.gravity-button[disabled],[disabled].gravity-button-style,[disabled].gravity-button-primary:not([disabled]),[disabled].gravity-button-secondary:not([disabled]),[disabled].gravity-button-tertiary:not([disabled]),[disabled].gravity-button-positive:not([disabled]),[disabled].gravity-button-negative:not([disabled]),[disabled].gravity-button-alternative:not([disabled]){--button-background-color: var(--bg-button-disabled);--button-border-color: var(--bg-button-disabled);--button-text-color: var(--on-bg-button-disabled);cursor:default}\n"] }]
|
|
32
|
+
}], propDecorators: { data: [{
|
|
33
|
+
type: Input
|
|
34
|
+
}] } });
|
|
35
|
+
|
|
36
|
+
class GravityDropdownListComponent {
|
|
37
|
+
constructor() {
|
|
38
|
+
this.selectedIdResponse = new EventEmitter();
|
|
39
|
+
this.dropdownOpen = false;
|
|
40
|
+
}
|
|
41
|
+
ngOnInit() {
|
|
42
|
+
this.data.ngSelectConfig.placeholder = !this.data.ngSelectConfig.placeholder || this.data.ngSelectConfig.placeholder == '' ? 'All' : this.data.ngSelectConfig.placeholder;
|
|
43
|
+
this.data.ngSelectConfig.clearable = !this.data.ngSelectConfig.clearable ? false : this.data.ngSelectConfig.clearable;
|
|
44
|
+
this.data.required = this.data.required ? this.data.required : false;
|
|
45
|
+
this.data.state = this.data.state ? this.data.state : "enabled";
|
|
46
|
+
this.selectedId = this.data.ngSelectConfig.customId ? this.data.ngSelectConfig.items.find((item) => item.id == this.data.ngSelectConfig.customId).id : undefined;
|
|
47
|
+
if (this.selectedId) {
|
|
48
|
+
this.selectedIdResponse.emit(this.selectedId);
|
|
49
|
+
}
|
|
50
|
+
if (this.data.supportText) {
|
|
51
|
+
this.data.supportText.type = this.data.supportText.type ? this.data.supportText.type : "neutro";
|
|
52
|
+
}
|
|
53
|
+
if (this.data.icon) {
|
|
54
|
+
this.data.icon.placement = this.data.icon.placement ? this.data.icon.placement : 'left';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
changeSelectedId(newSelectedItem) {
|
|
58
|
+
this.selectedId = newSelectedItem ? newSelectedItem.id : undefined;
|
|
59
|
+
this.selectedIdResponse.emit(this.selectedId ? this.selectedId : -1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
GravityDropdownListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityDropdownListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
63
|
+
GravityDropdownListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityDropdownListComponent, selector: "gravity-dropdown-list", inputs: { data: "data" }, outputs: { selectedIdResponse: "selectedIdResponse" }, ngImport: i0, template: "<div class=\"gravity-dropdown-list\">\n <label class=\"hr-body-text md-regular {{data.state}}\" [class.empty]=\"!selectedId && !dropdownOpen\"\n [class.focused]=\"dropdownOpen\" [class.full]=\"selectedId && !dropdownOpen\">\n {{data.label}}\n <ng-container *ngIf=\"data.required\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Requerido <span class=\"text-negative\">*</span></ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Required <span class=\"text-negative\">*</span></ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'readonly'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- S\u00F3lo lectura</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Readonly</ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'disabled'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Deshabilitado</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Disabled</ng-container>\n </ng-container>\n </label>\n <div class=\"dropdown-field {{data.state}}\" [class.empty]=\"!selectedId && !dropdownOpen\"\n [class.focused]=\"dropdownOpen\" [class.full]=\"selectedId && !dropdownOpen\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <ng-select [attr.data-cy]=\"data.cypressTag\"\n [clearable]=\"data.ngSelectConfig.clearable\"\n [disabled]=\"data.state == 'disabled' ? true : null\"\n [items]=\"data.ngSelectConfig.items\"\n [placeholder]=\"selectedId ? '' : data.ngSelectConfig.placeholder\"\n [readonly]=\"data.state == 'readonly' ? true : null\"\n\n [(ngModel)]=\"selectedId\"\n\n (change)=\"changeSelectedId($event)\"\n (clear)=\"changeSelectedId()\"\n (close)=\"dropdownOpen = false\"\n (open)=\"dropdownOpen = true\"\n\n bindLabel=\"name\"\n bindValue=\"id\"\n class=\"hr-label md-regular\">\n </ng-select>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n </div>\n <p class=\"hr-body-text sm-regular support-text text-{{data.supportText.type}}\" *ngIf=\"data.supportText\">\n {{data.supportText.content}}\n </p>\n</div>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n\n", styles: ["body{font-family:Roboto Flex,sans-serif;color:var(--text-primary);leading-trim:both;text-edge:cap;font-style:normal;line-height:normal;font-optical-sizing:auto}.hr-body-text.sm-regular{font-size:.75rem;font-weight:400;line-height:1.17525rem;letter-spacing:.01875rem}.hr-body-text.sm-bold{font-size:.75rem;font-weight:650;line-height:1.17525rem;letter-spacing:.01875rem}.hr-body-text.md-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input.hr-body-text{font-size:1rem;font-weight:400;line-height:1.567rem;letter-spacing:.025rem}.hr-body-text.lg-regular{font-size:1.3325rem;font-weight:400;line-height:2.088rem;letter-spacing:.01969rem}.hr-body-text.lg-bold{font-size:1.3325rem;font-weight:700;line-height:1.99106rem;letter-spacing:.01969rem}.hr-title.sm-regular{font-size:1rem;font-weight:420;letter-spacing:.02rem}.hr-title.sm-bold{font-size:1rem;font-weight:731;letter-spacing:.02rem}.hr-title.md-bold{font-size:1.3325rem;font-weight:745;letter-spacing:.02665rem}.hr-title.lg-regular{font-size:1.75rem;font-weight:480;letter-spacing:.02625rem}.hr-title.lg-bold{font-size:1.75rem;font-weight:760}.hr-label.sm-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input.sm-regular{font-size:.75rem;font-weight:343;letter-spacing:.01875rem}.hr-label.sm-bold,.dropdown-field ng-select ::ng-deep .ng-select-container input.sm-bold{font-size:.75rem;font-weight:730;letter-spacing:.01875rem}.hr-label.md-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input{font-size:1rem;font-weight:343;letter-spacing:.03rem}.hr-label.md-bold,.dropdown-field ng-select ::ng-deep .ng-select-container input.md-bold{font-size:1rem;font-weight:700;letter-spacing:.03rem}.hr-label.lg-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input.lg-regular{font-size:1.75rem;font-weight:343;letter-spacing:.04375rem}.hr-label.lg-bold,.dropdown-field ng-select ::ng-deep .ng-select-container input.lg-bold{font-size:1.75rem;font-weight:700;letter-spacing:.04375rem}.hr-headline.sm-bold{font-size:2rem;font-weight:700;letter-spacing:.02rem}.hr-headline.md-bold{font-size:2.375rem;font-weight:700;letter-spacing:.02375rem}.hr-headline.lg-bold{font-size:2.875rem;font-weight:700;letter-spacing:.02875rem}.hr-display.sm-bold{font-size:3.125rem;font-weight:700;letter-spacing:.03125rem}.hr-display.md-bold{font-size:4.1875rem;font-weight:700;letter-spacing:.04188rem}.hr-display.lg-bold{font-size:5.625rem;font-weight:700;letter-spacing:.05625rem}.align-text-center{text-align:center}.text-negative{color:var(--negative-primary)}.text-neutro{color:var(--text-primary)}.text-positive{color:var(--positive-primary)}.support-text{margin-left:0;margin-top:.3125rem;padding-inline:1rem}label{color:var(--text-field-label-color);margin-inline:1rem}label.empty.enabled{--text-field-label-color: var(--label-text-empty-enabled-primary)}label.empty.disabled{--text-field-label-color: var(--label-text-empty-disabled-primary)}label.full.enabled{--text-field-label-color: var(--label-text-full-enabled-primary)}label.full.disabled{--text-field-label-color: var(--label-text-full-disabled-primary)}label.full.readonly{--text-field-label-color: var(--label-text-full-read-only-primary)}label.focused{--text-field-label-color: var(--label-text-full-enabled-pressed-primary)}.dropdown-field{align-items:center;background-color:var(--text-field-dropdown-field-background-color);border:1px solid var(--text-field-dropdown-field-border-color);border-radius:.625rem;cursor:var(--cursor-type);--cursor-type: pointer;display:flex;max-height:2rem;min-height:1.5rem;padding:.625rem 1rem}.dropdown-field.readonly{--cursor-type: text}.dropdown-field.disabled{--cursor-type: initial}.dropdown-field svg-icon{height:1rem;line-height:0;width:1rem}.dropdown-field svg-icon.placement-left{margin-right:.5rem}.dropdown-field svg-icon.placement-right{margin-left:.5rem}.dropdown-field ng-select{width:-webkit-fill-available}.dropdown-field ng-select ::ng-deep .ng-select-container{cursor:var(--cursor-type)!important}.dropdown-field ng-select ::ng-deep .ng-select-container .ng-placeholder{color:var(--text-field-dropdown-field-placeholder-color)}.dropdown-field ng-select ::ng-deep .ng-select-container .ng-value-label{color:var(--text-field-dropdown-field-input-color)}.dropdown-field ng-select ::ng-deep .ng-select-container input{cursor:var(--cursor-type)!important;color:var(--text-field-dropdown-field-input-color)}.dropdown-field ng-select ::ng-deep .ng-select-container input::placeholder{color:var(--text-field-dropdown-field-placeholder-color)}.dropdown-field ng-select ::ng-deep .ng-clear-wrapper .ng-clear{color:var(--clear-icon-color)}.dropdown-field ng-select ::ng-deep .ng-arrow-wrapper .ng-arrow{border-color:var(--arrow-color) transparent transparent;border-style:solid;border-width:.3125rem .3125rem .15625rem}.dropdown-field ng-select ::ng-deep ng-dropdown-panel{background-color:var(--bg-dropdown-list-primary);border:1px solid var(--outline-dropdown-list-primary);border-radius:.625rem;padding-block:.5rem}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option{color:var(--ng-option-color);--ng-option-color: var(--on-bg-dropdown-item-active-primary);padding:.1875rem 1rem}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option.ng-option-selected{font-weight:700;--ng-option-color: var(--on-bg-dropdown-item-pressed-primary)}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option:not(.ng-option-disabled):hover{background-color:var(--bg-dropdown-item-hover-primary);--ng-option-color: var(--on-bg-dropdown-item-hover-primary)}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option.ng-option-disabled{--ng-option-color: var(--on-bg-dropdown-item-disabled-primary)}.dropdown-field.empty.enabled{--arrow-color: var(--placeholder-empty-enabled-primary);--clear-icon-color: var(--placeholder-empty-enabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-empty-enabled-primary);--text-field-dropdown-field-border-color: var(--outline-field-empty-enabled-primary);--text-field-dropdown-field-placeholder-color: var(--placeholder-empty-enabled-primary);--text-field-dropdown-field-input-color: var(--placeholder-empty-enabled-primary)}.dropdown-field.empty.enabled:hover{--text-field-dropdown-field-background-color: var(--bg-field-empty-enabled-hover-primary)}.dropdown-field.empty.disabled{--arrow-color: var(--placeholder-empty-disabled-primary);--clear-icon-color: var(--placeholder-empty-disabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-empty-disabled-primary);--text-field-dropdown-field-border-color: var(--bg-field-empty-disabled-primary);--text-field-dropdown-field-input-color: var(--placeholder-empty-disabled-primary);--text-field-dropdown-field-placeholder-color: var(--placeholder-empty-disabled-primary)}.dropdown-field.empty.disabled svg-icon ::ng-deep svg{--icon-color: var(--placeholder-empty-disabled-primary)}.dropdown-field.full.enabled{--arrow-color: var(--input-text-full-enabled-primary);--clear-icon-color: var(--input-text-full-enabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-enabled-primary);--text-field-dropdown-field-border-color: var(--outline-field-full-enabled-primary);--text-field-dropdown-field-input-color: var(--input-text-full-enabled-primary)}.dropdown-field.full.enabled:hover{--text-field-dropdown-field-background-color: var(--bg-field-full-enabled-hover-primary)}.dropdown-field.full.disabled{--arrow-color: var(--input-text-full-disabled-primary);--clear-icon-color: var(--input-text-full-disabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-disabled-primary);--text-field-dropdown-field-border-color: var(--bg-field-full-disabled-primary);--text-field-dropdown-field-input-color: var(--input-text-full-disabled-primary)}.dropdown-field.full.disabled svg-icon ::ng-deep svg{--icon-color: var(--input-text-full-disabled-primary)}.dropdown-field.readonly{--arrow-color: var(--input-text-full-read-only-primary);--clear-icon-color: var(--input-text-full-read-only-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-read-only-primary);--text-field-dropdown-field-border-color: var(--bg-field-full-read-only-primary);--text-field-dropdown-field-input-color: var(--input-text-full-read-only-primary)}.dropdown-field.focused:not(.readonly){--arrow-color: var(--input-text-full-read-only-primary);--clear-icon-color: var(--input-text-full-read-only-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-enabled-pressed-primary);--text-field-dropdown-field-border-color: var(--outline-field-full-enabled-pressed-primary);--text-field-dropdown-field-input-color: var(--input-text-full-read-only-primary)}\n"], dependencies: [{ kind: "component", type: i1.SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "applyCss", "svgClass", "class", "viewBox", "svgAriaLabel", "svgStyle"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }] });
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityDropdownListComponent, decorators: [{
|
|
65
|
+
type: Component,
|
|
66
|
+
args: [{ selector: 'gravity-dropdown-list', template: "<div class=\"gravity-dropdown-list\">\n <label class=\"hr-body-text md-regular {{data.state}}\" [class.empty]=\"!selectedId && !dropdownOpen\"\n [class.focused]=\"dropdownOpen\" [class.full]=\"selectedId && !dropdownOpen\">\n {{data.label}}\n <ng-container *ngIf=\"data.required\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Requerido <span class=\"text-negative\">*</span></ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Required <span class=\"text-negative\">*</span></ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'readonly'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- S\u00F3lo lectura</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Readonly</ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'disabled'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Deshabilitado</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Disabled</ng-container>\n </ng-container>\n </label>\n <div class=\"dropdown-field {{data.state}}\" [class.empty]=\"!selectedId && !dropdownOpen\"\n [class.focused]=\"dropdownOpen\" [class.full]=\"selectedId && !dropdownOpen\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <ng-select [attr.data-cy]=\"data.cypressTag\"\n [clearable]=\"data.ngSelectConfig.clearable\"\n [disabled]=\"data.state == 'disabled' ? true : null\"\n [items]=\"data.ngSelectConfig.items\"\n [placeholder]=\"selectedId ? '' : data.ngSelectConfig.placeholder\"\n [readonly]=\"data.state == 'readonly' ? true : null\"\n\n [(ngModel)]=\"selectedId\"\n\n (change)=\"changeSelectedId($event)\"\n (clear)=\"changeSelectedId()\"\n (close)=\"dropdownOpen = false\"\n (open)=\"dropdownOpen = true\"\n\n bindLabel=\"name\"\n bindValue=\"id\"\n class=\"hr-label md-regular\">\n </ng-select>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n </div>\n <p class=\"hr-body-text sm-regular support-text text-{{data.supportText.type}}\" *ngIf=\"data.supportText\">\n {{data.supportText.content}}\n </p>\n</div>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n\n", styles: ["body{font-family:Roboto Flex,sans-serif;color:var(--text-primary);leading-trim:both;text-edge:cap;font-style:normal;line-height:normal;font-optical-sizing:auto}.hr-body-text.sm-regular{font-size:.75rem;font-weight:400;line-height:1.17525rem;letter-spacing:.01875rem}.hr-body-text.sm-bold{font-size:.75rem;font-weight:650;line-height:1.17525rem;letter-spacing:.01875rem}.hr-body-text.md-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input.hr-body-text{font-size:1rem;font-weight:400;line-height:1.567rem;letter-spacing:.025rem}.hr-body-text.lg-regular{font-size:1.3325rem;font-weight:400;line-height:2.088rem;letter-spacing:.01969rem}.hr-body-text.lg-bold{font-size:1.3325rem;font-weight:700;line-height:1.99106rem;letter-spacing:.01969rem}.hr-title.sm-regular{font-size:1rem;font-weight:420;letter-spacing:.02rem}.hr-title.sm-bold{font-size:1rem;font-weight:731;letter-spacing:.02rem}.hr-title.md-bold{font-size:1.3325rem;font-weight:745;letter-spacing:.02665rem}.hr-title.lg-regular{font-size:1.75rem;font-weight:480;letter-spacing:.02625rem}.hr-title.lg-bold{font-size:1.75rem;font-weight:760}.hr-label.sm-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input.sm-regular{font-size:.75rem;font-weight:343;letter-spacing:.01875rem}.hr-label.sm-bold,.dropdown-field ng-select ::ng-deep .ng-select-container input.sm-bold{font-size:.75rem;font-weight:730;letter-spacing:.01875rem}.hr-label.md-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input{font-size:1rem;font-weight:343;letter-spacing:.03rem}.hr-label.md-bold,.dropdown-field ng-select ::ng-deep .ng-select-container input.md-bold{font-size:1rem;font-weight:700;letter-spacing:.03rem}.hr-label.lg-regular,.dropdown-field ng-select ::ng-deep .ng-select-container input.lg-regular{font-size:1.75rem;font-weight:343;letter-spacing:.04375rem}.hr-label.lg-bold,.dropdown-field ng-select ::ng-deep .ng-select-container input.lg-bold{font-size:1.75rem;font-weight:700;letter-spacing:.04375rem}.hr-headline.sm-bold{font-size:2rem;font-weight:700;letter-spacing:.02rem}.hr-headline.md-bold{font-size:2.375rem;font-weight:700;letter-spacing:.02375rem}.hr-headline.lg-bold{font-size:2.875rem;font-weight:700;letter-spacing:.02875rem}.hr-display.sm-bold{font-size:3.125rem;font-weight:700;letter-spacing:.03125rem}.hr-display.md-bold{font-size:4.1875rem;font-weight:700;letter-spacing:.04188rem}.hr-display.lg-bold{font-size:5.625rem;font-weight:700;letter-spacing:.05625rem}.align-text-center{text-align:center}.text-negative{color:var(--negative-primary)}.text-neutro{color:var(--text-primary)}.text-positive{color:var(--positive-primary)}.support-text{margin-left:0;margin-top:.3125rem;padding-inline:1rem}label{color:var(--text-field-label-color);margin-inline:1rem}label.empty.enabled{--text-field-label-color: var(--label-text-empty-enabled-primary)}label.empty.disabled{--text-field-label-color: var(--label-text-empty-disabled-primary)}label.full.enabled{--text-field-label-color: var(--label-text-full-enabled-primary)}label.full.disabled{--text-field-label-color: var(--label-text-full-disabled-primary)}label.full.readonly{--text-field-label-color: var(--label-text-full-read-only-primary)}label.focused{--text-field-label-color: var(--label-text-full-enabled-pressed-primary)}.dropdown-field{align-items:center;background-color:var(--text-field-dropdown-field-background-color);border:1px solid var(--text-field-dropdown-field-border-color);border-radius:.625rem;cursor:var(--cursor-type);--cursor-type: pointer;display:flex;max-height:2rem;min-height:1.5rem;padding:.625rem 1rem}.dropdown-field.readonly{--cursor-type: text}.dropdown-field.disabled{--cursor-type: initial}.dropdown-field svg-icon{height:1rem;line-height:0;width:1rem}.dropdown-field svg-icon.placement-left{margin-right:.5rem}.dropdown-field svg-icon.placement-right{margin-left:.5rem}.dropdown-field ng-select{width:-webkit-fill-available}.dropdown-field ng-select ::ng-deep .ng-select-container{cursor:var(--cursor-type)!important}.dropdown-field ng-select ::ng-deep .ng-select-container .ng-placeholder{color:var(--text-field-dropdown-field-placeholder-color)}.dropdown-field ng-select ::ng-deep .ng-select-container .ng-value-label{color:var(--text-field-dropdown-field-input-color)}.dropdown-field ng-select ::ng-deep .ng-select-container input{cursor:var(--cursor-type)!important;color:var(--text-field-dropdown-field-input-color)}.dropdown-field ng-select ::ng-deep .ng-select-container input::placeholder{color:var(--text-field-dropdown-field-placeholder-color)}.dropdown-field ng-select ::ng-deep .ng-clear-wrapper .ng-clear{color:var(--clear-icon-color)}.dropdown-field ng-select ::ng-deep .ng-arrow-wrapper .ng-arrow{border-color:var(--arrow-color) transparent transparent;border-style:solid;border-width:.3125rem .3125rem .15625rem}.dropdown-field ng-select ::ng-deep ng-dropdown-panel{background-color:var(--bg-dropdown-list-primary);border:1px solid var(--outline-dropdown-list-primary);border-radius:.625rem;padding-block:.5rem}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option{color:var(--ng-option-color);--ng-option-color: var(--on-bg-dropdown-item-active-primary);padding:.1875rem 1rem}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option.ng-option-selected{font-weight:700;--ng-option-color: var(--on-bg-dropdown-item-pressed-primary)}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option:not(.ng-option-disabled):hover{background-color:var(--bg-dropdown-item-hover-primary);--ng-option-color: var(--on-bg-dropdown-item-hover-primary)}.dropdown-field ng-select ::ng-deep ng-dropdown-panel .ng-option.ng-option-disabled{--ng-option-color: var(--on-bg-dropdown-item-disabled-primary)}.dropdown-field.empty.enabled{--arrow-color: var(--placeholder-empty-enabled-primary);--clear-icon-color: var(--placeholder-empty-enabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-empty-enabled-primary);--text-field-dropdown-field-border-color: var(--outline-field-empty-enabled-primary);--text-field-dropdown-field-placeholder-color: var(--placeholder-empty-enabled-primary);--text-field-dropdown-field-input-color: var(--placeholder-empty-enabled-primary)}.dropdown-field.empty.enabled:hover{--text-field-dropdown-field-background-color: var(--bg-field-empty-enabled-hover-primary)}.dropdown-field.empty.disabled{--arrow-color: var(--placeholder-empty-disabled-primary);--clear-icon-color: var(--placeholder-empty-disabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-empty-disabled-primary);--text-field-dropdown-field-border-color: var(--bg-field-empty-disabled-primary);--text-field-dropdown-field-input-color: var(--placeholder-empty-disabled-primary);--text-field-dropdown-field-placeholder-color: var(--placeholder-empty-disabled-primary)}.dropdown-field.empty.disabled svg-icon ::ng-deep svg{--icon-color: var(--placeholder-empty-disabled-primary)}.dropdown-field.full.enabled{--arrow-color: var(--input-text-full-enabled-primary);--clear-icon-color: var(--input-text-full-enabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-enabled-primary);--text-field-dropdown-field-border-color: var(--outline-field-full-enabled-primary);--text-field-dropdown-field-input-color: var(--input-text-full-enabled-primary)}.dropdown-field.full.enabled:hover{--text-field-dropdown-field-background-color: var(--bg-field-full-enabled-hover-primary)}.dropdown-field.full.disabled{--arrow-color: var(--input-text-full-disabled-primary);--clear-icon-color: var(--input-text-full-disabled-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-disabled-primary);--text-field-dropdown-field-border-color: var(--bg-field-full-disabled-primary);--text-field-dropdown-field-input-color: var(--input-text-full-disabled-primary)}.dropdown-field.full.disabled svg-icon ::ng-deep svg{--icon-color: var(--input-text-full-disabled-primary)}.dropdown-field.readonly{--arrow-color: var(--input-text-full-read-only-primary);--clear-icon-color: var(--input-text-full-read-only-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-read-only-primary);--text-field-dropdown-field-border-color: var(--bg-field-full-read-only-primary);--text-field-dropdown-field-input-color: var(--input-text-full-read-only-primary)}.dropdown-field.focused:not(.readonly){--arrow-color: var(--input-text-full-read-only-primary);--clear-icon-color: var(--input-text-full-read-only-primary);--text-field-dropdown-field-background-color: var(--bg-field-full-enabled-pressed-primary);--text-field-dropdown-field-border-color: var(--outline-field-full-enabled-pressed-primary);--text-field-dropdown-field-input-color: var(--input-text-full-read-only-primary)}\n"] }]
|
|
67
|
+
}], propDecorators: { selectedIdResponse: [{
|
|
68
|
+
type: Output
|
|
69
|
+
}], data: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}] } });
|
|
72
|
+
|
|
73
|
+
class GravityTextFieldComponent {
|
|
74
|
+
constructor() {
|
|
75
|
+
this.textFieldValueResponse = new EventEmitter();
|
|
76
|
+
this.focusInput = false;
|
|
77
|
+
this.inputValue = '';
|
|
78
|
+
this.placeholders = {
|
|
79
|
+
'email': 'test@email.com',
|
|
80
|
+
'url': 'https://www.test.com'
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
ngOnInit() {
|
|
84
|
+
this.data.autocomplete = this.data.autocomplete ? this.data.autocomplete : "off";
|
|
85
|
+
this.data.placeholderType = this.data.placeholderType ? this.data.placeholderType : "default";
|
|
86
|
+
this.data.required = this.data.required ? this.data.required : false;
|
|
87
|
+
this.data.state = this.data.state ? this.data.state : "enabled";
|
|
88
|
+
this.data.type = this.data.type ? this.data.type : "text";
|
|
89
|
+
if (this.data.supportText) {
|
|
90
|
+
this.data.supportText.type = this.data.supportText.type ? this.data.supportText.type : "neutro";
|
|
91
|
+
}
|
|
92
|
+
if (this.data.icon) {
|
|
93
|
+
this.data.icon.placement = this.data.icon.placement ? this.data.icon.placement : 'left';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
ngAfterViewInit() {
|
|
97
|
+
this.changeInputValue();
|
|
98
|
+
}
|
|
99
|
+
getPlaceholder() {
|
|
100
|
+
if (this.data.customPlaceholder && this.data.customPlaceholder != '') {
|
|
101
|
+
return this.data.customPlaceholder;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
if (this.data.placeholderType == 'default') {
|
|
105
|
+
return this.data.label;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return this.placeholders[this.data.placeholderType];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
changeInputValue() {
|
|
113
|
+
this.inputValue = this.inputElement.nativeElement.value;
|
|
114
|
+
this.textFieldValueResponse.emit(this.inputValue);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
GravityTextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
118
|
+
GravityTextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityTextFieldComponent, selector: "gravity-text-field", inputs: { data: "data" }, outputs: { textFieldValueResponse: "textFieldValueResponse" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }], ngImport: i0, template: "<div class=\"gravity-text-field\">\n <label class=\"hr-body-text md-regular {{data.state}}\" [class.empty]=\"inputValue == '' && !focusInput\"\n [class.focused]=\"focusInput\" [class.full]=\"inputValue != '' && !focusInput\">\n {{data.label}}\n <ng-container *ngIf=\"data.required\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Requerido <span class=\"text-negative\">*</span></ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Required <span class=\"text-negative\">*</span></ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'readonly'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- S\u00F3lo lectura</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Readonly</ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'disabled'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Deshabilitado</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Disabled</ng-container>\n </ng-container>\n </label>\n <div class=\"input-field {{data.state}}\" [class.empty]=\"inputValue == '' && !focusInput\" [class.focused]=\"focusInput\"\n [class.full]=\"inputValue != '' && !focusInput\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <input [attr.data-cy]=\"data.cypressTag\"\n [attr.disabled]=\"data.state == 'disabled' ? true : null\"\n [attr.readonly]=\"data.state == 'readonly' ? true : null\"\n [attr.value]=\"data.customInputValue ? data.customInputValue : null\"\n [autocomplete]=\"data.autocomplete\"\n [placeholder]=\"getPlaceholder()\"\n [type]=\"data.type\"\n\n (blur)=\"focusInput = false\"\n (focus)=\"focusInput = true\"\n (keyup)=\"changeInputValue()\"\n\n class=\"hr-label md-regular\"\n\n #inputElement>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n </div>\n <p class=\"hr-body-text sm-regular support-text text-{{data.supportText.type}}\" *ngIf=\"data.supportText\">\n {{data.supportText.content}}\n </p>\n</div>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n", styles: [".text-negative{color:var(--negative-primary)}.text-neutro{color:var(--text-primary)}.text-positive{color:var(--positive-primary)}.support-text{margin-left:0;margin-top:.3125rem;padding-inline:1rem}label{color:var(--text-field-label-color);margin-inline:1rem}label.empty.enabled{--text-field-label-color: var(--label-text-empty-enabled-primary)}label.empty.disabled{--text-field-label-color: var(--label-text-empty-disabled-primary)}label.full.enabled{--text-field-label-color: var(--label-text-full-enabled-primary)}label.full.disabled{--text-field-label-color: var(--label-text-full-disabled-primary)}label.full.readonly{--text-field-label-color: var(--label-text-full-read-only-primary)}label.focused{--text-field-label-color: var(--label-text-full-enabled-pressed-primary)}.input-field{align-items:center;background-color:var(--text-field-input-field-background-color);border:1px solid var(--text-field-input-field-border-color);border-radius:.625rem;display:flex;max-height:2rem;min-height:1.5rem;padding:.625rem 1rem}.input-field svg-icon{height:1rem;line-height:0;width:1rem}.input-field svg-icon.placement-left{margin-right:.5rem}.input-field svg-icon.placement-right{margin-left:.5rem}.input-field input{background-color:transparent;border:none;box-shadow:none;color:var(--text-field-input-field-input-color);line-height:0;outline:none;padding:0;width:100%}.input-field input::placeholder{color:var(--text-field-input-field-placeholder-color)}.input-field.empty.enabled{--text-field-input-field-background-color: var(--bg-field-empty-enabled-primary);--text-field-input-field-border-color: var(--outline-field-empty-enabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-enabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-enabled-primary)}.input-field.empty.enabled:hover{--text-field-input-field-background-color: var(--bg-field-empty-enabled-hover-primary)}.input-field.empty.disabled{--text-field-input-field-background-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-border-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-disabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-disabled-primary)}.input-field.empty.disabled svg-icon ::ng-deep svg{--icon-color: var(--placeholder-empty-disabled-primary)}.input-field.full.enabled{--text-field-input-field-background-color: var(--bg-field-full-enabled-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-primary);--text-field-input-field-input-color: var(--input-text-full-enabled-primary)}.input-field.full.enabled:hover{--text-field-input-field-background-color: var(--bg-field-full-enabled-hover-primary)}.input-field.full.disabled{--text-field-input-field-background-color: var(--bg-field-full-disabled-primary);--text-field-input-field-border-color: var(--bg-field-full-disabled-primary);--text-field-input-field-input-color: var(--input-text-full-disabled-primary)}.input-field.full.disabled svg-icon ::ng-deep svg{--icon-color: var(--input-text-full-disabled-primary)}.input-field.readonly{--text-field-input-field-background-color: var(--bg-field-full-read-only-primary);--text-field-input-field-border-color: var(--bg-field-full-read-only-primary);--text-field-input-field-input-color: var(--input-text-full-read-only-primary)}.input-field.focused:not(.readonly){--text-field-input-field-background-color: var(--bg-field-full-enabled-pressed-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-pressed-primary);--text-field-input-field-input-color: var(--placeholder-full-enabled-pressed-primary)}\n"], dependencies: [{ kind: "component", type: i1.SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "applyCss", "svgClass", "class", "viewBox", "svgAriaLabel", "svgStyle"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTextFieldComponent, decorators: [{
|
|
120
|
+
type: Component,
|
|
121
|
+
args: [{ selector: 'gravity-text-field', template: "<div class=\"gravity-text-field\">\n <label class=\"hr-body-text md-regular {{data.state}}\" [class.empty]=\"inputValue == '' && !focusInput\"\n [class.focused]=\"focusInput\" [class.full]=\"inputValue != '' && !focusInput\">\n {{data.label}}\n <ng-container *ngIf=\"data.required\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Requerido <span class=\"text-negative\">*</span></ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Required <span class=\"text-negative\">*</span></ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'readonly'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- S\u00F3lo lectura</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Readonly</ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'disabled'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Deshabilitado</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Disabled</ng-container>\n </ng-container>\n </label>\n <div class=\"input-field {{data.state}}\" [class.empty]=\"inputValue == '' && !focusInput\" [class.focused]=\"focusInput\"\n [class.full]=\"inputValue != '' && !focusInput\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <input [attr.data-cy]=\"data.cypressTag\"\n [attr.disabled]=\"data.state == 'disabled' ? true : null\"\n [attr.readonly]=\"data.state == 'readonly' ? true : null\"\n [attr.value]=\"data.customInputValue ? data.customInputValue : null\"\n [autocomplete]=\"data.autocomplete\"\n [placeholder]=\"getPlaceholder()\"\n [type]=\"data.type\"\n\n (blur)=\"focusInput = false\"\n (focus)=\"focusInput = true\"\n (keyup)=\"changeInputValue()\"\n\n class=\"hr-label md-regular\"\n\n #inputElement>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n </div>\n <p class=\"hr-body-text sm-regular support-text text-{{data.supportText.type}}\" *ngIf=\"data.supportText\">\n {{data.supportText.content}}\n </p>\n</div>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n", styles: [".text-negative{color:var(--negative-primary)}.text-neutro{color:var(--text-primary)}.text-positive{color:var(--positive-primary)}.support-text{margin-left:0;margin-top:.3125rem;padding-inline:1rem}label{color:var(--text-field-label-color);margin-inline:1rem}label.empty.enabled{--text-field-label-color: var(--label-text-empty-enabled-primary)}label.empty.disabled{--text-field-label-color: var(--label-text-empty-disabled-primary)}label.full.enabled{--text-field-label-color: var(--label-text-full-enabled-primary)}label.full.disabled{--text-field-label-color: var(--label-text-full-disabled-primary)}label.full.readonly{--text-field-label-color: var(--label-text-full-read-only-primary)}label.focused{--text-field-label-color: var(--label-text-full-enabled-pressed-primary)}.input-field{align-items:center;background-color:var(--text-field-input-field-background-color);border:1px solid var(--text-field-input-field-border-color);border-radius:.625rem;display:flex;max-height:2rem;min-height:1.5rem;padding:.625rem 1rem}.input-field svg-icon{height:1rem;line-height:0;width:1rem}.input-field svg-icon.placement-left{margin-right:.5rem}.input-field svg-icon.placement-right{margin-left:.5rem}.input-field input{background-color:transparent;border:none;box-shadow:none;color:var(--text-field-input-field-input-color);line-height:0;outline:none;padding:0;width:100%}.input-field input::placeholder{color:var(--text-field-input-field-placeholder-color)}.input-field.empty.enabled{--text-field-input-field-background-color: var(--bg-field-empty-enabled-primary);--text-field-input-field-border-color: var(--outline-field-empty-enabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-enabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-enabled-primary)}.input-field.empty.enabled:hover{--text-field-input-field-background-color: var(--bg-field-empty-enabled-hover-primary)}.input-field.empty.disabled{--text-field-input-field-background-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-border-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-disabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-disabled-primary)}.input-field.empty.disabled svg-icon ::ng-deep svg{--icon-color: var(--placeholder-empty-disabled-primary)}.input-field.full.enabled{--text-field-input-field-background-color: var(--bg-field-full-enabled-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-primary);--text-field-input-field-input-color: var(--input-text-full-enabled-primary)}.input-field.full.enabled:hover{--text-field-input-field-background-color: var(--bg-field-full-enabled-hover-primary)}.input-field.full.disabled{--text-field-input-field-background-color: var(--bg-field-full-disabled-primary);--text-field-input-field-border-color: var(--bg-field-full-disabled-primary);--text-field-input-field-input-color: var(--input-text-full-disabled-primary)}.input-field.full.disabled svg-icon ::ng-deep svg{--icon-color: var(--input-text-full-disabled-primary)}.input-field.readonly{--text-field-input-field-background-color: var(--bg-field-full-read-only-primary);--text-field-input-field-border-color: var(--bg-field-full-read-only-primary);--text-field-input-field-input-color: var(--input-text-full-read-only-primary)}.input-field.focused:not(.readonly){--text-field-input-field-background-color: var(--bg-field-full-enabled-pressed-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-pressed-primary);--text-field-input-field-input-color: var(--placeholder-full-enabled-pressed-primary)}\n"] }]
|
|
122
|
+
}], propDecorators: { textFieldValueResponse: [{
|
|
123
|
+
type: Output
|
|
124
|
+
}], data: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], inputElement: [{
|
|
127
|
+
type: ViewChild,
|
|
128
|
+
args: ['inputElement', { static: false }]
|
|
129
|
+
}] } });
|
|
130
|
+
|
|
131
|
+
class GravityTooltipComponent {
|
|
132
|
+
transitionEnd() {
|
|
133
|
+
if (this.show) {
|
|
134
|
+
this.events.emit({
|
|
135
|
+
type: 'shown'
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
set show(value) {
|
|
140
|
+
if (value) {
|
|
141
|
+
this.setPosition();
|
|
142
|
+
}
|
|
143
|
+
this._show = this.hostClassShow = value;
|
|
144
|
+
}
|
|
145
|
+
get show() {
|
|
146
|
+
return this._show;
|
|
147
|
+
}
|
|
148
|
+
get placement() {
|
|
149
|
+
return this.data.options.placement;
|
|
150
|
+
}
|
|
151
|
+
get autoPlacement() {
|
|
152
|
+
return this.data.options.autoPlacement;
|
|
153
|
+
}
|
|
154
|
+
get element() {
|
|
155
|
+
return this.data.element;
|
|
156
|
+
}
|
|
157
|
+
get elementPosition() {
|
|
158
|
+
return this.data.elementPosition;
|
|
159
|
+
}
|
|
160
|
+
get options() {
|
|
161
|
+
return this.data.options;
|
|
162
|
+
}
|
|
163
|
+
get value() {
|
|
164
|
+
return this.data.value;
|
|
165
|
+
}
|
|
166
|
+
get tooltipOffset() {
|
|
167
|
+
return Number(this.data.options.offset);
|
|
168
|
+
}
|
|
169
|
+
get isThemeLight() {
|
|
170
|
+
return this.options['theme'] === 'light';
|
|
171
|
+
}
|
|
172
|
+
constructor(elementRef, renderer) {
|
|
173
|
+
this.elementRef = elementRef;
|
|
174
|
+
this.renderer = renderer;
|
|
175
|
+
this._show = false;
|
|
176
|
+
this.events = new EventEmitter();
|
|
177
|
+
}
|
|
178
|
+
ngOnInit() {
|
|
179
|
+
this.setCustomClass();
|
|
180
|
+
this.setStyles();
|
|
181
|
+
}
|
|
182
|
+
setPosition() {
|
|
183
|
+
if (this.setHostStyle(this.placement)) {
|
|
184
|
+
this.setPlacementClass(this.placement);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
/* Is tooltip outside the visible area */
|
|
189
|
+
const placements = ['top', 'right', 'bottom', 'left'];
|
|
190
|
+
let isPlacementSet;
|
|
191
|
+
for (const placement of placements) {
|
|
192
|
+
if (this.setHostStyle(placement)) {
|
|
193
|
+
this.setPlacementClass(placement);
|
|
194
|
+
isPlacementSet = true;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/* Set original placement */
|
|
199
|
+
if (!isPlacementSet) {
|
|
200
|
+
this.setHostStyle(this.placement, true);
|
|
201
|
+
this.setPlacementClass(this.placement);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
setPlacementClass(placement) {
|
|
206
|
+
this.renderer.addClass(this.elementRef.nativeElement, 'tooltip-' + placement);
|
|
207
|
+
}
|
|
208
|
+
setHostStyle(placement, disableAutoPlacement = false) {
|
|
209
|
+
const isSvg = this.element instanceof SVGElement;
|
|
210
|
+
const tooltip = this.elementRef.nativeElement;
|
|
211
|
+
const isCustomPosition = !this.elementPosition.right;
|
|
212
|
+
let elementHeight = isSvg ? this.element.getBoundingClientRect().height : this.element.offsetHeight;
|
|
213
|
+
let elementWidth = isSvg ? this.element.getBoundingClientRect().width : this.element.offsetWidth;
|
|
214
|
+
const tooltipHeight = tooltip.clientHeight;
|
|
215
|
+
const tooltipWidth = tooltip.clientWidth;
|
|
216
|
+
const scrollY = window.pageYOffset;
|
|
217
|
+
if (isCustomPosition) {
|
|
218
|
+
elementHeight = 0;
|
|
219
|
+
elementWidth = 0;
|
|
220
|
+
}
|
|
221
|
+
let topStyle;
|
|
222
|
+
let leftStyle;
|
|
223
|
+
if (placement === 'top') {
|
|
224
|
+
topStyle = (this.elementPosition.top + scrollY) - (tooltipHeight + this.tooltipOffset);
|
|
225
|
+
}
|
|
226
|
+
if (placement === 'bottom') {
|
|
227
|
+
topStyle = (this.elementPosition.top + scrollY) + elementHeight + this.tooltipOffset;
|
|
228
|
+
}
|
|
229
|
+
if (placement === 'top' || placement === 'bottom') {
|
|
230
|
+
leftStyle = (this.elementPosition.left + elementWidth / 2) - tooltipWidth / 2;
|
|
231
|
+
}
|
|
232
|
+
if (placement === 'left') {
|
|
233
|
+
leftStyle = this.elementPosition.left - tooltipWidth - this.tooltipOffset;
|
|
234
|
+
}
|
|
235
|
+
if (placement === 'right') {
|
|
236
|
+
leftStyle = this.elementPosition.left + elementWidth + this.tooltipOffset;
|
|
237
|
+
}
|
|
238
|
+
if (placement === 'left' || placement === 'right') {
|
|
239
|
+
topStyle = (this.elementPosition.top + scrollY) + elementHeight / 2 - tooltip.clientHeight / 2;
|
|
240
|
+
}
|
|
241
|
+
/* Is tooltip outside the visible area */
|
|
242
|
+
if (this.autoPlacement && !disableAutoPlacement) {
|
|
243
|
+
const topEdge = topStyle;
|
|
244
|
+
const bottomEdge = topStyle + tooltipHeight;
|
|
245
|
+
const leftEdge = leftStyle;
|
|
246
|
+
const rightEdge = leftStyle + tooltipWidth;
|
|
247
|
+
const bodyHeight = window.innerHeight + scrollY;
|
|
248
|
+
const bodyWidth = document.body.clientWidth;
|
|
249
|
+
if (topEdge < 0 || bottomEdge > bodyHeight || leftEdge < 0 || rightEdge > bodyWidth) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
this.hostStyleTop = topStyle + 'px';
|
|
254
|
+
this.hostStyleLeft = leftStyle + 'px';
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
setZIndex() {
|
|
258
|
+
if (this.options['zIndex'] !== 0) {
|
|
259
|
+
this.hostStyleZIndex = this.options['zIndex'];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
setPointerEvents() {
|
|
263
|
+
if (this.options['pointerEvents']) {
|
|
264
|
+
this.hostStylePointerEvents = this.options['pointerEvents'];
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
setCustomClass() {
|
|
268
|
+
if (this.options['tooltipClass']) {
|
|
269
|
+
this.options['tooltipClass'].split(' ').forEach((className) => {
|
|
270
|
+
this.renderer.addClass(this.elementRef.nativeElement, className);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
setAnimationDuration() {
|
|
275
|
+
if (Number(this.options['animationDuration']) != this.options['animationDurationDefault']) {
|
|
276
|
+
this.hostStyleTransition = 'opacity ' + this.options['animationDuration'] + 'ms';
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
setStyles() {
|
|
280
|
+
this.setZIndex();
|
|
281
|
+
this.setPointerEvents();
|
|
282
|
+
this.setAnimationDuration();
|
|
283
|
+
this.hostClassShadow = this.options['shadow'];
|
|
284
|
+
this.hostClassLight = this.isThemeLight;
|
|
285
|
+
this.hostStyleMaxWidth = this.options['maxWidth'];
|
|
286
|
+
this.hostStyleWidth = this.options['width'] ? this.options['width'] : '';
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
GravityTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
290
|
+
GravityTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityTooltipComponent, selector: "tooltip", inputs: { data: "data", show: "show" }, host: { listeners: { "transitionend": "transitionEnd($event)" }, properties: { "style.top": "this.hostStyleTop", "style.left": "this.hostStyleLeft", "style.z-index": "this.hostStyleZIndex", "style.transition": "this.hostStyleTransition", "style.width": "this.hostStyleWidth", "style.max-width": "this.hostStyleMaxWidth", "style.pointer-events": "this.hostStylePointerEvents", "class.tooltip-show": "this.hostClassShow", "class.tooltip-shadow": "this.hostClassShadow", "class.tooltip-light": "this.hostClassLight" }, classAttribute: "tooltip" }, ngImport: i0, template: "<div *ngIf=\"isThemeLight\" class=\"tooltip-arrow\"></div>\n\n<div *ngIf=\"options['contentType'] === 'template' else htmlOrStringTemplate\">\n <ng-container *ngTemplateOutlet=\"value\"></ng-container>\n</div>\n\n<ng-template #htmlOrStringTemplate>\n <div [innerHTML]=\"value\"></div>\n</ng-template>\n", styles: [":host{max-width:200px;background-color:var(--bg-tooltip-primary);color:var(--on-bg-tooltip-primary);text-align:center;border-radius:6px;padding:5px 8px;position:absolute;pointer-events:none;z-index:1000;display:block;opacity:0;transition:opacity .3s;top:0;left:0}:host.tooltip-show{opacity:1}:host.tooltip-shadow{box-shadow:0 7px 15px -5px #0006}:host.tooltip-light.tooltip-shadow{box-shadow:0 5px 15px -5px #0006}:host.tooltip:after{content:\"\";position:absolute;border-style:solid}:host.tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:var(--bg-tooltip-primary) transparent transparent transparent}:host.tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent var(--bg-tooltip-primary) transparent}:host.tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--bg-tooltip-primary)}:host.tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent var(--bg-tooltip-primary) transparent transparent}:host.tooltip-light:after{display:none}:host.tooltip-light{border:1px solid rgba(0,0,0,.06);background-color:#fff;color:#000}:host.tooltip-light .tooltip-arrow{position:absolute;width:10px;height:10px;transform:rotate(135deg);background-color:#00000012}:host.tooltip-light .tooltip-arrow:after{background-color:#fff;content:\"\";display:block;position:absolute;width:10px;height:10px}:host.tooltip-top.tooltip-light{margin-top:-2px}:host.tooltip-top.tooltip-light .tooltip-arrow{top:100%;left:50%;margin-top:-4px;margin-left:-5px;background:linear-gradient(to bottom left,rgba(0,0,0,.07) 50%,transparent 50%)}:host.tooltip-top.tooltip-light .tooltip-arrow:after{top:1px;right:1px}:host.tooltip-bottom.tooltip-light .tooltip-arrow{bottom:100%;left:50%;margin-bottom:-4px;margin-left:-5px;background:linear-gradient(to top right,rgba(0,0,0,.1) 50%,transparent 50%)}:host.tooltip-bottom.tooltip-light .tooltip-arrow:after{top:-1px;right:-1px}:host.tooltip-left.tooltip-light .tooltip-arrow{top:50%;left:100%;margin-top:-5px;margin-left:-4px;background:linear-gradient(to bottom right,rgba(0,0,0,.07) 50%,transparent 50%)}:host.tooltip-left.tooltip-light .tooltip-arrow:after{top:1px;right:-1px}:host.tooltip-right.tooltip-light .tooltip-arrow{top:50%;right:100%;margin-top:-5px;margin-right:-4px;background:linear-gradient(to top left,rgba(0,0,0,.07) 50%,transparent 50%)}:host.tooltip-right.tooltip-light .tooltip-arrow:after{top:-1px;right:1px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipComponent, decorators: [{
|
|
292
|
+
type: Component,
|
|
293
|
+
args: [{ selector: 'tooltip', host: { 'class': 'tooltip' }, template: "<div *ngIf=\"isThemeLight\" class=\"tooltip-arrow\"></div>\n\n<div *ngIf=\"options['contentType'] === 'template' else htmlOrStringTemplate\">\n <ng-container *ngTemplateOutlet=\"value\"></ng-container>\n</div>\n\n<ng-template #htmlOrStringTemplate>\n <div [innerHTML]=\"value\"></div>\n</ng-template>\n", styles: [":host{max-width:200px;background-color:var(--bg-tooltip-primary);color:var(--on-bg-tooltip-primary);text-align:center;border-radius:6px;padding:5px 8px;position:absolute;pointer-events:none;z-index:1000;display:block;opacity:0;transition:opacity .3s;top:0;left:0}:host.tooltip-show{opacity:1}:host.tooltip-shadow{box-shadow:0 7px 15px -5px #0006}:host.tooltip-light.tooltip-shadow{box-shadow:0 5px 15px -5px #0006}:host.tooltip:after{content:\"\";position:absolute;border-style:solid}:host.tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:var(--bg-tooltip-primary) transparent transparent transparent}:host.tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent var(--bg-tooltip-primary) transparent}:host.tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--bg-tooltip-primary)}:host.tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent var(--bg-tooltip-primary) transparent transparent}:host.tooltip-light:after{display:none}:host.tooltip-light{border:1px solid rgba(0,0,0,.06);background-color:#fff;color:#000}:host.tooltip-light .tooltip-arrow{position:absolute;width:10px;height:10px;transform:rotate(135deg);background-color:#00000012}:host.tooltip-light .tooltip-arrow:after{background-color:#fff;content:\"\";display:block;position:absolute;width:10px;height:10px}:host.tooltip-top.tooltip-light{margin-top:-2px}:host.tooltip-top.tooltip-light .tooltip-arrow{top:100%;left:50%;margin-top:-4px;margin-left:-5px;background:linear-gradient(to bottom left,rgba(0,0,0,.07) 50%,transparent 50%)}:host.tooltip-top.tooltip-light .tooltip-arrow:after{top:1px;right:1px}:host.tooltip-bottom.tooltip-light .tooltip-arrow{bottom:100%;left:50%;margin-bottom:-4px;margin-left:-5px;background:linear-gradient(to top right,rgba(0,0,0,.1) 50%,transparent 50%)}:host.tooltip-bottom.tooltip-light .tooltip-arrow:after{top:-1px;right:-1px}:host.tooltip-left.tooltip-light .tooltip-arrow{top:50%;left:100%;margin-top:-5px;margin-left:-4px;background:linear-gradient(to bottom right,rgba(0,0,0,.07) 50%,transparent 50%)}:host.tooltip-left.tooltip-light .tooltip-arrow:after{top:1px;right:-1px}:host.tooltip-right.tooltip-light .tooltip-arrow{top:50%;right:100%;margin-top:-5px;margin-right:-4px;background:linear-gradient(to top left,rgba(0,0,0,.07) 50%,transparent 50%)}:host.tooltip-right.tooltip-light .tooltip-arrow:after{top:-1px;right:1px}\n"] }]
|
|
294
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { data: [{
|
|
295
|
+
type: Input
|
|
296
|
+
}], hostStyleTop: [{
|
|
297
|
+
type: HostBinding,
|
|
298
|
+
args: ['style.top']
|
|
299
|
+
}], hostStyleLeft: [{
|
|
300
|
+
type: HostBinding,
|
|
301
|
+
args: ['style.left']
|
|
302
|
+
}], hostStyleZIndex: [{
|
|
303
|
+
type: HostBinding,
|
|
304
|
+
args: ['style.z-index']
|
|
305
|
+
}], hostStyleTransition: [{
|
|
306
|
+
type: HostBinding,
|
|
307
|
+
args: ['style.transition']
|
|
308
|
+
}], hostStyleWidth: [{
|
|
309
|
+
type: HostBinding,
|
|
310
|
+
args: ['style.width']
|
|
311
|
+
}], hostStyleMaxWidth: [{
|
|
312
|
+
type: HostBinding,
|
|
313
|
+
args: ['style.max-width']
|
|
314
|
+
}], hostStylePointerEvents: [{
|
|
315
|
+
type: HostBinding,
|
|
316
|
+
args: ['style.pointer-events']
|
|
317
|
+
}], hostClassShow: [{
|
|
318
|
+
type: HostBinding,
|
|
319
|
+
args: ['class.tooltip-show']
|
|
320
|
+
}], hostClassShadow: [{
|
|
321
|
+
type: HostBinding,
|
|
322
|
+
args: ['class.tooltip-shadow']
|
|
323
|
+
}], hostClassLight: [{
|
|
324
|
+
type: HostBinding,
|
|
325
|
+
args: ['class.tooltip-light']
|
|
326
|
+
}], transitionEnd: [{
|
|
327
|
+
type: HostListener,
|
|
328
|
+
args: ['transitionend', ['$event']]
|
|
329
|
+
}], show: [{
|
|
330
|
+
type: Input
|
|
331
|
+
}] } });
|
|
12
332
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
333
|
+
/**
|
|
334
|
+
* This is not a real service, but it looks like it from the outside.
|
|
335
|
+
* It's just an InjectionToken used to import the config (initOptions) object, provided from the outside
|
|
336
|
+
*/
|
|
337
|
+
const TooltipOptionsService = new InjectionToken('TooltipOptions');
|
|
338
|
+
|
|
339
|
+
const defaultOptions = {
|
|
340
|
+
'placement': 'top',
|
|
341
|
+
'autoPlacement': true,
|
|
342
|
+
'contentType': 'string',
|
|
343
|
+
'showDelay': 0,
|
|
344
|
+
'hideDelay': 300,
|
|
345
|
+
'hideDelayMobile': 0,
|
|
346
|
+
'hideDelayTouchscreen': 0,
|
|
347
|
+
'zIndex': 0,
|
|
348
|
+
'animationDuration': 300,
|
|
349
|
+
'animationDurationDefault': 300,
|
|
350
|
+
'trigger': 'hover',
|
|
351
|
+
'tooltipClass': '',
|
|
352
|
+
'display': true,
|
|
353
|
+
'displayMobile': true,
|
|
354
|
+
'displayTouchscreen': true,
|
|
355
|
+
'shadow': true,
|
|
356
|
+
'theme': 'dark',
|
|
357
|
+
'offset': 8,
|
|
358
|
+
'maxWidth': '',
|
|
359
|
+
'id': false,
|
|
360
|
+
'hideDelayAfterClick': 2000
|
|
361
|
+
};
|
|
362
|
+
const backwardCompatibilityOptions = {
|
|
363
|
+
'delay': 'showDelay',
|
|
364
|
+
'show-delay': 'showDelay',
|
|
365
|
+
'hide-delay': 'hideDelay',
|
|
366
|
+
'hide-delay-mobile': 'hideDelayTouchscreen',
|
|
367
|
+
'hideDelayMobile': 'hideDelayTouchscreen',
|
|
368
|
+
'z-index': 'zIndex',
|
|
369
|
+
'animation-duration': 'animationDuration',
|
|
370
|
+
'animation-duration-default': 'animationDurationDefault',
|
|
371
|
+
'tooltip-class': 'tooltipClass',
|
|
372
|
+
'display-mobile': 'displayTouchscreen',
|
|
373
|
+
'displayMobile': 'displayTouchscreen',
|
|
374
|
+
'max-width': 'maxWidth'
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
class GravityTooltipDirective {
|
|
378
|
+
set options(value) {
|
|
379
|
+
if (value && defaultOptions) {
|
|
380
|
+
this._options = value;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
get options() {
|
|
384
|
+
return this._options;
|
|
385
|
+
}
|
|
386
|
+
// Content type
|
|
387
|
+
set contentTypeBackwardCompatibility(value) {
|
|
388
|
+
if (value) {
|
|
389
|
+
this._contentType = value;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
set contentType(value) {
|
|
393
|
+
if (value) {
|
|
394
|
+
this._contentType = value;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
get contentType() {
|
|
398
|
+
return this._contentType;
|
|
399
|
+
}
|
|
400
|
+
// z-index
|
|
401
|
+
set zIndexBackwardCompatibility(value) {
|
|
402
|
+
if (value) {
|
|
403
|
+
this._zIndex = value;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
set zIndex(value) {
|
|
407
|
+
if (value) {
|
|
408
|
+
this._zIndex = value;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
get zIndex() {
|
|
412
|
+
return this._zIndex;
|
|
413
|
+
}
|
|
414
|
+
// Animation duration
|
|
415
|
+
set animationDurationBackwardCompatibility(value) {
|
|
416
|
+
if (value) {
|
|
417
|
+
this._animationDuration = value;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
set animationDuration(value) {
|
|
421
|
+
if (value) {
|
|
422
|
+
this._animationDuration = value;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
get animationDuration() {
|
|
426
|
+
return this._animationDuration;
|
|
427
|
+
}
|
|
428
|
+
// Tooltip class
|
|
429
|
+
set tooltipClassBackwardCompatibility(value) {
|
|
430
|
+
if (value) {
|
|
431
|
+
this._tooltipClass = value;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
set tooltipClass(value) {
|
|
435
|
+
if (value) {
|
|
436
|
+
this._tooltipClass = value;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
get tooltipClass() {
|
|
440
|
+
return this._tooltipClass;
|
|
441
|
+
}
|
|
442
|
+
// Max width
|
|
443
|
+
set maxWidthBackwardCompatibility(value) {
|
|
444
|
+
if (value) {
|
|
445
|
+
this._maxWidth = value;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
set maxWidth(value) {
|
|
449
|
+
if (value) {
|
|
450
|
+
this._maxWidth = value;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
get maxWidth() {
|
|
454
|
+
return this._maxWidth;
|
|
455
|
+
}
|
|
456
|
+
// Show delay
|
|
457
|
+
set showDelayBackwardCompatibility(value) {
|
|
458
|
+
if (value) {
|
|
459
|
+
this._showDelay = value;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
set showDelay(value) {
|
|
463
|
+
if (value) {
|
|
464
|
+
this._showDelay = value;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
get showDelay() {
|
|
468
|
+
return this._showDelay;
|
|
469
|
+
}
|
|
470
|
+
// Hide delay
|
|
471
|
+
set hideDelayBackwardCompatibility(value) {
|
|
472
|
+
if (value) {
|
|
473
|
+
this._hideDelay = value;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
set hideDelay(value) {
|
|
477
|
+
if (value) {
|
|
478
|
+
this._hideDelay = value;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
get hideDelay() {
|
|
482
|
+
return this._hideDelay;
|
|
483
|
+
}
|
|
484
|
+
get isTooltipDestroyed() {
|
|
485
|
+
return this.componentRef && this.componentRef.hostView.destroyed;
|
|
486
|
+
}
|
|
487
|
+
get destroyDelay() {
|
|
488
|
+
if (this._destroyDelay) {
|
|
489
|
+
return this._destroyDelay;
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
return Number(this.getHideDelay()) + Number(this.options['animationDuration']);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
set destroyDelay(value) {
|
|
496
|
+
this._destroyDelay = value;
|
|
497
|
+
}
|
|
498
|
+
get tooltipPosition() {
|
|
499
|
+
if (this.options['position']) {
|
|
500
|
+
return this.options['position'];
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
return this.elementPosition;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
constructor(initOptions, elementRef, componentFactoryResolver, appRef, injector) {
|
|
507
|
+
this.initOptions = initOptions;
|
|
508
|
+
this.elementRef = elementRef;
|
|
509
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
510
|
+
this.appRef = appRef;
|
|
511
|
+
this.injector = injector;
|
|
512
|
+
this._options = {};
|
|
513
|
+
this._contentType = "string";
|
|
514
|
+
this.events = new EventEmitter();
|
|
515
|
+
}
|
|
516
|
+
onMouseEnter() {
|
|
517
|
+
if (this.isDisplayOnHover == false) {
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
this.show();
|
|
521
|
+
}
|
|
522
|
+
onMouseLeave() {
|
|
523
|
+
if (this.options['trigger'] === 'hover') {
|
|
524
|
+
this.destroyTooltip();
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
onClick() {
|
|
528
|
+
if (this.isDisplayOnClick == false) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
this.show();
|
|
532
|
+
this.hideAfterClickTimeoutId = window.setTimeout(() => {
|
|
533
|
+
this.destroyTooltip();
|
|
534
|
+
}, this.options['hideDelayAfterClick']);
|
|
535
|
+
}
|
|
536
|
+
ngOnInit() {
|
|
537
|
+
}
|
|
538
|
+
ngOnChanges(changes) {
|
|
539
|
+
this.initOptions = this.renameProperties(this.initOptions);
|
|
540
|
+
let changedOptions = this.getProperties(changes);
|
|
541
|
+
changedOptions = this.renameProperties(changedOptions);
|
|
542
|
+
this.applyOptionsDefault(defaultOptions, changedOptions);
|
|
543
|
+
}
|
|
544
|
+
ngOnDestroy() {
|
|
545
|
+
this.destroyTooltip({
|
|
546
|
+
fast: true
|
|
547
|
+
});
|
|
548
|
+
if (this.componentSubscribe) {
|
|
549
|
+
this.componentSubscribe.unsubscribe();
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
getShowDelay() {
|
|
553
|
+
return this.options['showDelay'];
|
|
554
|
+
}
|
|
555
|
+
getHideDelay() {
|
|
556
|
+
const hideDelay = this.options['hideDelay'];
|
|
557
|
+
const hideDelayTouchscreen = this.options['hideDelayTouchscreen'];
|
|
558
|
+
return this.isTouchScreen ? hideDelayTouchscreen : hideDelay;
|
|
559
|
+
}
|
|
560
|
+
getProperties(changes) {
|
|
561
|
+
let directiveProperties = {};
|
|
562
|
+
let customProperties = {};
|
|
563
|
+
let allProperties;
|
|
564
|
+
for (var prop in changes) {
|
|
565
|
+
if (prop !== 'options' && prop !== 'tooltipValue') {
|
|
566
|
+
directiveProperties[prop] = changes[prop].currentValue;
|
|
567
|
+
}
|
|
568
|
+
if (prop === 'options') {
|
|
569
|
+
customProperties = changes[prop].currentValue;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
allProperties = Object.assign({}, customProperties, directiveProperties);
|
|
573
|
+
return allProperties;
|
|
574
|
+
}
|
|
575
|
+
renameProperties(options) {
|
|
576
|
+
for (var prop in options) {
|
|
577
|
+
if (backwardCompatibilityOptions[prop]) {
|
|
578
|
+
options[backwardCompatibilityOptions[prop]] = options[prop];
|
|
579
|
+
delete options[prop];
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
return options;
|
|
583
|
+
}
|
|
584
|
+
getElementPosition() {
|
|
585
|
+
this.elementPosition = this.elementRef.nativeElement.getBoundingClientRect();
|
|
586
|
+
}
|
|
587
|
+
createTooltip() {
|
|
588
|
+
this.clearTimeouts();
|
|
589
|
+
this.getElementPosition();
|
|
590
|
+
this.createTimeoutId = window.setTimeout(() => {
|
|
591
|
+
this.appendComponentToBody(GravityTooltipComponent);
|
|
592
|
+
}, this.getShowDelay());
|
|
593
|
+
this.showTimeoutId = window.setTimeout(() => {
|
|
594
|
+
this.showTooltipElem();
|
|
595
|
+
}, this.getShowDelay());
|
|
596
|
+
}
|
|
597
|
+
destroyTooltip(options = {
|
|
598
|
+
fast: false
|
|
599
|
+
}) {
|
|
600
|
+
this.clearTimeouts();
|
|
601
|
+
if (this.isTooltipDestroyed == false) {
|
|
602
|
+
this.hideTimeoutId = window.setTimeout(() => {
|
|
603
|
+
this.hideTooltip();
|
|
604
|
+
}, options.fast ? 0 : this.getHideDelay());
|
|
605
|
+
this.destroyTimeoutId = window.setTimeout(() => {
|
|
606
|
+
if (!this.componentRef || this.isTooltipDestroyed) {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
this.appRef.detachView(this.componentRef.hostView);
|
|
610
|
+
this.componentRef.destroy();
|
|
611
|
+
this.events.emit({
|
|
612
|
+
type: 'hidden',
|
|
613
|
+
position: this.tooltipPosition
|
|
614
|
+
});
|
|
615
|
+
}, options.fast ? 0 : this.destroyDelay);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
showTooltipElem() {
|
|
619
|
+
this.clearTimeouts();
|
|
620
|
+
this.componentRef.instance.show = true;
|
|
621
|
+
this.events.emit({
|
|
622
|
+
type: 'show',
|
|
623
|
+
position: this.tooltipPosition
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
hideTooltip() {
|
|
627
|
+
if (!this.componentRef || this.isTooltipDestroyed) {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
this.componentRef.instance.show = false;
|
|
631
|
+
this.events.emit({
|
|
632
|
+
type: 'hide',
|
|
633
|
+
position: this.tooltipPosition
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
appendComponentToBody(component) {
|
|
637
|
+
this.componentRef = this.componentFactoryResolver
|
|
638
|
+
.resolveComponentFactory(component)
|
|
639
|
+
.create(this.injector);
|
|
640
|
+
this.componentRef.instance.data = {
|
|
641
|
+
value: this.tooltipValue,
|
|
642
|
+
element: this.elementRef.nativeElement,
|
|
643
|
+
elementPosition: this.tooltipPosition,
|
|
644
|
+
options: this.options
|
|
645
|
+
};
|
|
646
|
+
this.appRef.attachView(this.componentRef.hostView);
|
|
647
|
+
const domElem = this.componentRef.hostView.rootNodes[0];
|
|
648
|
+
document.body.appendChild(domElem);
|
|
649
|
+
this.componentSubscribe = this.componentRef.instance.events.subscribe((event) => {
|
|
650
|
+
this.handleEvents(event);
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
clearTimeouts() {
|
|
654
|
+
if (this.createTimeoutId) {
|
|
655
|
+
clearTimeout(this.createTimeoutId);
|
|
656
|
+
}
|
|
657
|
+
if (this.showTimeoutId) {
|
|
658
|
+
clearTimeout(this.showTimeoutId);
|
|
659
|
+
}
|
|
660
|
+
if (this.hideTimeoutId) {
|
|
661
|
+
clearTimeout(this.hideTimeoutId);
|
|
662
|
+
}
|
|
663
|
+
if (this.destroyTimeoutId) {
|
|
664
|
+
clearTimeout(this.destroyTimeoutId);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
get isDisplayOnHover() {
|
|
668
|
+
if (this.options['display'] == false) {
|
|
669
|
+
return false;
|
|
670
|
+
}
|
|
671
|
+
if (this.options['displayTouchscreen'] == false && this.isTouchScreen) {
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
return this.options['trigger'] === 'hover';
|
|
675
|
+
}
|
|
676
|
+
get isDisplayOnClick() {
|
|
677
|
+
if (this.options['display'] == false) {
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
if (this.options['displayTouchscreen'] == false && this.isTouchScreen) {
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
683
|
+
return this.options['trigger'] == 'click';
|
|
684
|
+
}
|
|
685
|
+
get isTouchScreen() {
|
|
686
|
+
var prefixes = ' -webkit- -moz- -o- -ms- '.split(' ');
|
|
687
|
+
var mq = function (query) {
|
|
688
|
+
return window.matchMedia(query).matches;
|
|
689
|
+
};
|
|
690
|
+
if (('ontouchstart' in window)) {
|
|
691
|
+
return true;
|
|
692
|
+
}
|
|
693
|
+
// include the 'heartz' as a way to have a non matching MQ to help terminate the join
|
|
694
|
+
// https://git.io/vznFH
|
|
695
|
+
var query = ['(', prefixes.join('touch-enabled),('), 'heartz', ')'].join('');
|
|
696
|
+
return mq(query);
|
|
697
|
+
}
|
|
698
|
+
applyOptionsDefault(defaultOptions, options) {
|
|
699
|
+
this.options = Object.assign({}, defaultOptions, this.initOptions || {}, this.options, options);
|
|
700
|
+
}
|
|
701
|
+
handleEvents(event) {
|
|
702
|
+
if (event.type === 'shown') {
|
|
703
|
+
this.events.emit({
|
|
704
|
+
type: 'shown',
|
|
705
|
+
position: this.tooltipPosition
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
show() {
|
|
710
|
+
if (!this.tooltipValue) {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
if (!this.componentRef || this.isTooltipDestroyed) {
|
|
714
|
+
this.createTooltip();
|
|
715
|
+
}
|
|
716
|
+
else if (!this.isTooltipDestroyed) {
|
|
717
|
+
this.showTooltipElem();
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
hide() {
|
|
721
|
+
this.destroyTooltip();
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
GravityTooltipDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipDirective, deps: [{ token: TooltipOptionsService, optional: true }, { token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
725
|
+
GravityTooltipDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: GravityTooltipDirective, selector: "[tooltip]", inputs: { options: "options", tooltipValue: ["tooltip", "tooltipValue"], placement: "placement", autoPlacement: "autoPlacement", contentTypeBackwardCompatibility: ["content-type", "contentTypeBackwardCompatibility"], contentType: "contentType", hideDelayMobile: ["hide-delay-mobile", "hideDelayMobile"], hideDelayTouchscreen: "hideDelayTouchscreen", zIndexBackwardCompatibility: ["z-index", "zIndexBackwardCompatibility"], zIndex: "zIndex", animationDurationBackwardCompatibility: ["animation-duration", "animationDurationBackwardCompatibility"], animationDuration: "animationDuration", trigger: "trigger", tooltipClassBackwardCompatibility: ["tooltip-class", "tooltipClassBackwardCompatibility"], tooltipClass: "tooltipClass", display: "display", displayMobile: ["display-mobile", "displayMobile"], displayTouchscreen: "displayTouchscreen", shadow: "shadow", theme: "theme", offset: "offset", width: "width", maxWidthBackwardCompatibility: ["max-width", "maxWidthBackwardCompatibility"], maxWidth: "maxWidth", id: "id", showDelayBackwardCompatibility: ["show-delay", "showDelayBackwardCompatibility"], showDelay: "showDelay", hideDelayBackwardCompatibility: ["hide-delay", "hideDelayBackwardCompatibility"], hideDelay: "hideDelay", hideDelayAfterClick: "hideDelayAfterClick", pointerEvents: "pointerEvents", position: "position" }, outputs: { events: "events" }, host: { listeners: { "focusin": "onMouseEnter()", "mouseenter": "onMouseEnter()", "focusout": "onMouseLeave()", "mouseleave": "onMouseLeave()", "click": "onClick()" } }, exportAs: ["tooltip"], usesOnChanges: true, ngImport: i0 });
|
|
726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipDirective, decorators: [{
|
|
727
|
+
type: Directive,
|
|
728
|
+
args: [{
|
|
729
|
+
selector: '[tooltip]',
|
|
730
|
+
exportAs: 'tooltip',
|
|
731
|
+
}]
|
|
732
|
+
}], ctorParameters: function () {
|
|
733
|
+
return [{ type: undefined, decorators: [{
|
|
734
|
+
type: Optional
|
|
735
|
+
}, {
|
|
736
|
+
type: Inject,
|
|
737
|
+
args: [TooltipOptionsService]
|
|
738
|
+
}] }, { type: i0.ElementRef }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }];
|
|
739
|
+
}, propDecorators: { options: [{
|
|
740
|
+
type: Input,
|
|
741
|
+
args: ['options']
|
|
742
|
+
}], tooltipValue: [{
|
|
743
|
+
type: Input,
|
|
744
|
+
args: ['tooltip']
|
|
745
|
+
}], placement: [{
|
|
746
|
+
type: Input,
|
|
747
|
+
args: ['placement']
|
|
748
|
+
}], autoPlacement: [{
|
|
749
|
+
type: Input,
|
|
750
|
+
args: ['autoPlacement']
|
|
751
|
+
}], contentTypeBackwardCompatibility: [{
|
|
752
|
+
type: Input,
|
|
753
|
+
args: ['content-type']
|
|
754
|
+
}], contentType: [{
|
|
755
|
+
type: Input,
|
|
756
|
+
args: ['contentType']
|
|
757
|
+
}], hideDelayMobile: [{
|
|
758
|
+
type: Input,
|
|
759
|
+
args: ['hide-delay-mobile']
|
|
760
|
+
}], hideDelayTouchscreen: [{
|
|
761
|
+
type: Input,
|
|
762
|
+
args: ['hideDelayTouchscreen']
|
|
763
|
+
}], zIndexBackwardCompatibility: [{
|
|
764
|
+
type: Input,
|
|
765
|
+
args: ['z-index']
|
|
766
|
+
}], zIndex: [{
|
|
767
|
+
type: Input,
|
|
768
|
+
args: ['zIndex']
|
|
769
|
+
}], animationDurationBackwardCompatibility: [{
|
|
770
|
+
type: Input,
|
|
771
|
+
args: ['animation-duration']
|
|
772
|
+
}], animationDuration: [{
|
|
773
|
+
type: Input,
|
|
774
|
+
args: ['animationDuration']
|
|
775
|
+
}], trigger: [{
|
|
776
|
+
type: Input,
|
|
777
|
+
args: ['trigger']
|
|
778
|
+
}], tooltipClassBackwardCompatibility: [{
|
|
779
|
+
type: Input,
|
|
780
|
+
args: ['tooltip-class']
|
|
781
|
+
}], tooltipClass: [{
|
|
782
|
+
type: Input,
|
|
783
|
+
args: ['tooltipClass']
|
|
784
|
+
}], display: [{
|
|
785
|
+
type: Input,
|
|
786
|
+
args: ['display']
|
|
787
|
+
}], displayMobile: [{
|
|
788
|
+
type: Input,
|
|
789
|
+
args: ['display-mobile']
|
|
790
|
+
}], displayTouchscreen: [{
|
|
791
|
+
type: Input,
|
|
792
|
+
args: ['displayTouchscreen']
|
|
793
|
+
}], shadow: [{
|
|
794
|
+
type: Input,
|
|
795
|
+
args: ['shadow']
|
|
796
|
+
}], theme: [{
|
|
797
|
+
type: Input,
|
|
798
|
+
args: ['theme']
|
|
799
|
+
}], offset: [{
|
|
800
|
+
type: Input,
|
|
801
|
+
args: ['offset']
|
|
802
|
+
}], width: [{
|
|
803
|
+
type: Input,
|
|
804
|
+
args: ['width']
|
|
805
|
+
}], maxWidthBackwardCompatibility: [{
|
|
806
|
+
type: Input,
|
|
807
|
+
args: ['max-width']
|
|
808
|
+
}], maxWidth: [{
|
|
809
|
+
type: Input,
|
|
810
|
+
args: ['maxWidth']
|
|
811
|
+
}], id: [{
|
|
812
|
+
type: Input,
|
|
813
|
+
args: ['id']
|
|
814
|
+
}], showDelayBackwardCompatibility: [{
|
|
815
|
+
type: Input,
|
|
816
|
+
args: ['show-delay']
|
|
817
|
+
}], showDelay: [{
|
|
818
|
+
type: Input,
|
|
819
|
+
args: ['showDelay']
|
|
820
|
+
}], hideDelayBackwardCompatibility: [{
|
|
821
|
+
type: Input,
|
|
822
|
+
args: ['hide-delay']
|
|
823
|
+
}], hideDelay: [{
|
|
824
|
+
type: Input,
|
|
825
|
+
args: ['hideDelay']
|
|
826
|
+
}], hideDelayAfterClick: [{
|
|
827
|
+
type: Input,
|
|
828
|
+
args: ['hideDelayAfterClick']
|
|
829
|
+
}], pointerEvents: [{
|
|
830
|
+
type: Input,
|
|
831
|
+
args: ['pointerEvents']
|
|
832
|
+
}], position: [{
|
|
833
|
+
type: Input,
|
|
834
|
+
args: ['position']
|
|
835
|
+
}], events: [{
|
|
836
|
+
type: Output
|
|
837
|
+
}], onMouseEnter: [{
|
|
838
|
+
type: HostListener,
|
|
839
|
+
args: ['focusin']
|
|
840
|
+
}, {
|
|
841
|
+
type: HostListener,
|
|
842
|
+
args: ['mouseenter']
|
|
843
|
+
}], onMouseLeave: [{
|
|
844
|
+
type: HostListener,
|
|
845
|
+
args: ['focusout']
|
|
846
|
+
}, {
|
|
847
|
+
type: HostListener,
|
|
848
|
+
args: ['mouseleave']
|
|
849
|
+
}], onClick: [{
|
|
850
|
+
type: HostListener,
|
|
851
|
+
args: ['click']
|
|
852
|
+
}] } });
|
|
853
|
+
|
|
854
|
+
class GravityTooltipModule {
|
|
855
|
+
static forRoot(initOptions) {
|
|
856
|
+
return {
|
|
857
|
+
ngModule: GravityTooltipModule,
|
|
858
|
+
providers: [
|
|
859
|
+
{
|
|
860
|
+
provide: TooltipOptionsService,
|
|
861
|
+
useValue: initOptions
|
|
862
|
+
}
|
|
863
|
+
]
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
GravityTooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
868
|
+
GravityTooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipModule, declarations: [GravityTooltipDirective,
|
|
869
|
+
GravityTooltipComponent], imports: [CommonModule], exports: [GravityTooltipDirective,
|
|
870
|
+
GravityTooltipComponent] });
|
|
871
|
+
GravityTooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipModule, imports: [CommonModule] });
|
|
872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityTooltipModule, decorators: [{
|
|
873
|
+
type: NgModule,
|
|
874
|
+
args: [{
|
|
875
|
+
declarations: [
|
|
876
|
+
GravityTooltipDirective,
|
|
877
|
+
GravityTooltipComponent
|
|
878
|
+
],
|
|
879
|
+
imports: [
|
|
880
|
+
CommonModule
|
|
881
|
+
],
|
|
882
|
+
exports: [
|
|
883
|
+
GravityTooltipDirective,
|
|
884
|
+
GravityTooltipComponent
|
|
885
|
+
]
|
|
886
|
+
}]
|
|
28
887
|
}] });
|
|
29
888
|
|
|
889
|
+
class GravityCalendarComponent {
|
|
890
|
+
constructor() {
|
|
891
|
+
this.calendarResponse = new EventEmitter();
|
|
892
|
+
this.calendarOpened = false;
|
|
893
|
+
this.focusInput = false;
|
|
894
|
+
this.selectedDate = '';
|
|
895
|
+
}
|
|
896
|
+
ngOnInit() {
|
|
897
|
+
this.data.required = this.data.required ? this.data.required : false;
|
|
898
|
+
this.data.state = this.data.state ? this.data.state : "enabled";
|
|
899
|
+
if (this.data.supportText) {
|
|
900
|
+
this.data.supportText.type = this.data.supportText.type ? this.data.supportText.type : "neutro";
|
|
901
|
+
}
|
|
902
|
+
if (this.data.icon) {
|
|
903
|
+
this.data.icon.placement = this.data.icon.placement ? this.data.icon.placement : 'left';
|
|
904
|
+
}
|
|
905
|
+
if (this.data.dates) {
|
|
906
|
+
if (this.data.dates.defaultDays) {
|
|
907
|
+
this.updateDate(null, new Date(new Date().setDate(new Date().getDate() - this.data.dates.defaultDays)));
|
|
908
|
+
}
|
|
909
|
+
if (this.data.dates.customDate) {
|
|
910
|
+
this.updateDate(null, this.data.dates.customDate);
|
|
911
|
+
}
|
|
912
|
+
if (this.data.dates.minDate) {
|
|
913
|
+
this.minDate = {};
|
|
914
|
+
this.minDate.year = this.data.dates.minDate.getUTCFullYear();
|
|
915
|
+
this.minDate.month = (this.data.dates.minDate.getUTCMonth() + 1);
|
|
916
|
+
this.minDate.day = this.data.dates.minDate.getUTCDate();
|
|
917
|
+
}
|
|
918
|
+
if (this.data.dates.maxDate) {
|
|
919
|
+
if (this.data.dates.maxDate == 'today') {
|
|
920
|
+
this.data.dates.maxDate = new Date();
|
|
921
|
+
}
|
|
922
|
+
this.maxDate = {};
|
|
923
|
+
this.maxDate.year = this.data.dates.maxDate.getUTCFullYear();
|
|
924
|
+
this.maxDate.month = (this.data.dates.maxDate.getUTCMonth() + 1);
|
|
925
|
+
this.maxDate.day = this.data.dates.maxDate.getUTCDate();
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
updateDate($event, customDate) {
|
|
930
|
+
if ($event) {
|
|
931
|
+
this.selectedDate = GravityCalendarComponent.formatNgbDate($event);
|
|
932
|
+
this.calendarResponse.emit(new Date($event.year, ($event.month - 1), $event.day));
|
|
933
|
+
}
|
|
934
|
+
else if (customDate) {
|
|
935
|
+
this.selectedDate = GravityCalendarComponent.formatTSDate(customDate);
|
|
936
|
+
this.calendarResponse.emit(customDate);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
static formatNgbDate(ngbDate) {
|
|
940
|
+
if (!ngbDate) {
|
|
941
|
+
return null;
|
|
942
|
+
}
|
|
943
|
+
return [
|
|
944
|
+
(ngbDate.month < 10 ? ('0' + ngbDate.month) : ngbDate.month),
|
|
945
|
+
(ngbDate.day < 10 ? ('0' + ngbDate.day) : ngbDate.day),
|
|
946
|
+
ngbDate.year
|
|
947
|
+
].join('/');
|
|
948
|
+
}
|
|
949
|
+
static formatTSDate(date) {
|
|
950
|
+
if (!date) {
|
|
951
|
+
return null;
|
|
952
|
+
}
|
|
953
|
+
return [
|
|
954
|
+
((date.getUTCMonth() + 1) < 10 ? ('0' + (date.getUTCMonth() + 1)) : (date.getUTCMonth() + 1)),
|
|
955
|
+
(date.getUTCDate() < 10 ? ('0' + date.getUTCDate()) : date.getUTCDate()),
|
|
956
|
+
date.getUTCFullYear()
|
|
957
|
+
].join('/');
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
GravityCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
961
|
+
GravityCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityCalendarComponent, selector: "gravity-calendar", inputs: { data: "data" }, outputs: { calendarResponse: "calendarResponse" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true }], ngImport: i0, template: "<div class=\"gravity-calendar\">\n <label class=\"hr-body-text md-regular {{data.state}}\" [class.empty]=\"!selectedDate && !focusInput && !calendarOpened\"\n [class.focused]=\"focusInput || calendarOpened\" [class.full]=\"selectedDate && !focusInput && !calendarOpened\">\n {{data.label}}\n <ng-container *ngIf=\"data.required\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Requerido <span class=\"text-negative\">*</span></ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Required <span class=\"text-negative\">*</span></ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'readonly'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- S\u00F3lo lectura</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Readonly</ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'disabled'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Deshabilitado</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Disabled</ng-container>\n </ng-container>\n </label>\n <div class=\"calendar-field {{data.state}}\" [class.empty]=\"!selectedDate && !focusInput && !calendarOpened\"\n [class.focused]=\"focusInput || calendarOpened\" [class.full]=\"selectedDate && !focusInput && !calendarOpened\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <input [attr.data-cy]=\"data.cypressTag\"\n [disabled]=\"data.state == 'disabled' ? true : null\"\n [readonly]=\"data.state != 'disabled' ? true : null\"\n [value]=\"selectedDate\"\n\n (blur)=\"focusInput = false\"\n (closed)=\"calendarOpened = false\"\n (dateSelect)=\"updateDate($event)\"\n (focus)=\"focusInput = true\"\n\n class=\"hr-label md-regular\"\n ngbDatepicker\n placeholder=\"Select your date\"\n\n [container]=\"'body'\"\n [datepickerClass]=\"'gravity-datepicker-dialog'\"\n [maxDate]=\"maxDate ? maxDate : null\"\n [minDate]=\"minDate ? minDate : null\"\n [navigation]=\"'arrows'\"\n [showWeekNumbers]=\"true\"\n\n #datePicker=\"ngbDatepicker\">\n <span (click)=\"datePicker.open(); calendarOpened = true\" *ngIf=\"!calendarOpened && data.state == 'enabled'\"></span>\n <span (click)=\"datePicker.close(); calendarOpened = false\" *ngIf=\"calendarOpened && data.state == 'enabled'\"></span>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n </div>\n <p class=\"hr-body-text sm-regular support-text text-{{data.supportText.type}}\" *ngIf=\"data.supportText\">\n {{data.supportText.content}}\n </p>\n</div>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n", styles: [".text-negative{color:var(--negative-primary)}.text-neutro{color:var(--text-primary)}.text-positive{color:var(--positive-primary)}.support-text{margin-left:0;margin-top:.3125rem;padding-inline:1rem}label{color:var(--text-field-label-color);margin-inline:1rem}label.empty.enabled{--text-field-label-color: var(--label-text-empty-enabled-primary)}label.empty.disabled{--text-field-label-color: var(--label-text-empty-disabled-primary)}label.full.enabled{--text-field-label-color: var(--label-text-full-enabled-primary)}label.full.disabled{--text-field-label-color: var(--label-text-full-disabled-primary)}label.full.readonly{--text-field-label-color: var(--label-text-full-read-only-primary)}label.focused{--text-field-label-color: var(--label-text-full-enabled-pressed-primary)}.calendar-field{align-items:center;background-color:var(--text-field-input-field-background-color);border:1px solid var(--text-field-input-field-border-color);border-radius:.625rem;display:flex;max-height:2rem;min-height:1.5rem;padding:.625rem 1rem;position:relative}.calendar-field svg-icon{height:1rem;line-height:0;width:1rem}.calendar-field svg-icon.placement-left{margin-right:.5rem}.calendar-field svg-icon.placement-right{margin-left:.5rem}.calendar-field input{background-color:transparent;border:none;box-shadow:none;color:var(--text-field-input-field-input-color);line-height:0;outline:none;padding:0;width:100%}.calendar-field input::placeholder{color:var(--text-field-input-field-placeholder-color)}.calendar-field span{cursor:pointer;height:100%;left:0;position:absolute;width:100%}.calendar-field.empty.enabled{--text-field-input-field-background-color: var(--bg-field-empty-enabled-primary);--text-field-input-field-border-color: var(--outline-field-empty-enabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-enabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-enabled-primary)}.calendar-field.empty.enabled:hover{--text-field-input-field-background-color: var(--bg-field-empty-enabled-hover-primary)}.calendar-field.empty.disabled{--text-field-input-field-background-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-border-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-disabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-disabled-primary)}.calendar-field.empty.disabled svg-icon ::ng-deep svg{--icon-color: var(--placeholder-empty-disabled-primary)}.calendar-field.full.enabled{--text-field-input-field-background-color: var(--bg-field-full-enabled-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-primary);--text-field-input-field-input-color: var(--input-text-full-enabled-primary)}.calendar-field.full.enabled:hover{--text-field-input-field-background-color: var(--bg-field-full-enabled-hover-primary)}.calendar-field.full.disabled{--text-field-input-field-background-color: var(--bg-field-full-disabled-primary);--text-field-input-field-border-color: var(--bg-field-full-disabled-primary);--text-field-input-field-input-color: var(--input-text-full-disabled-primary)}.calendar-field.full.disabled svg-icon ::ng-deep svg{--icon-color: var(--input-text-full-disabled-primary)}.calendar-field.readonly{--text-field-input-field-background-color: var(--bg-field-full-read-only-primary);--text-field-input-field-border-color: var(--bg-field-full-read-only-primary);--text-field-input-field-input-color: var(--input-text-full-read-only-primary)}.calendar-field.focused:not(.readonly){--text-field-input-field-background-color: var(--bg-field-full-enabled-pressed-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-pressed-primary);--text-field-input-field-input-color: var(--placeholder-full-enabled-pressed-primary)}\n"], dependencies: [{ kind: "component", type: i1.SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "applyCss", "svgClass", "class", "viewBox", "svgAriaLabel", "svgStyle"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$1.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }] });
|
|
962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityCalendarComponent, decorators: [{
|
|
963
|
+
type: Component,
|
|
964
|
+
args: [{ selector: 'gravity-calendar', template: "<div class=\"gravity-calendar\">\n <label class=\"hr-body-text md-regular {{data.state}}\" [class.empty]=\"!selectedDate && !focusInput && !calendarOpened\"\n [class.focused]=\"focusInput || calendarOpened\" [class.full]=\"selectedDate && !focusInput && !calendarOpened\">\n {{data.label}}\n <ng-container *ngIf=\"data.required\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Requerido <span class=\"text-negative\">*</span></ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Required <span class=\"text-negative\">*</span></ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'readonly'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- S\u00F3lo lectura</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Readonly</ng-container>\n </ng-container>\n <ng-container *ngIf=\"data.state == 'disabled'\">\n <ng-container *ngIf=\"data.currentLang == 'es'\">- Deshabilitado</ng-container>\n <ng-container *ngIf=\"data.currentLang == 'en'\">- Disabled</ng-container>\n </ng-container>\n </label>\n <div class=\"calendar-field {{data.state}}\" [class.empty]=\"!selectedDate && !focusInput && !calendarOpened\"\n [class.focused]=\"focusInput || calendarOpened\" [class.full]=\"selectedDate && !focusInput && !calendarOpened\">\n <ng-container *ngIf=\"data.icon?.placement == 'left'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n <input [attr.data-cy]=\"data.cypressTag\"\n [disabled]=\"data.state == 'disabled' ? true : null\"\n [readonly]=\"data.state != 'disabled' ? true : null\"\n [value]=\"selectedDate\"\n\n (blur)=\"focusInput = false\"\n (closed)=\"calendarOpened = false\"\n (dateSelect)=\"updateDate($event)\"\n (focus)=\"focusInput = true\"\n\n class=\"hr-label md-regular\"\n ngbDatepicker\n placeholder=\"Select your date\"\n\n [container]=\"'body'\"\n [datepickerClass]=\"'gravity-datepicker-dialog'\"\n [maxDate]=\"maxDate ? maxDate : null\"\n [minDate]=\"minDate ? minDate : null\"\n [navigation]=\"'arrows'\"\n [showWeekNumbers]=\"true\"\n\n #datePicker=\"ngbDatepicker\">\n <span (click)=\"datePicker.open(); calendarOpened = true\" *ngIf=\"!calendarOpened && data.state == 'enabled'\"></span>\n <span (click)=\"datePicker.close(); calendarOpened = false\" *ngIf=\"calendarOpened && data.state == 'enabled'\"></span>\n <ng-container *ngIf=\"data.icon?.placement == 'right'\">\n <ng-container *ngTemplateOutlet=\"icons\"></ng-container>\n </ng-container>\n </div>\n <p class=\"hr-body-text sm-regular support-text text-{{data.supportText.type}}\" *ngIf=\"data.supportText\">\n {{data.supportText.content}}\n </p>\n</div>\n\n<ng-template #icons>\n <svg-icon class=\"placement-{{data.icon.placement}}\" [name]=\"iconName\"\n *ngFor=\"let iconName of data.icon.names\"></svg-icon>\n</ng-template>\n", styles: [".text-negative{color:var(--negative-primary)}.text-neutro{color:var(--text-primary)}.text-positive{color:var(--positive-primary)}.support-text{margin-left:0;margin-top:.3125rem;padding-inline:1rem}label{color:var(--text-field-label-color);margin-inline:1rem}label.empty.enabled{--text-field-label-color: var(--label-text-empty-enabled-primary)}label.empty.disabled{--text-field-label-color: var(--label-text-empty-disabled-primary)}label.full.enabled{--text-field-label-color: var(--label-text-full-enabled-primary)}label.full.disabled{--text-field-label-color: var(--label-text-full-disabled-primary)}label.full.readonly{--text-field-label-color: var(--label-text-full-read-only-primary)}label.focused{--text-field-label-color: var(--label-text-full-enabled-pressed-primary)}.calendar-field{align-items:center;background-color:var(--text-field-input-field-background-color);border:1px solid var(--text-field-input-field-border-color);border-radius:.625rem;display:flex;max-height:2rem;min-height:1.5rem;padding:.625rem 1rem;position:relative}.calendar-field svg-icon{height:1rem;line-height:0;width:1rem}.calendar-field svg-icon.placement-left{margin-right:.5rem}.calendar-field svg-icon.placement-right{margin-left:.5rem}.calendar-field input{background-color:transparent;border:none;box-shadow:none;color:var(--text-field-input-field-input-color);line-height:0;outline:none;padding:0;width:100%}.calendar-field input::placeholder{color:var(--text-field-input-field-placeholder-color)}.calendar-field span{cursor:pointer;height:100%;left:0;position:absolute;width:100%}.calendar-field.empty.enabled{--text-field-input-field-background-color: var(--bg-field-empty-enabled-primary);--text-field-input-field-border-color: var(--outline-field-empty-enabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-enabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-enabled-primary)}.calendar-field.empty.enabled:hover{--text-field-input-field-background-color: var(--bg-field-empty-enabled-hover-primary)}.calendar-field.empty.disabled{--text-field-input-field-background-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-border-color: var(--bg-field-empty-disabled-primary);--text-field-input-field-input-color: var(--placeholder-empty-disabled-primary);--text-field-input-field-placeholder-color: var(--placeholder-empty-disabled-primary)}.calendar-field.empty.disabled svg-icon ::ng-deep svg{--icon-color: var(--placeholder-empty-disabled-primary)}.calendar-field.full.enabled{--text-field-input-field-background-color: var(--bg-field-full-enabled-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-primary);--text-field-input-field-input-color: var(--input-text-full-enabled-primary)}.calendar-field.full.enabled:hover{--text-field-input-field-background-color: var(--bg-field-full-enabled-hover-primary)}.calendar-field.full.disabled{--text-field-input-field-background-color: var(--bg-field-full-disabled-primary);--text-field-input-field-border-color: var(--bg-field-full-disabled-primary);--text-field-input-field-input-color: var(--input-text-full-disabled-primary)}.calendar-field.full.disabled svg-icon ::ng-deep svg{--icon-color: var(--input-text-full-disabled-primary)}.calendar-field.readonly{--text-field-input-field-background-color: var(--bg-field-full-read-only-primary);--text-field-input-field-border-color: var(--bg-field-full-read-only-primary);--text-field-input-field-input-color: var(--input-text-full-read-only-primary)}.calendar-field.focused:not(.readonly){--text-field-input-field-background-color: var(--bg-field-full-enabled-pressed-primary);--text-field-input-field-border-color: var(--outline-field-full-enabled-pressed-primary);--text-field-input-field-input-color: var(--placeholder-full-enabled-pressed-primary)}\n"] }]
|
|
965
|
+
}], propDecorators: { calendarResponse: [{
|
|
966
|
+
type: Output
|
|
967
|
+
}], data: [{
|
|
968
|
+
type: Input
|
|
969
|
+
}], inputElement: [{
|
|
970
|
+
type: ViewChild,
|
|
971
|
+
args: ['inputElement', { static: false }]
|
|
972
|
+
}] } });
|
|
973
|
+
|
|
974
|
+
class GravityRadioButtonComponent {
|
|
975
|
+
constructor() {
|
|
976
|
+
this.checked = false;
|
|
977
|
+
this.disabled = false;
|
|
978
|
+
this.change = new EventEmitter();
|
|
979
|
+
}
|
|
980
|
+
onChange(event) {
|
|
981
|
+
this.change.emit(event);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
GravityRadioButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityRadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
985
|
+
GravityRadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityRadioButtonComponent, selector: "gravity-radio-button", inputs: { checked: "checked", value: "value", disabled: "disabled", name: "name" }, outputs: { change: "change" }, ngImport: i0, template: "<p-radio\n animation=\"smooth\"\n name=\"icon\"\n outline=\"outline\"\n shape=\"round\"\n\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [value]=\"value\"\n\n (change)=\"onChange($event)\">\n <ng-content></ng-content>\n</p-radio>\n\n\n", styles: [""], dependencies: [{ kind: "component", type: i1$1.NgxPrettyRadioComponent, selector: "ngx-pretty-radio:not([will-change]), p-radio:not([will-change])", inputs: ["checked", "disabled", "value", "lock"], outputs: ["change"], exportAs: ["ngxPrettyRadio"] }] });
|
|
986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityRadioButtonComponent, decorators: [{
|
|
987
|
+
type: Component,
|
|
988
|
+
args: [{ selector: 'gravity-radio-button', template: "<p-radio\n animation=\"smooth\"\n name=\"icon\"\n outline=\"outline\"\n shape=\"round\"\n\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [value]=\"value\"\n\n (change)=\"onChange($event)\">\n <ng-content></ng-content>\n</p-radio>\n\n\n" }]
|
|
989
|
+
}], propDecorators: { checked: [{
|
|
990
|
+
type: Input
|
|
991
|
+
}], value: [{
|
|
992
|
+
type: Input
|
|
993
|
+
}], disabled: [{
|
|
994
|
+
type: Input
|
|
995
|
+
}], name: [{
|
|
996
|
+
type: Input
|
|
997
|
+
}], change: [{
|
|
998
|
+
type: Output
|
|
999
|
+
}] } });
|
|
1000
|
+
|
|
1001
|
+
class GravitySwitchComponent {
|
|
1002
|
+
constructor() {
|
|
1003
|
+
this.disabled = false;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
GravitySwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravitySwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1007
|
+
GravitySwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravitySwitchComponent, selector: "gravity-switch", inputs: { disabled: "disabled" }, ngImport: i0, template: "<p-checkbox [disabled]=\"disabled\" isSwitch=\"true\" stroke=\"fill\">\n <ng-content></ng-content>\n</p-checkbox>\n", styles: [""], dependencies: [{ kind: "component", type: i1$1.NgxPrettyCheckboxComponent, selector: "ngx-pretty-checkbox:not([will-change]), p-checkbox:not([will-change])", inputs: ["checked", "disabled", "value", "lock", "stateless"], outputs: ["change"], exportAs: ["ngxPrettyCheckbox"] }] });
|
|
1008
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravitySwitchComponent, decorators: [{
|
|
1009
|
+
type: Component,
|
|
1010
|
+
args: [{ selector: 'gravity-switch', template: "<p-checkbox [disabled]=\"disabled\" isSwitch=\"true\" stroke=\"fill\">\n <ng-content></ng-content>\n</p-checkbox>\n" }]
|
|
1011
|
+
}], propDecorators: { disabled: [{
|
|
1012
|
+
type: Input
|
|
1013
|
+
}] } });
|
|
1014
|
+
|
|
1015
|
+
class GravityCheckboxComponent {
|
|
1016
|
+
constructor() {
|
|
1017
|
+
this.disabled = false;
|
|
1018
|
+
this.checked = false;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
GravityCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1022
|
+
GravityCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityCheckboxComponent, selector: "gravity-checkbox", inputs: { value: "value", disabled: "disabled", checked: "checked" }, ngImport: i0, template: "<p-checkbox [checked]=\"checked\" color=\"default\" [disabled]=\"disabled\" shape=\"curve\" stroke=\"fill\" [value]=\"value\">\n <svg-icon p-svg name=\"check\"></svg-icon>\n <ng-content></ng-content>\n</p-checkbox>\n", styles: ["svg-icon{padding:2%}\n"], dependencies: [{ kind: "component", type: i1.SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "applyCss", "svgClass", "class", "viewBox", "svgAriaLabel", "svgStyle"] }, { kind: "component", type: i1$1.NgxPrettyCheckboxComponent, selector: "ngx-pretty-checkbox:not([will-change]), p-checkbox:not([will-change])", inputs: ["checked", "disabled", "value", "lock", "stateless"], outputs: ["change"], exportAs: ["ngxPrettyCheckbox"] }, { kind: "directive", type: i1$1.NgxPrettySvgDirective, selector: "[pSvg], [p-svg]" }] });
|
|
1023
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityCheckboxComponent, decorators: [{
|
|
1024
|
+
type: Component,
|
|
1025
|
+
args: [{ selector: 'gravity-checkbox', template: "<p-checkbox [checked]=\"checked\" color=\"default\" [disabled]=\"disabled\" shape=\"curve\" stroke=\"fill\" [value]=\"value\">\n <svg-icon p-svg name=\"check\"></svg-icon>\n <ng-content></ng-content>\n</p-checkbox>\n", styles: ["svg-icon{padding:2%}\n"] }]
|
|
1026
|
+
}], propDecorators: { value: [{
|
|
1027
|
+
type: Input
|
|
1028
|
+
}], disabled: [{
|
|
1029
|
+
type: Input
|
|
1030
|
+
}], checked: [{
|
|
1031
|
+
type: Input
|
|
1032
|
+
}] } });
|
|
1033
|
+
|
|
1034
|
+
class GravityIconComponent {
|
|
1035
|
+
}
|
|
1036
|
+
GravityIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1037
|
+
GravityIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GravityIconComponent, selector: "gravity-icon", inputs: { iconName: "iconName" }, ngImport: i0, template: "<svg-icon name=\"{{iconName}}\"></svg-icon>\n", styles: ["svg-icon ::ng-deep svg{--icon-color: var(--icon-active-primary);height:1rem;width:1rem}svg-icon:hover,svg-icon *:hover,svg-icon ::ng-deep *:hover{--icon-color: var(--icon-hover-primary)}\n"], dependencies: [{ kind: "component", type: i1.SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "applyCss", "svgClass", "class", "viewBox", "svgAriaLabel", "svgStyle"] }] });
|
|
1038
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityIconComponent, decorators: [{
|
|
1039
|
+
type: Component,
|
|
1040
|
+
args: [{ selector: 'gravity-icon', template: "<svg-icon name=\"{{iconName}}\"></svg-icon>\n", styles: ["svg-icon ::ng-deep svg{--icon-color: var(--icon-active-primary);height:1rem;width:1rem}svg-icon:hover,svg-icon *:hover,svg-icon ::ng-deep *:hover{--icon-color: var(--icon-hover-primary)}\n"] }]
|
|
1041
|
+
}], propDecorators: { iconName: [{
|
|
1042
|
+
type: Input
|
|
1043
|
+
}] } });
|
|
1044
|
+
|
|
30
1045
|
class GravityDesignSystemModule {
|
|
31
1046
|
}
|
|
32
1047
|
GravityDesignSystemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityDesignSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
33
|
-
GravityDesignSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: GravityDesignSystemModule, declarations: [
|
|
34
|
-
|
|
1048
|
+
GravityDesignSystemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: GravityDesignSystemModule, declarations: [GravityButtonComponent,
|
|
1049
|
+
GravityCalendarComponent,
|
|
1050
|
+
GravityCheckboxComponent,
|
|
1051
|
+
GravityDropdownListComponent,
|
|
1052
|
+
GravityIconComponent,
|
|
1053
|
+
GravityRadioButtonComponent,
|
|
1054
|
+
GravitySwitchComponent,
|
|
1055
|
+
GravityTextFieldComponent], imports: [i1.AngularSvgIconModule, i2$1.AngularSvgIconPreloaderModule, CommonModule,
|
|
1056
|
+
FormsModule, GravityTooltipModule, NgbDatepickerModule,
|
|
1057
|
+
NgSelectModule,
|
|
1058
|
+
NgxPrettyCheckboxModule,
|
|
1059
|
+
ReactiveFormsModule], exports: [GravityButtonComponent,
|
|
1060
|
+
GravityCalendarComponent,
|
|
1061
|
+
GravityCheckboxComponent,
|
|
1062
|
+
GravityDropdownListComponent,
|
|
1063
|
+
GravityIconComponent,
|
|
1064
|
+
GravityRadioButtonComponent,
|
|
1065
|
+
GravitySwitchComponent,
|
|
1066
|
+
GravityTextFieldComponent,
|
|
1067
|
+
GravityTooltipModule] });
|
|
1068
|
+
GravityDesignSystemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityDesignSystemModule, imports: [AngularSvgIconModule.forRoot(),
|
|
1069
|
+
AngularSvgIconPreloaderModule.forRoot({
|
|
1070
|
+
configUrl: './assets/gravity/json/icons.json',
|
|
1071
|
+
}),
|
|
1072
|
+
CommonModule,
|
|
1073
|
+
FormsModule,
|
|
1074
|
+
GravityTooltipModule.forRoot({}),
|
|
1075
|
+
NgbDatepickerModule,
|
|
1076
|
+
NgSelectModule,
|
|
1077
|
+
NgxPrettyCheckboxModule,
|
|
1078
|
+
ReactiveFormsModule, GravityTooltipModule] });
|
|
35
1079
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GravityDesignSystemModule, decorators: [{
|
|
36
1080
|
type: NgModule,
|
|
37
1081
|
args: [{
|
|
38
1082
|
declarations: [
|
|
39
|
-
|
|
1083
|
+
GravityButtonComponent,
|
|
1084
|
+
GravityCalendarComponent,
|
|
1085
|
+
GravityCheckboxComponent,
|
|
1086
|
+
GravityDropdownListComponent,
|
|
1087
|
+
GravityIconComponent,
|
|
1088
|
+
GravityRadioButtonComponent,
|
|
1089
|
+
GravitySwitchComponent,
|
|
1090
|
+
GravityTextFieldComponent
|
|
1091
|
+
],
|
|
1092
|
+
imports: [
|
|
1093
|
+
AngularSvgIconModule.forRoot(),
|
|
1094
|
+
AngularSvgIconPreloaderModule.forRoot({
|
|
1095
|
+
configUrl: './assets/gravity/json/icons.json',
|
|
1096
|
+
}),
|
|
1097
|
+
CommonModule,
|
|
1098
|
+
FormsModule,
|
|
1099
|
+
GravityTooltipModule.forRoot({}),
|
|
1100
|
+
NgbDatepickerModule,
|
|
1101
|
+
NgSelectModule,
|
|
1102
|
+
NgxPrettyCheckboxModule,
|
|
1103
|
+
ReactiveFormsModule
|
|
40
1104
|
],
|
|
41
1105
|
exports: [
|
|
42
|
-
|
|
1106
|
+
GravityButtonComponent,
|
|
1107
|
+
GravityCalendarComponent,
|
|
1108
|
+
GravityCheckboxComponent,
|
|
1109
|
+
GravityDropdownListComponent,
|
|
1110
|
+
GravityIconComponent,
|
|
1111
|
+
GravityRadioButtonComponent,
|
|
1112
|
+
GravitySwitchComponent,
|
|
1113
|
+
GravityTextFieldComponent,
|
|
1114
|
+
GravityTooltipModule
|
|
43
1115
|
]
|
|
44
1116
|
}]
|
|
45
1117
|
}] });
|
|
@@ -52,5 +1124,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
|
|
|
52
1124
|
* Generated bundle index. Do not edit.
|
|
53
1125
|
*/
|
|
54
1126
|
|
|
55
|
-
export {
|
|
1127
|
+
export { GravityButtonComponent, GravityCalendarComponent, GravityCheckboxComponent, GravityDesignSystemModule, GravityDropdownListComponent, GravityIconComponent, GravityRadioButtonComponent, GravitySwitchComponent, GravityTextFieldComponent, GravityTooltipComponent, GravityTooltipDirective, GravityTooltipModule };
|
|
56
1128
|
//# sourceMappingURL=progressio_resources-gravity-design-system.mjs.map
|