@cdek-it/angular-ui-kit 0.2.6-test → 0.2.8-test
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/avatar/index.d.ts +2 -2
- package/components/button/index.d.ts +6 -6
- package/components/confirm-dialog/index.d.ts +1 -1
- package/components/fileupload/index.d.ts +62 -0
- package/components/message/index.d.ts +3 -1
- package/components/progressspinner/index.d.ts +1 -1
- package/components/select-button/index.d.ts +38 -0
- package/components/tag/index.d.ts +1 -1
- package/components/togglebutton/index.d.ts +41 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-avatar.mjs +2 -2
- package/fesm2022/cdek-it-angular-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-button.mjs +9 -9
- package/fesm2022/cdek-it-angular-ui-kit-components-button.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-confirm-dialog.mjs +2 -2
- package/fesm2022/cdek-it-angular-ui-kit-components-confirm-dialog.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-fileupload.mjs +436 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-fileupload.mjs.map +1 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-message.mjs +11 -4
- package/fesm2022/cdek-it-angular-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-progressspinner.mjs +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-progressspinner.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-select-button.mjs +136 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-select-button.mjs.map +1 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-stepper.mjs +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-tag.mjs +2 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-tag.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-togglebutton.mjs +167 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-togglebutton.mjs.map +1 -0
- package/fesm2022/cdek-it-angular-ui-kit-providers.mjs +5189 -3114
- package/fesm2022/cdek-it-angular-ui-kit-providers.mjs.map +1 -1
- package/package.json +22 -2
- package/tailwind/theme.css +467 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, Optional, Self, Component } from '@angular/core';
|
|
3
|
+
import { NgClass } from '@angular/common';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import { SelectButton } from 'primeng/selectbutton';
|
|
7
|
+
import * as i2 from 'primeng/api';
|
|
8
|
+
import { SharedModule } from 'primeng/api';
|
|
9
|
+
|
|
10
|
+
class ExtraSelectButtonComponent {
|
|
11
|
+
ngControl;
|
|
12
|
+
options = [];
|
|
13
|
+
optionLabel = 'label';
|
|
14
|
+
optionValue = 'value';
|
|
15
|
+
optionDisabled = 'disabled';
|
|
16
|
+
size = 'base';
|
|
17
|
+
multiple = false;
|
|
18
|
+
allowEmpty = true;
|
|
19
|
+
valueChange = new EventEmitter();
|
|
20
|
+
value = '';
|
|
21
|
+
_disabled = false;
|
|
22
|
+
onChange = (_) => { };
|
|
23
|
+
onTouched = () => { };
|
|
24
|
+
constructor(ngControl) {
|
|
25
|
+
this.ngControl = ngControl;
|
|
26
|
+
if (ngControl)
|
|
27
|
+
ngControl.valueAccessor = this;
|
|
28
|
+
}
|
|
29
|
+
get isDisabled() {
|
|
30
|
+
return this._disabled;
|
|
31
|
+
}
|
|
32
|
+
get sizeClass() {
|
|
33
|
+
const sizeMap = {
|
|
34
|
+
small: 'p-selectbutton-small',
|
|
35
|
+
large: 'p-selectbutton-large',
|
|
36
|
+
xlarge: 'p-selectbutton-xlarge',
|
|
37
|
+
};
|
|
38
|
+
return sizeMap[this.size] ?? '';
|
|
39
|
+
}
|
|
40
|
+
writeValue(value) {
|
|
41
|
+
this.value = value ?? '';
|
|
42
|
+
}
|
|
43
|
+
registerOnChange(fn) {
|
|
44
|
+
this.onChange = fn;
|
|
45
|
+
}
|
|
46
|
+
registerOnTouched(fn) {
|
|
47
|
+
this.onTouched = fn;
|
|
48
|
+
}
|
|
49
|
+
setDisabledState(isDisabled) {
|
|
50
|
+
this._disabled = isDisabled;
|
|
51
|
+
}
|
|
52
|
+
onValueChange(newValue) {
|
|
53
|
+
this.value = newValue;
|
|
54
|
+
this.onChange(newValue);
|
|
55
|
+
this.onTouched();
|
|
56
|
+
this.valueChange.emit(newValue);
|
|
57
|
+
}
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraSelectButtonComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ExtraSelectButtonComponent, isStandalone: true, selector: "extra-select-button", inputs: { options: "options", optionLabel: "optionLabel", optionValue: "optionValue", optionDisabled: "optionDisabled", size: "size", multiple: "multiple", allowEmpty: "allowEmpty" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
60
|
+
<p-selectbutton
|
|
61
|
+
[options]="options"
|
|
62
|
+
[ngModel]="value"
|
|
63
|
+
(ngModelChange)="onValueChange($event)"
|
|
64
|
+
[optionLabel]="optionLabel"
|
|
65
|
+
[optionValue]="optionValue"
|
|
66
|
+
[optionDisabled]="optionDisabled"
|
|
67
|
+
[multiple]="multiple"
|
|
68
|
+
[allowEmpty]="allowEmpty"
|
|
69
|
+
[disabled]="isDisabled"
|
|
70
|
+
[ngClass]="sizeClass"
|
|
71
|
+
>
|
|
72
|
+
<ng-template pTemplate="item" let-item>
|
|
73
|
+
@if ($any(item)['icon']) {
|
|
74
|
+
<i [class]="$any(item)['icon']"></i>
|
|
75
|
+
}
|
|
76
|
+
<span>{{ $any(item)[optionLabel] }}</span>
|
|
77
|
+
</ng-template>
|
|
78
|
+
</p-selectbutton>
|
|
79
|
+
`, isInline: true, dependencies: [{ kind: "component", type: SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "styleClass", "ariaLabelledBy", "dataKey", "autofocus", "size", "fluid"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: SharedModule }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraSelectButtonComponent, decorators: [{
|
|
82
|
+
type: Component,
|
|
83
|
+
args: [{
|
|
84
|
+
selector: 'extra-select-button',
|
|
85
|
+
standalone: true,
|
|
86
|
+
imports: [SelectButton, SharedModule, FormsModule, NgClass],
|
|
87
|
+
template: `
|
|
88
|
+
<p-selectbutton
|
|
89
|
+
[options]="options"
|
|
90
|
+
[ngModel]="value"
|
|
91
|
+
(ngModelChange)="onValueChange($event)"
|
|
92
|
+
[optionLabel]="optionLabel"
|
|
93
|
+
[optionValue]="optionValue"
|
|
94
|
+
[optionDisabled]="optionDisabled"
|
|
95
|
+
[multiple]="multiple"
|
|
96
|
+
[allowEmpty]="allowEmpty"
|
|
97
|
+
[disabled]="isDisabled"
|
|
98
|
+
[ngClass]="sizeClass"
|
|
99
|
+
>
|
|
100
|
+
<ng-template pTemplate="item" let-item>
|
|
101
|
+
@if ($any(item)['icon']) {
|
|
102
|
+
<i [class]="$any(item)['icon']"></i>
|
|
103
|
+
}
|
|
104
|
+
<span>{{ $any(item)[optionLabel] }}</span>
|
|
105
|
+
</ng-template>
|
|
106
|
+
</p-selectbutton>
|
|
107
|
+
`,
|
|
108
|
+
}]
|
|
109
|
+
}], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
|
|
110
|
+
type: Optional
|
|
111
|
+
}, {
|
|
112
|
+
type: Self
|
|
113
|
+
}] }], propDecorators: { options: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}], optionLabel: [{
|
|
116
|
+
type: Input
|
|
117
|
+
}], optionValue: [{
|
|
118
|
+
type: Input
|
|
119
|
+
}], optionDisabled: [{
|
|
120
|
+
type: Input
|
|
121
|
+
}], size: [{
|
|
122
|
+
type: Input
|
|
123
|
+
}], multiple: [{
|
|
124
|
+
type: Input
|
|
125
|
+
}], allowEmpty: [{
|
|
126
|
+
type: Input
|
|
127
|
+
}], valueChange: [{
|
|
128
|
+
type: Output
|
|
129
|
+
}] } });
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Generated bundle index. Do not edit.
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
export { ExtraSelectButtonComponent };
|
|
136
|
+
//# sourceMappingURL=cdek-it-angular-ui-kit-components-select-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-select-button.mjs","sources":["../../src/lib/components/select-button/select-button.component.ts","../../src/lib/components/select-button/cdek-it-angular-ui-kit-components-select-button.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Optional, Output, Self } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { ControlValueAccessor, FormsModule, NgControl } from '@angular/forms';\nimport { SelectButton } from 'primeng/selectbutton';\nimport { SharedModule } from 'primeng/api';\n\nexport interface ExtraSelectButtonItem {\n label: string;\n value: string;\n icon?: string;\n disabled?: boolean;\n}\n\n@Component({\n selector: 'extra-select-button',\n standalone: true,\n imports: [SelectButton, SharedModule, FormsModule, NgClass],\n template: `\n <p-selectbutton\n [options]=\"options\"\n [ngModel]=\"value\"\n (ngModelChange)=\"onValueChange($event)\"\n [optionLabel]=\"optionLabel\"\n [optionValue]=\"optionValue\"\n [optionDisabled]=\"optionDisabled\"\n [multiple]=\"multiple\"\n [allowEmpty]=\"allowEmpty\"\n [disabled]=\"isDisabled\"\n [ngClass]=\"sizeClass\"\n >\n <ng-template pTemplate=\"item\" let-item>\n @if ($any(item)['icon']) {\n <i [class]=\"$any(item)['icon']\"></i>\n }\n <span>{{ $any(item)[optionLabel] }}</span>\n </ng-template>\n </p-selectbutton>\n `,\n})\nexport class ExtraSelectButtonComponent implements ControlValueAccessor {\n @Input() options: unknown[] = [];\n @Input() optionLabel = 'label';\n @Input() optionValue = 'value';\n @Input() optionDisabled = 'disabled';\n @Input() size: 'base' | 'small' | 'large' | 'xlarge' = 'base';\n @Input() multiple = false;\n @Input() allowEmpty = true;\n\n @Output() valueChange = new EventEmitter<string | string[]>();\n\n value: string | string[] = '';\n\n private _disabled = false;\n private onChange = (_: string | string[]) => {};\n private onTouched = () => {};\n\n constructor(@Optional() @Self() private ngControl: NgControl) {\n if (ngControl) ngControl.valueAccessor = this;\n }\n\n get isDisabled(): boolean {\n return this._disabled;\n }\n\n get sizeClass(): string {\n const sizeMap: Record<string, string> = {\n small: 'p-selectbutton-small',\n large: 'p-selectbutton-large',\n xlarge: 'p-selectbutton-xlarge',\n };\n return sizeMap[this.size] ?? '';\n }\n\n writeValue(value: string | string[]): void {\n this.value = value ?? '';\n }\n\n registerOnChange(fn: (value: string | string[]) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._disabled = isDisabled;\n }\n\n onValueChange(newValue: string | string[]): void {\n this.value = newValue;\n this.onChange(newValue);\n this.onTouched();\n this.valueChange.emit(newValue);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAuCa,0BAA0B,CAAA;AAiBG,IAAA,SAAA;IAhB/B,OAAO,GAAc,EAAE;IACvB,WAAW,GAAG,OAAO;IACrB,WAAW,GAAG,OAAO;IACrB,cAAc,GAAG,UAAU;IAC3B,IAAI,GAA0C,MAAM;IACpD,QAAQ,GAAG,KAAK;IAChB,UAAU,GAAG,IAAI;AAEhB,IAAA,WAAW,GAAG,IAAI,YAAY,EAAqB;IAE7D,KAAK,GAAsB,EAAE;IAErB,SAAS,GAAG,KAAK;AACjB,IAAA,QAAQ,GAAG,CAAC,CAAoB,KAAI,EAAE,CAAC;AACvC,IAAA,SAAS,GAAG,MAAK,EAAE,CAAC;AAE5B,IAAA,WAAA,CAAwC,SAAoB,EAAA;QAApB,IAAA,CAAA,SAAS,GAAT,SAAS;AAC/C,QAAA,IAAI,SAAS;AAAE,YAAA,SAAS,CAAC,aAAa,GAAG,IAAI;IAC/C;AAEA,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,SAAS;IACvB;AAEA,IAAA,IAAI,SAAS,GAAA;AACX,QAAA,MAAM,OAAO,GAA2B;AACtC,YAAA,KAAK,EAAE,sBAAsB;AAC7B,YAAA,KAAK,EAAE,sBAAsB;AAC7B,YAAA,MAAM,EAAE,uBAAuB;SAChC;QACD,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;IACjC;AAEA,IAAA,UAAU,CAAC,KAAwB,EAAA;AACjC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;IAC1B;AAEA,IAAA,gBAAgB,CAAC,EAAsC,EAAA;AACrD,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE;IACpB;AAEA,IAAA,iBAAiB,CAAC,EAAc,EAAA;AAC9B,QAAA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AAA,EAAA,gBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,UAAA,EAAA,YAAA,EAAA,YAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,WAAW,+VAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAuB/C,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBA1BtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,CAAC;AAC3D,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;AAoBT,EAAA,CAAA;AACF,iBAAA;;0BAkBc;;0BAAY;;sBAhBxB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;;AChDH;;AAEG;;;;"}
|
|
@@ -105,7 +105,7 @@ class ExtraStepperComponent {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
</p-stepper>
|
|
108
|
-
`, isInline: true, dependencies: [{ kind: "component", type: Stepper, selector: "p-stepper", inputs: ["value", "linear", "transitionOptions"], outputs: ["valueChange"] }, { kind: "component", type: StepList, selector: "p-step-list" }, { kind: "component", type: Step, selector: "p-step", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: StepPanels, selector: "p-step-panels" }, { kind: "component", type: StepPanel, selector: "p-step-panel", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: StepItem, selector: "p-step-item", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ExtraButtonComponent, selector: "extra-button", inputs: ["label", "variant", "severity", "size", "rounded", "
|
|
108
|
+
`, isInline: true, dependencies: [{ kind: "component", type: Stepper, selector: "p-stepper", inputs: ["value", "linear", "transitionOptions"], outputs: ["valueChange"] }, { kind: "component", type: StepList, selector: "p-step-list" }, { kind: "component", type: Step, selector: "p-step", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: StepPanels, selector: "p-step-panels" }, { kind: "component", type: StepPanel, selector: "p-step-panel", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: StepItem, selector: "p-step-item", inputs: ["value"], outputs: ["valueChange"] }, { kind: "component", type: ExtraButtonComponent, selector: "extra-button", inputs: ["label", "variant", "severity", "size", "rounded", "iconPosition", "iconOnly", "icon", "disabled", "loading", "badge", "badgeSeverity", "showBadge", "fluid", "ariaLabel", "autofocus", "tabindex", "text"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
109
109
|
}
|
|
110
110
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraStepperComponent, decorators: [{
|
|
111
111
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdek-it-angular-ui-kit-components-stepper.mjs","sources":["../../src/lib/components/stepper/stepper.component.ts","../../src/lib/components/stepper/cdek-it-angular-ui-kit-components-stepper.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { Step, StepItem, StepList, StepPanel, StepPanels, Stepper } from 'primeng/stepper';\nimport { ExtraButtonComponent } from '@cdek-it/angular-ui-kit/components/button';\n\nexport interface ExtraStepperItem {\n value: number | undefined;\n label: string;\n caption?: string;\n content?: string;\n disabled?: boolean;\n invalid?: boolean;\n}\n\n@Component({\n selector: 'extra-stepper',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [Stepper, StepList, Step, StepPanels, StepPanel, StepItem, ExtraButtonComponent, NgClass],\n template: `\n <p-stepper [value]=\"value\" [linear]=\"linear\" (valueChange)=\"onValueChange($event)\">\n @if (orientation === 'horizontal') {\n <p-step-list>\n @for (step of steps; track step.value) {\n <p-step\n [value]=\"step.value\"\n [disabled]=\"step.disabled || false\"\n [ngClass]=\"{ 'step-invalid': step.invalid }\"\n >\n {{ step.label }}\n @if (step.caption) {\n <div class=\"caption-secondary\">{{ step.caption }}</div>\n }\n </p-step>\n }\n </p-step-list>\n }\n @if (orientation === 'horizontal' && showPanels) {\n <p-step-panels>\n @for (step of steps; track step.value; let i = $index; let first = $first; let last = $last) {\n <p-step-panel [value]=\"step.value\">\n <ng-template #content let-activateCallback=\"activateCallback\">\n <p class=\"m-0\">{{ step.content }}</p>\n <div class=\"flex pt-4\">\n @if (!first) {\n <extra-button\n label=\"Назад\"\n variant=\"outlined\"\n (click)=\"activateCallback(steps[i - 1].value)\"\n ></extra-button>\n }\n @if (!last) {\n <extra-button\n label=\"Вперёд\"\n variant=\"secondary\"\n class=\"ml-auto\"\n [disabled]=\"!!step.invalid\"\n (click)=\"activateCallback(steps[i + 1].value)\"\n ></extra-button>\n }\n </div>\n </ng-template>\n </p-step-panel>\n }\n </p-step-panels>\n }\n\n @if (orientation === 'vertical') {\n @for (step of steps; track step.value; let i = $index; let first = $first; let last = $last) {\n <p-step-item [value]=\"step.value\">\n <p-step\n [value]=\"step.value\"\n [disabled]=\"step.disabled || false\"\n [ngClass]=\"{ 'step-invalid': step.invalid }\"\n >\n {{ step.label }}\n @if (step.caption) {\n <div class=\"caption-secondary\">{{ step.caption }}</div>\n }\n </p-step>\n @if (showPanels) {\n <p-step-panel [value]=\"step.value\">\n <ng-template #content let-activateCallback=\"activateCallback\">\n <p class=\"m-0\">{{ step.content }}</p>\n <div class=\"flex gap-2 pt-4\">\n @if (!first) {\n <extra-button\n label=\"Назад\"\n variant=\"outlined\"\n (click)=\"activateCallback(steps[i - 1].value)\"\n ></extra-button>\n }\n @if (!last) {\n <extra-button\n label=\"Вперёд\"\n variant=\"secondary\"\n [disabled]=\"!!step.invalid\"\n (click)=\"activateCallback(steps[i + 1].value)\"\n ></extra-button>\n }\n </div>\n </ng-template>\n </p-step-panel>\n }\n </p-step-item>\n }\n }\n </p-stepper>\n `\n})\nexport class ExtraStepperComponent {\n @Input() value: number | undefined = 1;\n @Input() steps: ExtraStepperItem[] = [];\n @Input() linear = false;\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n @Input() showPanels = true;\n\n @Output() valueChange = new EventEmitter<number | undefined>();\n\n onValueChange(newValue: number | undefined): void {\n this.value = newValue;\n this.valueChange.emit(newValue);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MA8Ga,qBAAqB,CAAA;IACvB,KAAK,GAAuB,CAAC;IAC7B,KAAK,GAAuB,EAAE;IAC9B,MAAM,GAAG,KAAK;IACd,WAAW,GAA8B,YAAY;IACrD,UAAU,GAAG,IAAI;AAEhB,IAAA,WAAW,GAAG,IAAI,YAAY,EAAsB;AAE9D,IAAA,aAAa,CAAC,QAA4B,EAAA;AACxC,QAAA,IAAI,CAAC,KAAK,GAAG,QAAQ;AACrB,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;IACjC;wGAZW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA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AA,IAAA,EAAE,QAAQ,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-stepper.mjs","sources":["../../src/lib/components/stepper/stepper.component.ts","../../src/lib/components/stepper/cdek-it-angular-ui-kit-components-stepper.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport { Step, StepItem, StepList, StepPanel, StepPanels, Stepper } from 'primeng/stepper';\nimport { ExtraButtonComponent } from '@cdek-it/angular-ui-kit/components/button';\n\nexport interface ExtraStepperItem {\n value: number | undefined;\n label: string;\n caption?: string;\n content?: string;\n disabled?: boolean;\n invalid?: boolean;\n}\n\n@Component({\n selector: 'extra-stepper',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [Stepper, StepList, Step, StepPanels, StepPanel, StepItem, ExtraButtonComponent, NgClass],\n template: `\n <p-stepper [value]=\"value\" [linear]=\"linear\" (valueChange)=\"onValueChange($event)\">\n @if (orientation === 'horizontal') {\n <p-step-list>\n @for (step of steps; track step.value) {\n <p-step\n [value]=\"step.value\"\n [disabled]=\"step.disabled || false\"\n [ngClass]=\"{ 'step-invalid': step.invalid }\"\n >\n {{ step.label }}\n @if (step.caption) {\n <div class=\"caption-secondary\">{{ step.caption }}</div>\n }\n </p-step>\n }\n </p-step-list>\n }\n @if (orientation === 'horizontal' && showPanels) {\n <p-step-panels>\n @for (step of steps; track step.value; let i = $index; let first = $first; let last = $last) {\n <p-step-panel [value]=\"step.value\">\n <ng-template #content let-activateCallback=\"activateCallback\">\n <p class=\"m-0\">{{ step.content }}</p>\n <div class=\"flex pt-4\">\n @if (!first) {\n <extra-button\n label=\"Назад\"\n variant=\"outlined\"\n (click)=\"activateCallback(steps[i - 1].value)\"\n ></extra-button>\n }\n @if (!last) {\n <extra-button\n label=\"Вперёд\"\n variant=\"secondary\"\n class=\"ml-auto\"\n [disabled]=\"!!step.invalid\"\n (click)=\"activateCallback(steps[i + 1].value)\"\n ></extra-button>\n }\n </div>\n </ng-template>\n </p-step-panel>\n }\n </p-step-panels>\n }\n\n @if (orientation === 'vertical') {\n @for (step of steps; track step.value; let i = $index; let first = $first; let last = $last) {\n <p-step-item [value]=\"step.value\">\n <p-step\n [value]=\"step.value\"\n [disabled]=\"step.disabled || false\"\n [ngClass]=\"{ 'step-invalid': step.invalid }\"\n >\n {{ step.label }}\n @if (step.caption) {\n <div class=\"caption-secondary\">{{ step.caption }}</div>\n }\n </p-step>\n @if (showPanels) {\n <p-step-panel [value]=\"step.value\">\n <ng-template #content let-activateCallback=\"activateCallback\">\n <p class=\"m-0\">{{ step.content }}</p>\n <div class=\"flex gap-2 pt-4\">\n @if (!first) {\n <extra-button\n label=\"Назад\"\n variant=\"outlined\"\n (click)=\"activateCallback(steps[i - 1].value)\"\n ></extra-button>\n }\n @if (!last) {\n <extra-button\n label=\"Вперёд\"\n variant=\"secondary\"\n [disabled]=\"!!step.invalid\"\n (click)=\"activateCallback(steps[i + 1].value)\"\n ></extra-button>\n }\n </div>\n </ng-template>\n </p-step-panel>\n }\n </p-step-item>\n }\n }\n </p-stepper>\n `\n})\nexport class ExtraStepperComponent {\n @Input() value: number | undefined = 1;\n @Input() steps: ExtraStepperItem[] = [];\n @Input() linear = false;\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n @Input() showPanels = true;\n\n @Output() valueChange = new EventEmitter<number | undefined>();\n\n onValueChange(newValue: number | undefined): void {\n this.value = newValue;\n this.valueChange.emit(newValue);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MA8Ga,qBAAqB,CAAA;IACvB,KAAK,GAAuB,CAAC;IAC7B,KAAK,GAA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;;AAyFT,EAAA;AACF,iBAAA;;sBAEE;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;;ACrHH;;AAEG;;;;"}
|
|
@@ -10,6 +10,8 @@ class ExtraTagComponent {
|
|
|
10
10
|
get primeSeverity() {
|
|
11
11
|
if (this.severity === 'primary')
|
|
12
12
|
return undefined;
|
|
13
|
+
if (this.severity === 'warning')
|
|
14
|
+
return 'warn';
|
|
13
15
|
return this.severity;
|
|
14
16
|
}
|
|
15
17
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdek-it-angular-ui-kit-components-tag.mjs","sources":["../../src/lib/components/tag/tag.component.ts","../../src/lib/components/tag/cdek-it-angular-ui-kit-components-tag.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { Tag } from 'primeng/tag';\n\nexport type ExtraTagSeverity = 'primary' | 'secondary' | 'success' | 'info' | '
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-tag.mjs","sources":["../../src/lib/components/tag/tag.component.ts","../../src/lib/components/tag/cdek-it-angular-ui-kit-components-tag.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { Tag } from 'primeng/tag';\n\nexport type ExtraTagSeverity = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';\n\n@Component({\n selector: 'extra-tag',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [Tag],\n template: `\n <p-tag [value]=\"value\" [severity]=\"primeSeverity\" [rounded]=\"rounded\" [icon]=\"icon || undefined\"></p-tag>\n `\n})\nexport class ExtraTagComponent {\n @Input() value = '';\n @Input() severity: ExtraTagSeverity = 'primary';\n @Input() rounded = false;\n @Input() icon = '';\n\n get primeSeverity(): 'secondary' | 'success' | 'info' | 'warn' | 'danger' | undefined {\n if (this.severity === 'primary') return undefined;\n if (this.severity === 'warning') return 'warn';\n return this.severity;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAca,iBAAiB,CAAA;IACnB,KAAK,GAAG,EAAE;IACV,QAAQ,GAAqB,SAAS;IACtC,OAAO,GAAG,KAAK;IACf,IAAI,GAAG,EAAE;AAElB,IAAA,IAAI,aAAa,GAAA;AACf,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;AAAE,YAAA,OAAO,SAAS;AACjD,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;AAAE,YAAA,OAAO,MAAM;QAC9C,OAAO,IAAI,CAAC,QAAQ;IACtB;wGAVW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAJlB;;AAET,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAHS,GAAG,EAAA,QAAA,EAAA,OAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,UAAA,EAAA,OAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAKF,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;oBAChB,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,GAAG,CAAC;AACd,oBAAA,QAAQ,EAAE;;AAET,EAAA;AACF,iBAAA;;sBAEE;;sBACA;;sBACA;;sBACA;;;AClBH;;AAEG;;;;"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, forwardRef, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { NgClass } from '@angular/common';
|
|
6
|
+
import { ToggleButton } from 'primeng/togglebutton';
|
|
7
|
+
|
|
8
|
+
class ExtraToggleButtonComponent {
|
|
9
|
+
cdr;
|
|
10
|
+
constructor(cdr) {
|
|
11
|
+
this.cdr = cdr;
|
|
12
|
+
}
|
|
13
|
+
onLabel = 'Вкл';
|
|
14
|
+
offLabel = 'Выкл';
|
|
15
|
+
onIcon = undefined;
|
|
16
|
+
offIcon = undefined;
|
|
17
|
+
iconPos = 'left';
|
|
18
|
+
size = 'base';
|
|
19
|
+
disabled = false;
|
|
20
|
+
iconOnly = false;
|
|
21
|
+
allowEmpty = undefined;
|
|
22
|
+
fluid = false;
|
|
23
|
+
ariaLabel = undefined;
|
|
24
|
+
ariaLabelledBy = undefined;
|
|
25
|
+
inputId = undefined;
|
|
26
|
+
tabindex = undefined;
|
|
27
|
+
autofocus = undefined;
|
|
28
|
+
onChange = new EventEmitter();
|
|
29
|
+
modelValue = false;
|
|
30
|
+
_onChange = () => { };
|
|
31
|
+
_onTouched = () => { };
|
|
32
|
+
get primeSize() {
|
|
33
|
+
if (this.size === 'small')
|
|
34
|
+
return 'small';
|
|
35
|
+
if (this.size === 'large' || this.size === 'xlarge')
|
|
36
|
+
return 'large';
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
get extraClasses() {
|
|
40
|
+
return {
|
|
41
|
+
'p-togglebutton-xlarge': this.size === 'xlarge',
|
|
42
|
+
'p-togglebutton-icon-only': this.iconOnly,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
onChangeHandler(event) {
|
|
46
|
+
this._onChange(event.checked);
|
|
47
|
+
this._onTouched();
|
|
48
|
+
this.onChange.emit(event);
|
|
49
|
+
}
|
|
50
|
+
writeValue(value) {
|
|
51
|
+
this.modelValue = value;
|
|
52
|
+
}
|
|
53
|
+
registerOnChange(fn) {
|
|
54
|
+
this._onChange = fn;
|
|
55
|
+
}
|
|
56
|
+
registerOnTouched(fn) {
|
|
57
|
+
this._onTouched = fn;
|
|
58
|
+
}
|
|
59
|
+
setDisabledState(isDisabled) {
|
|
60
|
+
this.disabled = isDisabled;
|
|
61
|
+
this.cdr.markForCheck();
|
|
62
|
+
}
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraToggleButtonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: ExtraToggleButtonComponent, isStandalone: true, selector: "extra-toggle-button", inputs: { onLabel: "onLabel", offLabel: "offLabel", onIcon: "onIcon", offIcon: "offIcon", iconPos: "iconPos", size: "size", disabled: "disabled", iconOnly: "iconOnly", allowEmpty: "allowEmpty", fluid: "fluid", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", inputId: "inputId", tabindex: "tabindex", autofocus: "autofocus" }, outputs: { onChange: "onChange" }, providers: [
|
|
65
|
+
{
|
|
66
|
+
provide: NG_VALUE_ACCESSOR,
|
|
67
|
+
useExisting: forwardRef(() => ExtraToggleButtonComponent),
|
|
68
|
+
multi: true,
|
|
69
|
+
},
|
|
70
|
+
], ngImport: i0, template: `
|
|
71
|
+
<p-togglebutton
|
|
72
|
+
[ngClass]="extraClasses"
|
|
73
|
+
[onLabel]="onLabel"
|
|
74
|
+
[offLabel]="offLabel"
|
|
75
|
+
[onIcon]="onIcon"
|
|
76
|
+
[offIcon]="offIcon"
|
|
77
|
+
[iconPos]="iconPos"
|
|
78
|
+
[size]="primeSize!"
|
|
79
|
+
[disabled]="disabled"
|
|
80
|
+
[allowEmpty]="allowEmpty"
|
|
81
|
+
[fluid]="fluid"
|
|
82
|
+
[ariaLabel]="ariaLabel"
|
|
83
|
+
[ariaLabelledBy]="ariaLabelledBy"
|
|
84
|
+
[inputId]="inputId"
|
|
85
|
+
[tabindex]="tabindex"
|
|
86
|
+
[autofocus]="autofocus"
|
|
87
|
+
[(ngModel)]="modelValue"
|
|
88
|
+
(onChange)="onChangeHandler($event)"
|
|
89
|
+
></p-togglebutton>
|
|
90
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "styleClass", "inputId", "tabindex", "iconPos", "autofocus", "size", "allowEmpty", "fluid"], outputs: ["onChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
91
|
+
}
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraToggleButtonComponent, decorators: [{
|
|
93
|
+
type: Component,
|
|
94
|
+
args: [{
|
|
95
|
+
selector: 'extra-toggle-button',
|
|
96
|
+
standalone: true,
|
|
97
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
98
|
+
imports: [ToggleButton, NgClass, FormsModule],
|
|
99
|
+
providers: [
|
|
100
|
+
{
|
|
101
|
+
provide: NG_VALUE_ACCESSOR,
|
|
102
|
+
useExisting: forwardRef(() => ExtraToggleButtonComponent),
|
|
103
|
+
multi: true,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
template: `
|
|
107
|
+
<p-togglebutton
|
|
108
|
+
[ngClass]="extraClasses"
|
|
109
|
+
[onLabel]="onLabel"
|
|
110
|
+
[offLabel]="offLabel"
|
|
111
|
+
[onIcon]="onIcon"
|
|
112
|
+
[offIcon]="offIcon"
|
|
113
|
+
[iconPos]="iconPos"
|
|
114
|
+
[size]="primeSize!"
|
|
115
|
+
[disabled]="disabled"
|
|
116
|
+
[allowEmpty]="allowEmpty"
|
|
117
|
+
[fluid]="fluid"
|
|
118
|
+
[ariaLabel]="ariaLabel"
|
|
119
|
+
[ariaLabelledBy]="ariaLabelledBy"
|
|
120
|
+
[inputId]="inputId"
|
|
121
|
+
[tabindex]="tabindex"
|
|
122
|
+
[autofocus]="autofocus"
|
|
123
|
+
[(ngModel)]="modelValue"
|
|
124
|
+
(onChange)="onChangeHandler($event)"
|
|
125
|
+
></p-togglebutton>
|
|
126
|
+
`,
|
|
127
|
+
}]
|
|
128
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { onLabel: [{
|
|
129
|
+
type: Input
|
|
130
|
+
}], offLabel: [{
|
|
131
|
+
type: Input
|
|
132
|
+
}], onIcon: [{
|
|
133
|
+
type: Input
|
|
134
|
+
}], offIcon: [{
|
|
135
|
+
type: Input
|
|
136
|
+
}], iconPos: [{
|
|
137
|
+
type: Input
|
|
138
|
+
}], size: [{
|
|
139
|
+
type: Input
|
|
140
|
+
}], disabled: [{
|
|
141
|
+
type: Input
|
|
142
|
+
}], iconOnly: [{
|
|
143
|
+
type: Input
|
|
144
|
+
}], allowEmpty: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], fluid: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], ariaLabel: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], ariaLabelledBy: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], inputId: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], tabindex: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], autofocus: [{
|
|
157
|
+
type: Input
|
|
158
|
+
}], onChange: [{
|
|
159
|
+
type: Output
|
|
160
|
+
}] } });
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Generated bundle index. Do not edit.
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
export { ExtraToggleButtonComponent };
|
|
167
|
+
//# sourceMappingURL=cdek-it-angular-ui-kit-components-togglebutton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-togglebutton.mjs","sources":["../../src/lib/components/togglebutton/togglebutton.component.ts","../../src/lib/components/togglebutton/cdek-it-angular-ui-kit-components-togglebutton.ts"],"sourcesContent":["import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, Output, EventEmitter, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgClass } from '@angular/common';\nimport { ToggleButton, ToggleButtonChangeEvent } from 'primeng/togglebutton';\n\nexport type ExtraToggleButtonSize = 'small' | 'base' | 'large' | 'xlarge';\n\n@Component({\n selector: 'extra-toggle-button',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ToggleButton, NgClass, FormsModule],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ExtraToggleButtonComponent),\n multi: true,\n },\n ],\n template: `\n <p-togglebutton\n [ngClass]=\"extraClasses\"\n [onLabel]=\"onLabel\"\n [offLabel]=\"offLabel\"\n [onIcon]=\"onIcon\"\n [offIcon]=\"offIcon\"\n [iconPos]=\"iconPos\"\n [size]=\"primeSize!\"\n [disabled]=\"disabled\"\n [allowEmpty]=\"allowEmpty\"\n [fluid]=\"fluid\"\n [ariaLabel]=\"ariaLabel\"\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [inputId]=\"inputId\"\n [tabindex]=\"tabindex\"\n [autofocus]=\"autofocus\"\n [(ngModel)]=\"modelValue\"\n (onChange)=\"onChangeHandler($event)\"\n ></p-togglebutton>\n `,\n})\nexport class ExtraToggleButtonComponent implements ControlValueAccessor {\n constructor(private cdr: ChangeDetectorRef) {}\n\n @Input() onLabel = 'Вкл';\n @Input() offLabel = 'Выкл';\n @Input() onIcon: string | undefined = undefined;\n @Input() offIcon: string | undefined = undefined;\n @Input() iconPos: 'left' | 'right' = 'left';\n @Input() size: ExtraToggleButtonSize = 'base';\n @Input() disabled = false;\n @Input() iconOnly = false;\n @Input() allowEmpty: boolean | undefined = undefined;\n @Input() fluid = false;\n @Input() ariaLabel: string | undefined = undefined;\n @Input() ariaLabelledBy: string | undefined = undefined;\n @Input() inputId: string | undefined = undefined;\n @Input() tabindex: number | undefined = undefined;\n @Input() autofocus: boolean | undefined = undefined;\n\n @Output() onChange = new EventEmitter<ToggleButtonChangeEvent>();\n\n modelValue = false;\n\n private _onChange: (value: any) => void = () => {};\n private _onTouched: () => void = () => {};\n\n get primeSize(): 'small' | 'large' | undefined {\n if (this.size === 'small') return 'small';\n if (this.size === 'large' || this.size === 'xlarge') return 'large';\n return undefined;\n }\n\n get extraClasses(): Record<string, boolean> {\n return {\n 'p-togglebutton-xlarge': this.size === 'xlarge',\n 'p-togglebutton-icon-only': this.iconOnly,\n };\n }\n\n onChangeHandler(event: ToggleButtonChangeEvent): void {\n this._onChange(event.checked);\n this._onTouched();\n this.onChange.emit(event);\n }\n\n writeValue(value: any): void {\n this.modelValue = value;\n }\n\n registerOnChange(fn: (value: any) => void): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAyCa,0BAA0B,CAAA;AACjB,IAAA,GAAA;AAApB,IAAA,WAAA,CAAoB,GAAsB,EAAA;QAAtB,IAAA,CAAA,GAAG,GAAH,GAAG;IAAsB;IAEpC,OAAO,GAAG,KAAK;IACf,QAAQ,GAAG,MAAM;IACjB,MAAM,GAAuB,SAAS;IACtC,OAAO,GAAuB,SAAS;IACvC,OAAO,GAAqB,MAAM;IAClC,IAAI,GAA0B,MAAM;IACpC,QAAQ,GAAG,KAAK;IAChB,QAAQ,GAAG,KAAK;IAChB,UAAU,GAAwB,SAAS;IAC3C,KAAK,GAAG,KAAK;IACb,SAAS,GAAuB,SAAS;IACzC,cAAc,GAAuB,SAAS;IAC9C,OAAO,GAAuB,SAAS;IACvC,QAAQ,GAAuB,SAAS;IACxC,SAAS,GAAwB,SAAS;AAEzC,IAAA,QAAQ,GAAG,IAAI,YAAY,EAA2B;IAEhE,UAAU,GAAG,KAAK;AAEV,IAAA,SAAS,GAAyB,MAAK,EAAE,CAAC;AAC1C,IAAA,UAAU,GAAe,MAAK,EAAE,CAAC;AAEzC,IAAA,IAAI,SAAS,GAAA;AACX,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;AAAE,YAAA,OAAO,OAAO;QACzC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;AAAE,YAAA,OAAO,OAAO;AACnE,QAAA,OAAO,SAAS;IAClB;AAEA,IAAA,IAAI,YAAY,GAAA;QACd,OAAO;AACL,YAAA,uBAAuB,EAAE,IAAI,CAAC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