@cuby-ui/core 0.0.4 → 0.0.6
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/accordion/accordion-item/accordion-item.component.d.ts +7 -0
- package/components/accordion/accordion.component.d.ts +5 -0
- package/components/accordion/accordion.module.d.ts +11 -0
- package/components/accordion/index.d.ts +3 -0
- package/components/button/button.component.d.ts +28 -29
- package/components/button/button.module.d.ts +9 -9
- package/components/button/button.options.d.ts +8 -8
- package/components/button/index.d.ts +3 -3
- package/components/context-menu/context-menu.component.d.ts +27 -0
- package/components/context-menu/context-menu.module.d.ts +9 -0
- package/components/context-menu/index.d.ts +2 -0
- package/components/hint/hint.component.d.ts +7 -0
- package/components/hint/hint.module.d.ts +7 -0
- package/components/hint/index.d.ts +2 -0
- package/components/icon-button/icon-button.component.d.ts +14 -0
- package/components/icon-button/icon-button.module.d.ts +9 -0
- package/components/icon-button/index.d.ts +2 -0
- package/components/index.d.ts +11 -2
- package/components/input-number/index.d.ts +2 -0
- package/components/input-number/input-number.component.d.ts +50 -0
- package/components/input-number/input-number.module.d.ts +10 -0
- package/components/input-number/input-number.options.d.ts +9 -0
- package/components/input-password/index.d.ts +2 -0
- package/components/input-password/input-password.component.d.ts +27 -0
- package/components/input-password/input-password.module.d.ts +10 -0
- package/components/input-text/index.d.ts +2 -0
- package/components/input-text/input-text.component.d.ts +26 -0
- package/components/input-text/input-text.module.d.ts +10 -0
- package/components/label/index.d.ts +2 -0
- package/components/label/label.component.d.ts +6 -0
- package/components/label/label.module.d.ts +8 -0
- package/components/svg/index.d.ts +2 -2
- package/components/svg/svg.component.d.ts +19 -19
- package/components/svg/svg.module.d.ts +8 -8
- package/components/textarea/index.d.ts +2 -0
- package/components/textarea/textarea.component.d.ts +8 -0
- package/components/textarea/textarea.module.d.ts +7 -0
- package/esm2020/components/accordion/accordion-item/accordion-item.component.mjs +19 -0
- package/esm2020/components/accordion/accordion.component.mjs +11 -0
- package/esm2020/components/accordion/accordion.module.mjs +37 -0
- package/esm2020/components/accordion/index.mjs +4 -0
- package/esm2020/components/button/button.component.mjs +92 -109
- package/esm2020/components/button/button.module.mjs +24 -24
- package/esm2020/components/button/button.options.mjs +9 -9
- package/esm2020/components/button/index.mjs +4 -4
- package/esm2020/components/context-menu/context-menu.component.mjs +94 -0
- package/esm2020/components/context-menu/context-menu.module.mjs +24 -0
- package/esm2020/components/context-menu/index.mjs +3 -0
- package/esm2020/components/hint/hint.component.mjs +19 -0
- package/esm2020/components/hint/hint.module.mjs +16 -0
- package/esm2020/components/hint/index.mjs +3 -0
- package/esm2020/components/icon-button/icon-button.component.mjs +41 -0
- package/esm2020/components/icon-button/icon-button.module.mjs +24 -0
- package/esm2020/components/icon-button/index.mjs +3 -0
- package/esm2020/components/index.mjs +12 -3
- package/esm2020/components/input-number/index.mjs +3 -0
- package/esm2020/components/input-number/input-number.component.mjs +187 -0
- package/esm2020/components/input-number/input-number.module.mjs +20 -0
- package/esm2020/components/input-number/input-number.options.mjs +11 -0
- package/esm2020/components/input-password/index.mjs +3 -0
- package/esm2020/components/input-password/input-password.component.mjs +74 -0
- package/esm2020/components/input-password/input-password.module.mjs +28 -0
- package/esm2020/components/input-text/index.mjs +3 -0
- package/esm2020/components/input-text/input-text.component.mjs +72 -0
- package/esm2020/components/input-text/input-text.module.mjs +28 -0
- package/esm2020/components/label/index.mjs +3 -0
- package/esm2020/components/label/label.component.mjs +17 -0
- package/esm2020/components/label/label.module.mjs +18 -0
- package/esm2020/components/svg/index.mjs +3 -3
- package/esm2020/components/svg/svg.component.mjs +48 -45
- package/esm2020/components/svg/svg.module.mjs +17 -17
- package/esm2020/components/textarea/index.mjs +3 -0
- package/esm2020/components/textarea/textarea.component.mjs +28 -0
- package/esm2020/components/textarea/textarea.module.mjs +16 -0
- package/esm2020/cuby-ui-core.mjs +4 -4
- package/esm2020/index.mjs +5 -3
- package/esm2020/interfaces/context-menu-item.mjs +2 -0
- package/esm2020/interfaces/index.mjs +2 -0
- package/esm2020/types/appearance.mjs +2 -2
- package/esm2020/types/hint-type.mjs +2 -0
- package/esm2020/types/index.mjs +4 -3
- package/esm2020/types/size.mjs +2 -2
- package/esm2020/utils/format/index.mjs +3 -0
- package/esm2020/utils/format/remove-spaces.mjs +4 -0
- package/esm2020/utils/format/replace.mjs +5 -0
- package/esm2020/utils/index.mjs +2 -0
- package/fesm2015/cuby-ui-core.mjs +883 -187
- package/fesm2015/cuby-ui-core.mjs.map +1 -1
- package/fesm2020/cuby-ui-core.mjs +880 -185
- package/fesm2020/cuby-ui-core.mjs.map +1 -1
- package/fonts/Inter-Bold.eot +0 -0
- package/fonts/Inter-Bold.otf +0 -0
- package/fonts/Inter-Bold.svg +25443 -0
- package/fonts/Inter-Bold.ttf +0 -0
- package/fonts/Inter-Bold.woff +0 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-Medium.eot +0 -0
- package/fonts/Inter-Medium.otf +0 -0
- package/fonts/Inter-Medium.svg +25400 -0
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-Regular.eot +0 -0
- package/fonts/Inter-Regular.otf +0 -0
- package/fonts/Inter-Regular.svg +24341 -0
- package/fonts/Inter-Regular.ttf +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.eot +0 -0
- package/fonts/Inter-SemiBold.otf +0 -0
- package/fonts/Inter-SemiBold.svg +25459 -0
- package/fonts/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/index.d.ts +4 -2
- package/interfaces/context-menu-item.d.ts +6 -0
- package/interfaces/index.d.ts +1 -0
- package/package.json +6 -3
- package/styles/fonts.scss +51 -0
- package/styles/global.scss +8 -0
- package/styles/mixins/buttons.scss +10 -0
- package/styles/mixins/inputs.scss +77 -0
- package/styles/mixins/lists.scss +5 -0
- package/styles/mixins/paddings.scss +35 -0
- package/styles/mixins/shadows.scss +37 -0
- package/styles/mixins/texts.scss +219 -15
- package/styles/{cui-ui-theme.scss → theme.scss} +49 -37
- package/styles/variables/colors.scss +45 -33
- package/types/appearance.d.ts +7 -7
- package/types/hint-type.d.ts +1 -0
- package/types/index.d.ts +3 -2
- package/types/size.d.ts +4 -4
- package/utils/format/index.d.ts +2 -0
- package/utils/format/remove-spaces.d.ts +1 -0
- package/utils/format/replace.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- package/styles/cuby-ui-global.scss +0 -5
- package/styles/cui-ui-fonts.scss +0 -6
|
@@ -1,201 +1,897 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Component, ChangeDetectionStrategy, Input,
|
|
3
|
-
import * as i1
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { InjectionToken, inject, ElementRef, Component, ChangeDetectionStrategy, Input, ChangeDetectorRef, HostBinding, ViewChild, NgModule, forwardRef, HostListener } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
5
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
6
|
+
import { cuiIsIcon, CUI_ICONS } from '@cuby-ui/icons';
|
|
7
|
+
import * as i2 from '@angular/forms';
|
|
8
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
9
|
+
import * as i1$1 from '@cuby-ui/cdk';
|
|
10
|
+
import { CuiAutoResizingDirective } from '@cuby-ui/cdk';
|
|
11
|
+
|
|
12
|
+
const CUI_BUTTON_DEFAULT_OPTIONS = {
|
|
13
|
+
appearance: 'accent',
|
|
14
|
+
size: 'sm'
|
|
15
|
+
};
|
|
16
|
+
const CUI_BUTTON_OPTIONS = new InjectionToken('', {
|
|
17
|
+
factory: () => CUI_BUTTON_DEFAULT_OPTIONS
|
|
13
18
|
});
|
|
14
19
|
|
|
15
|
-
class CuiSvgComponent {
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
i0.ɵɵ
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type: Input
|
|
51
|
-
}],
|
|
52
|
-
type: Input
|
|
53
|
-
}],
|
|
54
|
-
type: Input
|
|
20
|
+
class CuiSvgComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.domSanitizer = inject(DomSanitizer);
|
|
23
|
+
this.element = inject(ElementRef).nativeElement;
|
|
24
|
+
this.STROKE_WIDTH_ATTRIBUTE = 'stroke-width';
|
|
25
|
+
}
|
|
26
|
+
set icon(icon) {
|
|
27
|
+
// TODO: В данном случае подключаются все иконки (вероятно, можно как-то оптимизировано их подключать)
|
|
28
|
+
this.safeSvgContent = this.domSanitizer.bypassSecurityTrustHtml(cuiIsIcon(icon)
|
|
29
|
+
? CUI_ICONS[icon]
|
|
30
|
+
: icon);
|
|
31
|
+
}
|
|
32
|
+
set strokeWidth(strokeWidth) {
|
|
33
|
+
this._strokeWidth = strokeWidth;
|
|
34
|
+
this.updateStrokeWidth();
|
|
35
|
+
}
|
|
36
|
+
ngAfterViewInit() {
|
|
37
|
+
this.updateStrokeWidth();
|
|
38
|
+
}
|
|
39
|
+
updateStrokeWidth() {
|
|
40
|
+
if (this._strokeWidth === undefined) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.element.querySelectorAll(`[${this.STROKE_WIDTH_ATTRIBUTE}]`)
|
|
44
|
+
.forEach(element => {
|
|
45
|
+
element.setAttribute(this.STROKE_WIDTH_ATTRIBUTE, this._strokeWidth.toString());
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
CuiSvgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiSvgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
+
CuiSvgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: { width: "width", height: "height", icon: "icon", strokeWidth: "strokeWidth" }, ngImport: i0, template: "<span\n [innerHTML]=\"safeSvgContent\"\n [style.width.px]=\"width\"\n [style.height.px]=\"height\"\n></span>", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;line-height:0}:host ::ng-deep svg{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiSvgComponent, decorators: [{
|
|
52
|
+
type: Component,
|
|
53
|
+
args: [{ selector: 'cui-svg[icon]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [innerHTML]=\"safeSvgContent\"\n [style.width.px]=\"width\"\n [style.height.px]=\"height\"\n></span>", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;line-height:0}:host ::ng-deep svg{width:100%;height:100%}\n"] }]
|
|
54
|
+
}], propDecorators: { width: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], height: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], icon: [{
|
|
59
|
+
type: Input
|
|
60
|
+
}], strokeWidth: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}] } });
|
|
63
|
+
|
|
64
|
+
class CuiButtonComponent {
|
|
65
|
+
constructor() {
|
|
66
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
67
|
+
this.cuiButtonOptions = inject(CUI_BUTTON_OPTIONS);
|
|
68
|
+
this._size = this.cuiButtonOptions.size;
|
|
69
|
+
this.svgOptions = {
|
|
70
|
+
width: 20,
|
|
71
|
+
height: 20,
|
|
72
|
+
strokeWidth: 1.5
|
|
73
|
+
};
|
|
74
|
+
this.appearance = this.cuiButtonOptions.appearance;
|
|
75
|
+
this.disabled = false;
|
|
76
|
+
this.isLoaderShown = false;
|
|
77
|
+
this.containsOnlyIcon = false;
|
|
78
|
+
}
|
|
79
|
+
get size() {
|
|
80
|
+
return this._size;
|
|
81
|
+
}
|
|
82
|
+
set size(size) {
|
|
83
|
+
this._size = size;
|
|
84
|
+
if (size === 'xxs') {
|
|
85
|
+
this.svgOptions = {
|
|
86
|
+
width: 16,
|
|
87
|
+
height: 16,
|
|
88
|
+
strokeWidth: 1.5
|
|
89
|
+
};
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.svgOptions = {
|
|
93
|
+
width: 20,
|
|
94
|
+
height: 20,
|
|
95
|
+
strokeWidth: 1.5
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
get isDisabled() {
|
|
99
|
+
return this.disabled || this.isLoaderShown;
|
|
100
|
+
}
|
|
101
|
+
ngAfterViewInit() {
|
|
102
|
+
this.initContainsOnlyIcon();
|
|
103
|
+
}
|
|
104
|
+
initContainsOnlyIcon() {
|
|
105
|
+
Promise.resolve().then(() => {
|
|
106
|
+
this.containsOnlyIcon = this.content.nativeElement.childNodes.length === 0;
|
|
107
|
+
this.changeDetectorRef.markForCheck();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
CuiButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
+
CuiButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: { appearance: "appearance", disabled: "disabled", isLoaderShown: "isLoaderShown", icon: "icon", iconRight: "iconRight", size: "size" }, host: { properties: { "attr.data-appearance": "this.appearance", "class._disabled": "this.disabled", "class._loading": "this.isLoaderShown", "attr.data-size": "this.size", "class._only-icon": "this.containsOnlyIcon", "disabled": "this.isDisabled" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "<span\n class=\"c-wrapper\"\n [class.c-wrapper_invisible]=\"isLoaderShown\"\n>\n <cui-svg\n *ngIf=\"icon\"\n [icon]=\"icon\"\n [width]=\"svgOptions.width\"\n [height]=\"svgOptions.height\"\n [strokeWidth]=\"svgOptions.strokeWidth\"\n class=\"c-icon\"\n ></cui-svg>\n <span\n #content\n *ngIf=\"!containsOnlyIcon\"\n >\n <ng-content></ng-content>\n </span>\n <cui-svg\n *ngIf=\"iconRight\"\n [icon]=\"iconRight\"\n [width]=\"svgOptions.width\"\n [height]=\"svgOptions.height\"\n [strokeWidth]=\"svgOptions.strokeWidth\"\n class=\"c-icon\"\n ></cui-svg>\n</span>\n<cui-svg\n *ngIf=\"isLoaderShown\"\n icon=\"cuiIconLoading\"\n class=\"c-loader\"\n></cui-svg>\n", styles: [":host{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;font-weight:500;font-size:14px;line-height:20px;position:relative;box-sizing:border-box;border-radius:8px;font-family:var(--cui-main-font)}:host:disabled{cursor:not-allowed}:host[data-appearance=accent]{background:var(--cui-accent-800);color:var(--cui-base-0)}@media (hover: hover){:host[data-appearance=accent]:hover{background:var(--cui-accent-900)}}:host[data-appearance=accent]:active{background:var(--cui-accent-900)}:host[data-appearance=accent]:disabled{background:var(--cui-accent-800)}:host[data-appearance=secondary]{background:var(--cui-base-100);color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=secondary]:hover{background:var(--cui-base-200)}}:host[data-appearance=secondary]:active{background:var(--cui-base-200)}:host[data-appearance=secondary]:disabled{background:var(--cui-base-100)}:host[data-appearance=secondary] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined]{border:1px solid var(--cui-base-200);background:var(--cui-base-0);color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=outlined]:hover{background:var(--cui-base-50)}}:host[data-appearance=outlined]:active{background:var(--cui-base-50)}:host[data-appearance=outlined]:disabled{background:var(--cui-base-0)}:host[data-appearance=outlined] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined-gray]{border:1px solid var(--cui-base-200);background:var(--cui-base-10);color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=outlined-gray]:hover{background:var(--cui-base-50)}}:host[data-appearance=outlined-gray]:active{background:var(--cui-base-50)}:host[data-appearance=outlined-gray]:disabled{background:var(--cui-base-10)}:host[data-appearance=outlined-gray] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=ghost]{color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=ghost]:hover{background:var(--cui-base-50)}}:host[data-appearance=ghost]:active{background:var(--cui-base-50)}:host[data-appearance=ghost]:disabled{background:inherit}:host[data-appearance=ghost] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=destructive]{background:var(--cui-error-500);color:var(--cui-base-0)}@media (hover: hover){:host[data-appearance=destructive]:hover{background:var(--cui-error-600)}}:host[data-appearance=destructive]:active{background:var(--cui-error-600)}:host[data-appearance=destructive]:disabled{background:var(--cui-error-500)}:host[data-appearance=link]{height:24px!important;padding:0 4px!important;color:var(--cui-info-600)}@media (hover: hover){:host[data-appearance=link]:hover{color:var(--cui-info-900)}}:host[data-appearance=link]:active{color:var(--cui-info-900)}:host[data-appearance=link]:disabled{color:var(--cui-info-600)}:host[data-size=xxs]{font-size:12px;line-height:14px;height:28px;padding:0 8px}:host[data-size=xxs][data-appearance=outlined],:host[data-size=xxs][data-appearance=outlined-gray]{padding:0 7px}:host[data-size=xxs]._only-icon{width:28px}:host[data-size=xxs] .c-wrapper{gap:6px}:host[data-size=xs]{font-size:13px;line-height:16px;height:32px;padding:0 12px}:host[data-size=xs][data-appearance=outlined],:host[data-size=xs][data-appearance=outlined-gray]{padding:0 11px}:host[data-size=xs]._only-icon{width:32px}:host[data-size=sm]{height:36px;padding:0 14px}:host[data-size=sm][data-appearance=outlined],:host[data-size=sm][data-appearance=outlined-gray]{padding:0 13px}:host[data-size=sm]._only-icon{width:36px}:host[data-size=md]{height:40px;padding:0 18px}:host[data-size=md][data-appearance=outlined],:host[data-size=md][data-appearance=outlined-gray]{padding:0 17px}:host[data-size=md]._only-icon{width:40px}:host._disabled{opacity:.5}.c-wrapper{display:flex;justify-content:center;align-items:center;gap:8px;height:100%}.c-wrapper_invisible{opacity:0}.c-icon ::ng-deep path{stroke:currentColor}.c-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "icon", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonComponent, decorators: [{
|
|
114
|
+
type: Component,
|
|
115
|
+
args: [{ selector: 'button[cuiButton], a[cuiButton]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n class=\"c-wrapper\"\n [class.c-wrapper_invisible]=\"isLoaderShown\"\n>\n <cui-svg\n *ngIf=\"icon\"\n [icon]=\"icon\"\n [width]=\"svgOptions.width\"\n [height]=\"svgOptions.height\"\n [strokeWidth]=\"svgOptions.strokeWidth\"\n class=\"c-icon\"\n ></cui-svg>\n <span\n #content\n *ngIf=\"!containsOnlyIcon\"\n >\n <ng-content></ng-content>\n </span>\n <cui-svg\n *ngIf=\"iconRight\"\n [icon]=\"iconRight\"\n [width]=\"svgOptions.width\"\n [height]=\"svgOptions.height\"\n [strokeWidth]=\"svgOptions.strokeWidth\"\n class=\"c-icon\"\n ></cui-svg>\n</span>\n<cui-svg\n *ngIf=\"isLoaderShown\"\n icon=\"cuiIconLoading\"\n class=\"c-loader\"\n></cui-svg>\n", styles: [":host{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;font-weight:500;font-size:14px;line-height:20px;position:relative;box-sizing:border-box;border-radius:8px;font-family:var(--cui-main-font)}:host:disabled{cursor:not-allowed}:host[data-appearance=accent]{background:var(--cui-accent-800);color:var(--cui-base-0)}@media (hover: hover){:host[data-appearance=accent]:hover{background:var(--cui-accent-900)}}:host[data-appearance=accent]:active{background:var(--cui-accent-900)}:host[data-appearance=accent]:disabled{background:var(--cui-accent-800)}:host[data-appearance=secondary]{background:var(--cui-base-100);color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=secondary]:hover{background:var(--cui-base-200)}}:host[data-appearance=secondary]:active{background:var(--cui-base-200)}:host[data-appearance=secondary]:disabled{background:var(--cui-base-100)}:host[data-appearance=secondary] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined]{border:1px solid var(--cui-base-200);background:var(--cui-base-0);color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=outlined]:hover{background:var(--cui-base-50)}}:host[data-appearance=outlined]:active{background:var(--cui-base-50)}:host[data-appearance=outlined]:disabled{background:var(--cui-base-0)}:host[data-appearance=outlined] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined-gray]{border:1px solid var(--cui-base-200);background:var(--cui-base-10);color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=outlined-gray]:hover{background:var(--cui-base-50)}}:host[data-appearance=outlined-gray]:active{background:var(--cui-base-50)}:host[data-appearance=outlined-gray]:disabled{background:var(--cui-base-10)}:host[data-appearance=outlined-gray] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=ghost]{color:var(--cui-base-900)}@media (hover: hover){:host[data-appearance=ghost]:hover{background:var(--cui-base-50)}}:host[data-appearance=ghost]:active{background:var(--cui-base-50)}:host[data-appearance=ghost]:disabled{background:inherit}:host[data-appearance=ghost] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=destructive]{background:var(--cui-error-500);color:var(--cui-base-0)}@media (hover: hover){:host[data-appearance=destructive]:hover{background:var(--cui-error-600)}}:host[data-appearance=destructive]:active{background:var(--cui-error-600)}:host[data-appearance=destructive]:disabled{background:var(--cui-error-500)}:host[data-appearance=link]{height:24px!important;padding:0 4px!important;color:var(--cui-info-600)}@media (hover: hover){:host[data-appearance=link]:hover{color:var(--cui-info-900)}}:host[data-appearance=link]:active{color:var(--cui-info-900)}:host[data-appearance=link]:disabled{color:var(--cui-info-600)}:host[data-size=xxs]{font-size:12px;line-height:14px;height:28px;padding:0 8px}:host[data-size=xxs][data-appearance=outlined],:host[data-size=xxs][data-appearance=outlined-gray]{padding:0 7px}:host[data-size=xxs]._only-icon{width:28px}:host[data-size=xxs] .c-wrapper{gap:6px}:host[data-size=xs]{font-size:13px;line-height:16px;height:32px;padding:0 12px}:host[data-size=xs][data-appearance=outlined],:host[data-size=xs][data-appearance=outlined-gray]{padding:0 11px}:host[data-size=xs]._only-icon{width:32px}:host[data-size=sm]{height:36px;padding:0 14px}:host[data-size=sm][data-appearance=outlined],:host[data-size=sm][data-appearance=outlined-gray]{padding:0 13px}:host[data-size=sm]._only-icon{width:36px}:host[data-size=md]{height:40px;padding:0 18px}:host[data-size=md][data-appearance=outlined],:host[data-size=md][data-appearance=outlined-gray]{padding:0 17px}:host[data-size=md]._only-icon{width:40px}:host._disabled{opacity:.5}.c-wrapper{display:flex;justify-content:center;align-items:center;gap:8px;height:100%}.c-wrapper_invisible{opacity:0}.c-icon ::ng-deep path{stroke:currentColor}.c-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
|
|
116
|
+
}], propDecorators: { appearance: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}, {
|
|
119
|
+
type: HostBinding,
|
|
120
|
+
args: ['attr.data-appearance']
|
|
121
|
+
}], disabled: [{
|
|
122
|
+
type: Input
|
|
123
|
+
}, {
|
|
124
|
+
type: HostBinding,
|
|
125
|
+
args: ['class._disabled']
|
|
126
|
+
}], isLoaderShown: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}, {
|
|
129
|
+
type: HostBinding,
|
|
130
|
+
args: ['class._loading']
|
|
131
|
+
}], icon: [{
|
|
132
|
+
type: Input
|
|
133
|
+
}], iconRight: [{
|
|
134
|
+
type: Input
|
|
135
|
+
}], size: [{
|
|
136
|
+
type: Input
|
|
137
|
+
}, {
|
|
138
|
+
type: HostBinding,
|
|
139
|
+
args: ['attr.data-size']
|
|
140
|
+
}], containsOnlyIcon: [{
|
|
141
|
+
type: HostBinding,
|
|
142
|
+
args: ['class._only-icon']
|
|
143
|
+
}], isDisabled: [{
|
|
144
|
+
type: HostBinding,
|
|
145
|
+
args: ['disabled']
|
|
146
|
+
}], content: [{
|
|
147
|
+
type: ViewChild,
|
|
148
|
+
args: ['content']
|
|
149
|
+
}] } });
|
|
150
|
+
|
|
151
|
+
class CuiSvgModule {
|
|
152
|
+
}
|
|
153
|
+
CuiSvgModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiSvgModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
154
|
+
CuiSvgModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiSvgModule, declarations: [CuiSvgComponent], imports: [CommonModule], exports: [CuiSvgComponent] });
|
|
155
|
+
CuiSvgModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiSvgModule, imports: [CommonModule] });
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiSvgModule, decorators: [{
|
|
157
|
+
type: NgModule,
|
|
158
|
+
args: [{
|
|
159
|
+
imports: [CommonModule],
|
|
160
|
+
declarations: [CuiSvgComponent],
|
|
161
|
+
exports: [CuiSvgComponent]
|
|
162
|
+
}]
|
|
163
|
+
}] });
|
|
164
|
+
|
|
165
|
+
class CuiButtonModule {
|
|
166
|
+
}
|
|
167
|
+
CuiButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
168
|
+
CuiButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonModule, declarations: [CuiButtonComponent], imports: [CommonModule,
|
|
169
|
+
CuiSvgModule], exports: [CuiButtonComponent] });
|
|
170
|
+
CuiButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonModule, imports: [CommonModule,
|
|
171
|
+
CuiSvgModule] });
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonModule, decorators: [{
|
|
173
|
+
type: NgModule,
|
|
174
|
+
args: [{
|
|
175
|
+
imports: [
|
|
176
|
+
CommonModule,
|
|
177
|
+
CuiSvgModule
|
|
178
|
+
],
|
|
179
|
+
declarations: [CuiButtonComponent],
|
|
180
|
+
exports: [CuiButtonComponent]
|
|
181
|
+
}]
|
|
182
|
+
}] });
|
|
183
|
+
|
|
184
|
+
class CuiIconButtonComponent {
|
|
185
|
+
constructor() {
|
|
186
|
+
this.ICON_WIDTH = 16;
|
|
187
|
+
this.ICON_HEIGHT = 16;
|
|
188
|
+
this.ICON_STROKE_WIDTH = 1.5;
|
|
189
|
+
}
|
|
190
|
+
get isWithColor() {
|
|
191
|
+
return !!this.color;
|
|
192
|
+
}
|
|
193
|
+
get isWithHoverColor() {
|
|
194
|
+
return !!this.hoverColor;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
CuiIconButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiIconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
198
|
+
CuiIconButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiIconButtonComponent, selector: "button[cuiIconButton][icon], a[cuiIconButton][icon]", inputs: { icon: "icon", color: "color", hoverColor: "hoverColor" }, host: { properties: { "style.--icon-color": "this.color", "style.--icon-hover-color": "this.hoverColor", "class._with-color": "this.isWithColor", "class._with-hover-color": "this.isWithHoverColor" } }, ngImport: i0, template: "<cui-svg\n [icon]=\"icon\"\n [width]=\"ICON_WIDTH\"\n [height]=\"ICON_HEIGHT\"\n [strokeWidth]=\"ICON_STROKE_WIDTH\"\n class=\"c-icon\"\n></cui-svg>\n", styles: [":host{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;display:flex;justify-content:center;align-items:center;width:24px;height:24px}:host._with-color .c-icon ::ng-deep path{stroke:var(--icon-color)}:host._with-hover-color:active .c-icon ::ng-deep path{stroke:var(--icon-hover-color)}@media (hover: hover){:host._with-hover-color:hover .c-icon ::ng-deep path{stroke:var(--icon-hover-color)}}\n"], dependencies: [{ kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "icon", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiIconButtonComponent, decorators: [{
|
|
200
|
+
type: Component,
|
|
201
|
+
args: [{ selector: 'button[cuiIconButton][icon], a[cuiIconButton][icon]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cui-svg\n [icon]=\"icon\"\n [width]=\"ICON_WIDTH\"\n [height]=\"ICON_HEIGHT\"\n [strokeWidth]=\"ICON_STROKE_WIDTH\"\n class=\"c-icon\"\n></cui-svg>\n", styles: [":host{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;display:flex;justify-content:center;align-items:center;width:24px;height:24px}:host._with-color .c-icon ::ng-deep path{stroke:var(--icon-color)}:host._with-hover-color:active .c-icon ::ng-deep path{stroke:var(--icon-hover-color)}@media (hover: hover){:host._with-hover-color:hover .c-icon ::ng-deep path{stroke:var(--icon-hover-color)}}\n"] }]
|
|
202
|
+
}], propDecorators: { icon: [{
|
|
203
|
+
type: Input
|
|
204
|
+
}], color: [{
|
|
205
|
+
type: Input
|
|
206
|
+
}, {
|
|
207
|
+
type: HostBinding,
|
|
208
|
+
args: ['style.--icon-color']
|
|
209
|
+
}], hoverColor: [{
|
|
210
|
+
type: Input
|
|
211
|
+
}, {
|
|
212
|
+
type: HostBinding,
|
|
213
|
+
args: ['style.--icon-hover-color']
|
|
214
|
+
}], isWithColor: [{
|
|
215
|
+
type: HostBinding,
|
|
216
|
+
args: ['class._with-color']
|
|
217
|
+
}], isWithHoverColor: [{
|
|
218
|
+
type: HostBinding,
|
|
219
|
+
args: ['class._with-hover-color']
|
|
220
|
+
}] } });
|
|
221
|
+
|
|
222
|
+
class CuiIconButtonModule {
|
|
223
|
+
}
|
|
224
|
+
CuiIconButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiIconButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
225
|
+
CuiIconButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiIconButtonModule, declarations: [CuiIconButtonComponent], imports: [CommonModule,
|
|
226
|
+
CuiSvgModule], exports: [CuiIconButtonComponent] });
|
|
227
|
+
CuiIconButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiIconButtonModule, imports: [CommonModule,
|
|
228
|
+
CuiSvgModule] });
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiIconButtonModule, decorators: [{
|
|
230
|
+
type: NgModule,
|
|
231
|
+
args: [{
|
|
232
|
+
imports: [
|
|
233
|
+
CommonModule,
|
|
234
|
+
CuiSvgModule
|
|
235
|
+
],
|
|
236
|
+
declarations: [CuiIconButtonComponent],
|
|
237
|
+
exports: [CuiIconButtonComponent]
|
|
238
|
+
}]
|
|
239
|
+
}] });
|
|
240
|
+
|
|
241
|
+
const INPUT_TEXT_VALUE_ACCESSOR = {
|
|
242
|
+
provide: NG_VALUE_ACCESSOR,
|
|
243
|
+
useExisting: forwardRef(() => CuiInputTextComponent),
|
|
244
|
+
multi: true
|
|
245
|
+
};
|
|
246
|
+
class CuiInputTextComponent {
|
|
247
|
+
constructor() {
|
|
248
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
249
|
+
this.isError = false;
|
|
250
|
+
}
|
|
251
|
+
get isClearButtonShown() {
|
|
252
|
+
return !!(this.value && !this.isDisabled);
|
|
253
|
+
}
|
|
254
|
+
writeValue(value) {
|
|
255
|
+
this.value = value;
|
|
256
|
+
this.changeDetectorRef.markForCheck();
|
|
257
|
+
}
|
|
258
|
+
registerOnChange(fn) {
|
|
259
|
+
this.onChange = fn;
|
|
260
|
+
}
|
|
261
|
+
registerOnTouched(fn) {
|
|
262
|
+
this.onTouched = fn;
|
|
263
|
+
}
|
|
264
|
+
setDisabledState(isDisabled) {
|
|
265
|
+
this.isDisabled = isDisabled;
|
|
266
|
+
this.changeDetectorRef.markForCheck();
|
|
267
|
+
}
|
|
268
|
+
onInput({ target }) {
|
|
269
|
+
this.changeModel(target.value);
|
|
270
|
+
}
|
|
271
|
+
onClear() {
|
|
272
|
+
this.changeModel('');
|
|
273
|
+
}
|
|
274
|
+
onFocus() {
|
|
275
|
+
this.input.nativeElement.focus();
|
|
276
|
+
}
|
|
277
|
+
changeModel(value) {
|
|
278
|
+
this.value = value;
|
|
279
|
+
this.onChange(value);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
CuiInputTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
+
CuiInputTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiInputTextComponent, selector: "cui-input-text", inputs: { isError: "isError", inputId: "inputId", inputPlaceholder: "inputPlaceholder" }, host: { listeners: { "click": "onFocus()" }, properties: { "class._with-error": "this.isError", "class._disabled": "this.isDisabled" } }, providers: [INPUT_TEXT_VALUE_ACCESSOR], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input\n #input\n [ngModel]=\"value\"\n [attr.id]=\"inputId\"\n [attr.placeholder]=\"inputPlaceholder\"\n type=\"text\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>\n<button\n *ngIf=\"isClearButtonShown\"\n class=\"c-button\"\n (click)=\"onClear()\"\n>\n <cui-svg icon=\"cuiIconClear\"></cui-svg>\n</button>\n", styles: [":host{padding:8px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-base-10);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-button{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "icon", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputTextComponent, decorators: [{
|
|
285
|
+
type: Component,
|
|
286
|
+
args: [{ selector: 'cui-input-text', changeDetection: ChangeDetectionStrategy.OnPush, providers: [INPUT_TEXT_VALUE_ACCESSOR], template: "<input\n #input\n [ngModel]=\"value\"\n [attr.id]=\"inputId\"\n [attr.placeholder]=\"inputPlaceholder\"\n type=\"text\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>\n<button\n *ngIf=\"isClearButtonShown\"\n class=\"c-button\"\n (click)=\"onClear()\"\n>\n <cui-svg icon=\"cuiIconClear\"></cui-svg>\n</button>\n", styles: [":host{padding:8px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-base-10);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-button{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}\n"] }]
|
|
287
|
+
}], propDecorators: { isError: [{
|
|
288
|
+
type: Input
|
|
289
|
+
}, {
|
|
290
|
+
type: HostBinding,
|
|
291
|
+
args: ['class._with-error']
|
|
292
|
+
}], inputId: [{
|
|
293
|
+
type: Input
|
|
294
|
+
}], inputPlaceholder: [{
|
|
295
|
+
type: Input
|
|
296
|
+
}], isDisabled: [{
|
|
297
|
+
type: HostBinding,
|
|
298
|
+
args: ['class._disabled']
|
|
299
|
+
}], input: [{
|
|
300
|
+
type: ViewChild,
|
|
301
|
+
args: ['input']
|
|
302
|
+
}], onFocus: [{
|
|
303
|
+
type: HostListener,
|
|
304
|
+
args: ['click']
|
|
55
305
|
}] } });
|
|
56
306
|
|
|
57
|
-
class
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
constructor(
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
repeatCount="indefinite">
|
|
92
|
-
</animateTransform>
|
|
93
|
-
<path opacity="0.5" d="M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z" fill="white" fill-opacity="0.5"/>
|
|
94
|
-
<path d="M20 12H22C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2V4C14.1217 4 16.1566 4.84285 17.6569 6.34315C19.1571 7.84344 20 9.87827 20 12Z" fill="white"/>
|
|
95
|
-
</svg>
|
|
96
|
-
`;
|
|
97
|
-
this._size = this.cuiButtonOptions.size;
|
|
98
|
-
this.svgOptions = {
|
|
99
|
-
width: 20,
|
|
100
|
-
height: 20,
|
|
101
|
-
strokeWidth: 1.5
|
|
102
|
-
};
|
|
103
|
-
this.appearance = this.cuiButtonOptions.appearance;
|
|
104
|
-
this.disabled = false;
|
|
105
|
-
this.isLoaderShown = false;
|
|
106
|
-
this.containsOnlyIcon = false;
|
|
107
|
-
}
|
|
108
|
-
ngAfterViewInit() {
|
|
109
|
-
this.initContainsOnlyIcon();
|
|
110
|
-
}
|
|
111
|
-
initContainsOnlyIcon() {
|
|
112
|
-
Promise.resolve().then(() => {
|
|
113
|
-
this.containsOnlyIcon = this.content.nativeElement.childNodes.length === 0;
|
|
114
|
-
this.changeDetectorRef.detectChanges();
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
CuiButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: CUI_BUTTON_OPTIONS }], target: i0.ɵɵFactoryTarget.Component });
|
|
119
|
-
CuiButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: { appearance: "appearance", disabled: "disabled", isLoaderShown: "isLoaderShown", icon: "icon", iconRight: "iconRight", size: "size" }, host: { properties: { "attr.data-appearance": "this.appearance", "class._disabled": "this.disabled", "class._loading": "this.isLoaderShown", "attr.data-size": "this.size", "class._only-icon": "this.containsOnlyIcon", "disabled": "this.isDisabled" } }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], ngImport: i0, template: "<span\r\n class=\"c-wrapper\"\r\n [class.c-wrapper_invisible]=\"isLoaderShown\"\r\n>\r\n <cui-svg\r\n *ngIf=\"icon\"\r\n [icon]=\"icon\"\r\n [width]=\"svgOptions.width\"\r\n [height]=\"svgOptions.height\"\r\n [strokeWidth]=\"svgOptions.strokeWidth\"\r\n class=\"c-icon\"\r\n ></cui-svg>\r\n <span #content *ngIf=\"!containsOnlyIcon\">\r\n <ng-content></ng-content>\r\n </span>\r\n <cui-svg\r\n *ngIf=\"iconRight\"\r\n [icon]=\"iconRight\"\r\n [width]=\"svgOptions.width\"\r\n [height]=\"svgOptions.height\"\r\n [strokeWidth]=\"svgOptions.strokeWidth\"\r\n class=\"c-icon\"\r\n ></cui-svg>\r\n</span>\r\n<cui-svg\r\n *ngIf=\"isLoaderShown\"\r\n [icon]=\"CUI_ICON_LOADING\"\r\n class=\"c-loader\"\r\n></cui-svg>\r\n", styles: ["@font-face{font-family:Inter;font-style:normal;font-weight:500;src:url(../fonts/Inter-Medium.ttf) format(\"truetype\")}:root{--cui-main-font: Inter, sans-serif;--cui-gray-0: #FFFFFF;--cui-gray-10: #F9FAFB;--cui-gray-50: #F5F6F8;--cui-gray-100: #E9EBEE;--cui-gray-200: #E2E4E9;--cui-gray-500: #6B7280;--cui-gray-900: #111827;--cui-cyan-800: #297F7E;--cui-cyan-900: #1A6B6A;--cui-red-800: #D92D20;--cui-red-900: #B41308;--cui-blue-600: #1570EF;--cui-blue-900: #00429D;--cui-base-0: var(--cui-gray-0);--cui-base-10: var(--cui-gray-10);--cui-base-50: var(--cui-gray-50);--cui-base-100: var(--cui-gray-100);--cui-base-200: var(--cui-gray-200);--cui-base-500: var(--cui-gray-500);--cui-base-900: var(--cui-gray-900);--cui-primary-800: var(--cui-cyan-800);--cui-primary-900: var(--cui-cyan-900);--cui-error-800: var(--cui-red-800);--cui-error-900: var(--cui-red-900);--cui-info-600: var(--cui-blue-600);--cui-info-900: var(--cui-blue-900)}:host{font-size:14px;font-weight:500;line-height:20px;position:relative;box-sizing:border-box;border:0;border-radius:8px;outline:0;cursor:pointer;appearance:none;background:inherit;font-family:var(--cui-main-font);text-decoration:none}:host:disabled{cursor:not-allowed}:host[data-appearance=primary]{background:var(--cui-primary-800);color:var(--cui-base-0)}:host[data-appearance=primary]:hover{background:var(--cui-primary-900)}:host[data-appearance=primary]:disabled{background:var(--cui-primary-800)}:host[data-appearance=primary] .c-icon ::ng-deep path{stroke:var(--cui-base-0)}:host[data-appearance=secondary]{background:var(--cui-base-100);color:var(--cui-base-900)}:host[data-appearance=secondary]:hover{background:var(--cui-base-200)}:host[data-appearance=secondary]:disabled{background:var(--cui-base-100)}:host[data-appearance=secondary] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined]{border:1px solid var(--cui-base-200);background:var(--cui-base-0);color:var(--cui-base-900)}:host[data-appearance=outlined]:hover{background:var(--cui-base-50)}:host[data-appearance=outlined]:disabled{background:var(--cui-base-0)}:host[data-appearance=outlined] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined-gray]{border:1px solid var(--cui-base-200);background:var(--cui-base-10);color:var(--cui-base-900)}:host[data-appearance=outlined-gray]:hover{background:var(--cui-base-50)}:host[data-appearance=outlined-gray]:disabled{background:var(--cui-base-10)}:host[data-appearance=outlined-gray] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=ghost]{color:var(--cui-base-900)}:host[data-appearance=ghost]:hover{background:var(--cui-base-50)}:host[data-appearance=ghost]:disabled{background:inherit}:host[data-appearance=ghost] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=destructive]{background:var(--cui-error-800);color:var(--cui-base-0)}:host[data-appearance=destructive]:hover{background:var(--cui-error-900)}:host[data-appearance=destructive]:disabled{background:var(--cui-error-800)}:host[data-appearance=destructive] .c-icon ::ng-deep path{stroke:var(--cui-base-0)}:host[data-appearance=link]{height:24px!important;padding:0 4px!important;color:var(--cui-info-600)}:host[data-appearance=link]:hover{color:var(--cui-info-900)}:host[data-appearance=link]:hover .c-icon ::ng-deep path{stroke:var(--cui-info-900)}:host[data-appearance=link]:disabled{color:var(--cui-info-600)}:host[data-appearance=link]:disabled .c-icon ::ng-deep path{stroke:var(--cui-info-900)}:host[data-appearance=link] .c-icon ::ng-deep path{stroke:var(--cui-info-600)}:host[data-size=xxs]{font-size:12px;line-height:14px;height:28px;padding:0 8px}:host[data-size=xxs][data-appearance=outlined],:host[data-size=xxs][data-appearance=outlined-gray]{padding:0 7px}:host[data-size=xxs]._only-icon{width:28px}:host[data-size=xxs] .c-wrapper{gap:6px}:host[data-size=xs]{font-size:13px;line-height:16px;height:32px;padding:0 12px}:host[data-size=xs][data-appearance=outlined],:host[data-size=xs][data-appearance=outlined-gray]{padding:0 11px}:host[data-size=xs]._only-icon{width:32px}:host[data-size=sm]{height:36px;padding:0 14px}:host[data-size=sm][data-appearance=outlined],:host[data-size=sm][data-appearance=outlined-gray]{padding:0 13px}:host[data-size=sm]._only-icon{width:36px}:host[data-size=md]{height:40px;padding:0 18px}:host[data-size=md][data-appearance=outlined],:host[data-size=md][data-appearance=outlined-gray]{padding:0 17px}:host[data-size=md]._only-icon{width:40px}:host._disabled{opacity:.5}:host._loading :hover{background:unset}.c-wrapper{display:flex;justify-content:center;align-items:center;gap:8px;height:100%}.c-wrapper_invisible{opacity:0}.c-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "icon", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiButtonComponent, decorators: [{
|
|
121
|
-
type: Component,
|
|
122
|
-
args: [{ selector: 'button[cuiButton], a[cuiButton]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\r\n class=\"c-wrapper\"\r\n [class.c-wrapper_invisible]=\"isLoaderShown\"\r\n>\r\n <cui-svg\r\n *ngIf=\"icon\"\r\n [icon]=\"icon\"\r\n [width]=\"svgOptions.width\"\r\n [height]=\"svgOptions.height\"\r\n [strokeWidth]=\"svgOptions.strokeWidth\"\r\n class=\"c-icon\"\r\n ></cui-svg>\r\n <span #content *ngIf=\"!containsOnlyIcon\">\r\n <ng-content></ng-content>\r\n </span>\r\n <cui-svg\r\n *ngIf=\"iconRight\"\r\n [icon]=\"iconRight\"\r\n [width]=\"svgOptions.width\"\r\n [height]=\"svgOptions.height\"\r\n [strokeWidth]=\"svgOptions.strokeWidth\"\r\n class=\"c-icon\"\r\n ></cui-svg>\r\n</span>\r\n<cui-svg\r\n *ngIf=\"isLoaderShown\"\r\n [icon]=\"CUI_ICON_LOADING\"\r\n class=\"c-loader\"\r\n></cui-svg>\r\n", styles: ["@font-face{font-family:Inter;font-style:normal;font-weight:500;src:url(../fonts/Inter-Medium.ttf) format(\"truetype\")}:root{--cui-main-font: Inter, sans-serif;--cui-gray-0: #FFFFFF;--cui-gray-10: #F9FAFB;--cui-gray-50: #F5F6F8;--cui-gray-100: #E9EBEE;--cui-gray-200: #E2E4E9;--cui-gray-500: #6B7280;--cui-gray-900: #111827;--cui-cyan-800: #297F7E;--cui-cyan-900: #1A6B6A;--cui-red-800: #D92D20;--cui-red-900: #B41308;--cui-blue-600: #1570EF;--cui-blue-900: #00429D;--cui-base-0: var(--cui-gray-0);--cui-base-10: var(--cui-gray-10);--cui-base-50: var(--cui-gray-50);--cui-base-100: var(--cui-gray-100);--cui-base-200: var(--cui-gray-200);--cui-base-500: var(--cui-gray-500);--cui-base-900: var(--cui-gray-900);--cui-primary-800: var(--cui-cyan-800);--cui-primary-900: var(--cui-cyan-900);--cui-error-800: var(--cui-red-800);--cui-error-900: var(--cui-red-900);--cui-info-600: var(--cui-blue-600);--cui-info-900: var(--cui-blue-900)}:host{font-size:14px;font-weight:500;line-height:20px;position:relative;box-sizing:border-box;border:0;border-radius:8px;outline:0;cursor:pointer;appearance:none;background:inherit;font-family:var(--cui-main-font);text-decoration:none}:host:disabled{cursor:not-allowed}:host[data-appearance=primary]{background:var(--cui-primary-800);color:var(--cui-base-0)}:host[data-appearance=primary]:hover{background:var(--cui-primary-900)}:host[data-appearance=primary]:disabled{background:var(--cui-primary-800)}:host[data-appearance=primary] .c-icon ::ng-deep path{stroke:var(--cui-base-0)}:host[data-appearance=secondary]{background:var(--cui-base-100);color:var(--cui-base-900)}:host[data-appearance=secondary]:hover{background:var(--cui-base-200)}:host[data-appearance=secondary]:disabled{background:var(--cui-base-100)}:host[data-appearance=secondary] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined]{border:1px solid var(--cui-base-200);background:var(--cui-base-0);color:var(--cui-base-900)}:host[data-appearance=outlined]:hover{background:var(--cui-base-50)}:host[data-appearance=outlined]:disabled{background:var(--cui-base-0)}:host[data-appearance=outlined] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=outlined-gray]{border:1px solid var(--cui-base-200);background:var(--cui-base-10);color:var(--cui-base-900)}:host[data-appearance=outlined-gray]:hover{background:var(--cui-base-50)}:host[data-appearance=outlined-gray]:disabled{background:var(--cui-base-10)}:host[data-appearance=outlined-gray] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=ghost]{color:var(--cui-base-900)}:host[data-appearance=ghost]:hover{background:var(--cui-base-50)}:host[data-appearance=ghost]:disabled{background:inherit}:host[data-appearance=ghost] .c-icon ::ng-deep path{stroke:var(--cui-base-500)}:host[data-appearance=destructive]{background:var(--cui-error-800);color:var(--cui-base-0)}:host[data-appearance=destructive]:hover{background:var(--cui-error-900)}:host[data-appearance=destructive]:disabled{background:var(--cui-error-800)}:host[data-appearance=destructive] .c-icon ::ng-deep path{stroke:var(--cui-base-0)}:host[data-appearance=link]{height:24px!important;padding:0 4px!important;color:var(--cui-info-600)}:host[data-appearance=link]:hover{color:var(--cui-info-900)}:host[data-appearance=link]:hover .c-icon ::ng-deep path{stroke:var(--cui-info-900)}:host[data-appearance=link]:disabled{color:var(--cui-info-600)}:host[data-appearance=link]:disabled .c-icon ::ng-deep path{stroke:var(--cui-info-900)}:host[data-appearance=link] .c-icon ::ng-deep path{stroke:var(--cui-info-600)}:host[data-size=xxs]{font-size:12px;line-height:14px;height:28px;padding:0 8px}:host[data-size=xxs][data-appearance=outlined],:host[data-size=xxs][data-appearance=outlined-gray]{padding:0 7px}:host[data-size=xxs]._only-icon{width:28px}:host[data-size=xxs] .c-wrapper{gap:6px}:host[data-size=xs]{font-size:13px;line-height:16px;height:32px;padding:0 12px}:host[data-size=xs][data-appearance=outlined],:host[data-size=xs][data-appearance=outlined-gray]{padding:0 11px}:host[data-size=xs]._only-icon{width:32px}:host[data-size=sm]{height:36px;padding:0 14px}:host[data-size=sm][data-appearance=outlined],:host[data-size=sm][data-appearance=outlined-gray]{padding:0 13px}:host[data-size=sm]._only-icon{width:36px}:host[data-size=md]{height:40px;padding:0 18px}:host[data-size=md][data-appearance=outlined],:host[data-size=md][data-appearance=outlined-gray]{padding:0 17px}:host[data-size=md]._only-icon{width:40px}:host._disabled{opacity:.5}:host._loading :hover{background:unset}.c-wrapper{display:flex;justify-content:center;align-items:center;gap:8px;height:100%}.c-wrapper_invisible{opacity:0}.c-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
|
|
123
|
-
}], ctorParameters: function () {
|
|
124
|
-
return [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
125
|
-
type: Inject,
|
|
126
|
-
args: [CUI_BUTTON_OPTIONS]
|
|
127
|
-
}] }];
|
|
128
|
-
}, propDecorators: { appearance: [{
|
|
129
|
-
type: Input
|
|
130
|
-
}, {
|
|
131
|
-
type: HostBinding,
|
|
132
|
-
args: ['attr.data-appearance']
|
|
133
|
-
}], disabled: [{
|
|
134
|
-
type: Input
|
|
135
|
-
}, {
|
|
136
|
-
type: HostBinding,
|
|
137
|
-
args: ['class._disabled']
|
|
138
|
-
}], isLoaderShown: [{
|
|
139
|
-
type: Input
|
|
140
|
-
}, {
|
|
141
|
-
type: HostBinding,
|
|
142
|
-
args: ['class._loading']
|
|
143
|
-
}], icon: [{
|
|
144
|
-
type: Input
|
|
145
|
-
}], iconRight: [{
|
|
146
|
-
type: Input
|
|
147
|
-
}], size: [{
|
|
148
|
-
type: Input
|
|
149
|
-
}, {
|
|
150
|
-
type: HostBinding,
|
|
151
|
-
args: ['attr.data-size']
|
|
152
|
-
}], containsOnlyIcon: [{
|
|
153
|
-
type: HostBinding,
|
|
154
|
-
args: ['class._only-icon']
|
|
155
|
-
}], isDisabled: [{
|
|
156
|
-
type: HostBinding,
|
|
157
|
-
args: ['disabled']
|
|
158
|
-
}], content: [{
|
|
159
|
-
type: ViewChild,
|
|
160
|
-
args: ['content']
|
|
307
|
+
class CuiInputModule {
|
|
308
|
+
}
|
|
309
|
+
CuiInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
310
|
+
CuiInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiInputModule, declarations: [CuiInputTextComponent], imports: [CommonModule,
|
|
311
|
+
FormsModule,
|
|
312
|
+
CuiSvgModule], exports: [CuiInputTextComponent] });
|
|
313
|
+
CuiInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputModule, imports: [CommonModule,
|
|
314
|
+
FormsModule,
|
|
315
|
+
CuiSvgModule] });
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputModule, decorators: [{
|
|
317
|
+
type: NgModule,
|
|
318
|
+
args: [{
|
|
319
|
+
imports: [
|
|
320
|
+
CommonModule,
|
|
321
|
+
FormsModule,
|
|
322
|
+
CuiSvgModule
|
|
323
|
+
],
|
|
324
|
+
declarations: [CuiInputTextComponent],
|
|
325
|
+
exports: [CuiInputTextComponent]
|
|
326
|
+
}]
|
|
327
|
+
}] });
|
|
328
|
+
|
|
329
|
+
class CuiLabelComponent {
|
|
330
|
+
constructor() {
|
|
331
|
+
this.isRequired = false;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
CuiLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
335
|
+
CuiLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiLabelComponent, selector: "label[cuiLabel]", inputs: { isRequired: "isRequired" }, ngImport: i0, template: "<ng-content></ng-content>\n<span\n *ngIf=\"isRequired\"\n class=\"c-star\"\n>\n *\n</span>\n", styles: [":host{font-weight:500;font-size:14px;line-height:20px;display:inline-flex;gap:2px;color:var(--cui-base-900);font-family:var(--cui-main-font)}.c-star{color:var(--cui-error-500)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiLabelComponent, decorators: [{
|
|
337
|
+
type: Component,
|
|
338
|
+
args: [{ selector: 'label[cuiLabel]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n<span\n *ngIf=\"isRequired\"\n class=\"c-star\"\n>\n *\n</span>\n", styles: [":host{font-weight:500;font-size:14px;line-height:20px;display:inline-flex;gap:2px;color:var(--cui-base-900);font-family:var(--cui-main-font)}.c-star{color:var(--cui-error-500)}\n"] }]
|
|
339
|
+
}], propDecorators: { isRequired: [{
|
|
340
|
+
type: Input
|
|
161
341
|
}] } });
|
|
162
342
|
|
|
163
|
-
class
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
169
|
-
type: NgModule,
|
|
170
|
-
args: [{
|
|
171
|
-
imports: [CommonModule],
|
|
172
|
-
declarations: [
|
|
173
|
-
exports: [
|
|
174
|
-
}]
|
|
343
|
+
class CuiLabelModule {
|
|
344
|
+
}
|
|
345
|
+
CuiLabelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
346
|
+
CuiLabelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiLabelModule, declarations: [CuiLabelComponent], imports: [CommonModule], exports: [CuiLabelComponent] });
|
|
347
|
+
CuiLabelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiLabelModule, imports: [CommonModule] });
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiLabelModule, decorators: [{
|
|
349
|
+
type: NgModule,
|
|
350
|
+
args: [{
|
|
351
|
+
imports: [CommonModule],
|
|
352
|
+
declarations: [CuiLabelComponent],
|
|
353
|
+
exports: [CuiLabelComponent]
|
|
354
|
+
}]
|
|
175
355
|
}] });
|
|
176
356
|
|
|
177
|
-
class
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
185
|
-
type:
|
|
186
|
-
args: [{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
357
|
+
class CuiHintComponent {
|
|
358
|
+
constructor() {
|
|
359
|
+
this.hintType = 'info';
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
CuiHintComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
363
|
+
CuiHintComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiHintComponent, selector: "cui-hint", inputs: { hintType: "hintType" }, host: { properties: { "attr.data-hint-type": "this.hintType" } }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font)}:host[data-hint-type=info]{color:var(--cui-base-600)}:host[data-hint-type=error]{color:var(--cui-error-500)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiHintComponent, decorators: [{
|
|
365
|
+
type: Component,
|
|
366
|
+
args: [{ selector: 'cui-hint', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n", styles: [":host{font-weight:400;font-size:14px;line-height:20px;font-family:var(--cui-main-font)}:host[data-hint-type=info]{color:var(--cui-base-600)}:host[data-hint-type=error]{color:var(--cui-error-500)}\n"] }]
|
|
367
|
+
}], propDecorators: { hintType: [{
|
|
368
|
+
type: Input
|
|
369
|
+
}, {
|
|
370
|
+
type: HostBinding,
|
|
371
|
+
args: ['attr.data-hint-type']
|
|
372
|
+
}] } });
|
|
373
|
+
|
|
374
|
+
class CuiHintModule {
|
|
375
|
+
}
|
|
376
|
+
CuiHintModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiHintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
377
|
+
CuiHintModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiHintModule, declarations: [CuiHintComponent], exports: [CuiHintComponent] });
|
|
378
|
+
CuiHintModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiHintModule });
|
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiHintModule, decorators: [{
|
|
380
|
+
type: NgModule,
|
|
381
|
+
args: [{
|
|
382
|
+
declarations: [CuiHintComponent],
|
|
383
|
+
exports: [CuiHintComponent]
|
|
384
|
+
}]
|
|
385
|
+
}] });
|
|
386
|
+
|
|
387
|
+
const CUI_INPUT_NUMBER_DEFAULT_OPTIONS = {
|
|
388
|
+
min: -Infinity,
|
|
389
|
+
max: Infinity,
|
|
390
|
+
step: 1,
|
|
391
|
+
precision: 3
|
|
392
|
+
};
|
|
393
|
+
const CUI_INPUT_NUMBER_OPTIONS = new InjectionToken('', {
|
|
394
|
+
factory: () => CUI_INPUT_NUMBER_DEFAULT_OPTIONS
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
function cuiReplace(value, search, replace) {
|
|
398
|
+
const regex = new RegExp(search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g');
|
|
399
|
+
return value.replace(regex, replace);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function cuiRemoveSpaces(value) {
|
|
403
|
+
return value.replace(/\s+/g, '');
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const INPUT_NUMBER_VALUE_ACCESSOR = {
|
|
407
|
+
provide: NG_VALUE_ACCESSOR,
|
|
408
|
+
useExisting: forwardRef(() => CuiInputNumberComponent),
|
|
409
|
+
multi: true
|
|
410
|
+
};
|
|
411
|
+
class CuiInputNumberComponent {
|
|
412
|
+
constructor() {
|
|
413
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
414
|
+
this.cuiInputNumberOptions = inject(CUI_INPUT_NUMBER_OPTIONS);
|
|
415
|
+
this.MIN_JS_NUMBER = -(Math.pow(2, 53));
|
|
416
|
+
this.MAX_JS_NUMBER = Math.pow(2, 53);
|
|
417
|
+
this.INPUT_VALUE_REGEX = /^-?[\d\s]*(,\d*)?$/;
|
|
418
|
+
this.INTERVAL_BETWEEN_SPACES = 3;
|
|
419
|
+
this.formattedValue = '';
|
|
420
|
+
this._min = this.calculateValidMinValue(this.cuiInputNumberOptions.min);
|
|
421
|
+
this._max = this.calculateValidMaxValue(this.cuiInputNumberOptions.max);
|
|
422
|
+
this.step = this.cuiInputNumberOptions.step;
|
|
423
|
+
this.precision = this.cuiInputNumberOptions.precision;
|
|
424
|
+
this.isError = false;
|
|
425
|
+
}
|
|
426
|
+
set min(value) {
|
|
427
|
+
this._min = this.calculateValidMinValue(value);
|
|
428
|
+
}
|
|
429
|
+
set max(value) {
|
|
430
|
+
this._max = this.calculateValidMaxValue(value);
|
|
431
|
+
}
|
|
432
|
+
writeValue(value) {
|
|
433
|
+
var _a;
|
|
434
|
+
this.value = (_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : null;
|
|
435
|
+
this.formattedValue = this.formatValue(this.value);
|
|
436
|
+
this.changeDetectorRef.markForCheck();
|
|
437
|
+
}
|
|
438
|
+
registerOnChange(fn) {
|
|
439
|
+
this.onChange = fn;
|
|
440
|
+
}
|
|
441
|
+
registerOnTouched(fn) {
|
|
442
|
+
this.onTouched = fn;
|
|
443
|
+
}
|
|
444
|
+
setDisabledState(isDisabled) {
|
|
445
|
+
this.isDisabled = isDisabled;
|
|
446
|
+
this.changeDetectorRef.markForCheck();
|
|
447
|
+
}
|
|
448
|
+
onInput(event) {
|
|
449
|
+
var _a;
|
|
450
|
+
const eventTarget = event.target;
|
|
451
|
+
const targetValue = eventTarget.value;
|
|
452
|
+
const selectionStart = (_a = this.input.nativeElement.selectionStart) !== null && _a !== void 0 ? _a : 0;
|
|
453
|
+
const previousFormattedValue = this.formattedValue;
|
|
454
|
+
if (this.isInputValueCorrect(targetValue)) {
|
|
455
|
+
const parsedValue = this.parseValue(targetValue);
|
|
456
|
+
this.changeModel(parsedValue);
|
|
457
|
+
}
|
|
458
|
+
this.formattedValue = this.formatValue(this.value);
|
|
459
|
+
eventTarget.value = this.formattedValue;
|
|
460
|
+
const currentCaretPosition = selectionStart
|
|
461
|
+
+ (this.formattedValue.length - previousFormattedValue.length === 2 ? 1 : 0);
|
|
462
|
+
this.input.nativeElement.setSelectionRange(currentCaretPosition, currentCaretPosition);
|
|
463
|
+
}
|
|
464
|
+
onArrowUp() {
|
|
465
|
+
this.increaseByStep();
|
|
466
|
+
}
|
|
467
|
+
onArrowDown() {
|
|
468
|
+
this.decreaseByStep();
|
|
469
|
+
}
|
|
470
|
+
onFocus() {
|
|
471
|
+
this.input.nativeElement.focus();
|
|
472
|
+
}
|
|
473
|
+
isInputValueCorrect(inputValue) {
|
|
474
|
+
return this.INPUT_VALUE_REGEX.test(inputValue) && this.isInputValueValid(inputValue);
|
|
475
|
+
}
|
|
476
|
+
isInputValueValid(inputValue) {
|
|
477
|
+
const [, fractionPart = ''] = inputValue.split(',');
|
|
478
|
+
return this.isNumberValid(inputValue) && this.isPrecisionCountCorrect(fractionPart);
|
|
479
|
+
}
|
|
480
|
+
isNumberValid(inputValue) {
|
|
481
|
+
if (inputValue === '-' && this._min > 0) {
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
if (inputValue === ',' || inputValue === '-' || inputValue === '-,' || inputValue === '') {
|
|
485
|
+
return true;
|
|
486
|
+
}
|
|
487
|
+
const convertedValue = +cuiReplace(cuiRemoveSpaces(inputValue), ',', '.');
|
|
488
|
+
return convertedValue <= this._max && convertedValue >= this._min;
|
|
489
|
+
}
|
|
490
|
+
isPrecisionCountCorrect(fractionPart = '') {
|
|
491
|
+
return fractionPart.length <= this.precision;
|
|
492
|
+
}
|
|
493
|
+
parseValue(inputValue) {
|
|
494
|
+
const valueWithoutSpaces = cuiRemoveSpaces(inputValue);
|
|
495
|
+
switch (valueWithoutSpaces) {
|
|
496
|
+
case ',':
|
|
497
|
+
return '0.';
|
|
498
|
+
case '-,':
|
|
499
|
+
return '-0.';
|
|
500
|
+
default:
|
|
501
|
+
return cuiReplace(valueWithoutSpaces, ',', '.');
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
formatValue(value) {
|
|
505
|
+
if (!value) {
|
|
506
|
+
return '';
|
|
507
|
+
}
|
|
508
|
+
const [integerPart, fractionPart] = value.split('.');
|
|
509
|
+
let formattedInteger = this.insertSpacesWithInterval(integerPart) || '0';
|
|
510
|
+
if (fractionPart !== undefined && integerPart.startsWith('-') && !formattedInteger.slice(1)) {
|
|
511
|
+
formattedInteger = '-0';
|
|
512
|
+
}
|
|
513
|
+
return fractionPart !== undefined ? `${formattedInteger},${fractionPart}` : formattedInteger;
|
|
514
|
+
}
|
|
515
|
+
insertSpacesWithInterval(value) {
|
|
516
|
+
const regex = new RegExp(`\\B(?=(\\d{${this.INTERVAL_BETWEEN_SPACES}})+(?!\\d))`, 'g');
|
|
517
|
+
return value.replace(regex, ' ');
|
|
518
|
+
}
|
|
519
|
+
changeModel(value) {
|
|
520
|
+
this.value = value;
|
|
521
|
+
this.onChange(value === '-' ? 0 : +value);
|
|
522
|
+
}
|
|
523
|
+
increaseByStep() {
|
|
524
|
+
const value = this.value === '-'
|
|
525
|
+
? this.step
|
|
526
|
+
: (+(Number(this.value) + this.step).toFixed(this.precision));
|
|
527
|
+
if (value > this._max) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const convertedValue = value.toString();
|
|
531
|
+
this.formattedValue = this.formatValue(convertedValue);
|
|
532
|
+
this.changeModel(convertedValue);
|
|
533
|
+
}
|
|
534
|
+
decreaseByStep() {
|
|
535
|
+
const value = this.value === '-'
|
|
536
|
+
? -this.step
|
|
537
|
+
: (+(Number(this.value) - this.step).toFixed(this.precision));
|
|
538
|
+
if (value < this._min) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
const convertedValue = value.toString();
|
|
542
|
+
this.formattedValue = this.formatValue(convertedValue);
|
|
543
|
+
this.changeModel(convertedValue);
|
|
544
|
+
}
|
|
545
|
+
calculateValidMinValue(initialValue) {
|
|
546
|
+
return initialValue >= this.MIN_JS_NUMBER
|
|
547
|
+
? initialValue
|
|
548
|
+
: this.MIN_JS_NUMBER;
|
|
549
|
+
}
|
|
550
|
+
calculateValidMaxValue(initialValue) {
|
|
551
|
+
return initialValue <= this.MAX_JS_NUMBER
|
|
552
|
+
? initialValue
|
|
553
|
+
: this.MAX_JS_NUMBER;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
CuiInputNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
557
|
+
CuiInputNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiInputNumberComponent, selector: "cui-input-number", inputs: { step: "step", precision: "precision", isError: "isError", inputId: "inputId", inputPlaceholder: "inputPlaceholder", min: "min", max: "max" }, host: { listeners: { "click": "onFocus()" }, properties: { "class._with-error": "this.isError", "class._disabled": "this.isDisabled" } }, providers: [INPUT_NUMBER_VALUE_ACCESSOR], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<input\n #input\n [ngModel]=\"formattedValue\"\n [attr.id]=\"inputId\"\n [attr.placeholder]=\"inputPlaceholder\"\n type=\"text\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n (keydown.arrowUp)=\"onArrowUp()\"\n (keydown.arrowDown)=\"onArrowDown()\"\n>\n", styles: [":host{padding:8px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-base-10);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}\n"], dependencies: [{ kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberComponent, decorators: [{
|
|
559
|
+
type: Component,
|
|
560
|
+
args: [{ selector: 'cui-input-number', changeDetection: ChangeDetectionStrategy.OnPush, providers: [INPUT_NUMBER_VALUE_ACCESSOR], template: "<input\n #input\n [ngModel]=\"formattedValue\"\n [attr.id]=\"inputId\"\n [attr.placeholder]=\"inputPlaceholder\"\n type=\"text\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n (keydown.arrowUp)=\"onArrowUp()\"\n (keydown.arrowDown)=\"onArrowDown()\"\n>\n", styles: [":host{padding:8px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-base-10);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}\n"] }]
|
|
561
|
+
}], propDecorators: { step: [{
|
|
562
|
+
type: Input
|
|
563
|
+
}], precision: [{
|
|
564
|
+
type: Input
|
|
565
|
+
}], isError: [{
|
|
566
|
+
type: Input
|
|
567
|
+
}, {
|
|
568
|
+
type: HostBinding,
|
|
569
|
+
args: ['class._with-error']
|
|
570
|
+
}], inputId: [{
|
|
571
|
+
type: Input
|
|
572
|
+
}], inputPlaceholder: [{
|
|
573
|
+
type: Input
|
|
574
|
+
}], min: [{
|
|
575
|
+
type: Input
|
|
576
|
+
}], max: [{
|
|
577
|
+
type: Input
|
|
578
|
+
}], isDisabled: [{
|
|
579
|
+
type: HostBinding,
|
|
580
|
+
args: ['class._disabled']
|
|
581
|
+
}], input: [{
|
|
582
|
+
type: ViewChild,
|
|
583
|
+
args: ['input']
|
|
584
|
+
}], onFocus: [{
|
|
585
|
+
type: HostListener,
|
|
586
|
+
args: ['click']
|
|
587
|
+
}] } });
|
|
588
|
+
|
|
589
|
+
class CuiInputNumberModule {
|
|
590
|
+
}
|
|
591
|
+
CuiInputNumberModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
592
|
+
CuiInputNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, declarations: [CuiInputNumberComponent], imports: [CommonModule, CuiSvgModule, FormsModule], exports: [CuiInputNumberComponent] });
|
|
593
|
+
CuiInputNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, imports: [CommonModule, CuiSvgModule, FormsModule] });
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, decorators: [{
|
|
595
|
+
type: NgModule,
|
|
596
|
+
args: [{
|
|
597
|
+
imports: [CommonModule, CuiSvgModule, FormsModule],
|
|
598
|
+
declarations: [CuiInputNumberComponent],
|
|
599
|
+
exports: [CuiInputNumberComponent]
|
|
600
|
+
}]
|
|
601
|
+
}] });
|
|
602
|
+
|
|
603
|
+
const INPUT_PASSWORD_VALUE_ACCESSOR = {
|
|
604
|
+
provide: NG_VALUE_ACCESSOR,
|
|
605
|
+
useExisting: forwardRef(() => CuiInputPasswordComponent),
|
|
606
|
+
multi: true
|
|
607
|
+
};
|
|
608
|
+
class CuiInputPasswordComponent {
|
|
609
|
+
constructor() {
|
|
610
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
611
|
+
this.isPasswordHidden = true;
|
|
612
|
+
this.isError = false;
|
|
613
|
+
}
|
|
614
|
+
get isToggleButtonShown() {
|
|
615
|
+
return !this.isDisabled;
|
|
616
|
+
}
|
|
617
|
+
get icon() {
|
|
618
|
+
return this.isPasswordHidden ? 'cuiIconEye' : 'cuiIconEyeOff';
|
|
619
|
+
}
|
|
620
|
+
get type() {
|
|
621
|
+
return this.isPasswordHidden ? 'password' : 'text';
|
|
622
|
+
}
|
|
623
|
+
get buttonTitle() {
|
|
624
|
+
return this.isPasswordHidden ? 'Reveal password' : 'Hide password';
|
|
625
|
+
}
|
|
626
|
+
writeValue(value) {
|
|
627
|
+
this.value = value;
|
|
628
|
+
this.changeDetectorRef.markForCheck();
|
|
629
|
+
}
|
|
630
|
+
registerOnChange(fn) {
|
|
631
|
+
this.onChange = fn;
|
|
632
|
+
}
|
|
633
|
+
registerOnTouched(fn) {
|
|
634
|
+
this.onTouched = fn;
|
|
635
|
+
}
|
|
636
|
+
setDisabledState(isDisabled) {
|
|
637
|
+
this.isDisabled = isDisabled;
|
|
638
|
+
if (this.isDisabled) {
|
|
639
|
+
this.isPasswordHidden = true;
|
|
640
|
+
}
|
|
641
|
+
this.changeDetectorRef.markForCheck();
|
|
642
|
+
}
|
|
643
|
+
onInput({ target }) {
|
|
644
|
+
const value = target.value;
|
|
645
|
+
this.value = value;
|
|
646
|
+
this.onChange(value);
|
|
647
|
+
}
|
|
648
|
+
onTogglePasswordVisibility() {
|
|
649
|
+
this.isPasswordHidden = !this.isPasswordHidden;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
CuiInputPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
653
|
+
CuiInputPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiInputPasswordComponent, selector: "cui-input-password", inputs: { isError: "isError", inputId: "inputId", inputPlaceholder: "inputPlaceholder" }, host: { properties: { "class._with-error": "this.isError", "class._disabled": "this.isDisabled" } }, providers: [INPUT_PASSWORD_VALUE_ACCESSOR], ngImport: i0, template: "<input\n [ngModel]=\"value\"\n [attr.id]=\"inputId\"\n [attr.placeholder]=\"inputPlaceholder\"\n [type]=\"type\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>\n<button\n *ngIf=\"isToggleButtonShown\"\n [title]=\"buttonTitle\"\n class=\"c-button\"\n (click)=\"onTogglePasswordVisibility()\"\n>\n <cui-svg\n [icon]=\"icon\"\n [width]=\"16\"\n [height]=\"16\"\n ></cui-svg>\n</button>\n", styles: [":host{padding:8px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-base-10);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-input::-ms-reveal{display:none}.c-input[type=password]{color:var(--cui-base-400)}.c-button{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "icon", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
654
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputPasswordComponent, decorators: [{
|
|
655
|
+
type: Component,
|
|
656
|
+
args: [{ selector: 'cui-input-password', changeDetection: ChangeDetectionStrategy.OnPush, providers: [INPUT_PASSWORD_VALUE_ACCESSOR], template: "<input\n [ngModel]=\"value\"\n [attr.id]=\"inputId\"\n [attr.placeholder]=\"inputPlaceholder\"\n [type]=\"type\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>\n<button\n *ngIf=\"isToggleButtonShown\"\n [title]=\"buttonTitle\"\n class=\"c-button\"\n (click)=\"onTogglePasswordVisibility()\"\n>\n <cui-svg\n [icon]=\"icon\"\n [width]=\"16\"\n [height]=\"16\"\n ></cui-svg>\n</button>\n", styles: [":host{padding:8px 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-base-10);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-input::-ms-reveal{display:none}.c-input[type=password]{color:var(--cui-base-400)}.c-button{padding:0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}\n"] }]
|
|
657
|
+
}], propDecorators: { isError: [{
|
|
658
|
+
type: Input
|
|
659
|
+
}, {
|
|
660
|
+
type: HostBinding,
|
|
661
|
+
args: ['class._with-error']
|
|
662
|
+
}], inputId: [{
|
|
663
|
+
type: Input
|
|
664
|
+
}], inputPlaceholder: [{
|
|
665
|
+
type: Input
|
|
666
|
+
}], isDisabled: [{
|
|
667
|
+
type: HostBinding,
|
|
668
|
+
args: ['class._disabled']
|
|
669
|
+
}] } });
|
|
670
|
+
|
|
671
|
+
class CuiInputPasswordModule {
|
|
672
|
+
}
|
|
673
|
+
CuiInputPasswordModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputPasswordModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
674
|
+
CuiInputPasswordModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiInputPasswordModule, declarations: [CuiInputPasswordComponent], imports: [CommonModule,
|
|
675
|
+
FormsModule,
|
|
676
|
+
CuiSvgModule], exports: [CuiInputPasswordComponent] });
|
|
677
|
+
CuiInputPasswordModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputPasswordModule, imports: [CommonModule,
|
|
678
|
+
FormsModule,
|
|
679
|
+
CuiSvgModule] });
|
|
680
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputPasswordModule, decorators: [{
|
|
681
|
+
type: NgModule,
|
|
682
|
+
args: [{
|
|
683
|
+
imports: [
|
|
684
|
+
CommonModule,
|
|
685
|
+
FormsModule,
|
|
686
|
+
CuiSvgModule
|
|
687
|
+
],
|
|
688
|
+
declarations: [CuiInputPasswordComponent],
|
|
689
|
+
exports: [CuiInputPasswordComponent]
|
|
690
|
+
}]
|
|
691
|
+
}] });
|
|
692
|
+
|
|
693
|
+
class CuiTextareaComponent {
|
|
694
|
+
constructor() {
|
|
695
|
+
this.isError = false;
|
|
696
|
+
this.rows = 4;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
CuiTextareaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
700
|
+
CuiTextareaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiTextareaComponent, selector: "textarea [cuiTextarea]", inputs: { isError: "isError", rows: "rows" }, host: { properties: { "class._with-error": "this.isError", "rows": "this.rows" } }, hostDirectives: [{ directive: i1$1.CuiAutoResizingDirective }], ngImport: i0, template: "", styles: [":host{padding:11px 13px 11px 0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;color:inherit;font:inherit;line-height:inherit;padding:11px 13px;font-weight:400;font-size:14px;line-height:20px;box-sizing:border-box;width:100%;border:1px solid var(--cui-base-200);border-radius:8px;resize:none;background:none;color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host:disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host::placeholder{color:var(--cui-base-400)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiTextareaComponent, decorators: [{
|
|
702
|
+
type: Component,
|
|
703
|
+
args: [{ selector: 'textarea [cuiTextarea]', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [CuiAutoResizingDirective], template: "", styles: [":host{padding:11px 13px 11px 0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;color:inherit;font:inherit;line-height:inherit;padding:11px 13px;font-weight:400;font-size:14px;line-height:20px;box-sizing:border-box;width:100%;border:1px solid var(--cui-base-200);border-radius:8px;resize:none;background:none;color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px #e5ecff;border-color:var(--cui-info-600)}:host:disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host::placeholder{color:var(--cui-base-400)}:host._with-error{border-color:var(--cui-error-500)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}\n"] }]
|
|
704
|
+
}], propDecorators: { isError: [{
|
|
705
|
+
type: Input
|
|
706
|
+
}, {
|
|
707
|
+
type: HostBinding,
|
|
708
|
+
args: ['class._with-error']
|
|
709
|
+
}], rows: [{
|
|
710
|
+
type: Input
|
|
711
|
+
}, {
|
|
712
|
+
type: HostBinding,
|
|
713
|
+
args: ['rows']
|
|
714
|
+
}] } });
|
|
715
|
+
|
|
716
|
+
class CuiTextareaModule {
|
|
717
|
+
}
|
|
718
|
+
CuiTextareaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiTextareaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
719
|
+
CuiTextareaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiTextareaModule, declarations: [CuiTextareaComponent], exports: [CuiTextareaComponent] });
|
|
720
|
+
CuiTextareaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiTextareaModule });
|
|
721
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiTextareaModule, decorators: [{
|
|
722
|
+
type: NgModule,
|
|
723
|
+
args: [{
|
|
724
|
+
declarations: [CuiTextareaComponent],
|
|
725
|
+
exports: [CuiTextareaComponent]
|
|
726
|
+
}]
|
|
727
|
+
}] });
|
|
728
|
+
|
|
729
|
+
class CuiAccordionComponent {
|
|
730
|
+
}
|
|
731
|
+
CuiAccordionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
732
|
+
CuiAccordionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiAccordionComponent, selector: "cui-accordion", ngImport: i0, template: "<ng-content select=\"cui-accordion-item\"></ng-content>\n", styles: [":host{display:flex;flex-direction:column;gap:16px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionComponent, decorators: [{
|
|
734
|
+
type: Component,
|
|
735
|
+
args: [{ selector: 'cui-accordion', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content select=\"cui-accordion-item\"></ng-content>\n", styles: [":host{display:flex;flex-direction:column;gap:16px}\n"] }]
|
|
736
|
+
}] });
|
|
737
|
+
|
|
738
|
+
class CuiAccordionItemComponent {
|
|
739
|
+
constructor() {
|
|
740
|
+
this.isOpen = false;
|
|
741
|
+
}
|
|
742
|
+
onRowToggle() {
|
|
743
|
+
this.isOpen = !this.isOpen;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
CuiAccordionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
747
|
+
CuiAccordionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiAccordionItemComponent, selector: "cui-accordion-item", ngImport: i0, template: "<header class=\"c-header\">\n <span>\n <ng-content></ng-content>\n </span>\n <button\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconChevronDown\"\n (click)=\"onRowToggle()\"\n [class.c-button_opened]=\"isOpen\"\n ></button>\n</header>\n<div *ngIf=\"isOpen\">\n <ng-content select=\"[cuiAccordionItemContent]\"></ng-content>\n</div>\n", styles: [":host{padding:12px;display:flex;flex-direction:column;gap:8px;background:var(--cui-base-10);border-radius:8px}.c-header{font-weight:400;font-size:12px;line-height:14px;display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--cui-base-900);font-family:var(--cui-main-font);text-transform:uppercase}.c-button_opened{transform:rotate(180deg)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiButtonComponent, selector: "button[cuiButton], a[cuiButton]", inputs: ["appearance", "disabled", "isLoaderShown", "icon", "iconRight", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionItemComponent, decorators: [{
|
|
749
|
+
type: Component,
|
|
750
|
+
args: [{ selector: 'cui-accordion-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<header class=\"c-header\">\n <span>\n <ng-content></ng-content>\n </span>\n <button\n cuiButton\n appearance=\"ghost\"\n size=\"xxs\"\n icon=\"cuiIconChevronDown\"\n (click)=\"onRowToggle()\"\n [class.c-button_opened]=\"isOpen\"\n ></button>\n</header>\n<div *ngIf=\"isOpen\">\n <ng-content select=\"[cuiAccordionItemContent]\"></ng-content>\n</div>\n", styles: [":host{padding:12px;display:flex;flex-direction:column;gap:8px;background:var(--cui-base-10);border-radius:8px}.c-header{font-weight:400;font-size:12px;line-height:14px;display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--cui-base-900);font-family:var(--cui-main-font);text-transform:uppercase}.c-button_opened{transform:rotate(180deg)}\n"] }]
|
|
751
|
+
}] });
|
|
752
|
+
|
|
753
|
+
class CuiAccordionModule {
|
|
754
|
+
}
|
|
755
|
+
CuiAccordionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
756
|
+
CuiAccordionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionModule, declarations: [CuiAccordionComponent,
|
|
757
|
+
CuiAccordionItemComponent], imports: [CommonModule,
|
|
758
|
+
CuiSvgModule,
|
|
759
|
+
CuiButtonModule], exports: [CuiAccordionComponent,
|
|
760
|
+
CuiAccordionItemComponent] });
|
|
761
|
+
CuiAccordionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionModule, imports: [CommonModule,
|
|
762
|
+
CuiSvgModule,
|
|
763
|
+
CuiButtonModule] });
|
|
764
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiAccordionModule, decorators: [{
|
|
765
|
+
type: NgModule,
|
|
766
|
+
args: [{
|
|
767
|
+
imports: [
|
|
768
|
+
CommonModule,
|
|
769
|
+
CuiSvgModule,
|
|
770
|
+
CuiButtonModule,
|
|
771
|
+
],
|
|
772
|
+
declarations: [
|
|
773
|
+
CuiAccordionComponent,
|
|
774
|
+
CuiAccordionItemComponent
|
|
775
|
+
],
|
|
776
|
+
exports: [
|
|
777
|
+
CuiAccordionComponent,
|
|
778
|
+
CuiAccordionItemComponent
|
|
779
|
+
]
|
|
780
|
+
}]
|
|
781
|
+
}] });
|
|
782
|
+
|
|
783
|
+
class CuiContextMenuComponent {
|
|
784
|
+
constructor() {
|
|
785
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
786
|
+
this.element = inject(ElementRef).nativeElement;
|
|
787
|
+
this.document = inject(DOCUMENT);
|
|
788
|
+
this.documentElement = this.document.documentElement;
|
|
789
|
+
this.window = this.document.defaultView;
|
|
790
|
+
this.isVisible = false;
|
|
791
|
+
this.isHidden = false;
|
|
792
|
+
}
|
|
793
|
+
ngAfterViewInit() {
|
|
794
|
+
this.initTargetElementListener();
|
|
795
|
+
}
|
|
796
|
+
ngOnDestroy() {
|
|
797
|
+
this.destroyTargetElementListener();
|
|
798
|
+
}
|
|
799
|
+
onSelect(item) {
|
|
800
|
+
var _a;
|
|
801
|
+
this.isVisible = false;
|
|
802
|
+
(_a = item.command) === null || _a === void 0 ? void 0 : _a.call(item);
|
|
803
|
+
}
|
|
804
|
+
onClickOutside(target) {
|
|
805
|
+
if (this.element.contains(target) || this.target.contains(target)) {
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
this.isVisible = false;
|
|
809
|
+
}
|
|
810
|
+
trackByFn(_, item) {
|
|
811
|
+
return item.label;
|
|
812
|
+
}
|
|
813
|
+
initTargetElementListener() {
|
|
814
|
+
this.targetEventListener = ({ pageX, pageY }) => {
|
|
815
|
+
this.isVisible = !this.isVisible;
|
|
816
|
+
if (this.isVisible) {
|
|
817
|
+
this.changePosition(pageX, pageY);
|
|
818
|
+
}
|
|
819
|
+
this.changeDetectorRef.markForCheck();
|
|
820
|
+
};
|
|
821
|
+
this.target.addEventListener('click', this.targetEventListener);
|
|
822
|
+
}
|
|
823
|
+
destroyTargetElementListener() {
|
|
824
|
+
this.target.removeEventListener('click', this.targetEventListener);
|
|
825
|
+
}
|
|
826
|
+
changePosition(x, y) {
|
|
827
|
+
this.isHidden = true;
|
|
828
|
+
setTimeout(() => {
|
|
829
|
+
const { scrollX, scrollY } = this.window;
|
|
830
|
+
const { clientWidth, clientHeight } = this.documentElement;
|
|
831
|
+
const width = this.element.offsetWidth;
|
|
832
|
+
const height = this.element.offsetHeight;
|
|
833
|
+
let left = x;
|
|
834
|
+
let top = y;
|
|
835
|
+
if (left + width > scrollX + clientWidth) {
|
|
836
|
+
left -= width;
|
|
837
|
+
}
|
|
838
|
+
if (top + height > scrollY + clientHeight) {
|
|
839
|
+
top -= height;
|
|
840
|
+
}
|
|
841
|
+
left = Math.max(left, scrollX);
|
|
842
|
+
top = Math.max(top, scrollY);
|
|
843
|
+
this.isHidden = false;
|
|
844
|
+
this.pageX = left;
|
|
845
|
+
this.pageY = top;
|
|
846
|
+
this.changeDetectorRef.markForCheck();
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
CuiContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
851
|
+
CuiContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiContextMenuComponent, selector: "cui-context-menu [items] [target]", inputs: { items: "items", target: "target" }, host: { listeners: { "document:click": "onClickOutside($event.target)" }, properties: { "class._hidden": "this.isHidden", "style.left.px": "this.pageX", "style.top.px": "this.pageY" } }, ngImport: i0, template: "<ul\n *ngIf=\"isVisible\"\n class=\"c-ul\"\n>\n <li *ngFor=\"let item of items; trackBy: trackByFn\">\n <button\n class=\"c-button\"\n (click)=\"onSelect(item)\"\n >\n <cui-svg\n *ngIf=\"item.icon\"\n [icon]=\"item.icon\"\n ></cui-svg>\n <span>{{ item.label }}</span>\n </button>\n </li>\n</ul>\n", styles: [":host{position:absolute;display:block;width:268px;border-radius:8px}:host._hidden{visibility:hidden}.c-ul{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;border:1px solid var(--cui-base-200);border-radius:inherit;background:var(--cui-base-0);color:var(--cui-base-900);font-family:var(--cui-main-font)}.c-button{padding:8px 11px 8px 0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;gap:12px}.c-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-button:hover{background:var(--cui-base-50)}}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "icon", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuComponent, decorators: [{
|
|
853
|
+
type: Component,
|
|
854
|
+
args: [{ selector: 'cui-context-menu [items] [target]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul\n *ngIf=\"isVisible\"\n class=\"c-ul\"\n>\n <li *ngFor=\"let item of items; trackBy: trackByFn\">\n <button\n class=\"c-button\"\n (click)=\"onSelect(item)\"\n >\n <cui-svg\n *ngIf=\"item.icon\"\n [icon]=\"item.icon\"\n ></cui-svg>\n <span>{{ item.label }}</span>\n </button>\n </li>\n</ul>\n", styles: [":host{position:absolute;display:block;width:268px;border-radius:8px}:host._hidden{visibility:hidden}.c-ul{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;border:1px solid var(--cui-base-200);border-radius:inherit;background:var(--cui-base-0);color:var(--cui-base-900);font-family:var(--cui-main-font)}.c-button{padding:8px 11px 8px 0;border:0;outline:none;cursor:pointer;appearance:none;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;gap:12px}.c-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-button:hover{background:var(--cui-base-50)}}\n"] }]
|
|
855
|
+
}], propDecorators: { items: [{
|
|
856
|
+
type: Input
|
|
857
|
+
}], target: [{
|
|
858
|
+
type: Input
|
|
859
|
+
}], isHidden: [{
|
|
860
|
+
type: HostBinding,
|
|
861
|
+
args: ['class._hidden']
|
|
862
|
+
}], pageX: [{
|
|
863
|
+
type: HostBinding,
|
|
864
|
+
args: ['style.left.px']
|
|
865
|
+
}], pageY: [{
|
|
866
|
+
type: HostBinding,
|
|
867
|
+
args: ['style.top.px']
|
|
868
|
+
}], onClickOutside: [{
|
|
869
|
+
type: HostListener,
|
|
870
|
+
args: ['document:click', ['$event.target']]
|
|
871
|
+
}] } });
|
|
872
|
+
|
|
873
|
+
class CuiContextMenuModule {
|
|
874
|
+
}
|
|
875
|
+
CuiContextMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
876
|
+
CuiContextMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuModule, declarations: [CuiContextMenuComponent], imports: [CommonModule,
|
|
877
|
+
CuiSvgModule], exports: [CuiContextMenuComponent] });
|
|
878
|
+
CuiContextMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuModule, imports: [CommonModule,
|
|
879
|
+
CuiSvgModule] });
|
|
880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiContextMenuModule, decorators: [{
|
|
881
|
+
type: NgModule,
|
|
882
|
+
args: [{
|
|
883
|
+
imports: [
|
|
884
|
+
CommonModule,
|
|
885
|
+
CuiSvgModule
|
|
886
|
+
],
|
|
887
|
+
declarations: [CuiContextMenuComponent],
|
|
888
|
+
exports: [CuiContextMenuComponent]
|
|
889
|
+
}]
|
|
194
890
|
}] });
|
|
195
891
|
|
|
196
|
-
/**
|
|
197
|
-
* Generated bundle index. Do not edit.
|
|
892
|
+
/**
|
|
893
|
+
* Generated bundle index. Do not edit.
|
|
198
894
|
*/
|
|
199
895
|
|
|
200
|
-
export { CUI_BUTTON_DEFAULT_OPTIONS, CUI_BUTTON_OPTIONS, CuiButtonComponent, CuiButtonModule, CuiSvgComponent, CuiSvgModule };
|
|
896
|
+
export { CUI_BUTTON_DEFAULT_OPTIONS, CUI_BUTTON_OPTIONS, CuiAccordionComponent, CuiAccordionItemComponent, CuiAccordionModule, CuiButtonComponent, CuiButtonModule, CuiContextMenuComponent, CuiContextMenuModule, CuiHintComponent, CuiHintModule, CuiIconButtonComponent, CuiIconButtonModule, CuiInputModule, CuiInputNumberComponent, CuiInputNumberModule, CuiInputPasswordComponent, CuiInputPasswordModule, CuiInputTextComponent, CuiLabelComponent, CuiLabelModule, CuiSvgComponent, CuiSvgModule, CuiTextareaComponent, CuiTextareaModule, cuiRemoveSpaces, cuiReplace };
|
|
201
897
|
//# sourceMappingURL=cuby-ui-core.mjs.map
|