@testgorilla/tgo-ui 4.1.2-beta → 4.1.3-beta
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/components/autocomplete/autocomplete.component.d.ts +1 -1
- package/components/autocomplete/autocomplete.component.module.d.ts +7 -8
- package/components/autocomplete/index.d.ts +5 -0
- package/components/autocomplete/public-api.d.ts +4 -0
- package/components/avatar/avatar.component.module.d.ts +1 -1
- package/components/avatar/index.d.ts +5 -0
- package/components/avatar/public-api.d.ts +4 -0
- package/components/card/index.d.ts +5 -0
- package/components/card/public-api.d.ts +4 -0
- package/components/checkbox/checkbox.component.d.ts +1 -1
- package/components/checkbox/checkbox.component.module.d.ts +4 -5
- package/components/checkbox/index.d.ts +5 -0
- package/components/checkbox/public-api.d.ts +4 -0
- package/components/core/has-validation-error.pipe.d.ts +15 -0
- package/components/core/keyboard-events.model.d.ts +11 -0
- package/components/core/public-api.d.ts +7 -0
- package/components/core/select-text.directive.d.ts +19 -0
- package/components/datepicker/datepicker.component.module.d.ts +1 -1
- package/components/dropdown/dropdown.component.module.d.ts +2 -3
- package/components/dropdown/index.d.ts +5 -0
- package/components/dropdown/public-api.d.ts +4 -0
- package/components/empty-state/index.d.ts +5 -0
- package/components/empty-state/public-api.d.ts +4 -0
- package/components/field/field.component.d.ts +1 -1
- package/components/field/field.component.module.d.ts +3 -5
- package/components/field/index.d.ts +5 -0
- package/components/field/public-api.d.ts +4 -0
- package/components/file-upload/file-upload.component.module.d.ts +1 -1
- package/components/filter-button/filter-button.component.module.d.ts +3 -3
- package/components/filter-button/index.d.ts +5 -0
- package/components/filter-button/public-api.d.ts +4 -0
- package/components/inline-field/index.d.ts +5 -0
- package/components/inline-field/inline-field.component.d.ts +2 -2
- package/components/inline-field/inline-field.component.module.d.ts +1 -1
- package/components/inline-field/public-api.d.ts +4 -0
- package/components/logo/index.d.ts +5 -0
- package/components/logo/public-api.d.ts +4 -0
- package/components/multi-input/multi-input.component.module.d.ts +5 -6
- package/components/navbar/mobile-navbar-side-sheet/mobile-navbar-side-sheet.component.d.ts +1 -1
- package/components/navbar/navbar.component.d.ts +2 -2
- package/components/navbar/navbar.component.module.d.ts +2 -2
- package/components/paginator/index.d.ts +5 -0
- package/components/paginator/public-api.d.ts +3 -0
- package/components/password-criteria/password.component.module.d.ts +2 -2
- package/components/password-strength/password-strength.component.module.d.ts +1 -1
- package/components/phone-input/phone-input.component.module.d.ts +2 -2
- package/components/progress-bar/index.d.ts +5 -0
- package/components/progress-bar/public-api.d.ts +3 -0
- package/components/prompt/prompt.component.d.ts +1 -1
- package/components/prompt/prompt.module.d.ts +3 -3
- package/components/radial-progress/index.d.ts +5 -0
- package/components/radial-progress/public-api.d.ts +4 -0
- package/components/radio-button/index.d.ts +5 -0
- package/components/radio-button/public-api.d.ts +4 -0
- package/components/radio-button/radio-button.component.d.ts +1 -1
- package/components/radio-button/radio-button.component.module.d.ts +1 -1
- package/components/rating/index.d.ts +5 -0
- package/components/rating/public-api.d.ts +3 -0
- package/components/scale/index.d.ts +5 -0
- package/components/scale/public-api.d.ts +3 -0
- package/components/segmented-bar/index.d.ts +5 -0
- package/components/segmented-bar/public-api.d.ts +4 -0
- package/components/segmented-button/index.d.ts +5 -0
- package/components/segmented-button/public-api.d.ts +4 -0
- package/components/selectable-card/selectable-card.component.d.ts +1 -1
- package/components/selectable-card/selectable-card.component.module.d.ts +2 -2
- package/components/side-sheet/side-sheet.component.module.d.ts +1 -1
- package/components/slider/index.d.ts +5 -0
- package/components/slider/public-api.d.ts +4 -0
- package/components/spider-chart/spider-chart.module.d.ts +1 -1
- package/components/spinner/index.d.ts +5 -0
- package/components/spinner/public-api.d.ts +4 -0
- package/components/stepper/stepper.component.module.d.ts +1 -1
- package/components/table/table.component.module.d.ts +1 -1
- package/components/tag/index.d.ts +5 -0
- package/components/tag/public-api.d.ts +4 -0
- package/components/toggle/index.d.ts +5 -0
- package/components/toggle/public-api.d.ts +3 -0
- package/components/toggle/toggle.component.module.d.ts +1 -1
- package/components/universal-skills-report/universal-skills-report.component.module.d.ts +1 -1
- package/components/universal-skills-spider-charts/universal-skills-spider-charts.component.module.d.ts +1 -1
- package/components/validation-error/index.d.ts +5 -0
- package/components/validation-error/public-api.d.ts +3 -0
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1045 -0
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +173 -0
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +164 -0
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +402 -0
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +240 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +434 -0
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +326 -0
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +638 -0
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +314 -0
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +367 -0
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +218 -0
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +110 -0
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +128 -0
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +152 -0
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +373 -0
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +150 -0
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +158 -0
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +137 -0
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +128 -0
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +274 -0
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +108 -0
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +239 -0
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +216 -0
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +79 -0
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui.mjs +3057 -9093
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/package.json +99 -7
- package/public-api.d.ts +0 -63
- /package/{directives → components/autocomplete}/select-text.directive.d.ts +0 -0
- /package/{pipes → components/avatar}/name-initials.pipe.d.ts +0 -0
- /package/{utils → components/core}/autocomplete-utils.d.ts +0 -0
- /package/{models → components/core}/checkbox.model.d.ts +0 -0
- /package/{directives → components/core}/digits-only.directive.d.ts +0 -0
- /package/{utils → components/core}/hex-to-rgb.d.ts +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, Optional, Inject, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/platform-browser';
|
|
4
|
+
import * as i2 from '@angular/common';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import * as i3 from '@testgorilla/tgo-ui/components/icon';
|
|
7
|
+
import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
|
|
8
|
+
|
|
9
|
+
class CardComponent {
|
|
10
|
+
/**
|
|
11
|
+
* Show errors below card.
|
|
12
|
+
*
|
|
13
|
+
* @type {string[]}
|
|
14
|
+
* @memberof CardComponent
|
|
15
|
+
*/
|
|
16
|
+
set errors(errors) {
|
|
17
|
+
this.safeErrors = errors?.filter(Boolean).map(error => this.domSanitizer.bypassSecurityTrustHtml(error));
|
|
18
|
+
}
|
|
19
|
+
constructor(defaultAppTheme, domSanitizer) {
|
|
20
|
+
this.defaultAppTheme = defaultAppTheme;
|
|
21
|
+
this.domSanitizer = domSanitizer;
|
|
22
|
+
/**
|
|
23
|
+
* Card size. Defaults "medium".
|
|
24
|
+
*
|
|
25
|
+
* @type {CardSize}
|
|
26
|
+
* @memberof CardComponent
|
|
27
|
+
*/
|
|
28
|
+
this.size = 'medium';
|
|
29
|
+
/**
|
|
30
|
+
* Card variants. Defaults "default".
|
|
31
|
+
*
|
|
32
|
+
* @type {CardVariant}
|
|
33
|
+
* @memberof CardComponent
|
|
34
|
+
*/
|
|
35
|
+
this.variant = 'default';
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* Defines the application theme
|
|
39
|
+
*
|
|
40
|
+
* @type {ApplicationTheme}
|
|
41
|
+
* @memberof CardComponent
|
|
42
|
+
*/
|
|
43
|
+
this.applicationTheme = 'light';
|
|
44
|
+
/**
|
|
45
|
+
* Errors size
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @memberof CardComponent
|
|
49
|
+
*/
|
|
50
|
+
this.errorsSize = 'default';
|
|
51
|
+
/**
|
|
52
|
+
* Marks card as selected
|
|
53
|
+
*
|
|
54
|
+
* @type {boolean}
|
|
55
|
+
* @memberof CardComponent
|
|
56
|
+
*/
|
|
57
|
+
this.selected = false;
|
|
58
|
+
/**
|
|
59
|
+
* Marks card as readonly. Defaults "false".
|
|
60
|
+
*
|
|
61
|
+
* @type {boolean}
|
|
62
|
+
* @memberof CardComponent
|
|
63
|
+
*/
|
|
64
|
+
this.allowSelect = false;
|
|
65
|
+
/**
|
|
66
|
+
* Marks card as focusable. Defaults "true".
|
|
67
|
+
*
|
|
68
|
+
* @type {boolean}
|
|
69
|
+
* @memberof CardComponent
|
|
70
|
+
*/
|
|
71
|
+
this.allowFocus = true;
|
|
72
|
+
/**
|
|
73
|
+
* Emits when card is being selected
|
|
74
|
+
*/
|
|
75
|
+
this.cardSelected = new EventEmitter();
|
|
76
|
+
this.classes = '';
|
|
77
|
+
if (defaultAppTheme) {
|
|
78
|
+
this.applicationTheme = defaultAppTheme;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
ngOnChanges() {
|
|
82
|
+
this.classes = `card-size-${this.size ?? 'medium'} ${this.cardVariant ?? 'default'}`;
|
|
83
|
+
}
|
|
84
|
+
ngOnInit() {
|
|
85
|
+
this.classes = `card-size-${this.size ?? 'medium'} ${this.cardVariant ?? 'default'}`;
|
|
86
|
+
}
|
|
87
|
+
get cardVariant() {
|
|
88
|
+
return this.safeErrors?.length ? 'error' : this.variant;
|
|
89
|
+
}
|
|
90
|
+
get errorIconSize() {
|
|
91
|
+
return this.errorsSize === 'small' ? '16' : '24';
|
|
92
|
+
}
|
|
93
|
+
get isSelected() {
|
|
94
|
+
// educative, premium, ai, actionDriver and neutral variants shouldn't have any selected/interactive states
|
|
95
|
+
return (this.selected &&
|
|
96
|
+
this.variant !== 'educative' &&
|
|
97
|
+
this.variant !== 'premium' &&
|
|
98
|
+
this.variant !== 'ai' &&
|
|
99
|
+
this.variant !== 'actionDriver' &&
|
|
100
|
+
this.variant !== 'neutral');
|
|
101
|
+
}
|
|
102
|
+
selectCard() {
|
|
103
|
+
if (this.allowSelect &&
|
|
104
|
+
this.variant !== 'educative' &&
|
|
105
|
+
this.variant !== 'premium' &&
|
|
106
|
+
this.variant !== 'ai' &&
|
|
107
|
+
this.variant !== 'actionDriver' &&
|
|
108
|
+
this.variant !== 'neutral' &&
|
|
109
|
+
this.variant !== 'default') {
|
|
110
|
+
this.selected = true;
|
|
111
|
+
this.cardSelected.emit(this.selected);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CardComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
115
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: CardComponent, isStandalone: false, selector: "ui-card", inputs: { size: "size", variant: "variant", applicationTheme: "applicationTheme", errors: "errors", errorsSize: "errorsSize", selected: "selected", allowSelect: "allowSelect", allowFocus: "allowFocus" }, outputs: { cardSelected: "cardSelected" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"card-container\"\n (keydown.enter)=\"selectCard()\"\n (keydown.space)=\"selectCard()\"\n (click)=\"selectCard()\"\n [ngClass]=\"[classes, isSelected ? 'selected' : '']\"\n [attr.theme]=\"applicationTheme\"\n [attr.tabindex]=\"allowFocus ? 0 : null\"\n>\n <ng-content></ng-content>\n</div>\n@if (safeErrors?.length) {\n <div class=\"errors\"\n [class.errors-small]=\"errorsSize === 'small'\">\n @for (error of safeErrors; track error) {\n <div class=\"error\">\n <ui-icon [size]=\"errorIconSize\" [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n </div>\n}\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.card-container{border:1px solid #E0E0E0;background:#fff;position:relative;transition:box-shadow .25s ease}.card-container.card-size-medium{padding:24px}.card-container.card-size-large{padding:80px}.card-container.card-size-small{padding:16px}.card-container[theme=dark],.card-container[theme=light]{border-color:#d3d3d3;border-radius:10px;border-width:1px}.card-container[theme=dark].shadow,.card-container[theme=light].shadow{box-shadow:0 4px 100px #2424240a}.card-container[theme=dark].error,.card-container[theme=light].error{border-width:2px;border-color:#e02800}.card-container[theme=dark].ai,.card-container[theme=light].ai{border:2px solid transparent;background:linear-gradient(to left,#fff,#fff),linear-gradient(to right,#d410aa 25%,#0165fc);background-clip:padding-box,border-box;background-origin:padding-box,border-box}.card-container[theme=dark].educative,.card-container[theme=light].educative{background:#d9e8ff;border-color:#1a47aa}.card-container[theme=dark].premium,.card-container[theme=light].premium{background:#fff5e6;border-color:#d07d00}.card-container[theme=dark].actionDriver,.card-container[theme=light].actionDriver{background:#242424;border:none}.card-container[theme=dark].neutral,.card-container[theme=light].neutral{background:#f4f4f4;border:none}.card-container[theme=dark].state,.card-container[theme=light].state{cursor:pointer}.card-container[theme=dark].state:hover,.card-container[theme=dark].state:hover:focus,.card-container[theme=light].state:hover,.card-container[theme=light].state:hover:focus{border-color:#242424;outline:1px solid #242424}.card-container[theme=dark].state.selected:focus:not(:focus-visible),.card-container[theme=light].state.selected:focus:not(:focus-visible){border-color:#242424;outline:1px solid #242424}.card-container[theme=dark].selected,.card-container[theme=light].selected{border-color:#242424;outline:1px solid #242424}.card-container[theme=dark]:focus-visible:not(.selected),.card-container[theme=light]:focus-visible:not(.selected){outline:1px solid black;border-color:#242424;box-shadow:0 0 0 2px #fff,0 0 0 4px #242424;animation:none}.card-container[theme=dark]:focus-visible:not(.selected):before,.card-container[theme=light]:focus-visible:not(.selected):before{display:none}.card-container[theme=dark]:focus-visible:is(.selected),.card-container[theme=light]:focus-visible:is(.selected){outline:1px solid black;border-color:#242424;box-shadow:0 0 0 2px #fff,0 0 0 4px #242424;animation:none}.card-container[theme=dark]:focus-visible:is(.selected):before,.card-container[theme=light]:focus-visible:is(.selected):before{display:none}.card-container[theme=dark].default,.card-container[theme=light].default{border-color:#d3d3d3}.card-size-brand.card-size-medium{padding:23px}.card-size-brand.card-size-large{padding:79px}.card-size-brand.card-size-small{padding:15px}.errors{margin-top:8px}.errors.errors-small{margin-top:4px}.errors.errors-small .error{font-size:12px}.errors .error{font-size:14px;display:flex;flex-direction:row;align-items:center;color:#e02800}.errors .error ui-icon{margin-right:8px}.errors .error ui-icon ::ng-deep svg{color:#e02800}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
116
|
+
}
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CardComponent, decorators: [{
|
|
118
|
+
type: Component,
|
|
119
|
+
args: [{ selector: 'ui-card', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div\n class=\"card-container\"\n (keydown.enter)=\"selectCard()\"\n (keydown.space)=\"selectCard()\"\n (click)=\"selectCard()\"\n [ngClass]=\"[classes, isSelected ? 'selected' : '']\"\n [attr.theme]=\"applicationTheme\"\n [attr.tabindex]=\"allowFocus ? 0 : null\"\n>\n <ng-content></ng-content>\n</div>\n@if (safeErrors?.length) {\n <div class=\"errors\"\n [class.errors-small]=\"errorsSize === 'small'\">\n @for (error of safeErrors; track error) {\n <div class=\"error\">\n <ui-icon [size]=\"errorIconSize\" [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n </div>\n}\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.card-container{border:1px solid #E0E0E0;background:#fff;position:relative;transition:box-shadow .25s ease}.card-container.card-size-medium{padding:24px}.card-container.card-size-large{padding:80px}.card-container.card-size-small{padding:16px}.card-container[theme=dark],.card-container[theme=light]{border-color:#d3d3d3;border-radius:10px;border-width:1px}.card-container[theme=dark].shadow,.card-container[theme=light].shadow{box-shadow:0 4px 100px #2424240a}.card-container[theme=dark].error,.card-container[theme=light].error{border-width:2px;border-color:#e02800}.card-container[theme=dark].ai,.card-container[theme=light].ai{border:2px solid transparent;background:linear-gradient(to left,#fff,#fff),linear-gradient(to right,#d410aa 25%,#0165fc);background-clip:padding-box,border-box;background-origin:padding-box,border-box}.card-container[theme=dark].educative,.card-container[theme=light].educative{background:#d9e8ff;border-color:#1a47aa}.card-container[theme=dark].premium,.card-container[theme=light].premium{background:#fff5e6;border-color:#d07d00}.card-container[theme=dark].actionDriver,.card-container[theme=light].actionDriver{background:#242424;border:none}.card-container[theme=dark].neutral,.card-container[theme=light].neutral{background:#f4f4f4;border:none}.card-container[theme=dark].state,.card-container[theme=light].state{cursor:pointer}.card-container[theme=dark].state:hover,.card-container[theme=dark].state:hover:focus,.card-container[theme=light].state:hover,.card-container[theme=light].state:hover:focus{border-color:#242424;outline:1px solid #242424}.card-container[theme=dark].state.selected:focus:not(:focus-visible),.card-container[theme=light].state.selected:focus:not(:focus-visible){border-color:#242424;outline:1px solid #242424}.card-container[theme=dark].selected,.card-container[theme=light].selected{border-color:#242424;outline:1px solid #242424}.card-container[theme=dark]:focus-visible:not(.selected),.card-container[theme=light]:focus-visible:not(.selected){outline:1px solid black;border-color:#242424;box-shadow:0 0 0 2px #fff,0 0 0 4px #242424;animation:none}.card-container[theme=dark]:focus-visible:not(.selected):before,.card-container[theme=light]:focus-visible:not(.selected):before{display:none}.card-container[theme=dark]:focus-visible:is(.selected),.card-container[theme=light]:focus-visible:is(.selected){outline:1px solid black;border-color:#242424;box-shadow:0 0 0 2px #fff,0 0 0 4px #242424;animation:none}.card-container[theme=dark]:focus-visible:is(.selected):before,.card-container[theme=light]:focus-visible:is(.selected):before{display:none}.card-container[theme=dark].default,.card-container[theme=light].default{border-color:#d3d3d3}.card-size-brand.card-size-medium{padding:23px}.card-size-brand.card-size-large{padding:79px}.card-size-brand.card-size-small{padding:15px}.errors{margin-top:8px}.errors.errors-small{margin-top:4px}.errors.errors-small .error{font-size:12px}.errors .error{font-size:14px;display:flex;flex-direction:row;align-items:center;color:#e02800}.errors .error ui-icon{margin-right:8px}.errors .error ui-icon ::ng-deep svg{color:#e02800}\n"] }]
|
|
120
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
121
|
+
type: Optional
|
|
122
|
+
}, {
|
|
123
|
+
type: Inject,
|
|
124
|
+
args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
|
|
125
|
+
}] }, { type: i1.DomSanitizer }], propDecorators: { size: [{
|
|
126
|
+
type: Input
|
|
127
|
+
}], variant: [{
|
|
128
|
+
type: Input
|
|
129
|
+
}], applicationTheme: [{
|
|
130
|
+
type: Input
|
|
131
|
+
}], errors: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], errorsSize: [{
|
|
134
|
+
type: Input
|
|
135
|
+
}], selected: [{
|
|
136
|
+
type: Input
|
|
137
|
+
}], allowSelect: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}], allowFocus: [{
|
|
140
|
+
type: Input
|
|
141
|
+
}], cardSelected: [{
|
|
142
|
+
type: Output
|
|
143
|
+
}] } });
|
|
144
|
+
|
|
145
|
+
class CardComponentModule {
|
|
146
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CardComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
147
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: CardComponentModule, declarations: [CardComponent], imports: [CommonModule, IconComponentModule], exports: [CardComponent] }); }
|
|
148
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CardComponentModule, imports: [CommonModule, IconComponentModule] }); }
|
|
149
|
+
}
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CardComponentModule, decorators: [{
|
|
151
|
+
type: NgModule,
|
|
152
|
+
args: [{
|
|
153
|
+
declarations: [CardComponent],
|
|
154
|
+
imports: [CommonModule, IconComponentModule],
|
|
155
|
+
exports: [CardComponent],
|
|
156
|
+
}]
|
|
157
|
+
}] });
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Generated bundle index. Do not edit.
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export { CardComponent, CardComponentModule };
|
|
164
|
+
//# sourceMappingURL=testgorilla-tgo-ui-components-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-card.mjs","sources":["../../../components/card/card.component.ts","../../../components/card/card.component.html","../../../components/card/card.component.module.ts","../../../components/card/testgorilla-tgo-ui-components-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Input,\n OnChanges,\n OnInit,\n Optional,\n Output,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { IconSize } from '@testgorilla/tgo-ui/components/icon';\nimport { CardSize, CardVariant } from './card.model';\n\n@Component({\n selector: 'ui-card',\n templateUrl: './card.component.html',\n styleUrls: ['./card.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class CardComponent implements OnChanges, OnInit {\n /**\n * Card size. Defaults \"medium\".\n *\n * @type {CardSize}\n * @memberof CardComponent\n */\n @Input() size: CardSize = 'medium';\n\n /**\n * Card variants. Defaults \"default\".\n *\n * @type {CardVariant}\n * @memberof CardComponent\n */\n @Input() variant: CardVariant = 'default';\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof CardComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Show errors below card.\n *\n * @type {string[]}\n * @memberof CardComponent\n */\n @Input() set errors(errors: string[]) {\n this.safeErrors = errors?.filter(Boolean).map(error => this.domSanitizer.bypassSecurityTrustHtml(error));\n }\n\n /**\n * Errors size\n *\n * @type {string}\n * @memberof CardComponent\n */\n @Input() errorsSize? = 'default';\n\n /**\n * Marks card as selected\n *\n * @type {boolean}\n * @memberof CardComponent\n */\n @Input() selected = false;\n\n /**\n * Marks card as readonly. Defaults \"false\".\n *\n * @type {boolean}\n * @memberof CardComponent\n */\n @Input() allowSelect = false;\n\n /**\n * Marks card as focusable. Defaults \"true\".\n *\n * @type {boolean}\n * @memberof CardComponent\n */\n @Input() allowFocus = true;\n\n /**\n * Emits when card is being selected\n */\n @Output() cardSelected = new EventEmitter<boolean>();\n\n safeErrors: SafeHtml[];\n\n classes = '';\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme,\n private domSanitizer: DomSanitizer\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n ngOnChanges(): void {\n this.classes = `card-size-${this.size ?? 'medium'} ${this.cardVariant ?? 'default'}`;\n }\n\n ngOnInit(): void {\n this.classes = `card-size-${this.size ?? 'medium'} ${this.cardVariant ?? 'default'}`;\n }\n\n get cardVariant(): CardVariant {\n return this.safeErrors?.length ? 'error' : this.variant;\n }\n\n get errorIconSize(): IconSize {\n return this.errorsSize === 'small' ? '16' : '24';\n }\n\n get isSelected(): boolean {\n // educative, premium, ai, actionDriver and neutral variants shouldn't have any selected/interactive states\n return (\n this.selected &&\n this.variant !== 'educative' &&\n this.variant !== 'premium' &&\n this.variant !== 'ai' &&\n this.variant !== 'actionDriver' &&\n this.variant !== 'neutral'\n );\n }\n\n selectCard() {\n if (\n this.allowSelect &&\n this.variant !== 'educative' &&\n this.variant !== 'premium' &&\n this.variant !== 'ai' &&\n this.variant !== 'actionDriver' &&\n this.variant !== 'neutral' &&\n this.variant !== 'default'\n ) {\n this.selected = true;\n this.cardSelected.emit(this.selected);\n }\n }\n}\n","<div\n class=\"card-container\"\n (keydown.enter)=\"selectCard()\"\n (keydown.space)=\"selectCard()\"\n (click)=\"selectCard()\"\n [ngClass]=\"[classes, isSelected ? 'selected' : '']\"\n [attr.theme]=\"applicationTheme\"\n [attr.tabindex]=\"allowFocus ? 0 : null\"\n>\n <ng-content></ng-content>\n</div>\n@if (safeErrors?.length) {\n <div class=\"errors\"\n [class.errors-small]=\"errorsSize === 'small'\">\n @for (error of safeErrors; track error) {\n <div class=\"error\">\n <ui-icon [size]=\"errorIconSize\" [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span [innerHTML]=\"error\"></span>\n </div>\n }\n </div>\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { CardComponent } from './card.component';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\n@NgModule({\n declarations: [CardComponent],\n imports: [CommonModule, IconComponentModule],\n exports: [CardComponent],\n})\nexport class CardComponentModule {}\n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