@taiga-ui/kit 5.22.0 → 5.23.0-canary.0a07bcd
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/calendar-range/calendar-range.component.d.ts +5 -4
- package/components/confirm/confirm.component.d.ts +1 -1
- package/components/counter/counter.component.d.ts +2 -2
- package/components/files/input-files/input-files-validator.directive.d.ts +3 -0
- package/components/input-date/input-date.directive.d.ts +2 -2
- package/components/input-date-time/input-date-time.directive.d.ts +2 -2
- package/components/input-month/input-month.component.d.ts +2 -2
- package/components/input-number/number-mask.directive.d.ts +2 -2
- package/components/input-year/input-year.directive.d.ts +2 -2
- package/components/line-clamp/index.d.ts +1 -0
- package/components/line-clamp/line-clamp-fallback.directive.d.ts +22 -0
- package/components/line-clamp/line-clamp.component.d.ts +14 -11
- package/components/pincode/pincode.component.d.ts +1 -1
- package/components/rating/rating.component.d.ts +1 -1
- package/fesm2022/taiga-ui-kit-components-accordion.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-accordion.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-avatar.mjs +9 -9
- package/fesm2022/taiga-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-badge.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-badge.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-block.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-block.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs +12 -14
- package/fesm2022/taiga-ui-kit-components-calendar-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-chip.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-comment.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-comment.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-compass.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-compass.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-confirm.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-copy.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-copy.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-counter.mjs +6 -2
- package/fesm2022/taiga-ui-kit-components-counter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +29 -10
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-color.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +13 -11
- 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-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-month.mjs +4 -4
- package/fesm2022/taiga-ui-kit-components-input-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-number.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-phone-international.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-input-slider.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-year.mjs +6 -2
- 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-like.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs +74 -30
- package/fesm2022/taiga-ui-kit-components-line-clamp.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-message.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-meter.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-meter.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pin.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-pin.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-pincode.mjs +3 -1
- package/fesm2022/taiga-ui-kit-components-pincode.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-preview.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-preview.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +6 -6
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-radio-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-rating.mjs +3 -1
- package/fesm2022/taiga-ui-kit-components-rating.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-segmented.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-segmented.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-shrink-wrap.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-shrink-wrap.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-status.mjs +3 -3
- package/fesm2022/taiga-ui-kit-components-status.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-switch.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-switch.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +7 -6
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +3 -3
- 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-tiles.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-toast.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-toast.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-button-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-chevron.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-connected.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-connected.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-fade.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-fade.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-sensitive.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-sensitive.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-shimmer.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs +3 -3
- package/fesm2022/taiga-ui-kit-directives-skeleton.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs +2 -2
- package/fesm2022/taiga-ui-kit-directives-tooltip.mjs.map +1 -1
- package/package.json +25 -25
|
@@ -7,14 +7,14 @@ class TuiCompass {
|
|
|
7
7
|
this.degrees = input(Number.NaN);
|
|
8
8
|
}
|
|
9
9
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiCompass, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: TuiCompass, isStandalone: true, selector: "tui-compass", inputs: { degrees: { classPropertyName: "degrees", publicName: "degrees", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-tui-version": "5.
|
|
10
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: TuiCompass, isStandalone: true, selector: "tui-compass", inputs: { degrees: { classPropertyName: "degrees", publicName: "degrees", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-tui-version": "5.23.0-canary.0a07bcd" }, properties: { "style.--t-degrees.deg": "degrees()" } }, ngImport: i0, template: '', isInline: true, styles: ["tui-compass:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){position:relative;display:inline-block;color:var(--tui-background-accent-1);border-radius:50%;inline-size:1rem;block-size:1rem;border:.1875rem solid var(--tui-background-base);box-shadow:0 0 .1875rem #0000004d;transform-style:preserve-3d}tui-compass:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):before{content:\"\";position:absolute;inset-block-start:0;inset-inline-start:.125rem;-webkit-mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 8.99993C4 8 8 8 12 8.99993C9.91509 5.73239 8.5 3 6 0C3.5 3 2 5.5 0 8.99993Z\"/></svg>');mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 8.99993C4 8 8 8 12 8.99993C9.91509 5.73239 8.5 3 6 0C3.5 3 2 5.5 0 8.99993Z\"/></svg>');transform:rotate(var(--t-degrees)) translateY(-.625rem) translateZ(-1rem);inline-size:.75rem;block-size:1rem;background:currentColor}tui-compass:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):after{position:absolute;inset-block-start:0;inset-inline-start:0;inset-block-end:0;inset-inline-end:0;content:\"\";border-radius:inherit;background:currentColor linear-gradient(-45deg,rgba(0,0,0,.2),transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
11
11
|
}
|
|
12
12
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiCompass, decorators: [{
|
|
13
13
|
type: Component,
|
|
14
14
|
args: [{ selector: 'tui-compass', template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
15
15
|
'data-tui-version': TUI_VERSION,
|
|
16
16
|
'[style.--t-degrees.deg]': 'degrees()',
|
|
17
|
-
}, styles: ["tui-compass:where(*[data-tui-version=\"5.
|
|
17
|
+
}, styles: ["tui-compass:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){position:relative;display:inline-block;color:var(--tui-background-accent-1);border-radius:50%;inline-size:1rem;block-size:1rem;border:.1875rem solid var(--tui-background-base);box-shadow:0 0 .1875rem #0000004d;transform-style:preserve-3d}tui-compass:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):before{content:\"\";position:absolute;inset-block-start:0;inset-inline-start:.125rem;-webkit-mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 8.99993C4 8 8 8 12 8.99993C9.91509 5.73239 8.5 3 6 0C3.5 3 2 5.5 0 8.99993Z\"/></svg>');mask-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 8.99993C4 8 8 8 12 8.99993C9.91509 5.73239 8.5 3 6 0C3.5 3 2 5.5 0 8.99993Z\"/></svg>');transform:rotate(var(--t-degrees)) translateY(-.625rem) translateZ(-1rem);inline-size:.75rem;block-size:1rem;background:currentColor}tui-compass:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):after{position:absolute;inset-block-start:0;inset-inline-start:0;inset-block-end:0;inset-inline-end:0;content:\"\";border-radius:inherit;background:currentColor linear-gradient(-45deg,rgba(0,0,0,.2),transparent)}\n"] }]
|
|
18
18
|
}] });
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-compass.mjs","sources":["../../../projects/kit/components/compass/compass.component.ts","../../../projects/kit/components/compass/taiga-ui-kit-components-compass.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\n\n@Component({\n selector: 'tui-compass',\n template: '',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import '@taiga-ui/styles/components/compass.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'data-tui-version': TUI_VERSION,\n '[style.--t-degrees.deg]': 'degrees()',\n },\n})\nexport class TuiCompass {\n public readonly degrees = input(Number.NaN);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAuBa,UAAU,CAAA;AAfvB,IAAA,WAAA,GAAA;AAgBoB,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AAC9C,IAAA;+GAFY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,UAAU
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-compass.mjs","sources":["../../../projects/kit/components/compass/compass.component.ts","../../../projects/kit/components/compass/taiga-ui-kit-components-compass.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TUI_VERSION} from '@taiga-ui/cdk/constants';\n\n@Component({\n selector: 'tui-compass',\n template: '',\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import '@taiga-ui/styles/components/compass.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'data-tui-version': TUI_VERSION,\n '[style.--t-degrees.deg]': 'degrees()',\n },\n})\nexport class TuiCompass {\n public readonly degrees = input(Number.NaN);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAuBa,UAAU,CAAA;AAfvB,IAAA,WAAA,GAAA;AAgBoB,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AAC9C,IAAA;+GAFY,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,UAAU,8UAbT,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+sCAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAaH,UAAU,EAAA,UAAA,EAAA,CAAA;kBAftB,SAAS;+BACI,aAAa,EAAA,QAAA,EACb,EAAE,EAAA,aAAA,EAMG,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACF,wBAAA,kBAAkB,EAAE,WAAW;AAC/B,wBAAA,yBAAyB,EAAE,WAAW;AACzC,qBAAA,EAAA,MAAA,EAAA,CAAA,+sCAAA,CAAA,EAAA;;;ACrBL;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-confirm.mjs","sources":["../../../projects/kit/components/confirm/confirm.options.ts","../../../projects/kit/components/confirm/confirm.component.ts","../../../projects/kit/components/confirm/confirm.template.html","../../../projects/kit/components/confirm/confirm.service.ts","../../../projects/kit/components/confirm/taiga-ui-kit-components-confirm.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\n// TODO: Rename to TuiConfirmOptions in v6\nexport interface TuiConfirmData {\n readonly content?: PolymorpheusContent;\n readonly no?: string;\n readonly yes?: string;\n readonly appearance?: string | readonly [yes: string, no: string];\n}\n\nexport const [TUI_CONFIRM_OPTIONS, tuiConfirmOptionsProvider] =\n tuiCreateOptions<TuiConfirmData>({\n content: '',\n no: '',\n yes: '',\n appearance: '',\n });\n","import {ChangeDetectionStrategy, Component, inject, InjectionToken} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {TuiAutoFocus} from '@taiga-ui/cdk/directives/auto-focus';\nimport {\n TUI_BUTTON_OPTIONS,\n TuiButton,\n tuiButtonOptionsProvider,\n} from '@taiga-ui/core/components/button';\nimport {type TuiDialogContext} from '@taiga-ui/core/portals/dialog';\nimport {TUI_CONFIRM_WORDS} from '@taiga-ui/kit/tokens';\nimport {\n injectContext,\n PolymorpheusComponent,\n type PolymorpheusContent,\n PolymorpheusOutlet,\n} from '@taiga-ui/polymorpheus';\n\nimport {TUI_CONFIRM_OPTIONS, type TuiConfirmData} from './confirm.options';\n\n@Component({\n imports: [PolymorpheusOutlet, TuiAutoFocus, TuiButton],\n templateUrl: './confirm.template.html',\n styleUrl: './confirm.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiButtonOptionsProvider(() => ({\n size: 'm',\n appearance: inject(WA_IS_MOBILE) ? 'secondary' : 'flat',\n })),\n ],\n})\nexport class TuiConfirm {\n protected readonly options = inject(TUI_BUTTON_OPTIONS);\n protected readonly words = inject(TUI_CONFIRM_WORDS);\n protected readonly data = inject(TUI_CONFIRM_OPTIONS);\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-confirm.mjs","sources":["../../../projects/kit/components/confirm/confirm.options.ts","../../../projects/kit/components/confirm/confirm.component.ts","../../../projects/kit/components/confirm/confirm.template.html","../../../projects/kit/components/confirm/confirm.service.ts","../../../projects/kit/components/confirm/taiga-ui-kit-components-confirm.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\n// TODO: Rename to TuiConfirmOptions in v6\nexport interface TuiConfirmData {\n readonly content?: PolymorpheusContent;\n readonly no?: string;\n readonly yes?: string;\n readonly appearance?: string | readonly [yes: string, no: string];\n}\n\nexport const [TUI_CONFIRM_OPTIONS, tuiConfirmOptionsProvider] =\n tuiCreateOptions<TuiConfirmData>({\n content: '',\n no: '',\n yes: '',\n appearance: '',\n });\n","import {ChangeDetectionStrategy, Component, inject, InjectionToken} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {TuiAutoFocus} from '@taiga-ui/cdk/directives/auto-focus';\nimport {\n TUI_BUTTON_OPTIONS,\n TuiButton,\n tuiButtonOptionsProvider,\n} from '@taiga-ui/core/components/button';\nimport {type TuiDialogContext} from '@taiga-ui/core/portals/dialog';\nimport {TUI_CONFIRM_WORDS} from '@taiga-ui/kit/tokens';\nimport {\n injectContext,\n PolymorpheusComponent,\n type PolymorpheusContent,\n PolymorpheusOutlet,\n} from '@taiga-ui/polymorpheus';\n\nimport {TUI_CONFIRM_OPTIONS, type TuiConfirmData} from './confirm.options';\n\n@Component({\n imports: [PolymorpheusOutlet, TuiAutoFocus, TuiButton],\n templateUrl: './confirm.template.html',\n styleUrl: './confirm.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n tuiButtonOptionsProvider(() => ({\n size: 'm',\n appearance: inject(WA_IS_MOBILE) ? 'secondary' : 'flat',\n })),\n ],\n})\nexport class TuiConfirm {\n protected readonly options = inject(TUI_BUTTON_OPTIONS);\n protected readonly words = inject(TUI_CONFIRM_WORDS);\n protected readonly data = inject(TUI_CONFIRM_OPTIONS);\n\n public readonly context =\n injectContext<TuiDialogContext<boolean, TuiConfirmData | undefined>>();\n\n protected get appearance(): string | readonly [string, string] {\n return this.context.data?.appearance || this.data.appearance || '';\n }\n\n protected get yes(): string {\n return Array.isArray(this.appearance)\n ? this.appearance[0]\n : String(this.appearance || 'primary');\n }\n\n protected get no(): string {\n return Array.isArray(this.appearance)\n ? this.appearance[1]\n : this.options.appearance;\n }\n}\n\nexport const TUI_CONFIRM = new PolymorpheusComponent(TuiConfirm);\n\nexport const TUI_CONFIRM_DIALOG = new InjectionToken<\n PolymorpheusContent<TuiDialogContext<boolean, unknown>>\n>(ngDevMode ? 'TUI_CONFIRM_DIALOG' : '', {factory: () => TUI_CONFIRM});\n","<div\n *polymorpheusOutlet=\"context.data?.content || data.content as text; context: context\"\n class=\"t-content\"\n [innerHTML]=\"text\"\n></div>\n<footer class=\"t-buttons\">\n <button\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"no\"\n (click)=\"context.completeWith(false)\"\n >\n {{ context.data?.no || data.no || words().no }}\n </button>\n <button\n tuiAutoFocus\n tuiButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"yes\"\n (click)=\"context.completeWith(true)\"\n >\n {{ context.data?.yes || data.yes || words().yes }}\n </button>\n</footer>\n","import {inject, Injectable} from '@angular/core';\nimport {type TuiDialogOptions, TuiDialogService} from '@taiga-ui/core/portals/dialog';\nimport {defer, type Observable, of} from 'rxjs';\n\nimport {TUI_CONFIRM_DIALOG} from './confirm.component';\nimport {type TuiConfirmData} from './confirm.options';\n\n@Injectable()\nexport class TuiConfirmService {\n private readonly dialogs = inject(TuiDialogService);\n private readonly component = inject(TUI_CONFIRM_DIALOG);\n private dirty = false;\n\n public markAsDirty(): void {\n this.dirty = true;\n }\n\n public markAsPristine(): void {\n this.dirty = false;\n }\n\n public withConfirm<T = TuiConfirmData>(\n options: Partial<TuiDialogOptions<NoInfer<T>>>,\n ): Observable<boolean> {\n return defer(() =>\n this.dirty\n ? this.dialogs.open<boolean>(this.component, {size: 's', ...options})\n : of(true),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAWa,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,GACzD,gBAAgB,CAAiB;AAC7B,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,UAAU,EAAE,EAAE;AACjB,CAAA;;MCcQ,UAAU,CAAA;AAZvB,IAAA,WAAA,GAAA;AAauB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACpC,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACjC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC;QAErC,IAAA,CAAA,OAAO,GACnB,aAAa,EAAyD;AAiB7E,IAAA;AAfG,IAAA,IAAc,UAAU,GAAA;AACpB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE;IACtE;AAEA,IAAA,IAAc,GAAG,GAAA;AACb,QAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU;AAChC,cAAE,IAAI,CAAC,UAAU,CAAC,CAAC;cACjB,MAAM,CAAC,IAAI,CAAC,UAAU,IAAI,SAAS,CAAC;IAC9C;AAEA,IAAA,IAAc,EAAE,GAAA;AACZ,QAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU;AAChC,cAAE,IAAI,CAAC,UAAU,CAAC,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content />
|
|
57
57
|
}
|
|
58
|
-
`, 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.23.0-canary.0a07bcd\"]){display:flex;padding:.375rem;max-inline-size:none}[tuiButtonCopy]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):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 }); }
|
|
59
59
|
}
|
|
60
60
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiButtonCopy, decorators: [{
|
|
61
61
|
type: Component,
|
|
@@ -69,7 +69,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
69
69
|
tuiButton: '',
|
|
70
70
|
type: 'button',
|
|
71
71
|
'(document:click.capture)': 'copy($event.target)',
|
|
72
|
-
}, styles: ["tui-hint:has([tuiButtonCopy]):where(*[data-tui-version=\"5.
|
|
72
|
+
}, styles: ["tui-hint:has([tuiButtonCopy]):where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){display:flex;padding:.375rem;max-inline-size:none}[tuiButtonCopy]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):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"] }]
|
|
73
73
|
}] });
|
|
74
74
|
|
|
75
75
|
class TuiCopyComponent {
|
|
@@ -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 {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,IAAI,EAAE,WAAW;AACpB,CAAA;;MCoCY,aAAa,CAAA;AAxB1B,IAAA,WAAA,GAAA;QAyBqB,IAAA,CAAA,EAAE,GAAG,gBAAgB,EAAE;AACvB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAClC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AAClC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC;QAE/C,IAAA,CAAA,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI;AACvD,cAAE,IAAI,CAAC,YAAY,CAAC;cAClB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;AAErB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;AACtB,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC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A,EAAA,CAAA;AACP,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,CA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B,EAAE,0BAA0B;AACpD,wBAAA,SAAS,EAAE,QAAQ;AACtB,qBAAA;AACJ,iBAAA;;;ACnCM,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa;;ACJzE;;ACAA;;AAEG;;;;"}
|
|
@@ -40,8 +40,12 @@ class TuiCounter extends TuiControl {
|
|
|
40
40
|
.subscribe((value) => this.onStep(value));
|
|
41
41
|
this.step = input(this.options.step);
|
|
42
42
|
this.size = input(this.options.size);
|
|
43
|
-
this.min = input(this.options.min
|
|
44
|
-
|
|
43
|
+
this.min = input(this.options.min, {
|
|
44
|
+
transform: (min) => min ?? this.options.min,
|
|
45
|
+
});
|
|
46
|
+
this.max = input(this.options.max, {
|
|
47
|
+
transform: (max) => max ?? this.options.max,
|
|
48
|
+
});
|
|
45
49
|
this.appearance = input(this.options.appearance);
|
|
46
50
|
}
|
|
47
51
|
onStep(step) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-counter.mjs","sources":["../../../projects/kit/components/counter/counter.options.ts","../../../projects/kit/components/counter/counter.component.ts","../../../projects/kit/components/counter/counter.template.html","../../../projects/kit/components/counter/taiga-ui-kit-components-counter.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiAppearanceOptions} from '@taiga-ui/core/directives/appearance';\nimport {type TuiSizeL, type TuiSizeXS} from '@taiga-ui/core/types';\n\nexport interface TuiCounterOptions extends TuiAppearanceOptions {\n size: TuiSizeL | TuiSizeXS;\n readonly icons: Readonly<{\n decrease: string;\n increase: string;\n }>;\n step: number;\n min: number;\n max: number;\n}\n\nexport const TUI_COUNTER_DEFAULT_OPTIONS: TuiCounterOptions = {\n appearance: 'primary',\n size: 'l',\n min: 0,\n max: Number.MAX_SAFE_INTEGER,\n step: 1,\n icons: {\n increase: '@tui.plus',\n decrease: '@tui.minus',\n },\n};\n\nexport const [TUI_COUNTER_OPTIONS, tuiCounterOptionsProvider] = tuiCreateOptions(\n TUI_COUNTER_DEFAULT_OPTIONS,\n);\n","import {ChangeDetectionStrategy, Component, computed, inject, input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiClamp, tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {type TuiSizeL, type TuiSizeXS} from '@taiga-ui/core/types';\nimport {TuiInputNumberStepService} from '@taiga-ui/kit/components/input-number';\nimport {TuiFade} from '@taiga-ui/kit/directives/fade';\nimport {TuiFluidTypography} from '@taiga-ui/kit/directives/fluid-typography';\n\nimport {TUI_COUNTER_OPTIONS} from './counter.options';\n\nconst LIMIT: Record<TuiSizeL | TuiSizeXS, number> = {\n l: 1.25,\n m: 1,\n s: 13 / 16,\n xs: 0.75,\n};\n\n@Component({\n selector: 'tui-counter',\n imports: [TuiButton, TuiFade, TuiFluidTypography],\n templateUrl: './counter.template.html',\n styleUrl: './counter.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiInputNumberStepService, tuiFallbackValueProvider(0)],\n host: {'[attr.data-appearance]': 'appearance()', '[attr.data-size]': 'size()'},\n})\nexport class TuiCounter extends TuiControl<number> {\n protected readonly hold = inject(TuiInputNumberStepService<number>);\n protected readonly options = inject(TUI_COUNTER_OPTIONS);\n protected readonly limit = computed(() => LIMIT[this.size()]);\n\n protected readonly $ = this.hold.steps$\n .pipe(takeUntilDestroyed())\n .subscribe((value) => this.onStep(value));\n\n public readonly step = input(this.options.step);\n public readonly size = input(this.options.size);\n public readonly min = input(this.options.min);\n public readonly max = input(this.options.max);\n public readonly appearance = input(this.options.appearance);\n\n protected onStep(step: number): void {\n this.onChange(tuiClamp(tuiSum(this.value(), step), this.min(), this.max()));\n }\n}\n","<button\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"value() - step() < min()\"\n [iconStart]=\"options.icons.decrease\"\n [size]=\"size()\"\n (click)=\"onStep(-step())\"\n (pointerdown.prevent)=\"hold.next(-step())\"\n>\n -\n</button>\n<output\n tuiFade\n class=\"t-content\"\n [tuiFluidTypography]=\"[0.625, limit()]\"\n>\n {{ value() }}\n <ng-content />\n</output>\n<button\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"value() + step() > max()\"\n [iconStart]=\"options.icons.increase\"\n [size]=\"size()\"\n (click)=\"onStep(step())\"\n (pointerdown.prevent)=\"hold.next(step())\"\n>\n +\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAeO,MAAM,2BAA2B,GAAsB;AAC1D,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,MAAM,CAAC,gBAAgB;AAC5B,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE;AACH,QAAA,QAAQ,EAAE,WAAW;AACrB,QAAA,QAAQ,EAAE,YAAY;AACzB,KAAA;;AAGE,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,GAAG,gBAAgB,CAC5E,2BAA2B;;ACf/B,MAAM,KAAK,GAAyC;AAChD,IAAA,CAAC,EAAE,IAAI;AACP,IAAA,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,EAAE,GAAG,EAAE;AACV,IAAA,EAAE,EAAE,IAAI;CACX;AAWK,MAAO,UAAW,SAAQ,UAAkB,CAAA;AATlD,IAAA,WAAA,GAAA;;AAUuB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,EAAC,yBAAiC,EAAC;AAChD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACrC,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAE1C,QAAA,IAAA,CAAA,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;aAC5B,IAAI,CAAC,kBAAkB,EAAE;AACzB,aAAA,SAAS,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC/B,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAC/B,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-counter.mjs","sources":["../../../projects/kit/components/counter/counter.options.ts","../../../projects/kit/components/counter/counter.component.ts","../../../projects/kit/components/counter/counter.template.html","../../../projects/kit/components/counter/taiga-ui-kit-components-counter.ts"],"sourcesContent":["import {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport {type TuiAppearanceOptions} from '@taiga-ui/core/directives/appearance';\nimport {type TuiSizeL, type TuiSizeXS} from '@taiga-ui/core/types';\n\nexport interface TuiCounterOptions extends TuiAppearanceOptions {\n size: TuiSizeL | TuiSizeXS;\n readonly icons: Readonly<{\n decrease: string;\n increase: string;\n }>;\n step: number;\n min: number;\n max: number;\n}\n\nexport const TUI_COUNTER_DEFAULT_OPTIONS: TuiCounterOptions = {\n appearance: 'primary',\n size: 'l',\n min: 0,\n max: Number.MAX_SAFE_INTEGER,\n step: 1,\n icons: {\n increase: '@tui.plus',\n decrease: '@tui.minus',\n },\n};\n\nexport const [TUI_COUNTER_OPTIONS, tuiCounterOptionsProvider] = tuiCreateOptions(\n TUI_COUNTER_DEFAULT_OPTIONS,\n);\n","import {ChangeDetectionStrategy, Component, computed, inject, input} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {tuiFallbackValueProvider} from '@taiga-ui/cdk/tokens';\nimport {tuiClamp, tuiSum} from '@taiga-ui/cdk/utils/math';\nimport {TuiButton} from '@taiga-ui/core/components/button';\nimport {type TuiSizeL, type TuiSizeXS} from '@taiga-ui/core/types';\nimport {TuiInputNumberStepService} from '@taiga-ui/kit/components/input-number';\nimport {TuiFade} from '@taiga-ui/kit/directives/fade';\nimport {TuiFluidTypography} from '@taiga-ui/kit/directives/fluid-typography';\n\nimport {TUI_COUNTER_OPTIONS} from './counter.options';\n\nconst LIMIT: Record<TuiSizeL | TuiSizeXS, number> = {\n l: 1.25,\n m: 1,\n s: 13 / 16,\n xs: 0.75,\n};\n\n@Component({\n selector: 'tui-counter',\n imports: [TuiButton, TuiFade, TuiFluidTypography],\n templateUrl: './counter.template.html',\n styleUrl: './counter.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiInputNumberStepService, tuiFallbackValueProvider(0)],\n host: {'[attr.data-appearance]': 'appearance()', '[attr.data-size]': 'size()'},\n})\nexport class TuiCounter extends TuiControl<number> {\n protected readonly hold = inject(TuiInputNumberStepService<number>);\n protected readonly options = inject(TUI_COUNTER_OPTIONS);\n protected readonly limit = computed(() => LIMIT[this.size()]);\n\n protected readonly $ = this.hold.steps$\n .pipe(takeUntilDestroyed())\n .subscribe((value) => this.onStep(value));\n\n public readonly step = input(this.options.step);\n public readonly size = input(this.options.size);\n public readonly min = input(this.options.min, {\n transform: (min: number | undefined) => min ?? this.options.min,\n });\n\n public readonly max = input(this.options.max, {\n transform: (max: number | undefined) => max ?? this.options.max,\n });\n\n public readonly appearance = input(this.options.appearance);\n\n protected onStep(step: number): void {\n this.onChange(tuiClamp(tuiSum(this.value(), step), this.min(), this.max()));\n }\n}\n","<button\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"value() - step() < min()\"\n [iconStart]=\"options.icons.decrease\"\n [size]=\"size()\"\n (click)=\"onStep(-step())\"\n (pointerdown.prevent)=\"hold.next(-step())\"\n>\n -\n</button>\n<output\n tuiFade\n class=\"t-content\"\n [tuiFluidTypography]=\"[0.625, limit()]\"\n>\n {{ value() }}\n <ng-content />\n</output>\n<button\n tuiIconButton\n type=\"button\"\n class=\"t-button\"\n [appearance]=\"appearance()\"\n [disabled]=\"value() + step() > max()\"\n [iconStart]=\"options.icons.increase\"\n [size]=\"size()\"\n (click)=\"onStep(step())\"\n (pointerdown.prevent)=\"hold.next(step())\"\n>\n +\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAeO,MAAM,2BAA2B,GAAsB;AAC1D,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,MAAM,CAAC,gBAAgB;AAC5B,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE;AACH,QAAA,QAAQ,EAAE,WAAW;AACrB,QAAA,QAAQ,EAAE,YAAY;AACzB,KAAA;;AAGE,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,GAAG,gBAAgB,CAC5E,2BAA2B;;ACf/B,MAAM,KAAK,GAAyC;AAChD,IAAA,CAAC,EAAE,IAAI;AACP,IAAA,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,EAAE,GAAG,EAAE;AACV,IAAA,EAAE,EAAE,IAAI;CACX;AAWK,MAAO,UAAW,SAAQ,UAAkB,CAAA;AATlD,IAAA,WAAA,GAAA;;AAUuB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,EAAC,yBAAiC,EAAC;AAChD,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACrC,QAAA,IAAA,CAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,KAAK,CAA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is not an option:
|
|
70
|
+
* the fake `NgControl` signal forms provide has only the `errors` getter,
|
|
71
|
+
* and calling the missing method throws
|
|
72
|
+
*/
|
|
73
|
+
const error = control?.errors?.[key];
|
|
74
|
+
return (error?.$implicit ||
|
|
75
|
+
/**
|
|
76
|
+
* Signal forms wrap a reactive error into `CompatValidationError`
|
|
77
|
+
* https://github.com/angular/angular/blob/f44bf0fe221288d03107cc78acfbe333a9a9b7b5/packages/forms/signals/src/compat/validation_errors.ts#L55-L65
|
|
78
|
+
*
|
|
79
|
+
* TODO(v6): drop the `context` branch after signal forms are fully supported (Angular >= 22)
|
|
80
|
+
*/
|
|
81
|
+
error?.context?.$implicit ||
|
|
82
|
+
[]);
|
|
83
|
+
}
|
|
67
84
|
function tuiFilesRejected(control) {
|
|
68
|
-
const format = control
|
|
69
|
-
const size = control
|
|
85
|
+
const format = getRejected(control, TUI_FORMAT_ERROR);
|
|
86
|
+
const size = getRejected(control, TUI_SIZE_ERROR);
|
|
70
87
|
return Array.from(new Set([...format, ...size]));
|
|
71
88
|
}
|
|
72
89
|
function tuiFilesAccepted(control) {
|
|
73
90
|
const value = control?.value || [];
|
|
74
91
|
const files = coerceArray(value);
|
|
75
|
-
const size = control
|
|
76
|
-
const format = control
|
|
92
|
+
const size = getRejected(control, TUI_SIZE_ERROR);
|
|
93
|
+
const format = getRejected(control, TUI_FORMAT_ERROR);
|
|
77
94
|
return files.filter((file) => !size.includes(file) && !format.includes(file));
|
|
78
95
|
}
|
|
79
96
|
function tuiFormatSize(units, size, locale) {
|
|
@@ -166,13 +183,13 @@ class TuiFilesComponent {
|
|
|
166
183
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
167
184
|
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
185
|
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.
|
|
186
|
+
], 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.23.0-canary.0a07bcd\"]){inline-size:100%;overflow:hidden;border-radius:var(--tui-radius-m)}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):empty:empty{display:none}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .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.23.0-canary.0a07bcd\"]) .t-button{inline-size:100%;border-radius:inherit}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .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.23.0-canary.0a07bcd\"]) .t-bottom_collapsed{box-shadow:var(--tui-shadow-popup);margin-block-start:-1.5rem}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .t-extra-items{inline-size:100%}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .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],label[tuiButton],a[tuiIconButton],button[tuiIconButton],label[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
187
|
}
|
|
171
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiFilesComponent, decorators: [{
|
|
172
189
|
type: Component,
|
|
173
190
|
args: [{ selector: 'tui-files', imports: [NgTemplateOutlet, TuiButton, TuiExpand, TuiGroup], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
174
191
|
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.
|
|
192
|
+
], 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.23.0-canary.0a07bcd\"]){inline-size:100%;overflow:hidden;border-radius:var(--tui-radius-m)}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):empty:empty{display:none}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .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.23.0-canary.0a07bcd\"]) .t-button{inline-size:100%;border-radius:inherit}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .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.23.0-canary.0a07bcd\"]) .t-bottom_collapsed{box-shadow:var(--tui-shadow-popup);margin-block-start:-1.5rem}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .t-extra-items{inline-size:100%}tui-files:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) .t-extra-items>*{border-radius:0!important}\n"] }]
|
|
176
193
|
}] });
|
|
177
194
|
|
|
178
195
|
class TuiInputFilesContent {
|
|
@@ -229,8 +246,10 @@ class TuiInputFilesValidator extends TuiValidator {
|
|
|
229
246
|
constructor() {
|
|
230
247
|
super(...arguments);
|
|
231
248
|
this.options = inject(TUI_INPUT_FILES_OPTIONS);
|
|
249
|
+
this.validator = Validators.nullValidator;
|
|
232
250
|
this.accept = this.options.accept;
|
|
233
251
|
this.maxFileSize = this.options.maxFileSize;
|
|
252
|
+
this.validate = (control) => this.validator(control);
|
|
234
253
|
}
|
|
235
254
|
ngOnChanges() {
|
|
236
255
|
this.update();
|
|
@@ -239,7 +258,7 @@ class TuiInputFilesValidator extends TuiValidator {
|
|
|
239
258
|
this.update();
|
|
240
259
|
}
|
|
241
260
|
update() {
|
|
242
|
-
this.
|
|
261
|
+
this.validator =
|
|
243
262
|
Validators.compose([
|
|
244
263
|
tuiCreateFileFormatValidator(this.accept),
|
|
245
264
|
tuiCreateFileSizeValidator(this.maxFileSize),
|
|
@@ -351,7 +370,7 @@ class TuiInputFiles {
|
|
|
351
370
|
this.files = dataTransfer?.files;
|
|
352
371
|
}
|
|
353
372
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputFiles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
354
|
-
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.
|
|
373
|
+
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.23.0-canary.0a07bcd", "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: `
|
|
355
374
|
<ng-content />
|
|
356
375
|
<span
|
|
357
376
|
*polymorpheusOutlet="
|
|
@@ -361,7 +380,7 @@ class TuiInputFiles {
|
|
|
361
380
|
>
|
|
362
381
|
{{ text }}
|
|
363
382
|
</span>
|
|
364
|
-
`, isInline: true, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.
|
|
383
|
+
`, isInline: true, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){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.23.0-canary.0a07bcd\"])[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.23.0-canary.0a07bcd\"])>:not(input){position:relative;pointer-events:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) 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.23.0-canary.0a07bcd\"]) input:disabled~*{opacity:var(--tui-disabled-opacity)}label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) input::-webkit-file-upload-button{display:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) input::file-selector-button{display:none}*:disabled label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){pointer-events:none}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){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.23.0-canary.0a07bcd\"]){border-style:solid}[tuiInputFiles]._dragged [tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){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.23.0-canary.0a07bcd\"]):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.23.0-canary.0a07bcd\"])[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.23.0-canary.0a07bcd\"]):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.23.0-canary.0a07bcd\"])[data-state=active]{background:var(--tui-background-neutral-1-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):disabled:not([data-state]),[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"])[data-state=disabled]{background:transparent;border-color:var(--tui-text-tertiary)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):focus-visible:not([data-focus=false]){border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"])[data-focus=true]{border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):not(:disabled)[data-mode~=invalid],[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):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 }); }
|
|
365
384
|
}
|
|
366
385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiInputFiles, decorators: [{
|
|
367
386
|
type: Component,
|
|
@@ -385,7 +404,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
385
404
|
'(dragleave)': 'onDrag(null)',
|
|
386
405
|
'(dragover.prevent.zoneless)': '0',
|
|
387
406
|
'(drop.prevent)': 'onDropped($event)',
|
|
388
|
-
}, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.
|
|
407
|
+
}, styles: ["label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){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.23.0-canary.0a07bcd\"])[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.23.0-canary.0a07bcd\"])>:not(input){position:relative;pointer-events:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) 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.23.0-canary.0a07bcd\"]) input:disabled~*{opacity:var(--tui-disabled-opacity)}label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) input::-webkit-file-upload-button{display:none}label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]) input::file-selector-button{display:none}*:disabled label[tuiInputFiles]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){pointer-events:none}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){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.23.0-canary.0a07bcd\"]){border-style:solid}[tuiInputFiles]._dragged [tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]){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.23.0-canary.0a07bcd\"]):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.23.0-canary.0a07bcd\"])[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.23.0-canary.0a07bcd\"]):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.23.0-canary.0a07bcd\"])[data-state=active]{background:var(--tui-background-neutral-1-hover)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):disabled:not([data-state]),[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"])[data-state=disabled]{background:transparent;border-color:var(--tui-text-tertiary)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):focus-visible:not([data-focus=false]){border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"])[data-focus=true]{border:.125rem solid var(--tui-border-focus)}[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):not(:disabled)[data-mode~=invalid],[tuiAppearance][data-appearance=file]:where(*[data-tui-version=\"5.23.0-canary.0a07bcd\"]):invalid:not(:disabled):not([data-mode]){border-color:var(--tui-status-negative)!important}\n"] }]
|
|
389
408
|
}] });
|
|
390
409
|
|
|
391
410
|
class TuiFileRejectedPipe {
|