@taiga-ui/kit 5.14.0 → 5.15.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/copy/copy.directive.d.ts +3 -1
- package/components/input-chip/input-chip.utils.d.ts +2 -0
- package/components/textarea/textarea-content.component.d.ts +2 -3
- package/components/textarea/textarea.component.d.ts +1 -1
- package/directives/tooltip/tooltip.directive.d.ts +2 -1
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +9 -9
- package/fesm2022/taiga-ui-kit-components-badge.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-block.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-chip.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-comment.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-compass.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-copy.mjs +33 -9
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +5 -5
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +111 -99
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +5 -5
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +7 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-like.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-message.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-pin.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-preview.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-progress.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-segmented.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-shrink-wrap.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-status.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-switch.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +25 -15
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tiles.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-toast.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-connected.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-fade.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +6 -5
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
- package/package.json +40 -40
|
@@ -16,6 +16,7 @@ import { TuiIcon } from '@taiga-ui/core/components/icon';
|
|
|
16
16
|
import * as i2 from '@taiga-ui/core/portals/hint';
|
|
17
17
|
import { TuiHint, TuiHintDirective } from '@taiga-ui/core/portals/hint';
|
|
18
18
|
import { BehaviorSubject, switchMap, timer, map, startWith, Subject } from 'rxjs';
|
|
19
|
+
import { DOCUMENT } from '@angular/common';
|
|
19
20
|
import { TuiTextfieldComponent } from '@taiga-ui/core/components/textfield';
|
|
20
21
|
import * as i1$2 from '@taiga-ui/core/directives/appearance';
|
|
21
22
|
import { TUI_APPEARANCE_OPTIONS, TuiWithAppearance } from '@taiga-ui/core/directives/appearance';
|
|
@@ -54,7 +55,7 @@ class TuiButtonCopy {
|
|
|
54
55
|
} @else {
|
|
55
56
|
<ng-content />
|
|
56
57
|
}
|
|
57
|
-
`, isInline: true, styles: ["tui-hint:has([tuiButtonCopy]):where(*[data-tui-version=\"5.
|
|
58
|
+
`, isInline: true, styles: ["tui-hint:has([tuiButtonCopy]):where(*[data-tui-version=\"5.15.0\"]){display:flex;padding:.375rem;max-inline-size:none}[tuiButtonCopy]:where(*[data-tui-version=\"5.15.0\"]):not(:first-of-type){margin-inline-start:calc(.75rem - 1px);border-image:linear-gradient(transparent .375rem,var(--tui-border-normal) .375rem,var(--tui-border-normal) calc(100% - .375rem),transparent calc(100% - .375rem)) 0 0 0 1 / 0 1px / 0 .375rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
58
59
|
}
|
|
59
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiButtonCopy, decorators: [{
|
|
60
61
|
type: Component,
|
|
@@ -68,7 +69,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
68
69
|
tuiButton: '',
|
|
69
70
|
type: 'button',
|
|
70
71
|
'(document:click.capture)': 'copy($event.target)',
|
|
71
|
-
}, styles: ["tui-hint:has([tuiButtonCopy]):where(*[data-tui-version=\"5.
|
|
72
|
+
}, styles: ["tui-hint:has([tuiButtonCopy]):where(*[data-tui-version=\"5.15.0\"]){display:flex;padding:.375rem;max-inline-size:none}[tuiButtonCopy]:where(*[data-tui-version=\"5.15.0\"]):not(:first-of-type){margin-inline-start:calc(.75rem - 1px);border-image:linear-gradient(transparent .375rem,var(--tui-border-normal) .375rem,var(--tui-border-normal) calc(100% - .375rem),transparent calc(100% - .375rem)) 0 0 0 1 / 0 1px / 0 .375rem}\n"] }]
|
|
72
73
|
}] });
|
|
73
74
|
|
|
74
75
|
class TuiCopyComponent {
|
|
@@ -99,7 +100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
99
100
|
class TuiCopyDirective {
|
|
100
101
|
constructor() {
|
|
101
102
|
this.copied$ = new Subject();
|
|
102
|
-
this.
|
|
103
|
+
this.doc = inject(DOCUMENT);
|
|
103
104
|
this.stringify = inject(TUI_ITEMS_HANDLERS).stringify;
|
|
104
105
|
this.textfield = inject(TuiTextfieldComponent);
|
|
105
106
|
this.icons = tuiIconEnd(inject(TUI_COPY_OPTIONS).icon);
|
|
@@ -112,18 +113,41 @@ class TuiCopyDirective {
|
|
|
112
113
|
: !!this.textfield.value();
|
|
113
114
|
}
|
|
114
115
|
copy() {
|
|
115
|
-
if (this.multi) {
|
|
116
|
-
this.clipboard.copy(this.textfield.control()?.value.map(this.stringify()).join(', '));
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
116
|
+
if (!this.multi) {
|
|
119
117
|
this.textfield.input()?.nativeElement.select();
|
|
120
|
-
this.clipboard.copy(this.textfield.value());
|
|
121
118
|
}
|
|
122
|
-
this.
|
|
119
|
+
if (this.execCommandCopy(this.value)) {
|
|
120
|
+
this.copied$.next();
|
|
121
|
+
}
|
|
123
122
|
}
|
|
124
123
|
get multi() {
|
|
125
124
|
return Array.isArray(this.textfield.control()?.value);
|
|
126
125
|
}
|
|
126
|
+
get value() {
|
|
127
|
+
return this.multi
|
|
128
|
+
? this.textfield.control()?.value.map(this.stringify()).join(', ')
|
|
129
|
+
: this.textfield.value();
|
|
130
|
+
}
|
|
131
|
+
execCommandCopy(text) {
|
|
132
|
+
let copied = false;
|
|
133
|
+
const listener = (event) => {
|
|
134
|
+
if (event.clipboardData) {
|
|
135
|
+
event.clipboardData.setData('text/plain', text);
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
copied = true;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
this.doc.addEventListener('copy', listener);
|
|
141
|
+
try {
|
|
142
|
+
return this.doc.execCommand('copy') && copied;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
finally {
|
|
148
|
+
this.doc.removeEventListener('copy', listener);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
127
151
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiCopyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
128
152
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: TuiCopyDirective, isStandalone: true, selector: "tui-icon[tuiCopy]", host: { listeners: { "click": "copy()" }, properties: { "style.border-width.rem": "textfield.options.size() === \"l\" ? null : 0.25", "style.opacity": "hasValue ? null : \"var(--tui-disabled-opacity)\"", "style.pointer-events": "hasValue ? null : \"none\"" }, styleAttribute: "cursor: pointer" }, providers: [
|
|
129
153
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-copy.mjs","sources":["../../../projects/kit/components/copy/copy.options.ts","../../../projects/kit/components/copy/button-copy.component.ts","../../../projects/kit/components/copy/copy.component.ts","../../../projects/kit/components/copy/copy.template.html","../../../projects/kit/components/copy/copy.directive.ts","../../../projects/kit/components/copy/copy.ts","../../../projects/kit/components/copy/index.ts","../../../projects/kit/components/copy/taiga-ui-kit-components-copy.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiCopyOptions {\n readonly icon: string;\n}\n\nexport const [TUI_COPY_OPTIONS, tuiCopyOptionsProvider] = tuiCreateOptions({\n icon: '@tui.copy',\n});\n","import {Clipboard} from '@angular/cdk/clipboard';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton, tuiButtonOptionsProvider} from '@taiga-ui/core/components/button';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\nimport {tuiIconStart} from '@taiga-ui/core/directives/icons';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Component({\n selector: '[tuiButtonCopy]',\n template: `\n @if (copied()) {\n {{ copiedText() }}\n } @else {\n <ng-content />\n }\n `,\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './button-copy.styles.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiButtonOptionsProvider({appearance: 'flat-grayscale', size: 's'})],\n hostDirectives: [TuiButton],\n host: {\n tuiButton: '',\n type: 'button',\n '(document:click.capture)': 'copy($event.target)',\n },\n})\nexport class TuiButtonCopy {\n private readonly el = tuiInjectElement();\n private readonly clipboard = inject(Clipboard);\n private readonly options = inject(TUI_COPY_OPTIONS);\n private readonly copyTexts = inject(TUI_COPY_TEXTS);\n private readonly notification = inject(TUI_NOTIFICATION_OPTIONS);\n\n private readonly check = tuiIsString(this.notification.icon)\n ? this.notification.icon\n : this.notification.icon('positive');\n\n protected readonly copied = signal(false);\n protected readonly copiedText = computed(() => this.copyTexts()[1]);\n\n protected readonly icon = tuiIconStart(\n computed(() => (this.copied() ? this.check : this.options.icon)),\n );\n\n public readonly tuiButtonCopy = input('');\n\n protected copy(target: HTMLElement): void {\n const copied = this.el === target;\n\n if (copied) {\n this.clipboard.copy(this.tuiButtonCopy());\n }\n\n this.copied.set(copied);\n }\n}\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/portals/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 selector: 'tui-copy',\n imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon],\n templateUrl: './copy.template.html',\n styleUrl: './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(false);\n protected readonly texts = inject(TUI_COPY_TEXTS);\n\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 public readonly size = input<TuiSizeL>('m');\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=\"floating\"\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]=\"options.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 {Clipboard} from '@angular/cdk/clipboard';\nimport {Directive, inject} from '@angular/core';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {\n TUI_APPEARANCE_OPTIONS,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {TUI_ITEMS_HANDLERS} from '@taiga-ui/core/directives/items-handlers';\nimport {TuiHintDirective} from '@taiga-ui/core/portals/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 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 '[style.border-width.rem]': 'textfield.options.size() === \"l\" ? null : 0.25',\n '[style.opacity]': 'hasValue ? null : \"var(--tui-disabled-opacity)\"',\n '[style.pointer-events]': 'hasValue ? null : \"none\"',\n '(click)': 'copy()',\n },\n})\nexport class TuiCopyDirective {\n private readonly copied$ = new Subject<void>();\n private readonly clipboard = inject(Clipboard);\n private readonly stringify = inject(TUI_ITEMS_HANDLERS).stringify;\n\n protected readonly textfield = inject(TuiTextfieldComponent);\n protected readonly icons = tuiIconEnd(inject(TUI_COPY_OPTIONS).icon);\n protected readonly copyTexts = inject(TUI_COPY_TEXTS);\n\n protected readonly hint = tuiDirectiveBinding(\n TuiHintDirective,\n 'content',\n toSignal(\n toObservable(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 get hasValue(): boolean {\n return this.multi\n ? !!this.textfield.control()?.value.length\n : !!this.textfield.value();\n }\n\n protected copy(): void {\n if (this.multi) {\n this.clipboard.copy(\n this.textfield.control()?.value.map(this.stringify()).join(', '),\n );\n } else {\n this.textfield.input()?.nativeElement.select();\n this.clipboard.copy(this.textfield.value());\n }\n\n this.copied$.next();\n }\n\n private get multi(): boolean {\n return Array.isArray(this.textfield.control()?.value);\n }\n}\n","import {TuiButtonCopy} from './button-copy.component';\nimport {TuiCopyComponent} from './copy.component';\nimport {TuiCopyDirective} from './copy.directive';\n\nexport const TuiCopy = [TuiCopyComponent, TuiCopyDirective, TuiButtonCopy] as const;\n","// TODO: Move to components in v5\nexport * from './button-copy.component';\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":";;;;;;;;;;;;;;;;;;;;;;;MAMa,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GAAG,gBAAgB,CAAC;AACvE,IAAA,IAAI,EAAE,WAAW;AACpB,CAAA;;MCoCY,aAAa,CAAA;AAxB1B,IAA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,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,0BAA0B,EAAE,gDAAgD;AAC5E,wBAAA,iBAAiB,EAAE,iDAAiD;AACpE,wBAAA,wBAAwB,EAAE,0BAA0B;AACpD,wBAAA,SAAS,EAAE,QAAQ;AACtB,qBAAA;AACJ,iBAAA;;;ACnCM,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa;;ACJzE;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-copy.mjs","sources":["../../../projects/kit/components/copy/copy.options.ts","../../../projects/kit/components/copy/button-copy.component.ts","../../../projects/kit/components/copy/copy.component.ts","../../../projects/kit/components/copy/copy.template.html","../../../projects/kit/components/copy/copy.directive.ts","../../../projects/kit/components/copy/copy.ts","../../../projects/kit/components/copy/index.ts","../../../projects/kit/components/copy/taiga-ui-kit-components-copy.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\n\nexport interface TuiCopyOptions {\n readonly icon: string;\n}\n\nexport const [TUI_COPY_OPTIONS, tuiCopyOptionsProvider] = tuiCreateOptions({\n icon: '@tui.copy',\n});\n","import {Clipboard} from '@angular/cdk/clipboard';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiIsString} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiButton, tuiButtonOptionsProvider} from '@taiga-ui/core/components/button';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/components/notification';\nimport {tuiIconStart} from '@taiga-ui/core/directives/icons';\nimport {TUI_COPY_TEXTS} from '@taiga-ui/kit/tokens';\n\nimport {TUI_COPY_OPTIONS} from './copy.options';\n\n@Component({\n selector: '[tuiButtonCopy]',\n template: `\n @if (copied()) {\n {{ copiedText() }}\n } @else {\n <ng-content />\n }\n `,\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './button-copy.styles.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiButtonOptionsProvider({appearance: 'flat-grayscale', size: 's'})],\n hostDirectives: [TuiButton],\n host: {\n tuiButton: '',\n type: 'button',\n '(document:click.capture)': 'copy($event.target)',\n },\n})\nexport class TuiButtonCopy {\n private readonly el = tuiInjectElement();\n private readonly clipboard = inject(Clipboard);\n private readonly options = inject(TUI_COPY_OPTIONS);\n private readonly copyTexts = inject(TUI_COPY_TEXTS);\n private readonly notification = inject(TUI_NOTIFICATION_OPTIONS);\n\n private readonly check = tuiIsString(this.notification.icon)\n ? this.notification.icon\n : this.notification.icon('positive');\n\n protected readonly copied = signal(false);\n protected readonly copiedText = computed(() => this.copyTexts()[1]);\n\n protected readonly icon = tuiIconStart(\n computed(() => (this.copied() ? this.check : this.options.icon)),\n );\n\n public readonly tuiButtonCopy = input('');\n\n protected copy(target: HTMLElement): void {\n const copied = this.el === target;\n\n if (copied) {\n this.clipboard.copy(this.tuiButtonCopy());\n }\n\n this.copied.set(copied);\n }\n}\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/portals/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 selector: 'tui-copy',\n imports: [ClipboardModule, TuiButton, TuiHint, TuiIcon],\n templateUrl: './copy.template.html',\n styleUrl: './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(false);\n protected readonly texts = inject(TUI_COPY_TEXTS);\n\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 public readonly size = input<TuiSizeL>('m');\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=\"floating\"\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]=\"options.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 {Directive, inject} from '@angular/core';\nimport {toObservable, toSignal} from '@angular/core/rxjs-interop';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/di';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {\n TUI_APPEARANCE_OPTIONS,\n TuiWithAppearance,\n} from '@taiga-ui/core/directives/appearance';\nimport {tuiIconEnd} from '@taiga-ui/core/directives/icons';\nimport {TUI_ITEMS_HANDLERS} from '@taiga-ui/core/directives/items-handlers';\nimport {TuiHintDirective} from '@taiga-ui/core/portals/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 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 '[style.border-width.rem]': 'textfield.options.size() === \"l\" ? null : 0.25',\n '[style.opacity]': 'hasValue ? null : \"var(--tui-disabled-opacity)\"',\n '[style.pointer-events]': 'hasValue ? null : \"none\"',\n '(click)': 'copy()',\n },\n})\nexport class TuiCopyDirective {\n private readonly copied$ = new Subject<void>();\n private readonly doc = inject(DOCUMENT);\n private readonly stringify = inject(TUI_ITEMS_HANDLERS).stringify;\n\n protected readonly textfield = inject(TuiTextfieldComponent);\n protected readonly icons = tuiIconEnd(inject(TUI_COPY_OPTIONS).icon);\n protected readonly copyTexts = inject(TUI_COPY_TEXTS);\n\n protected readonly hint = tuiDirectiveBinding(\n TuiHintDirective,\n 'content',\n toSignal(\n toObservable(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 get hasValue(): boolean {\n return this.multi\n ? !!this.textfield.control()?.value.length\n : !!this.textfield.value();\n }\n\n protected copy(): void {\n if (!this.multi) {\n this.textfield.input()?.nativeElement.select();\n }\n\n if (this.execCommandCopy(this.value)) {\n this.copied$.next();\n }\n }\n\n private get multi(): boolean {\n return Array.isArray(this.textfield.control()?.value);\n }\n\n private get value(): string {\n return this.multi\n ? this.textfield.control()?.value.map(this.stringify()).join(', ')\n : this.textfield.value();\n }\n\n private execCommandCopy(text: string): boolean {\n let copied = false;\n\n const listener = (event: ClipboardEvent): void => {\n if (event.clipboardData) {\n event.clipboardData.setData('text/plain', text);\n event.preventDefault();\n\n copied = true;\n }\n };\n\n this.doc.addEventListener('copy', listener);\n\n try {\n return this.doc.execCommand('copy') && copied;\n } catch {\n return false;\n } finally {\n this.doc.removeEventListener('copy', listener);\n }\n }\n}\n","import {TuiButtonCopy} from './button-copy.component';\nimport {TuiCopyComponent} from './copy.component';\nimport {TuiCopyDirective} from './copy.directive';\n\nexport const TuiCopy = [TuiCopyComponent, TuiCopyDirective, TuiButtonCopy] as const;\n","// TODO: Move to components in v5\nexport * from './button-copy.component';\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":";;;;;;;;;;;;;;;;;;;;;;;;MAMa,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GAAG,gBAAgB,CAAC;AACvE,IAAA,IA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ACpD,wBAAA,SAAS,EAAE,QAAQ;AACtB,qBAAA;AACJ,iBAAA;;;ACnCM,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa;;ACJzE;;ACAA;;AAEG;;;;"}
|
|
@@ -166,13 +166,13 @@ class TuiFilesComponent {
|
|
|
166
166
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
167
167
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiFilesComponent, isStandalone: true, selector: "tui-files", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange" }, providers: [
|
|
168
168
|
tuiGroupOptionsProvider({ size: 'm', collapsed: true, orientation: 'vertical' }),
|
|
169
|
-
], queries: [{ propertyName: "items", predicate: TuiItem, read: TemplateRef, isSignal: true }], hostDirectives: [{ directive: i1$1.TuiGroup }], ngImport: i0, template: "<ng-content />\n@for (item of items(); track $index) {\n @if (!max() || $index < max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n}\n@if (max() && items().length > max()) {\n <tui-expand [expanded]=\"expanded()\">\n <div\n tuiGroup\n class=\"t-extra-items\"\n >\n @for (item of items(); track $index) {\n @if (max() && $index >= max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n }\n </div>\n </tui-expand>\n <div\n class=\"t-bottom\"\n [class.t-bottom_collapsed]=\"!expanded()\"\n >\n <button\n appearance=\"outline\"\n size=\"m\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? hideText() : showAllText() }}\n </button>\n </div>\n}\n", styles: ["tui-files:where(*[data-tui-version=\"5.
|
|
169
|
+
], queries: [{ propertyName: "items", predicate: TuiItem, read: TemplateRef, isSignal: true }], hostDirectives: [{ directive: i1$1.TuiGroup }], ngImport: i0, template: "<ng-content />\n@for (item of items(); track $index) {\n @if (!max() || $index < max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n}\n@if (max() && items().length > max()) {\n <tui-expand [expanded]=\"expanded()\">\n <div\n tuiGroup\n class=\"t-extra-items\"\n >\n @for (item of items(); track $index) {\n @if (max() && $index >= max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n }\n </div>\n </tui-expand>\n <div\n class=\"t-bottom\"\n [class.t-bottom_collapsed]=\"!expanded()\"\n >\n <button\n appearance=\"outline\"\n size=\"m\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? hideText() : showAllText() }}\n </button>\n </div>\n}\n", styles: ["tui-files:where(*[data-tui-version=\"5.15.0\"]){inline-size:100%;overflow:hidden;border-radius:var(--tui-radius-m)}tui-files:where(*[data-tui-version=\"5.15.0\"]):empty:empty{display:none}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-files{position:relative;display:block;inline-size:100%;block-size:100%;border-radius:var(--tui-radius-m);overflow:hidden}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-button{inline-size:100%;border-radius:inherit}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-bottom{z-index:3;inline-size:100%;background:var(--tui-background-base);-webkit-mask-image:none!important;mask-image:none!important}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-bottom_collapsed{box-shadow:var(--tui-shadow-popup);margin-block-start:-1.5rem}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-extra-items{inline-size:100%}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-extra-items>*{border-radius:0!important}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiExpand, selector: "tui-expand", inputs: ["expanded"] }, { kind: "directive", type: TuiGroup, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "collapsed", "rounded", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
170
170
|
}
|
|
171
171
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiFilesComponent, decorators: [{
|
|
172
172
|
type: Component,
|
|
173
173
|
args: [{ selector: 'tui-files', imports: [NgTemplateOutlet, TuiButton, TuiExpand, TuiGroup], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
174
174
|
tuiGroupOptionsProvider({ size: 'm', collapsed: true, orientation: 'vertical' }),
|
|
175
|
-
], hostDirectives: [TuiGroup], template: "<ng-content />\n@for (item of items(); track $index) {\n @if (!max() || $index < max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n}\n@if (max() && items().length > max()) {\n <tui-expand [expanded]=\"expanded()\">\n <div\n tuiGroup\n class=\"t-extra-items\"\n >\n @for (item of items(); track $index) {\n @if (max() && $index >= max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n }\n </div>\n </tui-expand>\n <div\n class=\"t-bottom\"\n [class.t-bottom_collapsed]=\"!expanded()\"\n >\n <button\n appearance=\"outline\"\n size=\"m\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? hideText() : showAllText() }}\n </button>\n </div>\n}\n", styles: ["tui-files:where(*[data-tui-version=\"5.
|
|
175
|
+
], hostDirectives: [TuiGroup], template: "<ng-content />\n@for (item of items(); track $index) {\n @if (!max() || $index < max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n}\n@if (max() && items().length > max()) {\n <tui-expand [expanded]=\"expanded()\">\n <div\n tuiGroup\n class=\"t-extra-items\"\n >\n @for (item of items(); track $index) {\n @if (max() && $index >= max()) {\n <ng-container [ngTemplateOutlet]=\"item\" />\n }\n }\n </div>\n </tui-expand>\n <div\n class=\"t-bottom\"\n [class.t-bottom_collapsed]=\"!expanded()\"\n >\n <button\n appearance=\"outline\"\n size=\"m\"\n tuiButton\n type=\"button\"\n class=\"t-button\"\n (click)=\"expanded.set(!expanded())\"\n >\n {{ expanded() ? hideText() : showAllText() }}\n </button>\n </div>\n}\n", styles: ["tui-files:where(*[data-tui-version=\"5.15.0\"]){inline-size:100%;overflow:hidden;border-radius:var(--tui-radius-m)}tui-files:where(*[data-tui-version=\"5.15.0\"]):empty:empty{display:none}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-files{position:relative;display:block;inline-size:100%;block-size:100%;border-radius:var(--tui-radius-m);overflow:hidden}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-button{inline-size:100%;border-radius:inherit}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-bottom{z-index:3;inline-size:100%;background:var(--tui-background-base);-webkit-mask-image:none!important;mask-image:none!important}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-bottom_collapsed{box-shadow:var(--tui-shadow-popup);margin-block-start:-1.5rem}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-extra-items{inline-size:100%}tui-files:where(*[data-tui-version=\"5.15.0\"]) .t-extra-items>*{border-radius:0!important}\n"] }]
|
|
176
176
|
}] });
|
|
177
177
|
|
|
178
178
|
class TuiInputFilesContent {
|
|
@@ -350,7 +350,7 @@ class TuiInputFiles {
|
|
|
350
350
|
this.files = dataTransfer?.files;
|
|
351
351
|
}
|
|
352
352
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputFiles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
353
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.25", type: TuiInputFiles, isStandalone: true, selector: "label[tuiInputFiles]", inputs: { size: { classPropertyName: "size", publicName: "tuiInputFiles", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-tui-version": "5.
|
|
353
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.25", type: TuiInputFiles, isStandalone: true, selector: "label[tuiInputFiles]", inputs: { size: { classPropertyName: "size", publicName: "tuiInputFiles", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-tui-version": "5.15.0", "tuiInputFiles": "" }, listeners: { "change": "onFilesSelected($event.target)", "dragenter": "onDrag($event.dataTransfer)", "dragleave": "onDrag(null)", "dragover.prevent.zoneless": "0", "drop.prevent": "onDropped($event)" }, properties: { "attr.data-size": "size() || options.size", "class._dragged": "fileDragged" } }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: TuiInputFilesDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
354
354
|
<ng-content />
|
|
355
355
|
<span
|
|
356
356
|
*polymorpheusOutlet="
|
|
@@ -360,7 +360,7 @@ class TuiInputFiles {
|
|
|
360
360
|
>
|
|
361
361
|
{{ text }}
|
|
362
362
|
</span>
|
|
363
|
-
`, isInline: true, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.
|
|
363
|
+
`, isInline: true, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]){position:relative;display:flex;box-sizing:border-box;flex-direction:column;min-block-size:var(--tui-height-m);justify-content:center;align-items:center;text-align:center;border-radius:var(--tui-radius-s);font:var(--tui-typography-body-s);overflow-wrap:break-word;padding:.75rem 1rem;gap:.5rem}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"])[data-size=l]{min-block-size:var(--tui-height-l);border-radius:var(--tui-radius-l);font:var(--tui-typography-body-m);padding:1rem}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"])>:not(input){position:relative;pointer-events:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;color:transparent;cursor:pointer}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input:disabled~*{opacity:var(--tui-disabled-opacity)}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input::-webkit-file-upload-button{display:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input::file-selector-button{display:none}*:disabled label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]){pointer-events:none}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]){transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:var(--tui-curve-productive-standard);border-radius:inherit;box-sizing:border-box;border:1px dashed var(--tui-text-action);outline:none}tui-root._mobile [tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]){border-style:solid}[tuiInputFiles]._dragged [tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]){background:var(--tui-background-neutral-1);border-color:var(--tui-text-action-hover)}@media(hover:hover)and (pointer:fine){[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):is(a,button,select,textarea,input,label,.tui-interactive):not(:disabled):hover:not([data-state]){background:var(--tui-background-neutral-1);border-color:var(--tui-text-action-hover)}}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-state=hover]{background:var(--tui-background-neutral-1);border-color:var(--tui-text-action-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):is(a,button,select,textarea,input,label,.tui-interactive):not(:disabled):active:not([data-state]){background:var(--tui-background-neutral-1-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-state=active]{background:var(--tui-background-neutral-1-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):disabled:not([data-state]),[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-state=disabled]{background:transparent;border-color:var(--tui-text-tertiary)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):focus-visible:not([data-focus=false]){border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-focus=true]{border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):not(:disabled)[data-mode~=invalid],[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):invalid:not(:disabled):not([data-mode]){border-color:var(--tui-status-negative)!important}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
364
364
|
}
|
|
365
365
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputFiles, decorators: [{
|
|
366
366
|
type: Component,
|
|
@@ -384,7 +384,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
384
384
|
'(dragleave)': 'onDrag(null)',
|
|
385
385
|
'(dragover.prevent.zoneless)': '0',
|
|
386
386
|
'(drop.prevent)': 'onDropped($event)',
|
|
387
|
-
}, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.
|
|
387
|
+
}, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]){position:relative;display:flex;box-sizing:border-box;flex-direction:column;min-block-size:var(--tui-height-m);justify-content:center;align-items:center;text-align:center;border-radius:var(--tui-radius-s);font:var(--tui-typography-body-s);overflow-wrap:break-word;padding:.75rem 1rem;gap:.5rem}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"])[data-size=l]{min-block-size:var(--tui-height-l);border-radius:var(--tui-radius-l);font:var(--tui-typography-body-m);padding:1rem}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"])>:not(input){position:relative;pointer-events:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;color:transparent;cursor:pointer}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input:disabled~*{opacity:var(--tui-disabled-opacity)}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input::-webkit-file-upload-button{display:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]) input::file-selector-button{display:none}*:disabled label[tuiInputFiles]:where(*[data-tui-version=\"5.15.0\"]){pointer-events:none}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]){transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:var(--tui-curve-productive-standard);border-radius:inherit;box-sizing:border-box;border:1px dashed var(--tui-text-action);outline:none}tui-root._mobile [tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]){border-style:solid}[tuiInputFiles]._dragged [tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]){background:var(--tui-background-neutral-1);border-color:var(--tui-text-action-hover)}@media(hover:hover)and (pointer:fine){[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):is(a,button,select,textarea,input,label,.tui-interactive):not(:disabled):hover:not([data-state]){background:var(--tui-background-neutral-1);border-color:var(--tui-text-action-hover)}}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-state=hover]{background:var(--tui-background-neutral-1);border-color:var(--tui-text-action-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):is(a,button,select,textarea,input,label,.tui-interactive):not(:disabled):active:not([data-state]){background:var(--tui-background-neutral-1-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-state=active]{background:var(--tui-background-neutral-1-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):disabled:not([data-state]),[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-state=disabled]{background:transparent;border-color:var(--tui-text-tertiary)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):focus-visible:not([data-focus=false]){border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"])[data-focus=true]{border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):not(:disabled)[data-mode~=invalid],[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.15.0\"]):invalid:not(:disabled):not([data-mode]){border-color:var(--tui-status-negative)!important}\n"] }]
|
|
388
388
|
}] });
|
|
389
389
|
|
|
390
390
|
class TuiFileRejectedPipe {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { TuiItem } from '@taiga-ui/cdk/directives/item';
|
|
2
2
|
import { TuiLabel } from '@taiga-ui/core/components/label';
|
|
3
|
-
import {
|
|
3
|
+
import { TuiTextfieldMultiComponent, tuiAsTextfieldAccessor, TUI_TEXTFIELD_OPTIONS, TuiTextfieldComponent, TuiTextfieldOptionsDirective } from '@taiga-ui/core/components/textfield';
|
|
4
4
|
import { TuiDropdownDirective, TuiDropdownOpen, tuiDropdownEnabled, TuiDropdownContent } from '@taiga-ui/core/portals/dropdown';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { inject, viewChild, ElementRef, signal, computed,
|
|
6
|
+
import { inject, input, Directive, viewChild, ElementRef, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
8
8
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import { WA_IS_MOBILE } from '@ng-web-apis/platform';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { tuiCreateOptions, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
|
|
11
|
+
import { tuiSanitizeText, tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
12
12
|
import { TuiButton } from '@taiga-ui/core/components/button';
|
|
13
13
|
import { TuiAppearance } from '@taiga-ui/core/directives/appearance';
|
|
14
14
|
import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
|
|
15
15
|
import { TuiHintDirective, TuiHintOverflow } from '@taiga-ui/core/portals/hint';
|
|
16
16
|
import { TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
|
|
17
|
-
import * as i1 from '@taiga-ui/kit/components/chip';
|
|
17
|
+
import * as i1$1 from '@taiga-ui/kit/components/chip';
|
|
18
18
|
import { TuiChip } from '@taiga-ui/kit/components/chip';
|
|
19
19
|
import { TuiFade } from '@taiga-ui/kit/directives/fade';
|
|
20
20
|
import { TUI_FILE_TEXTS } from '@taiga-ui/kit/tokens';
|
|
@@ -25,100 +25,26 @@ import { TuiControl, tuiAsControl } from '@taiga-ui/cdk/classes';
|
|
|
25
25
|
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
26
26
|
import { tuiFallbackValueProvider } from '@taiga-ui/cdk/tokens';
|
|
27
27
|
import { tuiInjectElement, tuiGetClipboardDataText } from '@taiga-ui/cdk/utils/dom';
|
|
28
|
-
import * as i1
|
|
28
|
+
import * as i1 from '@taiga-ui/core/components/input';
|
|
29
29
|
import { TuiWithInput } from '@taiga-ui/core/components/input';
|
|
30
30
|
import { filter } from 'rxjs';
|
|
31
31
|
|
|
32
|
-
class TuiInputChipComponent {
|
|
33
|
-
constructor() {
|
|
34
|
-
this.options = inject(TUI_TEXTFIELD_OPTIONS);
|
|
35
|
-
this.context = injectContext();
|
|
36
|
-
this.value = tuiInjectValue();
|
|
37
|
-
this.input = viewChild(TuiChip, { read: ElementRef });
|
|
38
|
-
this.icons = inject(TUI_COMMON_ICONS);
|
|
39
|
-
this.mobile = inject(WA_IS_MOBILE);
|
|
40
|
-
this.texts = inject(TUI_FILE_TEXTS);
|
|
41
|
-
this.internal = signal(this.context.$implicit.item);
|
|
42
|
-
this.editing = signal(false);
|
|
43
|
-
this.hint = inject(TuiHintDirective, { self: true, optional: true });
|
|
44
|
-
this.handlers = inject(TUI_ITEMS_HANDLERS);
|
|
45
|
-
this.textfield = inject(TuiTextfieldMultiComponent);
|
|
46
|
-
this.disabled = tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceState', computed(() => this.handlers.disabledItemHandler()(this.context.$implicit.item) ||
|
|
47
|
-
this.textfield.cva()?.disabled()
|
|
48
|
-
? 'disabled'
|
|
49
|
-
: null));
|
|
50
|
-
this.size = tuiDirectiveBinding(TuiChip, 'size', computed(() => (this.options.size() === 'l' ? 's' : 'xs')));
|
|
51
|
-
this.editable = input(true);
|
|
52
|
-
}
|
|
53
|
-
get index() {
|
|
54
|
-
return this.context.$implicit.index;
|
|
55
|
-
}
|
|
56
|
-
delete() {
|
|
57
|
-
if (this.textfield.cva()?.interactive()) {
|
|
58
|
-
this.textfield
|
|
59
|
-
.cva()
|
|
60
|
-
?.onChange(this.value().filter((_, i) => i !== this.index));
|
|
61
|
-
}
|
|
62
|
-
if (!this.mobile) {
|
|
63
|
-
this.textfield.input()?.nativeElement.focus({ preventScroll: true });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
save() {
|
|
67
|
-
if (!this.internal()) {
|
|
68
|
-
this.delete();
|
|
69
|
-
}
|
|
70
|
-
else if (this.handlers.disabledItemHandler()(this.internal())) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const value = this.value().map((item, index) => index === this.index ? this.internal() : item);
|
|
74
|
-
this.textfield.cva()?.onChange(value);
|
|
75
|
-
this.editing.set(false);
|
|
76
|
-
this.textfield.input()?.nativeElement.focus({ preventScroll: true });
|
|
77
|
-
}
|
|
78
|
-
cancel() {
|
|
79
|
-
this.editing.set(false);
|
|
80
|
-
this.internal.set(this.context.$implicit.item);
|
|
81
|
-
}
|
|
82
|
-
edit() {
|
|
83
|
-
if (!this.editable() ||
|
|
84
|
-
!this.textfield.cva()?.interactive() ||
|
|
85
|
-
!tuiIsString(this.internal()) ||
|
|
86
|
-
this.disabled()) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
this.editing.set(true);
|
|
90
|
-
setTimeout(() => this.input()?.nativeElement.focus());
|
|
91
|
-
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
93
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiInputChipComponent, isStandalone: true, selector: "tui-input-chip", inputs: { editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tuiChip": "" }, listeners: { "click": "editing() && $event.stopPropagation()", "dblclick": "edit()", "keydown.backspace.prevent": "delete()", "keydown.enter.prevent": "edit()" }, properties: { "attr.tabIndex": "disabled() ? null : -1", "class._edit": "editing()" }, classAttribute: "tui-interactive" }, viewQueries: [{ propertyName: "input", first: true, predicate: TuiChip, descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1.TuiChip }], ngImport: i0, template: "<input\n appearance=\"\"\n enterkeyhint=\"enter\"\n tuiChip\n class=\"t-input\"\n [disabled]=\"!editing()\"\n [ngModel]=\"internal()\"\n [ngModelOptions]=\"{standalone: true}\"\n (blur)=\"cancel()\"\n (keydown.enter)=\"save()\"\n (keydown.esc)=\"cancel()\"\n (keydown.stop)=\"(0)\"\n (ngModelChange)=\"internal.set($event)\"\n/>\n<div\n tuiFade\n tuiFadeOffset=\"0.5rem\"\n class=\"t-text\"\n [tuiHintOverflow]=\"hint?.content() ? null : handlers.stringify()(internal())\"\n (mousedown.prevent.zoneless)=\"(0)\"\n>\n {{ handlers.stringify()(internal()) }}\n</div>\n@if (textfield.cva()?.interactive() && !editing() && !disabled()) {\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click.stop)=\"delete()\"\n (pointerdown.prevent.stop.zoneless)=\"(0)\"\n >\n {{ texts().remove }}\n </button>\n}\n", styles: [":host{cursor:pointer;margin:.125rem 0;margin-inline-end:.25rem;pointer-events:auto}:host[tuiChip][tuiChip][data-state=disabled],:host-context(tui-textfield[data-state=\"disabled\"]) :host[tuiChip][tuiChip]{cursor:default}:host .t-input{padding:0;text-indent:.375rem;transition:none;color:var(--tui-text-primary);cursor:text;outline:none}:host .t-input:disabled{visibility:hidden}:host._edit{background:transparent}:host._edit .t-text{pointer-events:none;visibility:hidden}:host._edit:before{color:transparent;transition:none}:host-context(tui-textfield[data-size=\"s\"]){inset-inline-start:calc(var(--t-start) / 4 - .375rem);margin:.0625rem 0;margin-inline-end:.125rem}:host-context(tui-textfield[data-size=\"m\"]){inset-inline-start:-.125rem}:host-context(tui-textfield[data-size=\"l\"]){inset-inline-start:-.25rem}:host-context(tui-textfield[data-size=\"l\"]) .t-input{text-indent:.625rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }, { kind: "directive", type: TuiFade, selector: "[tuiFade]", inputs: ["tuiFadeHeight", "tuiFadeSize", "tuiFadeOffset", "tuiFade"] }, { kind: "directive", type: TuiHintOverflow, selector: "[tuiHintOverflow]", inputs: ["tuiHintOverflow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
94
|
-
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputChipComponent, decorators: [{
|
|
96
|
-
type: Component,
|
|
97
|
-
args: [{ selector: 'tui-input-chip', imports: [
|
|
98
|
-
FormsModule,
|
|
99
|
-
ReactiveFormsModule,
|
|
100
|
-
TuiButton,
|
|
101
|
-
TuiChip,
|
|
102
|
-
TuiFade,
|
|
103
|
-
TuiHintOverflow,
|
|
104
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiChip], host: {
|
|
105
|
-
tuiChip: '',
|
|
106
|
-
class: 'tui-interactive',
|
|
107
|
-
'[attr.tabIndex]': 'disabled() ? null : -1',
|
|
108
|
-
'[class._edit]': 'editing()',
|
|
109
|
-
'(click)': 'editing() && $event.stopPropagation()',
|
|
110
|
-
'(dblclick)': 'edit()',
|
|
111
|
-
'(keydown.backspace.prevent)': 'delete()',
|
|
112
|
-
'(keydown.enter.prevent)': 'edit()',
|
|
113
|
-
}, template: "<input\n appearance=\"\"\n enterkeyhint=\"enter\"\n tuiChip\n class=\"t-input\"\n [disabled]=\"!editing()\"\n [ngModel]=\"internal()\"\n [ngModelOptions]=\"{standalone: true}\"\n (blur)=\"cancel()\"\n (keydown.enter)=\"save()\"\n (keydown.esc)=\"cancel()\"\n (keydown.stop)=\"(0)\"\n (ngModelChange)=\"internal.set($event)\"\n/>\n<div\n tuiFade\n tuiFadeOffset=\"0.5rem\"\n class=\"t-text\"\n [tuiHintOverflow]=\"hint?.content() ? null : handlers.stringify()(internal())\"\n (mousedown.prevent.zoneless)=\"(0)\"\n>\n {{ handlers.stringify()(internal()) }}\n</div>\n@if (textfield.cva()?.interactive() && !editing() && !disabled()) {\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click.stop)=\"delete()\"\n (pointerdown.prevent.stop.zoneless)=\"(0)\"\n >\n {{ texts().remove }}\n </button>\n}\n", styles: [":host{cursor:pointer;margin:.125rem 0;margin-inline-end:.25rem;pointer-events:auto}:host[tuiChip][tuiChip][data-state=disabled],:host-context(tui-textfield[data-state=\"disabled\"]) :host[tuiChip][tuiChip]{cursor:default}:host .t-input{padding:0;text-indent:.375rem;transition:none;color:var(--tui-text-primary);cursor:text;outline:none}:host .t-input:disabled{visibility:hidden}:host._edit{background:transparent}:host._edit .t-text{pointer-events:none;visibility:hidden}:host._edit:before{color:transparent;transition:none}:host-context(tui-textfield[data-size=\"s\"]){inset-inline-start:calc(var(--t-start) / 4 - .375rem);margin:.0625rem 0;margin-inline-end:.125rem}:host-context(tui-textfield[data-size=\"m\"]){inset-inline-start:-.125rem}:host-context(tui-textfield[data-size=\"l\"]){inset-inline-start:-.25rem}:host-context(tui-textfield[data-size=\"l\"]) .t-input{text-indent:.625rem}\n"] }]
|
|
114
|
-
}] });
|
|
115
|
-
|
|
116
32
|
const TUI_INPUT_CHIP_DEFAULT_OPTIONS = {
|
|
117
33
|
separator: ',',
|
|
118
34
|
unique: true,
|
|
119
35
|
};
|
|
120
36
|
const [TUI_INPUT_CHIP_OPTIONS, tuiInputChipOptionsProvider] = tuiCreateOptions(TUI_INPUT_CHIP_DEFAULT_OPTIONS);
|
|
121
37
|
|
|
38
|
+
function tuiParseInputChipValue(rawValue, separator, handlers) {
|
|
39
|
+
const value = rawValue.trim();
|
|
40
|
+
const items = separator ? value.split(separator) : [value];
|
|
41
|
+
const isDisabled = handlers.disabledItemHandler();
|
|
42
|
+
const stringify = handlers.stringify();
|
|
43
|
+
return items
|
|
44
|
+
.map((item) => tuiSanitizeText(item))
|
|
45
|
+
.filter((item) => item && !isDisabled(item) && stringify(item));
|
|
46
|
+
}
|
|
47
|
+
|
|
122
48
|
// TODO: Consider making input[tuiTextfieldMulti] to reuse here and in InputDateMulti
|
|
123
49
|
class TuiInputChipDirective extends TuiControl {
|
|
124
50
|
constructor() {
|
|
@@ -145,14 +71,8 @@ class TuiInputChipDirective extends TuiControl {
|
|
|
145
71
|
this.onChange(this.unique() ? Array.from(new Set(value.reverse())).reverse() : value);
|
|
146
72
|
}
|
|
147
73
|
onEnter(rawValue = this.textfield.value()) {
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
const valid = items
|
|
151
|
-
.map((item) => tuiSanitizeText(item))
|
|
152
|
-
.filter((item) => item &&
|
|
153
|
-
!this.handlers.disabledItemHandler()(item) &&
|
|
154
|
-
this.handlers.stringify()(item));
|
|
155
|
-
if (!value || !valid.length) {
|
|
74
|
+
const valid = tuiParseInputChipValue(rawValue, this.separator(), this.handlers);
|
|
75
|
+
if (!valid.length) {
|
|
156
76
|
return;
|
|
157
77
|
}
|
|
158
78
|
this.setValue([...this.value(), ...valid]);
|
|
@@ -206,7 +126,7 @@ class TuiInputChipDirective extends TuiControl {
|
|
|
206
126
|
tuiAsControl(TuiInputChipDirective),
|
|
207
127
|
tuiFallbackValueProvider([]),
|
|
208
128
|
tuiAsTextfieldAccessor(TuiInputChipDirective),
|
|
209
|
-
], usesInheritance: true, hostDirectives: [{ directive: i1
|
|
129
|
+
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithInput }], ngImport: i0 }); }
|
|
210
130
|
}
|
|
211
131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputChipDirective, decorators: [{
|
|
212
132
|
type: Directive,
|
|
@@ -231,6 +151,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
231
151
|
}]
|
|
232
152
|
}] });
|
|
233
153
|
|
|
154
|
+
class TuiInputChipComponent {
|
|
155
|
+
constructor() {
|
|
156
|
+
this.options = inject(TUI_TEXTFIELD_OPTIONS);
|
|
157
|
+
this.context = injectContext();
|
|
158
|
+
this.value = tuiInjectValue();
|
|
159
|
+
this.input = viewChild(TuiChip, { read: ElementRef });
|
|
160
|
+
this.icons = inject(TUI_COMMON_ICONS);
|
|
161
|
+
this.mobile = inject(WA_IS_MOBILE);
|
|
162
|
+
this.texts = inject(TUI_FILE_TEXTS);
|
|
163
|
+
this.internal = signal(this.context.$implicit.item);
|
|
164
|
+
this.editing = signal(false);
|
|
165
|
+
this.hint = inject(TuiHintDirective, { self: true, optional: true });
|
|
166
|
+
this.handlers = inject(TUI_ITEMS_HANDLERS);
|
|
167
|
+
this.textfield = inject(TuiTextfieldMultiComponent);
|
|
168
|
+
this.disabled = tuiDirectiveBinding(TuiAppearance, 'tuiAppearanceState', computed(() => this.handlers.disabledItemHandler()(this.context.$implicit.item) ||
|
|
169
|
+
this.textfield.cva()?.disabled()
|
|
170
|
+
? 'disabled'
|
|
171
|
+
: null));
|
|
172
|
+
this.size = tuiDirectiveBinding(TuiChip, 'size', computed(() => (this.options.size() === 'l' ? 's' : 'xs')));
|
|
173
|
+
this.editable = input(true);
|
|
174
|
+
}
|
|
175
|
+
get index() {
|
|
176
|
+
return this.context.$implicit.index;
|
|
177
|
+
}
|
|
178
|
+
delete() {
|
|
179
|
+
if (this.textfield.cva()?.interactive()) {
|
|
180
|
+
this.textfield
|
|
181
|
+
.cva()
|
|
182
|
+
?.onChange(this.value().filter((_, i) => i !== this.index));
|
|
183
|
+
}
|
|
184
|
+
if (!this.mobile) {
|
|
185
|
+
this.textfield.input()?.nativeElement.focus({ preventScroll: true });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
save() {
|
|
189
|
+
const item = this.internal();
|
|
190
|
+
const cva = this.textfield.cva();
|
|
191
|
+
if (!item) {
|
|
192
|
+
this.delete();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const isItemDisabled = this.handlers.disabledItemHandler()(item);
|
|
196
|
+
const isChipTextfield = cva instanceof TuiInputChipDirective;
|
|
197
|
+
if (isItemDisabled || !isChipTextfield) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const items = tuiParseInputChipValue(String(item), cva.separator(), this.handlers);
|
|
201
|
+
if (!items.length) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
cva.setValue(this.value().flatMap((valueItem, index) => index === this.index ? items : [valueItem]));
|
|
205
|
+
this.editing.set(false);
|
|
206
|
+
this.textfield.input()?.nativeElement.focus({ preventScroll: true });
|
|
207
|
+
}
|
|
208
|
+
cancel() {
|
|
209
|
+
this.editing.set(false);
|
|
210
|
+
this.internal.set(this.context.$implicit.item);
|
|
211
|
+
}
|
|
212
|
+
edit() {
|
|
213
|
+
if (!this.editable() ||
|
|
214
|
+
!this.textfield.cva()?.interactive() ||
|
|
215
|
+
!tuiIsString(this.internal()) ||
|
|
216
|
+
this.disabled()) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
this.editing.set(true);
|
|
220
|
+
setTimeout(() => this.input()?.nativeElement.focus());
|
|
221
|
+
}
|
|
222
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
223
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TuiInputChipComponent, isStandalone: true, selector: "tui-input-chip", inputs: { editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tuiChip": "" }, listeners: { "click": "editing() && $event.stopPropagation()", "dblclick": "edit()", "keydown.backspace.prevent": "delete()", "keydown.enter.prevent": "edit()" }, properties: { "attr.tabIndex": "disabled() ? null : -1", "class._edit": "editing()" }, classAttribute: "tui-interactive" }, viewQueries: [{ propertyName: "input", first: true, predicate: TuiChip, descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1$1.TuiChip }], ngImport: i0, template: "<input\n appearance=\"\"\n enterkeyhint=\"enter\"\n tuiChip\n class=\"t-input\"\n [disabled]=\"!editing()\"\n [ngModel]=\"internal()\"\n [ngModelOptions]=\"{standalone: true}\"\n (blur)=\"cancel()\"\n (keydown.enter)=\"save()\"\n (keydown.esc)=\"cancel()\"\n (keydown.stop)=\"(0)\"\n (ngModelChange)=\"internal.set($event)\"\n/>\n<div\n tuiFade\n tuiFadeOffset=\"0.5rem\"\n class=\"t-text\"\n [tuiHintOverflow]=\"hint?.content() ? null : handlers.stringify()(internal())\"\n (mousedown.prevent.zoneless)=\"(0)\"\n>\n {{ handlers.stringify()(internal()) }}\n</div>\n@if (textfield.cva()?.interactive() && !editing() && !disabled()) {\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click.stop)=\"delete()\"\n (pointerdown.prevent.stop.zoneless)=\"(0)\"\n >\n {{ texts().remove }}\n </button>\n}\n", styles: [":host{cursor:pointer;margin:.125rem 0;margin-inline-end:.25rem;pointer-events:auto}:host[tuiChip][tuiChip][data-state=disabled],:host-context(tui-textfield[data-state=\"disabled\"]) :host[tuiChip][tuiChip]{cursor:default}:host .t-input{padding:0;text-indent:.375rem;transition:none;color:var(--tui-text-primary);cursor:text;outline:none}:host .t-input:disabled{visibility:hidden}:host._edit{background:transparent}:host._edit .t-text{pointer-events:none;visibility:hidden}:host._edit:before{color:transparent;transition:none}:host-context(tui-textfield[data-size=\"s\"]){inset-inline-start:calc(var(--t-start) / 4 - .375rem);margin:.0625rem 0;margin-inline-end:.125rem}:host-context(tui-textfield[data-size=\"m\"]){inset-inline-start:-.125rem}:host-context(tui-textfield[data-size=\"l\"]){inset-inline-start:-.25rem}:host-context(tui-textfield[data-size=\"l\"]) .t-input{text-indent:.625rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }, { kind: "directive", type: TuiFade, selector: "[tuiFade]", inputs: ["tuiFadeHeight", "tuiFadeSize", "tuiFadeOffset", "tuiFade"] }, { kind: "directive", type: TuiHintOverflow, selector: "[tuiHintOverflow]", inputs: ["tuiHintOverflow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
224
|
+
}
|
|
225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputChipComponent, decorators: [{
|
|
226
|
+
type: Component,
|
|
227
|
+
args: [{ selector: 'tui-input-chip', imports: [
|
|
228
|
+
FormsModule,
|
|
229
|
+
ReactiveFormsModule,
|
|
230
|
+
TuiButton,
|
|
231
|
+
TuiChip,
|
|
232
|
+
TuiFade,
|
|
233
|
+
TuiHintOverflow,
|
|
234
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiChip], host: {
|
|
235
|
+
tuiChip: '',
|
|
236
|
+
class: 'tui-interactive',
|
|
237
|
+
'[attr.tabIndex]': 'disabled() ? null : -1',
|
|
238
|
+
'[class._edit]': 'editing()',
|
|
239
|
+
'(click)': 'editing() && $event.stopPropagation()',
|
|
240
|
+
'(dblclick)': 'edit()',
|
|
241
|
+
'(keydown.backspace.prevent)': 'delete()',
|
|
242
|
+
'(keydown.enter.prevent)': 'edit()',
|
|
243
|
+
}, template: "<input\n appearance=\"\"\n enterkeyhint=\"enter\"\n tuiChip\n class=\"t-input\"\n [disabled]=\"!editing()\"\n [ngModel]=\"internal()\"\n [ngModelOptions]=\"{standalone: true}\"\n (blur)=\"cancel()\"\n (keydown.enter)=\"save()\"\n (keydown.esc)=\"cancel()\"\n (keydown.stop)=\"(0)\"\n (ngModelChange)=\"internal.set($event)\"\n/>\n<div\n tuiFade\n tuiFadeOffset=\"0.5rem\"\n class=\"t-text\"\n [tuiHintOverflow]=\"hint?.content() ? null : handlers.stringify()(internal())\"\n (mousedown.prevent.zoneless)=\"(0)\"\n>\n {{ handlers.stringify()(internal()) }}\n</div>\n@if (textfield.cva()?.interactive() && !editing() && !disabled()) {\n <button\n tabIndex=\"-1\"\n tuiIconButton\n type=\"button\"\n [iconStart]=\"icons.close\"\n (click.stop)=\"delete()\"\n (pointerdown.prevent.stop.zoneless)=\"(0)\"\n >\n {{ texts().remove }}\n </button>\n}\n", styles: [":host{cursor:pointer;margin:.125rem 0;margin-inline-end:.25rem;pointer-events:auto}:host[tuiChip][tuiChip][data-state=disabled],:host-context(tui-textfield[data-state=\"disabled\"]) :host[tuiChip][tuiChip]{cursor:default}:host .t-input{padding:0;text-indent:.375rem;transition:none;color:var(--tui-text-primary);cursor:text;outline:none}:host .t-input:disabled{visibility:hidden}:host._edit{background:transparent}:host._edit .t-text{pointer-events:none;visibility:hidden}:host._edit:before{color:transparent;transition:none}:host-context(tui-textfield[data-size=\"s\"]){inset-inline-start:calc(var(--t-start) / 4 - .375rem);margin:.0625rem 0;margin-inline-end:.125rem}:host-context(tui-textfield[data-size=\"m\"]){inset-inline-start:-.125rem}:host-context(tui-textfield[data-size=\"l\"]){inset-inline-start:-.25rem}:host-context(tui-textfield[data-size=\"l\"]) .t-input{text-indent:.625rem}\n"] }]
|
|
244
|
+
}] });
|
|
245
|
+
|
|
234
246
|
const TuiInputChip = [
|
|
235
247
|
TuiItem,
|
|
236
248
|
TuiLabel,
|