@taiga-ui/kit 4.58.0 → 4.60.0
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/progress/progress-bar/progress-color-segments.directive.d.ts +5 -4
- package/directives/copy/copy.component.d.ts +2 -0
- package/esm2022/components/progress/progress-bar/progress-color-segments.directive.mjs +37 -19
- package/esm2022/directives/copy/copy.component.mjs +9 -3
- package/fesm2022/taiga-ui-kit-components-progress.mjs +36 -18
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-copy.mjs +8 -2
- package/fesm2022/taiga-ui-kit-directives-copy.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class TuiProgressColorSegments {
|
|
3
|
-
private readonly colors
|
|
3
|
+
private readonly colors;
|
|
4
4
|
private readonly el;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
private readonly position;
|
|
6
|
+
protected readonly color: import("@angular/core").Signal<string | null>;
|
|
7
|
+
set colorsSetter(colors: readonly string[]);
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiProgressColorSegments, never>;
|
|
8
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiProgressColorSegments, "progress[tuiProgressBar][tuiProgressColorSegments]", never, { "
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiProgressColorSegments, "progress[tuiProgressBar][tuiProgressColorSegments]", never, { "colorsSetter": { "alias": "tuiProgressColorSegments"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
10
|
}
|
|
@@ -2,6 +2,7 @@ import { type TuiSizeL } from '@taiga-ui/core/types';
|
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TuiCopyComponent {
|
|
5
|
+
private readonly processor;
|
|
5
6
|
protected readonly notification: import("@taiga-ui/core/components/notification").TuiNotificationOptions;
|
|
6
7
|
protected readonly options: import("./copy.options").TuiCopyOptions;
|
|
7
8
|
protected readonly copied$: BehaviorSubject<boolean>;
|
|
@@ -10,6 +11,7 @@ export declare class TuiCopyComponent {
|
|
|
10
11
|
size: TuiSizeL;
|
|
11
12
|
protected get icon(): string;
|
|
12
13
|
protected get check(): string;
|
|
14
|
+
protected process(value: string | null | undefined): string;
|
|
13
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiCopyComponent, never>;
|
|
14
16
|
static ɵcmp: i0.ɵɵComponentDeclaration<TuiCopyComponent, "tui-copy", never, { "size": { "alias": "size"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
15
17
|
}
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
import { Directive, inject, Input } from '@angular/core';
|
|
1
|
+
import { computed, Directive, inject, Input, signal } from '@angular/core';
|
|
2
2
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
3
|
-
import {
|
|
4
|
-
import { tuiWatch
|
|
3
|
+
import { MutationObserverService, WA_MUTATION_OBSERVER_INIT, } from '@ng-web-apis/mutation-observer';
|
|
4
|
+
import { tuiWatch } from '@taiga-ui/cdk/observables';
|
|
5
5
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
6
|
-
import {
|
|
6
|
+
import { map } from 'rxjs';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
class TuiProgressColorSegments {
|
|
9
9
|
constructor() {
|
|
10
|
-
this.colors
|
|
10
|
+
this.colors = signal([]);
|
|
11
11
|
this.el = tuiInjectElement();
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
this.position = toSignal(inject(MutationObserverService, { self: true }).pipe(map(() => this.el.position), tuiWatch()), { initialValue: this.el.position });
|
|
13
|
+
this.color = computed(() => {
|
|
14
|
+
const colors = this.colors();
|
|
15
|
+
const position = this.position();
|
|
16
|
+
if (!colors.length || position <= 0) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const colorsString = colors.reduce((acc, color, i) => `${acc}, ${color} calc(${i} / ${colors.length} * 100% / ${position}) calc(${i + 1} / ${colors.length} * 100% / ${position})`, '');
|
|
20
|
+
return `linear-gradient(to right${colorsString})`;
|
|
21
|
+
});
|
|
20
22
|
}
|
|
21
|
-
set
|
|
22
|
-
this.colors
|
|
23
|
+
set colorsSetter(colors) {
|
|
24
|
+
this.colors.set(colors);
|
|
23
25
|
}
|
|
24
26
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiProgressColorSegments, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
25
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiProgressColorSegments, isStandalone: true, selector: "progress[tuiProgressBar][tuiProgressColorSegments]", inputs: {
|
|
27
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiProgressColorSegments, isStandalone: true, selector: "progress[tuiProgressBar][tuiProgressColorSegments]", inputs: { colorsSetter: ["tuiProgressColorSegments", "colorsSetter"] }, host: { properties: { "style.--tui-progress-color": "color()" } }, providers: [
|
|
28
|
+
MutationObserverService,
|
|
29
|
+
{
|
|
30
|
+
provide: WA_MUTATION_OBSERVER_INIT,
|
|
31
|
+
useValue: {
|
|
32
|
+
attributeOldValue: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
], ngImport: i0 }); }
|
|
26
36
|
}
|
|
27
37
|
export { TuiProgressColorSegments };
|
|
28
38
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiProgressColorSegments, decorators: [{
|
|
@@ -30,11 +40,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
30
40
|
args: [{
|
|
31
41
|
standalone: true,
|
|
32
42
|
selector: 'progress[tuiProgressBar][tuiProgressColorSegments]',
|
|
33
|
-
providers: [
|
|
43
|
+
providers: [
|
|
44
|
+
MutationObserverService,
|
|
45
|
+
{
|
|
46
|
+
provide: WA_MUTATION_OBSERVER_INIT,
|
|
47
|
+
useValue: {
|
|
48
|
+
attributeOldValue: true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
34
52
|
host: { '[style.--tui-progress-color]': 'color()' },
|
|
35
53
|
}]
|
|
36
|
-
}], propDecorators: {
|
|
54
|
+
}], propDecorators: { colorsSetter: [{
|
|
37
55
|
type: Input,
|
|
38
56
|
args: ['tuiProgressColorSegments']
|
|
39
57
|
}] } });
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
58
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZ3Jlc3MtY29sb3Itc2VnbWVudHMuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2l0L2NvbXBvbmVudHMvcHJvZ3Jlc3MvcHJvZ3Jlc3MtYmFyL3Byb2dyZXNzLWNvbG9yLXNlZ21lbnRzLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsUUFBUSxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUN6RSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sNEJBQTRCLENBQUM7QUFDcEQsT0FBTyxFQUNILHVCQUF1QixFQUN2Qix5QkFBeUIsR0FDNUIsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN4QyxPQUFPLEVBQU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Fkb25seSBlbCA9IHR1aUluamVjdEVsZW1lbnQ8SFRNTFByb2dyZXNzRWxlbWVudD4oKTtcbiAgICBwcml2YXRlIHJlYWRvbmx5IHBvc2l0aW9uID0gdG9TaWduYWwoXG4gICAgICAgIGluamVjdChNdXRhdGlvbk9ic2VydmVyU2VydmljZSwge3NlbGY6IHRydWV9KS5waXBlKFxuICAgICAgICAgICAgbWFwKCgpID0+IHRoaXMuZWwucG9zaXRpb24pLFxuICAgICAgICAgICAgdHVpV2F0Y2goKSxcbiAgICAgICAgKSxcbiAgICAgICAge2luaXRpYWxWYWx1ZTogdGhpcy5lbC5wb3NpdGlvbn0sXG4gICAgKTtcblxuICAgIHByb3RlY3RlZCByZWFkb25seSBjb2xvciA9IGNvbXB1dGVkKCgpID0+IHtcbiAgICAgICAgY29uc3QgY29sb3JzID0gdGhpcy5jb2xvcnMoKTtcbiAgICAgICAgY29uc3QgcG9zaXRpb24gPSB0aGlzLnBvc2l0aW9uKCk7XG5cbiAgICAgICAgaWYgKCFjb2xvcnMubGVuZ3RoIHx8IHBvc2l0aW9uIDw9IDApIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgY29sb3JzU3RyaW5nID0gY29sb3JzLnJlZHVjZShcbiAgICAgICAgICAgIChhY2MsIGNvbG9yLCBpKSA9PlxuICAgICAgICAgICAgICAgIGAke2FjY30sICR7Y29sb3J9IGNhbGMoJHtpfSAvICR7Y29sb3JzLmxlbmd0aH0gKiAxMDAlIC8gJHtwb3NpdGlvbn0pIGNhbGMoJHtpICsgMX0gLyAke2NvbG9ycy5sZW5ndGh9ICogMTAwJSAvICR7cG9zaXRpb259KWAsXG4gICAgICAgICAgICAnJyxcbiAgICAgICAgKTtcblxuICAgICAgICByZXR1cm4gYGxpbmVhci1ncmFkaWVudCh0byByaWdodCR7Y29sb3JzU3RyaW5nfSlgO1xuICAgIH0pO1xuXG4gICAgQElucHV0KCd0dWlQcm9ncmVzc0NvbG9yU2VnbWVudHMnKVxuICAgIHB1YmxpYyBzZXQgY29sb3JzU2V0dGVyKGNvbG9yczogcmVhZG9ubHkgc3RyaW5nW10pIHtcbiAgICAgICAgdGhpcy5jb2xvcnMuc2V0KGNvbG9ycyk7XG4gICAgfVxufVxuIl19
|
|
@@ -2,6 +2,7 @@ import { ClipboardModule } from '@angular/cdk/clipboard';
|
|
|
2
2
|
import { ChangeDetectionStrategy, Component, inject, Input } from '@angular/core';
|
|
3
3
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
5
|
+
import { TuiCopyProcessor } from '@taiga-ui/cdk/directives/copy-processor';
|
|
5
6
|
import { tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
6
7
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
7
8
|
import { TuiIcon } from '@taiga-ui/core/components/icon';
|
|
@@ -15,6 +16,7 @@ import * as i1 from "@angular/cdk/clipboard";
|
|
|
15
16
|
import * as i2 from "@taiga-ui/core/directives/hint";
|
|
16
17
|
class TuiCopyComponent {
|
|
17
18
|
constructor() {
|
|
19
|
+
this.processor = inject(TuiCopyProcessor, { optional: true });
|
|
18
20
|
this.notification = inject(TUI_NOTIFICATION_OPTIONS);
|
|
19
21
|
this.options = inject(TUI_COPY_OPTIONS);
|
|
20
22
|
this.copied$ = new BehaviorSubject(false);
|
|
@@ -32,8 +34,12 @@ class TuiCopyComponent {
|
|
|
32
34
|
? this.notification.icon
|
|
33
35
|
: this.notification.icon('positive');
|
|
34
36
|
}
|
|
37
|
+
process(value) {
|
|
38
|
+
const source = value ?? '';
|
|
39
|
+
return this.processor?.tuiCopyProcessor(source) ?? source.trim();
|
|
40
|
+
}
|
|
35
41
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiCopyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiCopyComponent, isStandalone: true, selector: "tui-copy", inputs: { size: "size" }, host: { listeners: { "pointerdown": "copied$.next(false)" }, properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"content.textContent
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiCopyComponent, isStandalone: true, selector: "tui-copy", inputs: { size: "size" }, host: { listeners: { "pointerdown": "copied$.next(false)" }, properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n", styles: [":host{cursor:pointer}:host[data-size=m]{--t-size: min( calc(1em + 1px) , 1rem)}:host[data-size=l]{--t-size: max(calc(1em / 1.57), min(max(calc(1em / 1.18), 1.25rem), 1.5rem))}@media (hover: hover) and (pointer: fine){:host:hover .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}:host:hover .t-button{opacity:1}}:host:has(.t-button:focus-visible) .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}.t-content{transition-property:opacity,-webkit-mask;transition-property:opacity,mask;transition-property:opacity,mask,-webkit-mask;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;-webkit-mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0;mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0}.t-button{opacity:0;border-radius:0;font-size:inherit!important;margin-inline-start:calc(-1 * var(--t-size));--t-size: inherit}.t-button:before{font-size:var(--t-size)}.t-button:focus-visible{opacity:1}.t-icon{font-size:1rem;margin-inline-end:.25rem;vertical-align:sub;color:var(--tui-text-positive)}\n"], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i1.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: i2.TuiHintManual, selector: "[tuiHint][tuiHintManual]", inputs: ["tuiHintManual"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
37
43
|
}
|
|
38
44
|
export { TuiCopyComponent };
|
|
39
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiCopyComponent, decorators: [{
|
|
@@ -41,8 +47,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
41
47
|
args: [{ standalone: true, selector: 'tui-copy', imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
42
48
|
'[attr.data-size]': 'size',
|
|
43
49
|
'(pointerdown)': 'copied$.next(false)',
|
|
44
|
-
}, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"content.textContent
|
|
50
|
+
}, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n", styles: [":host{cursor:pointer}:host[data-size=m]{--t-size: min( calc(1em + 1px) , 1rem)}:host[data-size=l]{--t-size: max(calc(1em / 1.57), min(max(calc(1em / 1.18), 1.25rem), 1.5rem))}@media (hover: hover) and (pointer: fine){:host:hover .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}:host:hover .t-button{opacity:1}}:host:has(.t-button:focus-visible) .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}.t-content{transition-property:opacity,-webkit-mask;transition-property:opacity,mask;transition-property:opacity,mask,-webkit-mask;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;-webkit-mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0;mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0}.t-button{opacity:0;border-radius:0;font-size:inherit!important;margin-inline-start:calc(-1 * var(--t-size));--t-size: inherit}.t-button:before{font-size:var(--t-size)}.t-button:focus-visible{opacity:1}.t-icon{font-size:1rem;margin-inline-end:.25rem;vertical-align:sub;color:var(--tui-text-positive)}\n"] }]
|
|
45
51
|
}], propDecorators: { size: [{
|
|
46
52
|
type: Input
|
|
47
53
|
}] } });
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29weS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9raXQvZGlyZWN0aXZlcy9jb3B5L2NvcHkuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2l0L2RpcmVjdGl2ZXMvY29weS9jb3B5LnRlbXBsYXRlLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLHdCQUF3QixDQUFDO0FBQ3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0dG9uXCJcbiAgICBbYXR0ci5hcmlhLWxhYmVsXT1cInRleHRzKCk/LlswXVwiXG4gICAgW2Nka0NvcHlUb0NsaXBib2FyZF09XCJwcm9jZXNzKGNvbnRlbnQudGV4dENvbnRlbnQpXCJcbiAgICBbaWNvblN0YXJ0XT1cImljb25cIlxuICAgIChjZGtDb3B5VG9DbGlwYm9hcmRDb3BpZWQpPVwiY29waWVkJC5uZXh0KCRldmVudClcIlxuPjwvYnV0dG9uPlxuPG5nLXRlbXBsYXRlICN0ZW1wbGF0ZT5cbiAgICA8dHVpLWljb25cbiAgICAgICAgY2xhc3M9XCJ0LWljb25cIlxuICAgICAgICBbaWNvbl09XCJjaGVja1wiXG4gICAgLz5cbiAgICB7eyB0ZXh0cygpPy5bMV0gfX1cbjwvbmctdGVtcGxhdGU+XG4iXX0=
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Directive, InjectionToken, inject, Input } from '@angular/core';
|
|
2
|
+
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Directive, InjectionToken, inject, Input, signal, computed } from '@angular/core';
|
|
3
3
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
4
4
|
import { tuiWithStyles, tuiProvideOptions } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
5
5
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { MutationObserverService, WA_MUTATION_OBSERVER_INIT } from '@ng-web-apis/mutation-observer';
|
|
7
|
+
import { tuiWatch } from '@taiga-ui/cdk/observables';
|
|
8
|
+
import { map, of, delay } from 'rxjs';
|
|
9
9
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
10
10
|
|
|
11
11
|
class TuiProgressFixedGradientStyles {
|
|
@@ -76,32 +76,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
76
76
|
|
|
77
77
|
class TuiProgressColorSegments {
|
|
78
78
|
constructor() {
|
|
79
|
-
this.colors
|
|
79
|
+
this.colors = signal([]);
|
|
80
80
|
this.el = tuiInjectElement();
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
this.position = toSignal(inject(MutationObserverService, { self: true }).pipe(map(() => this.el.position), tuiWatch()), { initialValue: this.el.position });
|
|
82
|
+
this.color = computed(() => {
|
|
83
|
+
const colors = this.colors();
|
|
84
|
+
const position = this.position();
|
|
85
|
+
if (!colors.length || position <= 0) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
const colorsString = colors.reduce((acc, color, i) => `${acc}, ${color} calc(${i} / ${colors.length} * 100% / ${position}) calc(${i + 1} / ${colors.length} * 100% / ${position})`, '');
|
|
89
|
+
return `linear-gradient(to right${colorsString})`;
|
|
90
|
+
});
|
|
89
91
|
}
|
|
90
|
-
set
|
|
91
|
-
this.colors
|
|
92
|
+
set colorsSetter(colors) {
|
|
93
|
+
this.colors.set(colors);
|
|
92
94
|
}
|
|
93
95
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiProgressColorSegments, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
94
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiProgressColorSegments, isStandalone: true, selector: "progress[tuiProgressBar][tuiProgressColorSegments]", inputs: {
|
|
96
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiProgressColorSegments, isStandalone: true, selector: "progress[tuiProgressBar][tuiProgressColorSegments]", inputs: { colorsSetter: ["tuiProgressColorSegments", "colorsSetter"] }, host: { properties: { "style.--tui-progress-color": "color()" } }, providers: [
|
|
97
|
+
MutationObserverService,
|
|
98
|
+
{
|
|
99
|
+
provide: WA_MUTATION_OBSERVER_INIT,
|
|
100
|
+
useValue: {
|
|
101
|
+
attributeOldValue: true,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
], ngImport: i0 }); }
|
|
95
105
|
}
|
|
96
106
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiProgressColorSegments, decorators: [{
|
|
97
107
|
type: Directive,
|
|
98
108
|
args: [{
|
|
99
109
|
standalone: true,
|
|
100
110
|
selector: 'progress[tuiProgressBar][tuiProgressColorSegments]',
|
|
101
|
-
providers: [
|
|
111
|
+
providers: [
|
|
112
|
+
MutationObserverService,
|
|
113
|
+
{
|
|
114
|
+
provide: WA_MUTATION_OBSERVER_INIT,
|
|
115
|
+
useValue: {
|
|
116
|
+
attributeOldValue: true,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
],
|
|
102
120
|
host: { '[style.--tui-progress-color]': 'color()' },
|
|
103
121
|
}]
|
|
104
|
-
}], propDecorators: {
|
|
122
|
+
}], propDecorators: { colorsSetter: [{
|
|
105
123
|
type: Input,
|
|
106
124
|
args: ['tuiProgressColorSegments']
|
|
107
125
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-progress.mjs","sources":["../../../projects/kit/components/progress/progress-bar/fixed-gradient/progress-fixed-gradient.directive.ts","../../../projects/kit/components/progress/progress.options.ts","../../../projects/kit/components/progress/progress-bar/progress-bar.component.ts","../../../projects/kit/components/progress/progress-bar/progress-color-segments.directive.ts","../../../projects/kit/components/progress/progress-circle/progress-circle.component.ts","../../../projects/kit/components/progress/progress-circle/progress-circle.template.html","../../../projects/kit/components/progress/progress-label/progress-label.component.ts","../../../projects/kit/components/progress/progress-label/progress-label.template.html","../../../projects/kit/components/progress/progress-segmented/progress-segmented.directive.ts","../../../projects/kit/components/progress/progress.ts","../../../projects/kit/components/progress/taiga-ui-kit-components-progress.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\n\n@Component({\n standalone: true,\n template: '',\n styleUrls: ['./progress-fixed-gradient.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tui-fixed-gradient',\n },\n})\nclass TuiProgressFixedGradientStyles {}\n\n@Directive({\n standalone: true,\n selector: 'progress[tuiProgressBar][tuiProgressFixedGradient]',\n host: {\n '[style.--tui-progress-percent.%]': 'progressPercent',\n },\n})\nexport class TuiProgressFixedGradientDirective {\n private readonly nativeProgress = tuiInjectElement<HTMLProgressElement>();\n protected readonly nothing = tuiWithStyles(TuiProgressFixedGradientStyles);\n\n protected get progressPercent(): number {\n const {value} = this.nativeProgress;\n const max = this.nativeProgress.max ?? 1;\n\n return Math.min((value / max) * 100, 100);\n }\n}\n","import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nexport interface TuiProgressOptions {\n readonly color: string | null;\n readonly size: TuiSizeXXL | TuiSizeXXS;\n}\n\nexport const TUI_PROGRESS_DEFAULT_OPTIONS: TuiProgressOptions = {\n color: null,\n size: 'm',\n};\n\nexport const TUI_PROGRESS_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_PROGRESS_OPTIONS' : '',\n {\n factory: () => TUI_PROGRESS_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiProgressOptionsProvider(\n options: Partial<TuiProgressOptions>,\n): Provider {\n return tuiProvideOptions(TUI_PROGRESS_OPTIONS, options, TUI_PROGRESS_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nimport {TUI_PROGRESS_OPTIONS} from '../progress.options';\n\n@Component({\n standalone: true,\n selector: 'progress[tuiProgressBar]',\n template: '',\n styles: ['@import \"@taiga-ui/kit/styles/components/progress-bar.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.--tui-progress-color]': 'color',\n '[attr.data-size]': 'size',\n },\n})\nexport class TuiProgressBar {\n private readonly options = inject(TUI_PROGRESS_OPTIONS);\n\n @Input()\n public color: string | null = this.options.color;\n\n @Input()\n public size: TuiSizeXXL | TuiSizeXXS = this.options.size;\n}\n","import {Directive, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {ResizeObserverService} from '@ng-web-apis/resize-observer';\nimport {tuiWatch, tuiZonefull} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {BehaviorSubject, combineLatest, distinctUntilChanged, map} from 'rxjs';\n\n@Directive({\n standalone: true,\n selector: 'progress[tuiProgressBar][tuiProgressColorSegments]',\n providers: [ResizeObserverService],\n host: {'[style.--tui-progress-color]': 'color()'},\n})\nexport class TuiProgressColorSegments {\n private readonly colors$ = new BehaviorSubject<string[]>([]);\n private readonly el = tuiInjectElement<HTMLProgressElement>();\n\n protected readonly color = toSignal(\n combineLatest([\n this.colors$,\n inject(ResizeObserverService, {self: true}).pipe(\n map(() => this.el.offsetWidth),\n distinctUntilChanged(),\n ),\n ]).pipe(\n map(([colors, width]) => {\n const segmentWidth = Math.ceil(width / colors.length);\n const colorsString = colors.reduce(\n (acc, color, i) =>\n `${acc}, ${color} ${i * segmentWidth}px ${(i + 1) * segmentWidth}px`,\n '',\n );\n\n return `linear-gradient(to right ${colorsString})`;\n }),\n tuiZonefull(),\n tuiWatch(),\n ),\n );\n\n @Input('tuiProgressColorSegments')\n public set colors(colors: string[]) {\n this.colors$.next(colors);\n }\n}\n","import {type BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\nimport {delay, of} from 'rxjs';\n\nimport {TUI_PROGRESS_OPTIONS} from '../progress.options';\n\n@Component({\n standalone: true,\n selector: 'tui-progress-circle',\n templateUrl: './progress-circle.template.html',\n styleUrls: ['./progress-circle.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n '[style.--tui-progress-color]': 'color',\n '[style.--t-progress-ratio]': 'progressRatio',\n '[class._arc]': 'arc',\n },\n})\nexport class TuiProgressCircle {\n private readonly options = inject(TUI_PROGRESS_OPTIONS);\n\n protected readonly animationDelay = toSignal(of(true).pipe(delay(0)));\n\n @Input()\n public value = 0;\n\n @Input()\n public max = 1;\n\n @Input()\n public color: string | null = this.options.color;\n\n @Input()\n public size: TuiSizeXXL | TuiSizeXXS = this.options.size;\n\n @Input({transform: coerceBooleanProperty})\n public arc: BooleanInput = false;\n\n protected get progressRatio(): number {\n const ratio = this.value / this.max;\n\n return Number.isFinite(ratio) ? ratio : 0;\n }\n}\n","<progress\n class=\"t-hidden-progress\"\n [max]=\"max\"\n [value]=\"value\"\n></progress>\n\n<svg\n aria-hidden=\"true\"\n height=\"100%\"\n width=\"100%\"\n class=\"t-svg\"\n>\n <circle\n cx=\"50%\"\n cy=\"50%\"\n class=\"t-track\"\n />\n\n <circle\n cx=\"50%\"\n cy=\"50%\"\n class=\"t-progress\"\n [class.t-progress_filled]=\"animationDelay()\"\n />\n</svg>\n","import {ChangeDetectionStrategy, Component} from '@angular/core';\n\n@Component({\n standalone: true,\n selector: 'label[tuiProgressLabel]',\n templateUrl: './progress-label.template.html',\n styleUrls: ['./progress-label.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiProgressLabel {}\n","<ng-content select=\"progress\" />\n<ng-content select=\"tui-progress-circle\" />\n<span class=\"t-label\">\n <ng-content />\n</span>\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\n\n@Component({\n standalone: true,\n template: '',\n styleUrls: ['./progress-segmented.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {class: 'tui-progress-segmented'},\n})\nclass TuiProgressSegmentedStyles {}\n\n@Directive({\n standalone: true,\n selector: '[tuiProgressBar][segments]',\n host: {\n class: '_segmented',\n '[style.--t-segment-width]': '1 / segments',\n },\n})\nexport class TuiProgressSegmented {\n protected readonly nothing = tuiWithStyles(TuiProgressSegmentedStyles);\n\n @Input()\n public segments = 1;\n}\n","import {TuiProgressFixedGradientDirective} from './progress-bar/fixed-gradient/progress-fixed-gradient.directive';\nimport {TuiProgressBar} from './progress-bar/progress-bar.component';\nimport {TuiProgressColorSegments} from './progress-bar/progress-color-segments.directive';\nimport {TuiProgressCircle} from './progress-circle/progress-circle.component';\nimport {TuiProgressLabel} from './progress-label/progress-label.component';\nimport {TuiProgressSegmented} from './progress-segmented/progress-segmented.directive';\n\nexport const TuiProgress = [\n TuiProgressBar,\n TuiProgressCircle,\n TuiProgressColorSegments,\n TuiProgressFixedGradientDirective,\n TuiProgressLabel,\n TuiProgressSegmented,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AASA,MAUM,8BAA8B,CAAA;+GAA9B,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,IAAA,GA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CAAC,0BAA0B,CAAC,CAAC;QAGhE,IAAQ,CAAA,QAAA,GAAG,CAAC,CAAC;AACvB,KAAA;+GALY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;mGAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,yBAAA,EAAA,cAAA,EAAA,EAAA,cAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;4FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,YAAY;AACnB,wBAAA,2BAA2B,EAAE,cAAc;AAC9C,qBAAA;AACJ,iBAAA,CAAA;8BAKU,QAAQ,EAAA,CAAA;sBADd,KAAK;;;ACvBG,MAAA,WAAW,GAAG;IACvB,cAAc;IACd,iBAAiB;IACjB,wBAAwB;IACxB,iCAAiC;IACjC,gBAAgB;IAChB,oBAAoB;;;ACbxB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-progress.mjs","sources":["../../../projects/kit/components/progress/progress-bar/fixed-gradient/progress-fixed-gradient.directive.ts","../../../projects/kit/components/progress/progress.options.ts","../../../projects/kit/components/progress/progress-bar/progress-bar.component.ts","../../../projects/kit/components/progress/progress-bar/progress-color-segments.directive.ts","../../../projects/kit/components/progress/progress-circle/progress-circle.component.ts","../../../projects/kit/components/progress/progress-circle/progress-circle.template.html","../../../projects/kit/components/progress/progress-label/progress-label.component.ts","../../../projects/kit/components/progress/progress-label/progress-label.template.html","../../../projects/kit/components/progress/progress-segmented/progress-segmented.directive.ts","../../../projects/kit/components/progress/progress.ts","../../../projects/kit/components/progress/taiga-ui-kit-components-progress.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\n\n@Component({\n standalone: true,\n template: '',\n styleUrls: ['./progress-fixed-gradient.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tui-fixed-gradient',\n },\n})\nclass TuiProgressFixedGradientStyles {}\n\n@Directive({\n standalone: true,\n selector: 'progress[tuiProgressBar][tuiProgressFixedGradient]',\n host: {\n '[style.--tui-progress-percent.%]': 'progressPercent',\n },\n})\nexport class TuiProgressFixedGradientDirective {\n private readonly nativeProgress = tuiInjectElement<HTMLProgressElement>();\n protected readonly nothing = tuiWithStyles(TuiProgressFixedGradientStyles);\n\n protected get progressPercent(): number {\n const {value} = this.nativeProgress;\n const max = this.nativeProgress.max ?? 1;\n\n return Math.min((value / max) * 100, 100);\n }\n}\n","import {InjectionToken, type Provider} from '@angular/core';\nimport {tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nexport interface TuiProgressOptions {\n readonly color: string | null;\n readonly size: TuiSizeXXL | TuiSizeXXS;\n}\n\nexport const TUI_PROGRESS_DEFAULT_OPTIONS: TuiProgressOptions = {\n color: null,\n size: 'm',\n};\n\nexport const TUI_PROGRESS_OPTIONS = new InjectionToken(\n ngDevMode ? 'TUI_PROGRESS_OPTIONS' : '',\n {\n factory: () => TUI_PROGRESS_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiProgressOptionsProvider(\n options: Partial<TuiProgressOptions>,\n): Provider {\n return tuiProvideOptions(TUI_PROGRESS_OPTIONS, options, TUI_PROGRESS_DEFAULT_OPTIONS);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nimport {TUI_PROGRESS_OPTIONS} from '../progress.options';\n\n@Component({\n standalone: true,\n selector: 'progress[tuiProgressBar]',\n template: '',\n styles: ['@import \"@taiga-ui/kit/styles/components/progress-bar.less\";'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.--tui-progress-color]': 'color',\n '[attr.data-size]': 'size',\n },\n})\nexport class TuiProgressBar {\n private readonly options = inject(TUI_PROGRESS_OPTIONS);\n\n @Input()\n public color: string | null = this.options.color;\n\n @Input()\n public size: TuiSizeXXL | TuiSizeXXS = this.options.size;\n}\n","import {computed, Directive, inject, Input, signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {\n MutationObserverService,\n WA_MUTATION_OBSERVER_INIT,\n} from '@ng-web-apis/mutation-observer';\nimport {tuiWatch} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {map} from 'rxjs';\n\n@Directive({\n standalone: true,\n selector: 'progress[tuiProgressBar][tuiProgressColorSegments]',\n providers: [\n MutationObserverService,\n {\n provide: WA_MUTATION_OBSERVER_INIT,\n useValue: {\n attributeOldValue: true,\n },\n },\n ],\n host: {'[style.--tui-progress-color]': 'color()'},\n})\nexport class TuiProgressColorSegments {\n private readonly colors = signal<readonly string[]>([]);\n private readonly el = tuiInjectElement<HTMLProgressElement>();\n private readonly position = toSignal(\n inject(MutationObserverService, {self: true}).pipe(\n map(() => this.el.position),\n tuiWatch(),\n ),\n {initialValue: this.el.position},\n );\n\n protected readonly color = computed(() => {\n const colors = this.colors();\n const position = this.position();\n\n if (!colors.length || position <= 0) {\n return null;\n }\n\n const colorsString = colors.reduce(\n (acc, color, i) =>\n `${acc}, ${color} calc(${i} / ${colors.length} * 100% / ${position}) calc(${i + 1} / ${colors.length} * 100% / ${position})`,\n '',\n );\n\n return `linear-gradient(to right${colorsString})`;\n });\n\n @Input('tuiProgressColorSegments')\n public set colorsSetter(colors: readonly string[]) {\n this.colors.set(colors);\n }\n}\n","import {type BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\nimport {delay, of} from 'rxjs';\n\nimport {TUI_PROGRESS_OPTIONS} from '../progress.options';\n\n@Component({\n standalone: true,\n selector: 'tui-progress-circle',\n templateUrl: './progress-circle.template.html',\n styleUrls: ['./progress-circle.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n '[style.--tui-progress-color]': 'color',\n '[style.--t-progress-ratio]': 'progressRatio',\n '[class._arc]': 'arc',\n },\n})\nexport class TuiProgressCircle {\n private readonly options = inject(TUI_PROGRESS_OPTIONS);\n\n protected readonly animationDelay = toSignal(of(true).pipe(delay(0)));\n\n @Input()\n public value = 0;\n\n @Input()\n public max = 1;\n\n @Input()\n public color: string | null = this.options.color;\n\n @Input()\n public size: TuiSizeXXL | TuiSizeXXS = this.options.size;\n\n @Input({transform: coerceBooleanProperty})\n public arc: BooleanInput = false;\n\n protected get progressRatio(): number {\n const ratio = this.value / this.max;\n\n return Number.isFinite(ratio) ? ratio : 0;\n }\n}\n","<progress\n class=\"t-hidden-progress\"\n [max]=\"max\"\n [value]=\"value\"\n></progress>\n\n<svg\n aria-hidden=\"true\"\n height=\"100%\"\n width=\"100%\"\n class=\"t-svg\"\n>\n <circle\n cx=\"50%\"\n cy=\"50%\"\n class=\"t-track\"\n />\n\n <circle\n cx=\"50%\"\n cy=\"50%\"\n class=\"t-progress\"\n [class.t-progress_filled]=\"animationDelay()\"\n />\n</svg>\n","import {ChangeDetectionStrategy, Component} from '@angular/core';\n\n@Component({\n standalone: true,\n selector: 'label[tuiProgressLabel]',\n templateUrl: './progress-label.template.html',\n styleUrls: ['./progress-label.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiProgressLabel {}\n","<ng-content select=\"progress\" />\n<ng-content select=\"tui-progress-circle\" />\n<span class=\"t-label\">\n <ng-content />\n</span>\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\n\n@Component({\n standalone: true,\n template: '',\n styleUrls: ['./progress-segmented.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {class: 'tui-progress-segmented'},\n})\nclass TuiProgressSegmentedStyles {}\n\n@Directive({\n standalone: true,\n selector: '[tuiProgressBar][segments]',\n host: {\n class: '_segmented',\n '[style.--t-segment-width]': '1 / segments',\n },\n})\nexport class TuiProgressSegmented {\n protected readonly nothing = tuiWithStyles(TuiProgressSegmentedStyles);\n\n @Input()\n public segments = 1;\n}\n","import {TuiProgressFixedGradientDirective} from './progress-bar/fixed-gradient/progress-fixed-gradient.directive';\nimport {TuiProgressBar} from './progress-bar/progress-bar.component';\nimport {TuiProgressColorSegments} from './progress-bar/progress-color-segments.directive';\nimport {TuiProgressCircle} from './progress-circle/progress-circle.component';\nimport {TuiProgressLabel} from './progress-label/progress-label.component';\nimport {TuiProgressSegmented} from './progress-segmented/progress-segmented.directive';\n\nexport const TuiProgress = [\n TuiProgressBar,\n TuiProgressCircle,\n TuiProgressColorSegments,\n TuiProgressFixedGradientDirective,\n TuiProgressLabel,\n TuiProgressSegmented,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AASA,MAUM,8BAA8B,CAAA;+GAA9B,8BAA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AAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,YAAY;AACnB,wBAAA,2BAA2B,EAAE,cAAc;AAC9C,qBAAA;AACJ,iBAAA,CAAA;8BAKU,QAAQ,EAAA,CAAA;sBADd,KAAK;;;ACvBG,MAAA,WAAW,GAAG;IACvB,cAAc;IACd,iBAAiB;IACjB,wBAAwB;IACxB,iCAAiC;IACjC,gBAAgB;IAChB,oBAAoB;;;ACbxB;;AAEG;;;;"}
|
|
@@ -4,6 +4,7 @@ import * as i0 from '@angular/core';
|
|
|
4
4
|
import { inject, Component, ChangeDetectionStrategy, Input, computed, Directive } from '@angular/core';
|
|
5
5
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { TUI_FALSE_HANDLER } from '@taiga-ui/cdk/constants';
|
|
7
|
+
import { TuiCopyProcessor } from '@taiga-ui/cdk/directives/copy-processor';
|
|
7
8
|
import { tuiIsString, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
8
9
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
9
10
|
import { TuiIcon } from '@taiga-ui/core/components/icon';
|
|
@@ -22,6 +23,7 @@ const [TUI_COPY_OPTIONS, tuiCopyOptionsProvider] = tuiCreateOptions({ icon: '@tu
|
|
|
22
23
|
|
|
23
24
|
class TuiCopyComponent {
|
|
24
25
|
constructor() {
|
|
26
|
+
this.processor = inject(TuiCopyProcessor, { optional: true });
|
|
25
27
|
this.notification = inject(TUI_NOTIFICATION_OPTIONS);
|
|
26
28
|
this.options = inject(TUI_COPY_OPTIONS);
|
|
27
29
|
this.copied$ = new BehaviorSubject(false);
|
|
@@ -39,15 +41,19 @@ class TuiCopyComponent {
|
|
|
39
41
|
? this.notification.icon
|
|
40
42
|
: this.notification.icon('positive');
|
|
41
43
|
}
|
|
44
|
+
process(value) {
|
|
45
|
+
const source = value ?? '';
|
|
46
|
+
return this.processor?.tuiCopyProcessor(source) ?? source.trim();
|
|
47
|
+
}
|
|
42
48
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiCopyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiCopyComponent, isStandalone: true, selector: "tui-copy", inputs: { size: "size" }, host: { listeners: { "pointerdown": "copied$.next(false)" }, properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"content.textContent
|
|
49
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiCopyComponent, isStandalone: true, selector: "tui-copy", inputs: { size: "size" }, host: { listeners: { "pointerdown": "copied$.next(false)" }, properties: { "attr.data-size": "size" } }, ngImport: i0, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n", styles: [":host{cursor:pointer}:host[data-size=m]{--t-size: min( calc(1em + 1px) , 1rem)}:host[data-size=l]{--t-size: max(calc(1em / 1.57), min(max(calc(1em / 1.18), 1.25rem), 1.5rem))}@media (hover: hover) and (pointer: fine){:host:hover .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}:host:hover .t-button{opacity:1}}:host:has(.t-button:focus-visible) .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}.t-content{transition-property:opacity,-webkit-mask;transition-property:opacity,mask;transition-property:opacity,mask,-webkit-mask;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;-webkit-mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0;mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0}.t-button{opacity:0;border-radius:0;font-size:inherit!important;margin-inline-start:calc(-1 * var(--t-size));--t-size: inherit}.t-button:before{font-size:var(--t-size)}.t-button:focus-visible{opacity:1}.t-icon{font-size:1rem;margin-inline-end:.25rem;vertical-align:sub;color:var(--tui-text-positive)}\n"], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i1.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHintContext", "tuiHintAppearance", "tuiHint"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: i2.TuiHintManual, selector: "[tuiHint][tuiHintManual]", inputs: ["tuiHintManual"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
44
50
|
}
|
|
45
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiCopyComponent, decorators: [{
|
|
46
52
|
type: Component,
|
|
47
53
|
args: [{ standalone: true, selector: 'tui-copy', imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
48
54
|
'[attr.data-size]': 'size',
|
|
49
55
|
'(pointerdown)': 'copied$.next(false)',
|
|
50
|
-
}, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"content.textContent
|
|
56
|
+
}, template: "<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n", styles: [":host{cursor:pointer}:host[data-size=m]{--t-size: min( calc(1em + 1px) , 1rem)}:host[data-size=l]{--t-size: max(calc(1em / 1.57), min(max(calc(1em / 1.18), 1.25rem), 1.5rem))}@media (hover: hover) and (pointer: fine){:host:hover .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}:host:hover .t-button{opacity:1}}:host:has(.t-button:focus-visible) .t-content{opacity:var(--tui-disabled-opacity);-webkit-mask-position:0;mask-position:0}.t-content{transition-property:opacity,-webkit-mask;transition-property:opacity,mask;transition-property:opacity,mask,-webkit-mask;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;-webkit-mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;mask:linear-gradient(to var(--tui-inline-start),transparent calc(1.25 * var(--t-size)),black calc(2 * var(--t-size))) no-repeat,linear-gradient(to var(--tui-inline-end),black,black calc(2 * var(--t-size)),transparent calc(2 * var(--t-size))) no-repeat;-webkit-mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0;mask-position:calc(var(--tui-inline) * 2 * var(--t-size)),0}.t-button{opacity:0;border-radius:0;font-size:inherit!important;margin-inline-start:calc(-1 * var(--t-size));--t-size: inherit}.t-button:before{font-size:var(--t-size)}.t-button:focus-visible{opacity:1}.t-icon{font-size:1rem;margin-inline-end:.25rem;vertical-align:sub;color:var(--tui-text-positive)}\n"] }]
|
|
51
57
|
}], propDecorators: { size: [{
|
|
52
58
|
type: Input
|
|
53
59
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-directives-copy.mjs","sources":["../../../projects/kit/directives/copy/copy.options.ts","../../../projects/kit/directives/copy/copy.component.ts","../../../projects/kit/directives/copy/copy.template.html","../../../projects/kit/directives/copy/copy.directive.ts","../../../projects/kit/directives/copy/copy.ts","../../../projects/kit/directives/copy/index.ts","../../../projects/kit/directives/copy/taiga-ui-kit-directives-copy.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiCopyOptions {\n readonly icon: TuiStringHandler<TuiSizeL | TuiSizeS> | string;\n}\n\nexport const [TUI_COPY_OPTIONS, tuiCopyOptionsProvider] =\n tuiCreateOptions<TuiCopyOptions>({icon: '@tui.copy'});\n","import {ClipboardModule} from '@angular/cdk/clipboard';\nimport {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\nimport {TuiHint} from '@taiga-ui/core/directives/hint';\nimport {type TuiSizeL} from '@taiga-ui/core/types';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\nimport {BehaviorSubject, map, startWith, switchMap, timer} from 'rxjs';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Component({\n standalone: true,\n selector: 'tui-copy',\n imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon],\n templateUrl: './copy.template.html',\n styleUrls: ['./copy.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n '(pointerdown)': 'copied$.next(false)',\n },\n})\nexport class TuiCopyComponent {\n protected readonly notification = inject(TUI_NOTIFICATION_OPTIONS);\n protected readonly options = inject(TUI_COPY_OPTIONS);\n protected readonly copied$ = new BehaviorSubject<boolean>(false);\n protected readonly texts = toSignal(inject(TUI_COPY_TEXTS));\n protected readonly hint = toSignal(\n this.copied$.pipe(\n switchMap((copied) =>\n timer(2000).pipe(map(TUI_FALSE_HANDLER), startWith(copied)),\n ),\n ),\n );\n\n @Input()\n public size: TuiSizeL = 'm';\n\n protected get icon(): string {\n return tuiIsString(this.options.icon)\n ? this.options.icon\n : this.options.icon(this.size);\n }\n\n protected get check(): string {\n return tuiIsString(this.notification.icon)\n ? this.notification.icon\n : this.notification.icon('positive');\n }\n}\n","<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"content.textContent ?? ''\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"content.textContent ?? ''\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n","import {DOCUMENT} from '@angular/common';\nimport {computed, Directive, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiDirectiveBinding, tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {\n TUI_APPEARANCE_OPTIONS,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\nimport {map, startWith, Subject, switchMap, timer} from 'rxjs';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Directive({\n standalone: true,\n selector: 'tui-icon[tuiCopy]',\n providers: [\n {\n provide: TUI_APPEARANCE_OPTIONS,\n useValue: {appearance: 'icon'},\n },\n ],\n hostDirectives: [\n TuiWithAppearance,\n {\n directive: TuiHintDirective,\n inputs: ['tuiHintAppearance', 'tuiHintContext'],\n },\n ],\n host: {\n style: 'cursor: pointer',\n '(click)': 'copy()',\n '[style.pointer-events]': 'disabled ? \"none\" : null',\n '[style.opacity]': 'disabled ? \"var(--tui-disabled-opacity)\" : null',\n '[style.border-width.rem]': 'textfield.options.size() === \"l\" ? null : 0.25',\n },\n})\nexport class TuiCopyDirective {\n private readonly options = inject(TUI_COPY_OPTIONS);\n private readonly copied$ = new Subject<void>();\n private readonly doc = inject(DOCUMENT);\n\n protected readonly textfield = inject(TuiTextfieldComponent);\n protected readonly hint = tuiDirectiveBinding(\n TuiHintDirective,\n 'tuiHint',\n toSignal(\n inject(TUI_COPY_TEXTS).pipe(\n switchMap(([copy, copied]) =>\n this.copied$.pipe(\n switchMap(() =>\n timer(3000).pipe(\n map(() => copy),\n startWith(copied),\n ),\n ),\n startWith(copy),\n ),\n ),\n ),\n {initialValue: ''},\n ),\n );\n\n protected readonly icons = tuiDirectiveBinding(\n TuiIcon,\n 'icon',\n computed((size = this.textfield.options.size()) =>\n tuiIsString(this.options.icon) ? this.options.icon : this.options.icon(size),\n ),\n );\n\n @Input()\n public tuiCopy = '';\n\n protected get disabled(): boolean {\n return !this.textfield.input?.nativeElement.value;\n }\n\n protected copy(): void {\n this.textfield.input?.nativeElement.select();\n this.doc.execCommand('copy');\n this.copied$.next();\n }\n}\n","import {TuiCopyComponent} from './copy.component';\nimport {TuiCopyDirective} from './copy.directive';\n\nexport const TuiCopy = [TuiCopyComponent, TuiCopyDirective] as const;\n","// TODO: Move to components in v5\nexport * from './copy';\nexport * from './copy.component';\nexport * from './copy.directive';\nexport * from './copy.options';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQa,MAAA,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GACnD,gBAAgB,CAAiB,EAAC,IAAI,EAAE,WAAW,EAAC;;ACMxD,MAYa,gBAAgB,CAAA;AAZ7B,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,YAAY,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,EAAC;AACjC,yBAAA;AACJ,qBAAA;AACD,oBAAA,cAAc,EAAE;wBACZ,iBAAiB;AACjB,wBAAA;AACI,4BAAA,SAAS,EAAE,gBAAgB;AAC3B,4BAAA,MAAM,EAAE,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;AAClD,yBAAA;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,wBAAwB,EAAE,0BAA0B;AACpD,wBAAA,iBAAiB,EAAE,iDAAiD;AACpE,wBAAA,0BAA0B,EAAE,gDAAgD;AAC/E,qBAAA;AACJ,iBAAA,CAAA;8BAqCU,OAAO,EAAA,CAAA;sBADb,KAAK;;;MCxEG,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB;;ACH1D;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-directives-copy.mjs","sources":["../../../projects/kit/directives/copy/copy.options.ts","../../../projects/kit/directives/copy/copy.component.ts","../../../projects/kit/directives/copy/copy.template.html","../../../projects/kit/directives/copy/copy.directive.ts","../../../projects/kit/directives/copy/copy.ts","../../../projects/kit/directives/copy/index.ts","../../../projects/kit/directives/copy/taiga-ui-kit-directives-copy.ts"],"sourcesContent":["import {type TuiStringHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiSizeL, type TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiCopyOptions {\n readonly icon: TuiStringHandler<TuiSizeL | TuiSizeS> | string;\n}\n\nexport const [TUI_COPY_OPTIONS, tuiCopyOptionsProvider] =\n tuiCreateOptions<TuiCopyOptions>({icon: '@tui.copy'});\n","import {ClipboardModule} from '@angular/cdk/clipboard';\nimport {ChangeDetectionStrategy, Component, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {TuiCopyProcessor} from '@taiga-ui/cdk/directives/copy-processor';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\nimport {TuiHint} from '@taiga-ui/core/directives/hint';\nimport {type TuiSizeL} from '@taiga-ui/core/types';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\nimport {BehaviorSubject, map, startWith, switchMap, timer} from 'rxjs';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Component({\n standalone: true,\n selector: 'tui-copy',\n imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon],\n templateUrl: './copy.template.html',\n styleUrls: ['./copy.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-size]': 'size',\n '(pointerdown)': 'copied$.next(false)',\n },\n})\nexport class TuiCopyComponent {\n private readonly processor = inject(TuiCopyProcessor, {optional: true});\n\n protected readonly notification = inject(TUI_NOTIFICATION_OPTIONS);\n protected readonly options = inject(TUI_COPY_OPTIONS);\n protected readonly copied$ = new BehaviorSubject<boolean>(false);\n protected readonly texts = toSignal(inject(TUI_COPY_TEXTS));\n protected readonly hint = toSignal(\n this.copied$.pipe(\n switchMap((copied) =>\n timer(2000).pipe(map(TUI_FALSE_HANDLER), startWith(copied)),\n ),\n ),\n );\n\n @Input()\n public size: TuiSizeL = 'm';\n\n protected get icon(): string {\n return tuiIsString(this.options.icon)\n ? this.options.icon\n : this.options.icon(this.size);\n }\n\n protected get check(): string {\n return tuiIsString(this.notification.icon)\n ? this.notification.icon\n : this.notification.icon('positive');\n }\n\n protected process(value: string | null | undefined): string {\n const source = value ?? '';\n\n return this.processor?.tuiCopyProcessor(source) ?? source.trim();\n }\n}\n","<span\n #content\n tuiHintAppearance=\"dark\"\n tuiHintDirection=\"top\"\n class=\"t-content\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [tuiHint]=\"template\"\n [tuiHintManual]=\"!!hint()\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n>\n <ng-content />\n</span>\n<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [attr.aria-label]=\"texts()?.[0]\"\n [cdkCopyToClipboard]=\"process(content.textContent)\"\n [iconStart]=\"icon\"\n (cdkCopyToClipboardCopied)=\"copied$.next($event)\"\n></button>\n<ng-template #template>\n <tui-icon\n class=\"t-icon\"\n [icon]=\"check\"\n />\n {{ texts()?.[1] }}\n</ng-template>\n","import {DOCUMENT} from '@angular/common';\nimport {computed, Directive, inject, Input} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {tuiDirectiveBinding, tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiIcon} from '@taiga-ui/core/components/icon';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {\n TUI_APPEARANCE_OPTIONS,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {TuiHintDirective} from '@taiga-ui/core/directives/hint';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\nimport {map, startWith, Subject, switchMap, timer} from 'rxjs';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Directive({\n standalone: true,\n selector: 'tui-icon[tuiCopy]',\n providers: [\n {\n provide: TUI_APPEARANCE_OPTIONS,\n useValue: {appearance: 'icon'},\n },\n ],\n hostDirectives: [\n TuiWithAppearance,\n {\n directive: TuiHintDirective,\n inputs: ['tuiHintAppearance', 'tuiHintContext'],\n },\n ],\n host: {\n style: 'cursor: pointer',\n '(click)': 'copy()',\n '[style.pointer-events]': 'disabled ? \"none\" : null',\n '[style.opacity]': 'disabled ? \"var(--tui-disabled-opacity)\" : null',\n '[style.border-width.rem]': 'textfield.options.size() === \"l\" ? null : 0.25',\n },\n})\nexport class TuiCopyDirective {\n private readonly options = inject(TUI_COPY_OPTIONS);\n private readonly copied$ = new Subject<void>();\n private readonly doc = inject(DOCUMENT);\n\n protected readonly textfield = inject(TuiTextfieldComponent);\n protected readonly hint = tuiDirectiveBinding(\n TuiHintDirective,\n 'tuiHint',\n toSignal(\n inject(TUI_COPY_TEXTS).pipe(\n switchMap(([copy, copied]) =>\n this.copied$.pipe(\n switchMap(() =>\n timer(3000).pipe(\n map(() => copy),\n startWith(copied),\n ),\n ),\n startWith(copy),\n ),\n ),\n ),\n {initialValue: ''},\n ),\n );\n\n protected readonly icons = tuiDirectiveBinding(\n TuiIcon,\n 'icon',\n computed((size = this.textfield.options.size()) =>\n tuiIsString(this.options.icon) ? this.options.icon : this.options.icon(size),\n ),\n );\n\n @Input()\n public tuiCopy = '';\n\n protected get disabled(): boolean {\n return !this.textfield.input?.nativeElement.value;\n }\n\n protected copy(): void {\n this.textfield.input?.nativeElement.select();\n this.doc.execCommand('copy');\n this.copied$.next();\n }\n}\n","import {TuiCopyComponent} from './copy.component';\nimport {TuiCopyDirective} from './copy.directive';\n\nexport const TuiCopy = [TuiCopyComponent, TuiCopyDirective] as const;\n","// TODO: Move to components in v5\nexport * from './copy';\nexport * from './copy.component';\nexport * from './copy.directive';\nexport * from './copy.options';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQa,MAAA,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GACnD,gBAAgB,CAAiB,EAAC,IAAI,EAAE,WAAW,EAAC;;ACOxD,MAYa,gBAAgB,CAAA;AAZ7B,IAAA,WAAA,GAAA;QAaqB,IAAS,CAAA,SAAA,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;AAErD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAChD,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IAAI;AAChB,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,SAAS,EAAE;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,sBAAsB;AAC/B,4BAAA,QAAQ,EAAE,EAAC,UAAU,EAAE,MAAM,EAAC;AACjC,yBAAA;AACJ,qBAAA;AACD,oBAAA,cAAc,EAAE;wBACZ,iBAAiB;AACjB,wBAAA;AACI,4BAAA,SAAS,EAAE,gBAAgB;AAC3B,4BAAA,MAAM,EAAE,CAAC,mBAAmB,EAAE,gBAAgB,CAAC;AAClD,yBAAA;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,iBAAiB;AACxB,wBAAA,SAAS,EAAE,QAAQ;AACnB,wBAAA,wBAAwB,EAAE,0BAA0B;AACpD,wBAAA,iBAAiB,EAAE,iDAAiD;AACpE,wBAAA,0BAA0B,EAAE,gDAAgD;AAC/E,qBAAA;AACJ,iBAAA,CAAA;8BAqCU,OAAO,EAAA,CAAA;sBADb,KAAK;;;MCxEG,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB;;ACH1D;;ACAA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.60.0",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -227,12 +227,6 @@
|
|
|
227
227
|
"esm": "./esm2022/components/input-date-range/taiga-ui-kit-components-input-date-range.mjs",
|
|
228
228
|
"default": "./fesm2022/taiga-ui-kit-components-input-date-range.mjs"
|
|
229
229
|
},
|
|
230
|
-
"./components/input-date-time": {
|
|
231
|
-
"types": "./components/input-date-time/index.d.ts",
|
|
232
|
-
"esm2022": "./esm2022/components/input-date-time/taiga-ui-kit-components-input-date-time.mjs",
|
|
233
|
-
"esm": "./esm2022/components/input-date-time/taiga-ui-kit-components-input-date-time.mjs",
|
|
234
|
-
"default": "./fesm2022/taiga-ui-kit-components-input-date-time.mjs"
|
|
235
|
-
},
|
|
236
230
|
"./components/input-inline": {
|
|
237
231
|
"types": "./components/input-inline/index.d.ts",
|
|
238
232
|
"esm2022": "./esm2022/components/input-inline/taiga-ui-kit-components-input-inline.mjs",
|
|
@@ -287,6 +281,12 @@
|
|
|
287
281
|
"esm": "./esm2022/components/input-range/taiga-ui-kit-components-input-range.mjs",
|
|
288
282
|
"default": "./fesm2022/taiga-ui-kit-components-input-range.mjs"
|
|
289
283
|
},
|
|
284
|
+
"./components/input-date-time": {
|
|
285
|
+
"types": "./components/input-date-time/index.d.ts",
|
|
286
|
+
"esm2022": "./esm2022/components/input-date-time/taiga-ui-kit-components-input-date-time.mjs",
|
|
287
|
+
"esm": "./esm2022/components/input-date-time/taiga-ui-kit-components-input-date-time.mjs",
|
|
288
|
+
"default": "./fesm2022/taiga-ui-kit-components-input-date-time.mjs"
|
|
289
|
+
},
|
|
290
290
|
"./components/input-slider": {
|
|
291
291
|
"types": "./components/input-slider/index.d.ts",
|
|
292
292
|
"esm2022": "./esm2022/components/input-slider/taiga-ui-kit-components-input-slider.mjs",
|
|
@@ -673,9 +673,9 @@
|
|
|
673
673
|
"@ng-web-apis/intersection-observer": "^4.12.0",
|
|
674
674
|
"@ng-web-apis/mutation-observer": "^4.12.0",
|
|
675
675
|
"@ng-web-apis/resize-observer": "^4.12.0",
|
|
676
|
-
"@taiga-ui/cdk": "^4.
|
|
677
|
-
"@taiga-ui/core": "^4.
|
|
678
|
-
"@taiga-ui/i18n": "^4.
|
|
676
|
+
"@taiga-ui/cdk": "^4.60.0",
|
|
677
|
+
"@taiga-ui/core": "^4.60.0",
|
|
678
|
+
"@taiga-ui/i18n": "^4.60.0",
|
|
679
679
|
"@taiga-ui/polymorpheus": "^4.9.0",
|
|
680
680
|
"rxjs": ">=7.0.0"
|
|
681
681
|
},
|