@taiga-ui/cdk 4.52.0-canary.24b31eb → 4.52.0-canary.2fa3dd5
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/README.md +1 -1
- package/classes/control.d.ts +4 -6
- package/classes/index.d.ts +0 -1
- package/constants/index.d.ts +0 -1
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/date-time/time.d.ts +2 -2
- package/date-time/types.d.ts +0 -5
- package/directives/auto-focus/autofocus.directive.d.ts +2 -3
- package/directives/auto-focus/autofocus.options.d.ts +1 -1
- package/directives/click-outside/click-outside.directive.d.ts +2 -2
- package/directives/copy-processor/copy-processor.directive.d.ts +2 -2
- package/directives/droppable/droppable.directive.d.ts +4 -2
- package/directives/hovered/hovered.directive.d.ts +1 -2
- package/directives/index.d.ts +0 -1
- package/directives/media/media.directive.d.ts +8 -12
- package/directives/native-validator/native-validator.directive.d.ts +2 -2
- package/directives/obscured/obscured.directive.d.ts +4 -4
- package/directives/pan/pan.directive.d.ts +1 -2
- package/directives/platform/platform.directive.d.ts +2 -2
- package/directives/repeat-times/repeat-times.directive.d.ts +5 -4
- package/directives/resizer/resizer.directive.d.ts +3 -4
- package/directives/swipe/swipe.directive.d.ts +1 -2
- package/directives/value-changes/value-changes.directive.d.ts +2 -2
- package/fesm2022/taiga-ui-cdk-classes.mjs +6 -89
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +14 -7
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs +13 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-animated.mjs +0 -2
- package/fesm2022/taiga-ui-cdk-directives-animated.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +8 -11
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +5 -6
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-control.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-control.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +5 -8
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +7 -9
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-element.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-element.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-font-size.mjs +1 -4
- package/fesm2022/taiga-ui-cdk-directives-font-size.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +4 -7
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-item.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-item.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-let.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-let.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-media.mjs +30 -55
- package/fesm2022/taiga-ui-cdk-directives-media.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +5 -8
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +8 -14
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs +4 -6
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs +7 -10
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs +20 -21
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-resizer.mjs +14 -18
- package/fesm2022/taiga-ui-cdk-directives-resizer.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +4 -6
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +5 -6
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +8 -4
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-animation.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-animation.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-keys.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-keys.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-replace.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-replace.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-portals.mjs +127 -0
- package/fesm2022/taiga-ui-cdk-portals.mjs.map +1 -0
- package/fesm2022/taiga-ui-cdk-services.mjs +3 -43
- package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs +1 -23
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs +2 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +7 -11
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk.mjs +1 -0
- package/fesm2022/taiga-ui-cdk.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +13 -10
- package/pipes/obfuscate/obfuscate.options.d.ts +1 -1
- package/portals/directive.d.ts +11 -0
- package/portals/index.d.ts +4 -0
- package/portals/portal.d.ts +25 -0
- package/portals/portals.d.ts +12 -0
- package/portals/service.d.ts +15 -0
- package/schematics/collection.json +2 -1
- package/schematics/migrate-tui-let/index.js +4 -3
- package/schematics/migrate-tui-let/index.js.map +1 -1
- package/schematics/migrate-tui-let/schema.json +7 -0
- package/schematics/ng-add/constants/versions.d.ts +1 -1
- package/schematics/ng-update/interfaces/html-comment.d.ts +1 -1
- package/schematics/ng-update/interfaces/removable-input.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-attribute-to-directive.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-attribute.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-tag.d.ts +1 -1
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +1 -1
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js.map +1 -1
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js +1 -1
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js.map +1 -1
- package/schematics/ng-update/v4/steps/migrate-templates.d.ts +2 -2
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +1 -1
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js.map +1 -1
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +1 -1
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js.map +1 -1
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +1 -1
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js.map +1 -1
- package/schematics/ng-update/v5/index.js +5 -0
- package/schematics/ng-update/v5/index.js.map +1 -1
- package/schematics/ng-update/v5/steps/constants/functions.js +36 -0
- package/schematics/ng-update/v5/steps/constants/functions.js.map +1 -1
- package/schematics/ng-update/v5/steps/constants/html-comments.d.ts +2 -0
- package/schematics/ng-update/v5/steps/constants/html-comments.js +11 -0
- package/schematics/ng-update/v5/steps/constants/html-comments.js.map +1 -0
- package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.d.ts +2 -0
- package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.js +22 -0
- package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.js.map +1 -0
- package/schematics/ng-update/v5/steps/migrate-templates.d.ts +17 -0
- package/schematics/ng-update/v5/steps/migrate-templates.js +42 -0
- package/schematics/ng-update/v5/steps/migrate-templates.js.map +1 -0
- package/schematics/ng-update/v5/steps/templates/migrate-input-year.d.ts +8 -0
- package/schematics/ng-update/v5/steps/templates/migrate-input-year.js +52 -0
- package/schematics/ng-update/v5/steps/templates/migrate-input-year.js.map +1 -0
- package/schematics/utils/angular-json-manipulations.js +0 -2
- package/schematics/utils/angular-json-manipulations.js.map +1 -1
- package/schematics/utils/run-migration.d.ts +14 -0
- package/schematics/utils/run-migration.js +26 -0
- package/schematics/utils/run-migration.js.map +1 -0
- package/schematics/utils/templates/elements.js +4 -12
- package/schematics/utils/templates/elements.js.map +1 -1
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +3 -3
- package/schematics/utils/templates/ng-component-input-manipulations.js +1 -3
- package/schematics/utils/templates/ng-component-input-manipulations.js.map +1 -1
- package/services/index.d.ts +0 -1
- package/utils/browser/index.d.ts +0 -2
- package/utils/miscellaneous/index.d.ts +1 -1
- package/utils/miscellaneous/object-shallow-equals.d.ts +1 -0
- package/classes/portals.d.ts +0 -33
- package/constants/allow-signal-writes.d.ts +0 -2
- package/directives/popover/index.d.ts +0 -1
- package/directives/popover/popover.directive.d.ts +0 -14
- package/fesm2022/taiga-ui-cdk-directives-popover.mjs +0 -32
- package/fesm2022/taiga-ui-cdk-directives-popover.mjs.map +0 -1
- package/services/popover.service.d.ts +0 -25
- package/utils/browser/is-apple.d.ts +0 -11
- package/utils/browser/is-ios.d.ts +0 -6
- package/utils/miscellaneous/directive-listener.d.ts +0 -9
package/README.md
CHANGED
package/classes/control.d.ts
CHANGED
|
@@ -8,30 +8,28 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
export declare abstract class TuiControl<T> implements ControlValueAccessor {
|
|
9
9
|
private readonly fallback;
|
|
10
10
|
private readonly refresh$;
|
|
11
|
-
private readonly pseudoInvalid;
|
|
12
11
|
private readonly internal;
|
|
13
12
|
protected readonly control: NgControl;
|
|
14
13
|
protected readonly cdr: ChangeDetectorRef;
|
|
15
14
|
protected transformer: TuiValueTransformer<any, any>;
|
|
16
15
|
readonly value: import("@angular/core").Signal<T>;
|
|
17
|
-
readonly readOnly: import("@angular/core").
|
|
16
|
+
readonly readOnly: import("@angular/core").InputSignal<boolean>;
|
|
17
|
+
readonly pseudoInvalid: import("@angular/core").InputSignal<boolean | null>;
|
|
18
18
|
readonly touched: import("@angular/core").WritableSignal<boolean>;
|
|
19
19
|
readonly status: import("@angular/core").WritableSignal<FormControlStatus | undefined>;
|
|
20
20
|
readonly disabled: import("@angular/core").Signal<boolean>;
|
|
21
21
|
readonly interactive: import("@angular/core").Signal<boolean>;
|
|
22
22
|
readonly invalid: import("@angular/core").Signal<boolean>;
|
|
23
|
-
readonly mode: import("@angular/core").Signal<"
|
|
23
|
+
readonly mode: import("@angular/core").Signal<"invalid" | "readonly" | "valid">;
|
|
24
24
|
onTouched: (...args: any[]) => void;
|
|
25
25
|
onChange: (value: T) => void;
|
|
26
26
|
constructor();
|
|
27
|
-
set readOnlySetter(readOnly: boolean);
|
|
28
|
-
set invalidSetter(invalid: boolean | null);
|
|
29
27
|
registerOnChange(onChange: (value: unknown) => void): void;
|
|
30
28
|
registerOnTouched(onTouched: () => void): void;
|
|
31
29
|
setDisabledState(): void;
|
|
32
30
|
writeValue(value: T | null): void;
|
|
33
31
|
private update;
|
|
34
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiControl<any>, never>;
|
|
35
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiControl<any>, never, never, { "
|
|
33
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiControl<any>, never, never, { "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "pseudoInvalid": { "alias": "invalid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
36
34
|
}
|
|
37
35
|
export declare function tuiAsControl<T>(control: Type<TuiControl<T>>): Provider;
|
package/classes/index.d.ts
CHANGED
package/constants/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Array of icons used in taiga-ui components
|
|
6
6
|
*/
|
|
7
|
-
export declare const TUI_USED_ICONS: readonly ["@tui.mir", "@tui.visa", "@tui.electron", "@tui.search", "@tui.sun", "@tui.moon", "@tui.code", "@tui.menu", "@tui.copy", "@tui.check", "@tui.link", "@tui.external-link", "@tui.languages", "@tui.shrink", "@tui.expand", "@tui.a-large-small", "@tui.arrow-right-left", "@tui.eye-off", "@tui.eye", "@tui.grip-vertical", "@tui.chevron-up", "@tui.chevron-down", "@tui.chevrons-up-down", "@tui.info", "@tui.circle-check", "@tui.circle-x", "@tui.circle-alert", "@tui.circle-help", "@tui.x", "@tui.chevron-right", "@tui.ellipsis", "@tui.chevron-left", "@tui.clock", "@tui.trash", "@tui.minus", "@tui.file", "@tui.calendar", "@tui.plus", "@tui.heart", "@tui.heart-filled", "@tui.star", "@tui.rotate-ccw-square", "@tui.arrow-left", "@tui.arrow-right", "@tui.minimize", "@tui.filter", "@tui.layout-grid"];
|
|
7
|
+
export declare const TUI_USED_ICONS: readonly ["@tui.mir", "@tui.visa", "@tui.electron", "@img.mastercard", "@img.maestro", "@img.amex", "@img.diners-club", "@img.discover", "@img.humo", "@img.jcb", "@img.ru-pay", "@img.union-pay", "@img.uzcard", "@img.verve", "@tui.search", "@tui.sun", "@tui.moon", "@tui.code", "@tui.menu", "@tui.copy", "@tui.check", "@tui.link", "@tui.external-link", "@tui.languages", "@tui.shrink", "@tui.expand", "@tui.a-large-small", "@tui.arrow-right-left", "@tui.eye-off", "@tui.eye", "@tui.grip-vertical", "@tui.chevron-up", "@tui.chevron-down", "@tui.chevrons-up-down", "@tui.info", "@tui.circle-check", "@tui.circle-x", "@tui.circle-alert", "@tui.circle-help", "@tui.x", "@tui.chevron-right", "@tui.ellipsis", "@tui.chevron-left", "@tui.clock", "@tui.trash", "@tui.minus", "@tui.file", "@tui.calendar", "@tui.plus", "@tui.heart", "@tui.heart-filled", "@tui.star", "@tui.rotate-ccw-square", "@tui.arrow-left", "@tui.arrow-right", "@tui.minimize", "@tui.filter", "@tui.layout-grid"];
|
package/constants/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TUI_VERSION = "4.52.0-canary.
|
|
1
|
+
export declare const TUI_VERSION = "4.52.0-canary.2fa3dd5";
|
package/constants/version.js
CHANGED
package/date-time/time.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TuiTimeLike
|
|
1
|
+
import { type TuiTimeLike } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Immutable time object with hours, minutes, seconds and ms
|
|
4
4
|
*/
|
|
@@ -42,7 +42,7 @@ export declare class TuiTime implements TuiTimeLike {
|
|
|
42
42
|
/**
|
|
43
43
|
* Converts TuiTime to string
|
|
44
44
|
*/
|
|
45
|
-
toString(mode?:
|
|
45
|
+
toString(mode?: 'HH AA' | 'HH:MM AA' | 'HH:MM:SS AA' | 'HH:MM:SS.MSS AA' | 'HH:MM:SS.MSS' | 'HH:MM:SS' | 'HH:MM' | 'HH' | 'MM:SS.MSS' | 'MM:SS' | 'SS.MSS'): string;
|
|
46
46
|
valueOf(): number;
|
|
47
47
|
/**
|
|
48
48
|
* Returns the primitive value of the given Date object.
|
package/date-time/types.d.ts
CHANGED
|
@@ -5,11 +5,6 @@
|
|
|
5
5
|
* TODO: Change to be MaskitoDateMode compatible in v5
|
|
6
6
|
*/
|
|
7
7
|
export type TuiDateMode = 'DMY' | 'MDY' | 'YMD';
|
|
8
|
-
/**
|
|
9
|
-
* TODO(v5): replace all its usage by MaskitoTimeMode and delete it
|
|
10
|
-
* @deprecated use `MaskitoTimeMode` (from `@maskito/kit`) instead
|
|
11
|
-
*/
|
|
12
|
-
export type TuiTimeMode = 'HH AA' | 'HH:MM AA' | 'HH:MM:SS AA' | 'HH:MM:SS.MSS AA' | 'HH:MM:SS.MSS' | 'HH:MM:SS' | 'HH:MM' | 'HH' | 'MM:SS.MSS' | 'MM:SS' | 'MM.SS.MSS' | 'SS.MSS';
|
|
13
8
|
/**
|
|
14
9
|
* Optionally has year and/or month and/or day
|
|
15
10
|
*/
|
|
@@ -5,10 +5,9 @@ export declare class TuiAutoFocus implements AfterViewInit {
|
|
|
5
5
|
private readonly handler;
|
|
6
6
|
private readonly options;
|
|
7
7
|
private readonly destroyRef;
|
|
8
|
-
autoFocus: BooleanInput
|
|
8
|
+
readonly autoFocus: import("@angular/core").InputSignalWithTransform<BooleanInput, any>;
|
|
9
9
|
ngAfterViewInit(): void;
|
|
10
10
|
focus(): void;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiAutoFocus, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiAutoFocus, "[tuiAutoFocus]", never, { "autoFocus": { "alias": "tuiAutoFocus"; "required": false; }; }, {}, never, never, true, never>;
|
|
13
|
-
static ngAcceptInputType_autoFocus: any;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiAutoFocus, "[tuiAutoFocus]", never, { "autoFocus": { "alias": "tuiAutoFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
14
13
|
}
|
|
@@ -14,6 +14,6 @@ export declare const TUI_AUTOFOCUS_OPTIONS: InjectionToken<TuiAutofocusOptions>,
|
|
|
14
14
|
export declare const TUI_AUTOFOCUS_HANDLER: InjectionToken<TuiAutofocusHandler>;
|
|
15
15
|
export declare const TUI_AUTOFOCUS_PROVIDERS: {
|
|
16
16
|
provide: InjectionToken<TuiAutofocusHandler>;
|
|
17
|
-
deps: (InjectionToken<
|
|
17
|
+
deps: (InjectionToken<TuiAutofocusOptions> | typeof ElementRef | typeof Renderer2 | typeof NgZone)[];
|
|
18
18
|
useFactory: (el: ElementRef<HTMLElement>, animationFrame$: Observable<number>, renderer: Renderer2, zone: NgZone, win: Window, isIos: boolean, options: TuiAutofocusOptions) => TuiDefaultAutofocusHandler | TuiIosAutofocusHandler;
|
|
19
19
|
}[];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type Observable } from 'rxjs';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
/**
|
|
4
3
|
* @deprecated use {@link TuiActiveZone} instead
|
|
@@ -7,7 +6,8 @@ export declare class TuiClickOutside {
|
|
|
7
6
|
private readonly zone;
|
|
8
7
|
private readonly doc;
|
|
9
8
|
private readonly el;
|
|
10
|
-
readonly tuiClickOutside
|
|
9
|
+
private readonly tuiClickOutside$;
|
|
10
|
+
readonly tuiClickOutside: import("@angular/core").OutputRef<unknown>;
|
|
11
11
|
private isOutside;
|
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiClickOutside, never>;
|
|
13
13
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiClickOutside, "[tuiClickOutside]", never, {}, { "tuiClickOutside": "tuiClickOutside"; }, never, never, true, never>;
|
|
@@ -2,8 +2,8 @@ import { type TuiStringHandler } from '@taiga-ui/cdk/types';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class TuiCopyProcessor {
|
|
4
4
|
private readonly win;
|
|
5
|
-
tuiCopyProcessor: TuiStringHandler<string
|
|
5
|
+
readonly tuiCopyProcessor: import("@angular/core").InputSignal<TuiStringHandler<string>>;
|
|
6
6
|
protected onCopy(event: ClipboardEvent): void;
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiCopyProcessor, never>;
|
|
8
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiCopyProcessor, "[tuiCopyProcessor]", never, { "tuiCopyProcessor": { "alias": "tuiCopyProcessor"; "required": false; }; }, {}, never, never, true, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiCopyProcessor, "[tuiCopyProcessor]", never, { "tuiCopyProcessor": { "alias": "tuiCopyProcessor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
9
9
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class TuiDroppable {
|
|
3
3
|
private readonly el;
|
|
4
|
-
readonly tuiDroppableDropped
|
|
5
|
-
readonly tuiDroppableDragOverChange
|
|
4
|
+
private readonly tuiDroppableDropped$;
|
|
5
|
+
private readonly tuiDroppableDragOverChange$;
|
|
6
|
+
readonly tuiDroppableDropped: import("@angular/core").OutputRef<DataTransfer>;
|
|
7
|
+
readonly tuiDroppableDragOverChange: import("@angular/core").OutputRef<DataTransfer | null>;
|
|
6
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiDroppable, never>;
|
|
7
9
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiDroppable, "[tuiDroppableDropped], [tuiDroppableDragOverChange]", never, {}, { "tuiDroppableDropped": "tuiDroppableDropped"; "tuiDroppableDragOverChange": "tuiDroppableDragOverChange"; }, never, never, true, never>;
|
|
8
10
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { TuiHoveredService } from './hovered.service';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class TuiHovered {
|
|
4
|
-
readonly tuiHoveredChange:
|
|
3
|
+
readonly tuiHoveredChange: import("@angular/core").OutputRef<boolean>;
|
|
5
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHovered, never>;
|
|
6
5
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiHovered, "[tuiHoveredChange]", never, {}, { "tuiHoveredChange": "tuiHoveredChange"; }, never, never, true, never>;
|
|
7
6
|
}
|
package/directives/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export * from '@taiga-ui/cdk/directives/native-validator';
|
|
|
17
17
|
export * from '@taiga-ui/cdk/directives/obscured';
|
|
18
18
|
export * from '@taiga-ui/cdk/directives/pan';
|
|
19
19
|
export * from '@taiga-ui/cdk/directives/platform';
|
|
20
|
-
export * from '@taiga-ui/cdk/directives/popover';
|
|
21
20
|
export * from '@taiga-ui/cdk/directives/repeat-times';
|
|
22
21
|
export * from '@taiga-ui/cdk/directives/resizer';
|
|
23
22
|
export * from '@taiga-ui/cdk/directives/swipe';
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class TuiMedia {
|
|
4
3
|
private readonly el;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
set paused(paused: boolean);
|
|
13
|
-
get currentTime(): number;
|
|
14
|
-
get paused(): boolean;
|
|
4
|
+
protected readonly setElCurrentTime: import("@angular/core").EffectRef;
|
|
5
|
+
protected readonly setElPlaybackRate: import("@angular/core").EffectRef;
|
|
6
|
+
protected readonly setElPaused: import("@angular/core").EffectRef;
|
|
7
|
+
readonly playbackRate: import("@angular/core").InputSignal<number>;
|
|
8
|
+
readonly volume: import("@angular/core").ModelSignal<number>;
|
|
9
|
+
readonly currentTime: import("@angular/core").ModelSignal<number>;
|
|
10
|
+
readonly paused: import("@angular/core").ModelSignal<boolean>;
|
|
15
11
|
protected onPausedChange(paused: boolean): void;
|
|
16
12
|
protected onVolumeChange(): void;
|
|
17
13
|
protected onCurrentTimeChange(): void;
|
|
18
14
|
private updatePlaybackRate;
|
|
19
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiMedia, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiMedia, "video[tuiMedia], audio[tuiMedia]", ["tuiMedia"], { "
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiMedia, "video[tuiMedia], audio[tuiMedia]", ["tuiMedia"], { "playbackRate": { "alias": "playbackRate"; "required": false; "isSignal": true; }; "volume": { "alias": "volume"; "required": false; "isSignal": true; }; "currentTime": { "alias": "currentTime"; "required": false; "isSignal": true; }; "paused": { "alias": "paused"; "required": false; "isSignal": true; }; }, { "volume": "volumeChange"; "currentTime": "currentTimeChange"; "paused": "pausedChange"; }, never, never, true, never>;
|
|
21
17
|
}
|
|
@@ -4,9 +4,9 @@ export declare class TuiNativeValidator implements Validator {
|
|
|
4
4
|
private readonly el;
|
|
5
5
|
private readonly control$;
|
|
6
6
|
protected readonly sub: import("rxjs").Subscription;
|
|
7
|
-
tuiNativeValidator: string
|
|
7
|
+
readonly tuiNativeValidator: import("@angular/core").InputSignal<string>;
|
|
8
8
|
validate(control: AbstractControl): null;
|
|
9
9
|
protected handleValidation(): void;
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiNativeValidator, never>;
|
|
11
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNativeValidator, "[tuiNativeValidator]", never, { "tuiNativeValidator": { "alias": "tuiNativeValidator"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiNativeValidator, "[tuiNativeValidator]", never, { "tuiNativeValidator": { "alias": "tuiNativeValidator"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
12
12
|
}
|
|
@@ -4,10 +4,10 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class TuiObscured {
|
|
6
6
|
private readonly activeZone;
|
|
7
|
-
private readonly enabled$;
|
|
8
7
|
private readonly obscured$;
|
|
9
|
-
readonly
|
|
10
|
-
|
|
8
|
+
readonly tuiObscuredEnabled: import("@angular/core").InputSignal<boolean | undefined>;
|
|
9
|
+
readonly tuiObscured$: import("rxjs").Observable<boolean>;
|
|
10
|
+
readonly tuiObscured: import("@angular/core").OutputRef<boolean>;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiObscured, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiObscured, "[tuiObscured]", never, { "tuiObscuredEnabled": { "alias": "tuiObscuredEnabled"; "required": false; }; }, { "tuiObscured": "tuiObscured"; }, never, never, true, never>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiObscured, "[tuiObscured]", never, { "tuiObscuredEnabled": { "alias": "tuiObscuredEnabled"; "required": false; "isSignal": true; }; }, { "tuiObscured": "tuiObscured"; }, never, never, true, never>;
|
|
13
13
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { TuiPanService } from './pan.service';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class TuiPan {
|
|
4
|
-
readonly tuiPan:
|
|
3
|
+
readonly tuiPan: import("@angular/core").OutputRef<readonly [number, number]>;
|
|
5
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPan, never>;
|
|
6
5
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiPan, "[tuiPan]", never, {}, { "tuiPan": "tuiPan"; }, never, never, true, never>;
|
|
7
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class TuiPlatform {
|
|
3
|
-
tuiPlatform: "android" | "ios" | "web"
|
|
3
|
+
readonly tuiPlatform: import("@angular/core").InputSignal<"android" | "ios" | "web">;
|
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPlatform, never>;
|
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiPlatform, "[tuiPlatform]", never, { "tuiPlatform": { "alias": "tuiPlatform"; "required": false; }; }, {}, never, never, true, never>;
|
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiPlatform, "[tuiPlatform]", never, { "tuiPlatform": { "alias": "tuiPlatform"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
6
6
|
}
|
|
@@ -12,11 +12,12 @@ export declare class TuiRepeatTimesContext implements TuiContext<number> {
|
|
|
12
12
|
* {@link TuiRepeatTimesContext.$implicit index} of a template instance.
|
|
13
13
|
*/
|
|
14
14
|
export declare class TuiRepeatTimes {
|
|
15
|
-
private readonly
|
|
16
|
-
private readonly
|
|
17
|
-
|
|
15
|
+
private readonly vcr;
|
|
16
|
+
private readonly template;
|
|
17
|
+
readonly tuiRepeatTimesOf: import("@angular/core").InputSignal<number>;
|
|
18
|
+
protected readonly setCount: import("@angular/core").EffectRef;
|
|
18
19
|
private addContainers;
|
|
19
20
|
private removeContainers;
|
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiRepeatTimes, never>;
|
|
21
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiRepeatTimes, "[tuiRepeatTimes][tuiRepeatTimesOf]", never, { "tuiRepeatTimesOf": { "alias": "tuiRepeatTimesOf"; "required":
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiRepeatTimes, "[tuiRepeatTimes][tuiRepeatTimesOf]", never, { "tuiRepeatTimesOf": { "alias": "tuiRepeatTimesOf"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
22
23
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class TuiResizer {
|
|
4
3
|
private readonly resizable;
|
|
@@ -6,13 +5,13 @@ export declare class TuiResizer {
|
|
|
6
5
|
protected y: number;
|
|
7
6
|
protected width: number;
|
|
8
7
|
protected height: number;
|
|
9
|
-
tuiResizer: readonly [x: number, y: number]
|
|
10
|
-
readonly tuiSizeChange:
|
|
8
|
+
readonly tuiResizer: import("@angular/core").InputSignal<readonly [x: number, y: number]>;
|
|
9
|
+
readonly tuiSizeChange: import("@angular/core").OutputEmitterRef<readonly [x: number, y: number]>;
|
|
11
10
|
protected get cursor(): string;
|
|
12
11
|
protected onPointerDown(x: number, y: number): void;
|
|
13
12
|
protected onPointerMove({ x, y, buttons }: PointerEvent): void;
|
|
14
13
|
protected onPointerUp(): void;
|
|
15
14
|
protected onMove(x: number, y: number): void;
|
|
16
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiResizer, never>;
|
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiResizer, "[tuiResizer]", never, { "tuiResizer": { "alias": "tuiResizer"; "required": false; }; }, { "tuiSizeChange": "tuiSizeChange"; }, never, never, true, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiResizer, "[tuiResizer]", never, { "tuiResizer": { "alias": "tuiResizer"; "required": false; "isSignal": true; }; }, { "tuiSizeChange": "tuiSizeChange"; }, never, never, true, never>;
|
|
18
17
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { TuiSwipeService } from './swipe.service';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class TuiSwipe {
|
|
4
|
-
readonly tuiSwipe:
|
|
3
|
+
readonly tuiSwipe: import("@angular/core").OutputRef<import("@taiga-ui/cdk/directives/swipe").TuiSwipeEvent>;
|
|
5
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiSwipe, never>;
|
|
6
5
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiSwipe, "[tuiSwipe]", never, {}, { "tuiSwipe": "tuiSwipe"; }, never, never, true, never>;
|
|
7
6
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type DoCheck } from '@angular/core';
|
|
2
|
-
import { type Observable } from 'rxjs';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
export declare class TuiValueChanges<T> implements DoCheck {
|
|
5
4
|
private readonly container;
|
|
6
5
|
private readonly control;
|
|
7
6
|
private readonly refresh$;
|
|
8
|
-
readonly tuiValueChanges
|
|
7
|
+
private readonly tuiValueChanges$;
|
|
8
|
+
readonly tuiValueChanges: import("@angular/core").OutputRef<T>;
|
|
9
9
|
ngDoCheck(): void;
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiValueChanges<any>, never>;
|
|
11
11
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiValueChanges<any>, "[tuiValueChanges]", never, {}, { "tuiValueChanges": "tuiValueChanges"; }, never, never, true, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, ChangeDetectorRef, computed,
|
|
2
|
+
import { inject, signal, ChangeDetectorRef, computed, input, untracked, Directive } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { NgControl, NgModel } from '@angular/forms';
|
|
5
5
|
import { EMPTY_FUNCTION } from '@taiga-ui/cdk/constants';
|
|
@@ -38,13 +38,13 @@ class TuiControl {
|
|
|
38
38
|
constructor() {
|
|
39
39
|
this.fallback = inject(TUI_FALLBACK_VALUE, FLAGS);
|
|
40
40
|
this.refresh$ = new Subject();
|
|
41
|
-
this.pseudoInvalid = signal(null);
|
|
42
41
|
this.internal = signal(this.fallback);
|
|
43
42
|
this.control = inject(NgControl, { self: true });
|
|
44
43
|
this.cdr = inject(ChangeDetectorRef);
|
|
45
44
|
this.transformer = inject(TuiValueTransformer, FLAGS) ?? TUI_IDENTITY_VALUE_TRANSFORMER;
|
|
46
45
|
this.value = computed(() => this.internal() ?? this.fallback);
|
|
47
|
-
this.readOnly =
|
|
46
|
+
this.readOnly = input(false);
|
|
47
|
+
this.pseudoInvalid = input(null, { alias: 'invalid' });
|
|
48
48
|
this.touched = signal(false);
|
|
49
49
|
this.status = signal(undefined);
|
|
50
50
|
this.disabled = computed(() => this.status() === 'DISABLED');
|
|
@@ -62,12 +62,6 @@ class TuiControl {
|
|
|
62
62
|
.pipe(delay(0), startWith(null), map(() => this.control.control), filter(Boolean), distinctUntilChanged(), switchMap((c) => merge(c.valueChanges, c.statusChanges, c.events || EMPTY).pipe(startWith(null))), takeUntilDestroyed())
|
|
63
63
|
.subscribe(() => this.update());
|
|
64
64
|
}
|
|
65
|
-
set readOnlySetter(readOnly) {
|
|
66
|
-
this.readOnly.set(readOnly);
|
|
67
|
-
}
|
|
68
|
-
set invalidSetter(invalid) {
|
|
69
|
-
this.pseudoInvalid.set(invalid);
|
|
70
|
-
}
|
|
71
65
|
registerOnChange(onChange) {
|
|
72
66
|
this.refresh$.next();
|
|
73
67
|
this.onChange = (value) => {
|
|
@@ -101,92 +95,15 @@ class TuiControl {
|
|
|
101
95
|
this.cdr.markForCheck();
|
|
102
96
|
}
|
|
103
97
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
104
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
98
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiControl, isStandalone: true, inputs: { readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, pseudoInvalid: { classPropertyName: "pseudoInvalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
105
99
|
}
|
|
106
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiControl, decorators: [{
|
|
107
101
|
type: Directive
|
|
108
|
-
}], ctorParameters: () => []
|
|
109
|
-
type: Input,
|
|
110
|
-
args: ['readOnly']
|
|
111
|
-
}], invalidSetter: [{
|
|
112
|
-
type: Input,
|
|
113
|
-
args: ['invalid']
|
|
114
|
-
}] } });
|
|
102
|
+
}], ctorParameters: () => [] });
|
|
115
103
|
function tuiAsControl(control) {
|
|
116
104
|
return tuiProvide(TuiControl, control);
|
|
117
105
|
}
|
|
118
106
|
|
|
119
|
-
/// <reference types="@taiga-ui/tsconfig/ng-dev-mode" />
|
|
120
|
-
/**
|
|
121
|
-
* Abstract class for host element for dynamically created portals.
|
|
122
|
-
*/
|
|
123
|
-
class TuiPortals {
|
|
124
|
-
constructor() {
|
|
125
|
-
this.injector = inject(INJECTOR);
|
|
126
|
-
this.nothing = inject(TuiPortalService).attach(this);
|
|
127
|
-
}
|
|
128
|
-
addComponentChild(component) {
|
|
129
|
-
const injector = component.createInjector(this.injector);
|
|
130
|
-
const ref = this.vcr.createComponent(component.component, { injector });
|
|
131
|
-
ref.changeDetectorRef.detectChanges();
|
|
132
|
-
return ref;
|
|
133
|
-
}
|
|
134
|
-
addTemplateChild(templateRef, context) {
|
|
135
|
-
return this.vcr.createEmbeddedView(templateRef, context);
|
|
136
|
-
}
|
|
137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPortals, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
138
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiPortals, isStandalone: true, viewQueries: [{ propertyName: "vcr", first: true, predicate: ["viewContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0 }); }
|
|
139
|
-
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPortals, decorators: [{
|
|
141
|
-
type: Directive
|
|
142
|
-
}], propDecorators: { vcr: [{
|
|
143
|
-
type: ViewChild,
|
|
144
|
-
args: ['viewContainer', { read: ViewContainerRef }]
|
|
145
|
-
}] } });
|
|
146
|
-
/**
|
|
147
|
-
* Abstract service for displaying portals
|
|
148
|
-
*/
|
|
149
|
-
class TuiPortalService {
|
|
150
|
-
attach(host) {
|
|
151
|
-
this.host = host;
|
|
152
|
-
}
|
|
153
|
-
add(component) {
|
|
154
|
-
return this.safeHost.addComponentChild(component);
|
|
155
|
-
}
|
|
156
|
-
remove({ hostView }) {
|
|
157
|
-
this.removeTemplate(hostView);
|
|
158
|
-
}
|
|
159
|
-
addTemplate(templateRef, context) {
|
|
160
|
-
return this.safeHost.addTemplateChild(templateRef, context);
|
|
161
|
-
}
|
|
162
|
-
removeTemplate(viewRef) {
|
|
163
|
-
if (!viewRef.destroyed) {
|
|
164
|
-
viewRef.destroy();
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
get safeHost() {
|
|
168
|
-
if (!this.host) {
|
|
169
|
-
throw new TuiNoHostException();
|
|
170
|
-
}
|
|
171
|
-
return this.host;
|
|
172
|
-
}
|
|
173
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPortalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
174
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPortalService }); }
|
|
175
|
-
}
|
|
176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPortalService, decorators: [{
|
|
177
|
-
type: Injectable
|
|
178
|
-
}] });
|
|
179
|
-
function tuiAsPortal(portal) {
|
|
180
|
-
return tuiProvide(TuiPortalService, portal);
|
|
181
|
-
}
|
|
182
|
-
class TuiNoHostException extends Error {
|
|
183
|
-
constructor() {
|
|
184
|
-
super(ngDevMode
|
|
185
|
-
? 'Portals cannot be used without TuiPortalHostComponent; perhaps you forgot to wrap your application with tui-root.'
|
|
186
|
-
: '');
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
107
|
class TuiValidationError {
|
|
191
108
|
constructor(message, context = {}) {
|
|
192
109
|
this.message = message;
|
|
@@ -198,5 +115,5 @@ class TuiValidationError {
|
|
|
198
115
|
* Generated bundle index. Do not edit.
|
|
199
116
|
*/
|
|
200
117
|
|
|
201
|
-
export { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl,
|
|
118
|
+
export { TUI_IDENTITY_VALUE_TRANSFORMER, TuiControl, TuiNonNullableValueTransformer, TuiValidationError, TuiValueTransformer, tuiAsControl, tuiValueTransformerFrom };
|
|
202
119
|
//# sourceMappingURL=taiga-ui-cdk-classes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-classes.mjs","sources":["../../../projects/cdk/classes/value-transformer.ts","../../../projects/cdk/classes/control.ts","../../../projects/cdk/classes/portals.ts","../../../projects/cdk/classes/validation-error.ts","../../../projects/cdk/classes/taiga-ui-cdk-classes.ts"],"sourcesContent":["import {type FactoryProvider, inject, type ProviderToken} from '@angular/core';\nimport {identity} from 'rxjs';\n\nexport abstract class TuiValueTransformer<From, To = unknown> {\n public abstract toControlValue(componentValue: From): To;\n public abstract fromControlValue(controlValue: To): From;\n}\n\nexport function tuiValueTransformerFrom<\n T extends {valueTransformer: TuiValueTransformer<unknown>},\n>(token: ProviderToken<T>): FactoryProvider {\n return {\n provide: TuiValueTransformer,\n useFactory: () => inject(token).valueTransformer,\n };\n}\n\nexport class TuiNonNullableValueTransformer<T> extends TuiValueTransformer<T | null, T> {\n private prevValue!: T;\n\n public fromControlValue(value: T): T {\n this.prevValue = value;\n\n return value;\n }\n\n public toControlValue(value: T | null): T {\n this.prevValue = value ?? this.prevValue;\n\n return this.prevValue;\n }\n}\n\nexport const TUI_IDENTITY_VALUE_TRANSFORMER: TuiValueTransformer<any, any> = {\n fromControlValue: identity,\n toControlValue: identity,\n};\n","import {\n ChangeDetectorRef,\n computed,\n Directive,\n inject,\n Input,\n type Provider,\n signal,\n type Type,\n untracked,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {\n type ControlValueAccessor,\n type FormControlStatus,\n NgControl,\n NgModel,\n} from '@angular/forms';\nimport {EMPTY_FUNCTION} from '@taiga-ui/cdk/constants';\nimport {TUI_FALLBACK_VALUE} from '@taiga-ui/cdk/tokens';\nimport {tuiProvide} from '@taiga-ui/cdk/utils';\nimport {\n delay,\n distinctUntilChanged,\n EMPTY,\n filter,\n map,\n merge,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport {TUI_IDENTITY_VALUE_TRANSFORMER, TuiValueTransformer} from './value-transformer';\n\nconst FLAGS = {self: true, optional: true};\n\n/**\n * Basic ControlValueAccessor class to build form components upon\n */\n@Directive()\nexport abstract class TuiControl<T> implements ControlValueAccessor {\n private readonly fallback = inject(TUI_FALLBACK_VALUE, FLAGS) as T;\n private readonly refresh$ = new Subject<void>();\n private readonly pseudoInvalid = signal<boolean | null>(null);\n private readonly internal = signal(this.fallback);\n\n protected readonly control = inject(NgControl, {self: true});\n protected readonly cdr = inject(ChangeDetectorRef);\n protected transformer =\n inject(TuiValueTransformer, FLAGS) ?? TUI_IDENTITY_VALUE_TRANSFORMER;\n\n public readonly value = computed(() => this.internal() ?? this.fallback);\n public readonly readOnly = signal(false);\n public readonly touched = signal(false);\n public readonly status = signal<FormControlStatus | undefined>(undefined);\n public readonly disabled = computed(() => this.status() === 'DISABLED');\n public readonly interactive = computed(() => !this.disabled() && !this.readOnly());\n public readonly invalid = computed(() =>\n this.pseudoInvalid() !== null\n ? !!this.pseudoInvalid() && this.interactive()\n : this.interactive() && this.touched() && this.status() === 'INVALID',\n );\n\n public readonly mode = computed(() =>\n // eslint-disable-next-line no-nested-ternary\n this.readOnly() ? 'readonly' : this.invalid() ? 'invalid' : 'valid',\n );\n\n public onTouched = EMPTY_FUNCTION;\n public onChange: (value: T) => void = EMPTY_FUNCTION;\n\n constructor() {\n this.control.valueAccessor = this;\n this.refresh$\n .pipe(\n delay(0),\n startWith(null),\n map(() => this.control.control),\n filter(Boolean),\n distinctUntilChanged(),\n switchMap((c) =>\n merge(\n c.valueChanges,\n c.statusChanges,\n (c as any).events || EMPTY,\n ).pipe(startWith(null)),\n ),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.update());\n }\n\n @Input('readOnly')\n public set readOnlySetter(readOnly: boolean) {\n this.readOnly.set(readOnly);\n }\n\n @Input('invalid')\n public set invalidSetter(invalid: boolean | null) {\n this.pseudoInvalid.set(invalid);\n }\n\n public registerOnChange(onChange: (value: unknown) => void): void {\n this.refresh$.next();\n\n this.onChange = (value: T) => {\n const internal = untracked(() => this.internal());\n\n if (value === internal) {\n return;\n }\n\n onChange(this.transformer.toControlValue(value));\n this.internal.set(value);\n this.update();\n };\n }\n\n public registerOnTouched(onTouched: () => void): void {\n this.onTouched = () => {\n onTouched();\n this.update();\n };\n }\n\n public setDisabledState(): void {\n this.update();\n }\n\n public writeValue(value: T | null): void {\n // TODO: https://github.com/angular/angular/issues/14988\n const safe = this.control instanceof NgModel ? this.control.model : value;\n\n this.internal.set(this.transformer.fromControlValue(safe));\n this.update();\n }\n\n private update(): void {\n this.status.set(this.control.control?.status);\n this.touched.set(!!this.control.control?.touched);\n this.cdr.markForCheck();\n }\n}\n\nexport function tuiAsControl<T>(control: Type<TuiControl<T>>): Provider {\n return tuiProvide(TuiControl, control);\n}\n","/// <reference types=\"@taiga-ui/tsconfig/ng-dev-mode\" />\nimport {\n type ComponentRef,\n Directive,\n type EmbeddedViewRef,\n inject,\n Injectable,\n INJECTOR,\n type Provider,\n type TemplateRef,\n ViewChild,\n ViewContainerRef,\n type ViewRef,\n} from '@angular/core';\nimport {tuiProvide} from '@taiga-ui/cdk/utils';\nimport {type PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\n/**\n * Abstract class for host element for dynamically created portals.\n */\n@Directive()\nexport abstract class TuiPortals {\n @ViewChild('viewContainer', {read: ViewContainerRef})\n private readonly vcr!: ViewContainerRef;\n\n private readonly injector = inject(INJECTOR);\n\n protected readonly nothing = inject(TuiPortalService).attach(this);\n\n public addComponentChild<C>(component: PolymorpheusComponent<C>): ComponentRef<C> {\n const injector = component.createInjector(this.injector);\n const ref = this.vcr.createComponent(component.component, {injector});\n\n ref.changeDetectorRef.detectChanges();\n\n return ref;\n }\n\n public addTemplateChild<C>(\n templateRef: TemplateRef<C>,\n context?: C,\n ): EmbeddedViewRef<C> {\n return this.vcr.createEmbeddedView(templateRef, context);\n }\n}\n\n/**\n * Abstract service for displaying portals\n */\n@Injectable()\nexport abstract class TuiPortalService {\n protected host?: TuiPortals;\n\n public attach(host: TuiPortals): void {\n this.host = host;\n }\n\n public add<C>(component: PolymorpheusComponent<C>): ComponentRef<C> {\n return this.safeHost.addComponentChild(component);\n }\n\n public remove<C>({hostView}: ComponentRef<C>): void {\n this.removeTemplate(hostView);\n }\n\n public addTemplate<C>(templateRef: TemplateRef<C>, context?: C): EmbeddedViewRef<C> {\n return this.safeHost.addTemplateChild(templateRef, context);\n }\n\n public removeTemplate<C>(viewRef: EmbeddedViewRef<C> | ViewRef): void {\n if (!viewRef.destroyed) {\n viewRef.destroy();\n }\n }\n\n protected get safeHost(): TuiPortals {\n if (!this.host) {\n throw new TuiNoHostException();\n }\n\n return this.host;\n }\n}\n\nexport function tuiAsPortal(portal: typeof TuiPortalService): Provider {\n return tuiProvide(TuiPortalService, portal);\n}\n\nexport class TuiNoHostException extends Error {\n constructor() {\n super(\n ngDevMode\n ? 'Portals cannot be used without TuiPortalHostComponent; perhaps you forgot to wrap your application with tui-root.'\n : '',\n );\n }\n}\n","import {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport class TuiValidationError<T extends Record<string, any> = Record<string, unknown>> {\n constructor(\n public readonly message: PolymorpheusContent<T>,\n public readonly context: T = {} as T,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\n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AAQ,EAAkB,EAAA;AACxC,QAAA,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;;IAG1B,WAAW,CAAI,WAA2B,EAAE,OAAW,EAAA;QAC1D,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC;;AAGxD,IAAA,cAAc,CAAI,OAAqC,EAAA;AAC1D,QAAA,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACpB,OAAO,CAAC,OAAO,EAAE;;;AAIzB,IAAA,IAAc,QAAQ,GAAA;AAClB,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACZ,MAAM,IAAI,kBAAkB,EAAE;;QAGlC,OAAO,IAAI,CAAC,IAAI;;+GA9BF,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAhB,gBAAgB,EAAA,CAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBADrC;;AAmCK,SAAU,WAAW,CAAC,MAA+B,EAAA;AACvD,IAAA,OAAO,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC;AAC/C;AAEM,MAAO,kBAAmB,SAAQ,KAAK,CAAA;AACzC,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,CACD;AACI,cAAE;cACA,EAAE,CACX;;AAER;;MC9FY,kBAAkB,CAAA;IAC3B,WACoB,CAAA,OAA+B,EAC/B,OAAA,GAAa,EAAO,EAAA;QADpB,IAAO,CAAA,OAAA,GAAP,OAAO;QACP,IAAO,CAAA,OAAA,GAAP,OAAO;;AAE9B;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-classes.mjs","sources":["../../../projects/cdk/classes/value-transformer.ts","../../../projects/cdk/classes/control.ts","../../../projects/cdk/classes/validation-error.ts","../../../projects/cdk/classes/taiga-ui-cdk-classes.ts"],"sourcesContent":["import {type FactoryProvider, inject, type ProviderToken} from '@angular/core';\nimport {identity} from 'rxjs';\n\nexport abstract class TuiValueTransformer<From, To = unknown> {\n public abstract toControlValue(componentValue: From): To;\n public abstract fromControlValue(controlValue: To): From;\n}\n\nexport function tuiValueTransformerFrom<\n T extends {valueTransformer: TuiValueTransformer<unknown>},\n>(token: ProviderToken<T>): FactoryProvider {\n return {\n provide: TuiValueTransformer,\n useFactory: () => inject(token).valueTransformer,\n };\n}\n\nexport class TuiNonNullableValueTransformer<T> extends TuiValueTransformer<T | null, T> {\n private prevValue!: T;\n\n public fromControlValue(value: T): T {\n this.prevValue = value;\n\n return value;\n }\n\n public toControlValue(value: T | null): T {\n this.prevValue = value ?? this.prevValue;\n\n return this.prevValue;\n }\n}\n\nexport const TUI_IDENTITY_VALUE_TRANSFORMER: TuiValueTransformer<any, any> = {\n fromControlValue: identity,\n toControlValue: identity,\n};\n","import {\n ChangeDetectorRef,\n computed,\n Directive,\n inject,\n input,\n type Provider,\n signal,\n type Type,\n untracked,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {\n type ControlValueAccessor,\n type FormControlStatus,\n NgControl,\n NgModel,\n} from '@angular/forms';\nimport {EMPTY_FUNCTION} from '@taiga-ui/cdk/constants';\nimport {TUI_FALLBACK_VALUE} from '@taiga-ui/cdk/tokens';\nimport {tuiProvide} from '@taiga-ui/cdk/utils';\nimport {\n delay,\n distinctUntilChanged,\n EMPTY,\n filter,\n map,\n merge,\n startWith,\n Subject,\n switchMap,\n} from 'rxjs';\n\nimport {TUI_IDENTITY_VALUE_TRANSFORMER, TuiValueTransformer} from './value-transformer';\n\nconst FLAGS = {self: true, optional: true};\n\n/**\n * Basic ControlValueAccessor class to build form components upon\n */\n@Directive()\nexport abstract class TuiControl<T> implements ControlValueAccessor {\n private readonly fallback = inject(TUI_FALLBACK_VALUE, FLAGS) as T;\n private readonly refresh$ = new Subject<void>();\n private readonly internal = signal(this.fallback);\n\n protected readonly control = inject(NgControl, {self: true});\n protected readonly cdr = inject(ChangeDetectorRef);\n protected transformer =\n inject(TuiValueTransformer, FLAGS) ?? TUI_IDENTITY_VALUE_TRANSFORMER;\n\n public readonly value = computed(() => this.internal() ?? this.fallback);\n public readonly readOnly = input(false);\n public readonly pseudoInvalid = input<boolean | null>(null, {alias: 'invalid'});\n public readonly touched = signal(false);\n public readonly status = signal<FormControlStatus | undefined>(undefined);\n public readonly disabled = computed(() => this.status() === 'DISABLED');\n public readonly interactive = computed(() => !this.disabled() && !this.readOnly());\n public readonly invalid = computed(() =>\n this.pseudoInvalid() !== null\n ? !!this.pseudoInvalid() && this.interactive()\n : this.interactive() && this.touched() && this.status() === 'INVALID',\n );\n\n public readonly mode = computed(() =>\n // eslint-disable-next-line no-nested-ternary\n this.readOnly() ? 'readonly' : this.invalid() ? 'invalid' : 'valid',\n );\n\n public onTouched = EMPTY_FUNCTION;\n public onChange: (value: T) => void = EMPTY_FUNCTION;\n\n constructor() {\n this.control.valueAccessor = this;\n this.refresh$\n .pipe(\n delay(0),\n startWith(null),\n map(() => this.control.control),\n filter(Boolean),\n distinctUntilChanged(),\n switchMap((c) =>\n merge(\n c.valueChanges,\n c.statusChanges,\n (c as any).events || EMPTY,\n ).pipe(startWith(null)),\n ),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.update());\n }\n\n public registerOnChange(onChange: (value: unknown) => void): void {\n this.refresh$.next();\n\n this.onChange = (value: T) => {\n const internal = untracked(() => this.internal());\n\n if (value === internal) {\n return;\n }\n\n onChange(this.transformer.toControlValue(value));\n this.internal.set(value);\n this.update();\n };\n }\n\n public registerOnTouched(onTouched: () => void): void {\n this.onTouched = () => {\n onTouched();\n this.update();\n };\n }\n\n public setDisabledState(): void {\n this.update();\n }\n\n public writeValue(value: T | null): void {\n // TODO: https://github.com/angular/angular/issues/14988\n const safe = this.control instanceof NgModel ? this.control.model : value;\n\n this.internal.set(this.transformer.fromControlValue(safe));\n this.update();\n }\n\n private update(): void {\n this.status.set(this.control.control?.status);\n this.touched.set(!!this.control.control?.touched);\n this.cdr.markForCheck();\n }\n}\n\nexport function tuiAsControl<T>(control: Type<TuiControl<T>>): Provider {\n return tuiProvide(TuiControl, control);\n}\n","import {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\n\nexport class TuiValidationError<T extends Record<string, any> = Record<string, unknown>> {\n constructor(\n public readonly message: PolymorpheusContent<T>,\n public readonly context: T = {} as T,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAGsB,mBAAmB,CAAA;AAGxC;AAEK,SAAU,uBAAuB,CAErC,KAAuB,EAAA;IACrB,OAAO;AACH,QAAA,OAAO,EAAE,mBAAmB;QAC5B,UAAU,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC,CAAC,gBAAgB;KACnD;AACL;AAEM,MAAO,8BAAkC,SAAQ,mBAAgC,CAAA;AAG5E,IAAA,gBAAgB,CAAC,KAAQ,EAAA;AAC5B,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;AAEtB,QAAA,OAAO,KAAK;;AAGT,IAAA,cAAc,CAAC,KAAe,EAAA;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,IAAI,IAAI,CAAC,SAAS;QAExC,OAAO,IAAI,CAAC,SAAS;;AAE5B;AAEY,MAAA,8BAA8B,GAAkC;AACzE,IAAA,gBAAgB,EAAE,QAAQ;AAC1B,IAAA,cAAc,EAAE,QAAQ;;;ACA5B,MAAM,KAAK,GAAG,EAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC;AAE1C;;AAEG;MAEmB,UAAU,CAAA;AA+B5B,IAAA,WAAA,GAAA;AA9BiB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAM;AACjD,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,OAAO,EAAQ;AAC9B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAA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AI,OAA4B,EAAA;AACxD,IAAA,OAAO,UAAU,CAAC,UAAU,EAAE,OAAO,CAAC;AAC1C;;MCvIa,kBAAkB,CAAA;IAC3B,WACoB,CAAA,OAA+B,EAC/B,OAAA,GAAa,EAAO,EAAA;QADpB,IAAO,CAAA,OAAA,GAAP,OAAO;QACP,IAAO,CAAA,OAAA,GAAP,OAAO;;AAE9B;;ACPD;;AAEG;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const TUI_ALLOW_SIGNAL_WRITES = parseInt(VERSION.major, 10) >= 19 ? {} : { allowSignalWrites: true };
|
|
1
|
+
import { QueryList } from '@angular/core';
|
|
4
2
|
|
|
5
3
|
const rect = {
|
|
6
4
|
bottom: 0,
|
|
@@ -29,12 +27,10 @@ const EMPTY_CLIENT_RECT = {
|
|
|
29
27
|
/**
|
|
30
28
|
* Handler that always returns `false`.
|
|
31
29
|
*/
|
|
32
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
33
30
|
const TUI_FALSE_HANDLER = () => false;
|
|
34
31
|
/**
|
|
35
32
|
* Handler that always returns `true`.
|
|
36
33
|
*/
|
|
37
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
38
34
|
const TUI_TRUE_HANDLER = () => true;
|
|
39
35
|
|
|
40
36
|
function bothEmpty(item1, item2) {
|
|
@@ -149,6 +145,17 @@ const TUI_USED_ICONS = [
|
|
|
149
145
|
'@tui.mir',
|
|
150
146
|
'@tui.visa',
|
|
151
147
|
'@tui.electron',
|
|
148
|
+
'@img.mastercard',
|
|
149
|
+
'@img.maestro',
|
|
150
|
+
'@img.amex',
|
|
151
|
+
'@img.diners-club',
|
|
152
|
+
'@img.discover',
|
|
153
|
+
'@img.humo',
|
|
154
|
+
'@img.jcb',
|
|
155
|
+
'@img.ru-pay',
|
|
156
|
+
'@img.union-pay',
|
|
157
|
+
'@img.uzcard',
|
|
158
|
+
'@img.verve',
|
|
152
159
|
'@tui.search',
|
|
153
160
|
'@tui.sun',
|
|
154
161
|
'@tui.moon',
|
|
@@ -195,11 +202,11 @@ const TUI_USED_ICONS = [
|
|
|
195
202
|
'@tui.layout-grid',
|
|
196
203
|
];
|
|
197
204
|
|
|
198
|
-
const TUI_VERSION = '4.52.0-canary.
|
|
205
|
+
const TUI_VERSION = '4.52.0-canary.2fa3dd5';
|
|
199
206
|
|
|
200
207
|
/**
|
|
201
208
|
* Generated bundle index. Do not edit.
|
|
202
209
|
*/
|
|
203
210
|
|
|
204
|
-
export { CHAR_BULLET, CHAR_CURRENCY_SIGN, CHAR_ELLIPSIS, CHAR_EM_DASH, CHAR_EN_DASH, CHAR_HYPHEN, CHAR_LAQUO, CHAR_MINUS, CHAR_NO_BREAK_SPACE, CHAR_PLUS, CHAR_RAQUO, CHAR_ZERO_WIDTH_SPACE, EMPTY_ARRAY, EMPTY_CLIENT_RECT, EMPTY_FUNCTION, EMPTY_QUERY,
|
|
211
|
+
export { CHAR_BULLET, CHAR_CURRENCY_SIGN, CHAR_ELLIPSIS, CHAR_EM_DASH, CHAR_EN_DASH, CHAR_HYPHEN, CHAR_LAQUO, CHAR_MINUS, CHAR_NO_BREAK_SPACE, CHAR_PLUS, CHAR_RAQUO, CHAR_ZERO_WIDTH_SPACE, EMPTY_ARRAY, EMPTY_CLIENT_RECT, EMPTY_FUNCTION, EMPTY_QUERY, TUI_DEFAULT_IDENTITY_MATCHER, TUI_DEFAULT_MATCHER, TUI_DIGIT_REGEXP, TUI_FALSE_HANDLER, TUI_NON_DIGITS_REGEXP, TUI_NON_DIGIT_REGEXP, TUI_STRICT_MATCHER, TUI_TRUE_HANDLER, TUI_USED_ICONS, TUI_VERSION, svgNodeFilter };
|
|
205
212
|
//# sourceMappingURL=taiga-ui-cdk-constants.mjs.map
|