@taiga-ui/kit 4.42.0-canary.551f28f → 4.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/index.d.ts +0 -1
- package/components/input-chip/input-chip.component.d.ts +2 -2
- package/components/input-chip/input-chip.directive.d.ts +0 -2
- package/components/input-date/input-date.directive.d.ts +1 -2
- package/components/input-date-range/input-date-range.directive.d.ts +0 -1
- package/components/progress/progress-circle/progress-circle.component.d.ts +1 -4
- package/components/select/select-option/select-option.component.d.ts +4 -2
- package/directives/button-select/button-select.directive.d.ts +2 -3
- package/esm2022/components/badge/badge.directive.mjs +2 -2
- package/esm2022/components/calendar-month/calendar-month.component.mjs +3 -3
- package/esm2022/components/combo-box/combo-box.directive.mjs +5 -2
- package/esm2022/components/files/input-files/input-files.directive.mjs +2 -3
- package/esm2022/components/index.mjs +1 -2
- package/esm2022/components/input-chip/input-chip.component.mjs +13 -15
- package/esm2022/components/input-chip/input-chip.directive.mjs +9 -20
- package/esm2022/components/input-date/input-date.directive.mjs +3 -11
- package/esm2022/components/input-date-range/input-date-range.directive.mjs +2 -6
- package/esm2022/components/input-inline/input-inline.component.mjs +1 -1
- package/esm2022/components/progress/progress-circle/progress-circle.component.mjs +3 -9
- package/esm2022/components/select/select-option/select-option.component.mjs +18 -10
- package/esm2022/components/select/select.directive.mjs +4 -1
- package/esm2022/components/tabs/tabs.directive.mjs +2 -2
- package/esm2022/components/textarea/textarea.component.mjs +3 -3
- package/esm2022/directives/button-select/button-select.directive.mjs +7 -15
- package/esm2022/directives/chevron/chevron.directive.mjs +2 -2
- package/esm2022/pipes/index.mjs +1 -2
- package/esm2022/tokens/items-handlers.mjs +4 -4
- package/esm2022/utils/index.mjs +1 -2
- 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-calendar-month.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-calendar-month.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs +4 -1
- package/fesm2022/taiga-ui-kit-components-combo-box.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-files.mjs +1 -2
- package/fesm2022/taiga-ui-kit-components-files.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs +95 -109
- package/fesm2022/taiga-ui-kit-components-input-chip.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs +0 -4
- package/fesm2022/taiga-ui-kit-components-input-date-range.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-date.mjs +2 -10
- package/fesm2022/taiga-ui-kit-components-input-date.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-input-inline.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-progress.mjs +2 -8
- package/fesm2022/taiga-ui-kit-components-progress.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-select.mjs +20 -11
- package/fesm2022/taiga-ui-kit-components-select.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-tabs.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-tabs.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components-textarea.mjs +2 -2
- package/fesm2022/taiga-ui-kit-components-textarea.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-components.mjs +0 -1
- package/fesm2022/taiga-ui-kit-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-directives-button-select.mjs +6 -14
- package/fesm2022/taiga-ui-kit-directives-button-select.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-pipes.mjs +0 -1
- package/fesm2022/taiga-ui-kit-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-tokens.mjs +3 -3
- package/fesm2022/taiga-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-kit-utils.mjs +1 -12
- package/fesm2022/taiga-ui-kit-utils.mjs.map +1 -1
- package/package.json +13 -25
- package/pipes/index.d.ts +0 -1
- package/styles/components/badge.less +13 -1
- package/tokens/items-handlers.d.ts +4 -4
- package/utils/index.d.ts +0 -1
- package/components/input-time/index.d.ts +0 -4
- package/components/input-time/input-time.component.d.ts +0 -14
- package/components/input-time/input-time.d.ts +0 -3
- package/components/input-time/input-time.directive.d.ts +0 -31
- package/components/input-time/input-time.options.d.ts +0 -11
- package/esm2022/components/input-time/index.mjs +0 -5
- package/esm2022/components/input-time/input-time.component.mjs +0 -49
- package/esm2022/components/input-time/input-time.directive.mjs +0 -123
- package/esm2022/components/input-time/input-time.mjs +0 -4
- package/esm2022/components/input-time/input-time.options.mjs +0 -9
- package/esm2022/components/input-time/taiga-ui-kit-components-input-time.mjs +0 -5
- package/esm2022/pipes/hide-selected/hide-selected.pipe.mjs +0 -46
- package/esm2022/pipes/hide-selected/index.mjs +0 -2
- package/esm2022/pipes/hide-selected/taiga-ui-kit-pipes-hide-selected.mjs +0 -5
- package/esm2022/utils/inject-value.mjs +0 -11
- package/fesm2022/taiga-ui-kit-components-input-time.mjs +0 -180
- package/fesm2022/taiga-ui-kit-components-input-time.mjs.map +0 -1
- package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs +0 -52
- package/fesm2022/taiga-ui-kit-pipes-hide-selected.mjs.map +0 -1
- package/pipes/hide-selected/hide-selected.pipe.d.ts +0 -12
- package/pipes/hide-selected/index.d.ts +0 -1
- package/utils/inject-value.d.ts +0 -2
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFpZ2EtdWkta2l0LWNvbXBvbmVudHMtaW5wdXQtdGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2tpdC9jb21wb25lbnRzL2lucHV0LXRpbWUvdGFpZ2EtdWkta2l0LWNvbXBvbmVudHMtaW5wdXQtdGltZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { inject, Pipe } from '@angular/core';
|
|
3
|
-
import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
4
|
-
import { TuiTextfieldComponent } from '@taiga-ui/core/components/textfield';
|
|
5
|
-
import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
|
|
6
|
-
import { tuiIsFlat } from '@taiga-ui/kit/utils';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
class TuiHideSelectedPipe {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.textfield = inject(TuiTextfieldComponent);
|
|
11
|
-
this.handlers = inject(TUI_ITEMS_HANDLERS);
|
|
12
|
-
}
|
|
13
|
-
transform(items) {
|
|
14
|
-
if (!items) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
const value = this.textfield.control?.value || [];
|
|
18
|
-
return tuiIsFlat(items)
|
|
19
|
-
? this.filter(items, value, this.handlers.identityMatcher())
|
|
20
|
-
: this.filter2d(items, value, this.handlers.identityMatcher());
|
|
21
|
-
}
|
|
22
|
-
filter2d(items, value, matcher) {
|
|
23
|
-
return items.map((subItems) => this.filter(subItems, value, matcher));
|
|
24
|
-
}
|
|
25
|
-
filter(items, value, matcher) {
|
|
26
|
-
return items.filter((item) => value.every((selected) => !matcher(selected, item)));
|
|
27
|
-
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiHideSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
29
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TuiHideSelectedPipe, isStandalone: true, name: "tuiHideSelected", pure: false }); }
|
|
30
|
-
}
|
|
31
|
-
__decorate([
|
|
32
|
-
tuiPure
|
|
33
|
-
], TuiHideSelectedPipe.prototype, "filter2d", null);
|
|
34
|
-
__decorate([
|
|
35
|
-
tuiPure
|
|
36
|
-
], TuiHideSelectedPipe.prototype, "filter", null);
|
|
37
|
-
export { TuiHideSelectedPipe };
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiHideSelectedPipe, decorators: [{
|
|
39
|
-
type: Pipe,
|
|
40
|
-
args: [{
|
|
41
|
-
standalone: true,
|
|
42
|
-
name: 'tuiHideSelected',
|
|
43
|
-
pure: false,
|
|
44
|
-
}]
|
|
45
|
-
}], propDecorators: { filter2d: [], filter: [] } });
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlkZS1zZWxlY3RlZC5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMva2l0L3BpcGVzL2hpZGUtc2VsZWN0ZWQvaGlkZS1zZWxlY3RlZC5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSxPQUFPLEVBQUMsTUFBTSxFQUFFLElBQUksRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUUzQyxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0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from './hide-selected.pipe';
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9raXQvcGlwZXMvaGlkZS1zZWxlY3RlZC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHNCQUFzQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9oaWRlLXNlbGVjdGVkLnBpcGUnO1xuIl19
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './index';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFpZ2EtdWkta2l0LXBpcGVzLWhpZGUtc2VsZWN0ZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9raXQvcGlwZXMvaGlkZS1zZWxlY3RlZC90YWlnYS11aS1raXQtcGlwZXMtaGlkZS1zZWxlY3RlZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { inject } from '@angular/core';
|
|
2
|
-
import { toSignal } from '@angular/core/rxjs-interop';
|
|
3
|
-
import { NgControl } from '@angular/forms';
|
|
4
|
-
import { tuiControlValue } from '@taiga-ui/cdk/observables';
|
|
5
|
-
import { TuiTextfieldComponent } from '@taiga-ui/core/components/textfield';
|
|
6
|
-
export function tuiInjectValue() {
|
|
7
|
-
const control = inject(TuiTextfieldComponent, { optional: true })?.control ||
|
|
8
|
-
inject(NgControl, { optional: true });
|
|
9
|
-
return toSignal(tuiControlValue(control), { requireSync: true });
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5qZWN0LXZhbHVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMva2l0L3V0aWxzL2luamVjdC12YWx1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUMsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3JDLE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQztBQUNwRCxPQUFPLEVBQUMsU0FBUyxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFDekMsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLDJCQUEyQixDQUFDO0FBQzFELE9BQU8sRUFBQyxxQkFBcUIsRUFBQyxNQUFNLHFDQUFxQyxDQUFDO0FBRTFFLE1BQU0sVUFBVSxjQUFjO0lBQzFCLE1BQU0sT0FBTyxHQUNULE1BQU0sQ0FBQyxxQkFBcUIsRUFBRSxFQUFDLFFBQVEsRUFBRSxJQUFJLEVBQUMsQ0FBQyxFQUFFLE9BQU87UUFDeEQsTUFBTSxDQUFDLFNBQVMsRUFBRSxFQUFDLFFBQVEsRUFBRSxJQUFJLEVBQUMsQ0FBQyxDQUFDO0lBRXhDLE9BQU8sUUFBUSxDQUFDLGVBQWUsQ0FBQyxPQUFPLENBQUMsRUFBRSxFQUFDLFdBQVcsRUFBRSxJQUFJLEVBQUMsQ0FBQyxDQUFDO0FBQ25FLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7U2lnbmFsfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7aW5qZWN0fSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7dG9TaWduYWx9IGZyb20gJ0Bhbmd1bGFyL2NvcmUvcnhqcy1pbnRlcm9wJztcbmltcG9ydCB7TmdDb250cm9sfSBmcm9tICdAYW5ndWxhci9mb3Jtcyc7XG5pbXBvcnQge3R1aUNvbnRyb2xWYWx1ZX0gZnJvbSAnQHRhaWdhLXVpL2Nkay9vYnNlcnZhYmxlcyc7XG5pbXBvcnQge1R1aVRleHRmaWVsZENvbXBvbmVudH0gZnJvbSAnQHRhaWdhLXVpL2NvcmUvY29tcG9uZW50cy90ZXh0ZmllbGQnO1xuXG5leHBvcnQgZnVuY3Rpb24gdHVpSW5qZWN0VmFsdWU8VD4oKTogU2lnbmFsPFQ+IHtcbiAgICBjb25zdCBjb250cm9sID1cbiAgICAgICAgaW5qZWN0KFR1aVRleHRmaWVsZENvbXBvbmVudCwge29wdGlvbmFsOiB0cnVlfSk/LmNvbnRyb2wgfHxcbiAgICAgICAgaW5qZWN0KE5nQ29udHJvbCwge29wdGlvbmFsOiB0cnVlfSk7XG5cbiAgICByZXR1cm4gdG9TaWduYWwodHVpQ29udHJvbFZhbHVlKGNvbnRyb2wpLCB7cmVxdWlyZVN5bmM6IHRydWV9KTtcbn1cbiJdfQ==
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { NgIf } from '@angular/common';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, computed, signal, Directive, Input, Component, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
|
|
4
|
-
import { TuiControl, tuiAsControl, tuiValueTransformerFrom } from '@taiga-ui/cdk/classes';
|
|
5
|
-
import { TuiTime } from '@taiga-ui/cdk/date-time';
|
|
6
|
-
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
|
-
import * as i1 from '@taiga-ui/core/components/textfield';
|
|
8
|
-
import { TuiTextfieldDirective, tuiTextfieldIconBinding, TuiTextfieldComponent, tuiAsTextfieldAccessor, TuiWithTextfield, TuiTextfieldContent } from '@taiga-ui/core/components/textfield';
|
|
9
|
-
import { toSignal } from '@angular/core/rxjs-interop';
|
|
10
|
-
import * as i2 from '@maskito/angular';
|
|
11
|
-
import { MaskitoDirective } from '@maskito/angular';
|
|
12
|
-
import { maskitoTimeOptionsGenerator, maskitoSelectionChangeHandler } from '@maskito/kit';
|
|
13
|
-
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
14
|
-
import { tuiDirectiveBinding } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
15
|
-
import { tuiAsOptionContent } from '@taiga-ui/core/components/data-list';
|
|
16
|
-
import { TuiDropdownDirective, tuiDropdownOpen, tuiDropdownEnabled } from '@taiga-ui/core/directives/dropdown';
|
|
17
|
-
import { tuiAsAuxiliary } from '@taiga-ui/core/tokens/auxiliary';
|
|
18
|
-
import { TuiSelectOption } from '@taiga-ui/kit/components/select';
|
|
19
|
-
import { TUI_TIME_TEXTS } from '@taiga-ui/kit/tokens';
|
|
20
|
-
import { tuiMaskito } from '@taiga-ui/kit/utils';
|
|
21
|
-
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
22
|
-
|
|
23
|
-
const TUI_INPUT_TIME_DEFAULT_OPTIONS = {
|
|
24
|
-
icon: () => '@tui.clock',
|
|
25
|
-
mode: 'HH:MM',
|
|
26
|
-
timeSegmentMaxValues: {},
|
|
27
|
-
valueTransformer: null,
|
|
28
|
-
};
|
|
29
|
-
const [TUI_INPUT_TIME_OPTIONS, tuiInputTimeOptionsProvider] = tuiCreateOptions(TUI_INPUT_TIME_DEFAULT_OPTIONS);
|
|
30
|
-
|
|
31
|
-
class TuiInputTimeDirective extends TuiControl {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.textfield = inject(TuiTextfieldDirective);
|
|
35
|
-
this.dropdown = inject(TuiDropdownDirective);
|
|
36
|
-
this.open = tuiDropdownOpen();
|
|
37
|
-
this.options = inject(TUI_INPUT_TIME_OPTIONS);
|
|
38
|
-
this.fillers = toSignal(inject(TUI_TIME_TEXTS));
|
|
39
|
-
this.icon = tuiTextfieldIconBinding(TUI_INPUT_TIME_OPTIONS);
|
|
40
|
-
this.dropdownEnabled = tuiDropdownEnabled(computed(() => !this.native && this.interactive()));
|
|
41
|
-
this.filler = tuiDirectiveBinding(TuiTextfieldComponent, 'fillerSetter', computed((fillers = this.fillers()) => fillers?.[this.timeMode()] ?? ''), {});
|
|
42
|
-
this.mask = tuiMaskito(computed(() => this.computeMask({
|
|
43
|
-
...this.options,
|
|
44
|
-
mode: this.timeMode(),
|
|
45
|
-
step: this.interactive() && !this.dropdown._content() ? 1 : 0,
|
|
46
|
-
})));
|
|
47
|
-
this.accept = [];
|
|
48
|
-
this.native = tuiInjectElement().type === 'time' && inject(TUI_IS_MOBILE);
|
|
49
|
-
this.timeMode = signal(this.options.mode);
|
|
50
|
-
}
|
|
51
|
-
// TODO(v5): use signal inputs
|
|
52
|
-
set modeSetter(x) {
|
|
53
|
-
this.timeMode.set(x);
|
|
54
|
-
}
|
|
55
|
-
setValue(value) {
|
|
56
|
-
this.onChange(value);
|
|
57
|
-
this.textfield.value.set(value?.toString(this.timeMode()) ?? '');
|
|
58
|
-
if (!value) {
|
|
59
|
-
this.open.set(true);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
writeValue(value) {
|
|
63
|
-
super.writeValue(value);
|
|
64
|
-
this.textfield.value.set(this.value()?.toString(this.timeMode()) ?? '');
|
|
65
|
-
}
|
|
66
|
-
onInput(value) {
|
|
67
|
-
const time = value.length === this.timeMode().length ? TuiTime.fromString(value) : null;
|
|
68
|
-
const newValue = this.accept.length && time ? this.findNearestTime(time, this.accept) : time;
|
|
69
|
-
this.control?.control?.updateValueAndValidity({ emitEvent: false });
|
|
70
|
-
this.onChange(newValue);
|
|
71
|
-
if (newValue && newValue !== time) {
|
|
72
|
-
this.textfield.value.set(newValue?.toString(this.timeMode()));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
toggle() {
|
|
76
|
-
this.open.update((x) => !x);
|
|
77
|
-
}
|
|
78
|
-
computeMask(params) {
|
|
79
|
-
const options = maskitoTimeOptionsGenerator(params);
|
|
80
|
-
const { mode } = params;
|
|
81
|
-
const inputModeSwitchPlugin = maskitoSelectionChangeHandler((element) => {
|
|
82
|
-
element.inputMode =
|
|
83
|
-
element.selectionStart >= mode.indexOf(' AA') ? 'text' : 'numeric';
|
|
84
|
-
});
|
|
85
|
-
return {
|
|
86
|
-
...options,
|
|
87
|
-
plugins: options.plugins.concat(mode.includes('AA') ? inputModeSwitchPlugin : []),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
findNearestTime(value, items) {
|
|
91
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
92
|
-
return items.reduce((previous, current) => Math.abs(current.valueOf() - value.valueOf()) <
|
|
93
|
-
Math.abs(previous.valueOf() - value.valueOf())
|
|
94
|
-
? current
|
|
95
|
-
: previous);
|
|
96
|
-
}
|
|
97
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputTimeDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
98
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputTimeDirective, isStandalone: true, selector: "input[tuiInputTime]", inputs: { accept: "accept", modeSetter: ["mode", "modeSetter"] }, host: { attributes: { "inputmode": "numeric" }, listeners: { "click": "toggle()", "input": "onInput($event.target.value)" }, properties: { "disabled": "disabled()" } }, providers: [
|
|
99
|
-
tuiAsControl(TuiInputTimeDirective),
|
|
100
|
-
tuiAsTextfieldAccessor(TuiInputTimeDirective),
|
|
101
|
-
tuiAsAuxiliary(TuiInputTimeDirective),
|
|
102
|
-
tuiValueTransformerFrom(TUI_INPUT_TIME_OPTIONS),
|
|
103
|
-
tuiAsOptionContent(TuiSelectOption),
|
|
104
|
-
], usesInheritance: true, hostDirectives: [{ directive: i1.TuiWithTextfield }, { directive: i2.MaskitoDirective }], ngImport: i0 }); }
|
|
105
|
-
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputTimeDirective, decorators: [{
|
|
107
|
-
type: Directive,
|
|
108
|
-
args: [{
|
|
109
|
-
standalone: true,
|
|
110
|
-
selector: 'input[tuiInputTime]',
|
|
111
|
-
providers: [
|
|
112
|
-
tuiAsControl(TuiInputTimeDirective),
|
|
113
|
-
tuiAsTextfieldAccessor(TuiInputTimeDirective),
|
|
114
|
-
tuiAsAuxiliary(TuiInputTimeDirective),
|
|
115
|
-
tuiValueTransformerFrom(TUI_INPUT_TIME_OPTIONS),
|
|
116
|
-
tuiAsOptionContent(TuiSelectOption),
|
|
117
|
-
],
|
|
118
|
-
hostDirectives: [TuiWithTextfield, MaskitoDirective],
|
|
119
|
-
host: {
|
|
120
|
-
inputmode: 'numeric',
|
|
121
|
-
'[disabled]': 'disabled()',
|
|
122
|
-
'(click)': 'toggle()',
|
|
123
|
-
'(input)': 'onInput($event.target.value)',
|
|
124
|
-
},
|
|
125
|
-
}]
|
|
126
|
-
}], propDecorators: { accept: [{
|
|
127
|
-
type: Input
|
|
128
|
-
}], modeSetter: [{
|
|
129
|
-
type: Input,
|
|
130
|
-
args: ['mode']
|
|
131
|
-
}] } });
|
|
132
|
-
|
|
133
|
-
class TuiInputTimeComponent {
|
|
134
|
-
constructor() {
|
|
135
|
-
this.control = inject(TuiControl);
|
|
136
|
-
this.list = tuiInjectElement().getAttribute('list');
|
|
137
|
-
this.host = inject(TuiInputTimeDirective);
|
|
138
|
-
this.textfield = inject(TuiTextfieldDirective);
|
|
139
|
-
this.value = computed((value = this.control.value()) => value
|
|
140
|
-
? value.toString(this.host.timeMode().replace(' AA', ''))
|
|
141
|
-
: '');
|
|
142
|
-
this.step = computed((mode = this.host.timeMode()) => {
|
|
143
|
-
switch (mode) {
|
|
144
|
-
case 'HH:MM:SS':
|
|
145
|
-
case 'HH:MM:SS AA':
|
|
146
|
-
return 1;
|
|
147
|
-
case 'HH:MM:SS.MSS':
|
|
148
|
-
case 'HH:MM:SS.MSS AA':
|
|
149
|
-
return 0.001;
|
|
150
|
-
default:
|
|
151
|
-
return 60;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
setValue(value) {
|
|
156
|
-
const mode = this.host.timeMode();
|
|
157
|
-
const time = TuiTime.fromString(value);
|
|
158
|
-
this.control.onChange(time);
|
|
159
|
-
this.textfield.value.set(time.toString(mode));
|
|
160
|
-
}
|
|
161
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputTimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
162
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiInputTimeComponent, isStandalone: true, selector: "input[tuiInputTime][type=\"time\"]", host: { attributes: { "ngSkipHydration": "true" }, properties: { "type": "\"text\"", "attr.list": "null" } }, ngImport: i0, template: "<ng-container *ngIf=\"host.native\">\n <input\n *tuiTextfieldContent\n type=\"time\"\n [attr.list]=\"list\"\n [step]=\"step()\"\n [value]=\"value()\"\n (change)=\"setValue($any($event.target).value)\"\n />\n</ng-container>\n", styles: ["tui-textfield input[tuiInputTime]~.t-content input[type=time]{position:absolute;right:0;left:auto;inline-size:calc(var(--t-right) + var(--t-padding));opacity:0;margin:0;padding:0}tui-textfield input[tuiInputTime]~.t-content input[type=time]::-webkit-calendar-picker-indicator{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiTextfieldContent, selector: "ng-template[tuiTextfieldContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
163
|
-
}
|
|
164
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiInputTimeComponent, decorators: [{
|
|
165
|
-
type: Component,
|
|
166
|
-
args: [{ standalone: true, selector: 'input[tuiInputTime][type="time"]', imports: [NgIf, TuiTextfieldContent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
167
|
-
ngSkipHydration: 'true',
|
|
168
|
-
'[type]': '"text"',
|
|
169
|
-
'[attr.list]': 'null',
|
|
170
|
-
}, template: "<ng-container *ngIf=\"host.native\">\n <input\n *tuiTextfieldContent\n type=\"time\"\n [attr.list]=\"list\"\n [step]=\"step()\"\n [value]=\"value()\"\n (change)=\"setValue($any($event.target).value)\"\n />\n</ng-container>\n", styles: ["tui-textfield input[tuiInputTime]~.t-content input[type=time]{position:absolute;right:0;left:auto;inline-size:calc(var(--t-right) + var(--t-padding));opacity:0;margin:0;padding:0}tui-textfield input[tuiInputTime]~.t-content input[type=time]::-webkit-calendar-picker-indicator{position:absolute;top:0;left:0;inline-size:100%;block-size:100%}\n"] }]
|
|
171
|
-
}] });
|
|
172
|
-
|
|
173
|
-
const TuiInputTime = [TuiInputTimeDirective, TuiInputTimeComponent];
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Generated bundle index. Do not edit.
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
export { TUI_INPUT_TIME_DEFAULT_OPTIONS, TUI_INPUT_TIME_OPTIONS, TuiInputTime, TuiInputTimeComponent, TuiInputTimeDirective, tuiInputTimeOptionsProvider };
|
|
180
|
-
//# sourceMappingURL=taiga-ui-kit-components-input-time.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components-input-time.mjs","sources":["../../../projects/kit/components/input-time/input-time.options.ts","../../../projects/kit/components/input-time/input-time.directive.ts","../../../projects/kit/components/input-time/input-time.component.ts","../../../projects/kit/components/input-time/input-time.template.html","../../../projects/kit/components/input-time/input-time.ts","../../../projects/kit/components/input-time/taiga-ui-kit-components-input-time.ts"],"sourcesContent":["import type {MaskitoTimeParams} from '@maskito/kit';\nimport type {TuiValueTransformer} from '@taiga-ui/cdk/classes';\nimport type {TuiTime} from '@taiga-ui/cdk/date-time';\nimport type {TuiHandler} from '@taiga-ui/cdk/types';\nimport {tuiCreateOptions} from '@taiga-ui/cdk/utils/di';\nimport type {TuiSizeL, TuiSizeS} from '@taiga-ui/core/types';\n\nexport interface TuiInputTimeOptions\n extends Required<Pick<MaskitoTimeParams, 'mode' | 'timeSegmentMaxValues'>> {\n readonly icon: TuiHandler<TuiSizeL | TuiSizeS, string>;\n readonly valueTransformer: TuiValueTransformer<TuiTime | null, any> | null;\n}\n\nexport const TUI_INPUT_TIME_DEFAULT_OPTIONS: TuiInputTimeOptions = {\n icon: () => '@tui.clock',\n mode: 'HH:MM',\n timeSegmentMaxValues: {},\n valueTransformer: null,\n};\n\nexport const [TUI_INPUT_TIME_OPTIONS, tuiInputTimeOptionsProvider] = tuiCreateOptions(\n TUI_INPUT_TIME_DEFAULT_OPTIONS,\n);\n","import {computed, Directive, inject, Input, signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {MaskitoDirective} from '@maskito/angular';\nimport type {MaskitoOptions} from '@maskito/core';\nimport type {MaskitoTimeMode, MaskitoTimeParams} from '@maskito/kit';\nimport {maskitoSelectionChangeHandler, maskitoTimeOptionsGenerator} from '@maskito/kit';\nimport {tuiAsControl, TuiControl, tuiValueTransformerFrom} from '@taiga-ui/cdk/classes';\nimport {TuiTime} from '@taiga-ui/cdk/date-time';\nimport {TUI_IS_MOBILE} from '@taiga-ui/cdk/tokens';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiDirectiveBinding} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {tuiAsOptionContent} from '@taiga-ui/core/components/data-list';\nimport type {TuiTextfieldAccessor} from '@taiga-ui/core/components/textfield';\nimport {\n tuiAsTextfieldAccessor,\n TuiTextfieldComponent,\n TuiTextfieldDirective,\n tuiTextfieldIconBinding,\n TuiWithTextfield,\n} from '@taiga-ui/core/components/textfield';\nimport {\n TuiDropdownDirective,\n tuiDropdownEnabled,\n tuiDropdownOpen,\n} from '@taiga-ui/core/directives/dropdown';\nimport {tuiAsAuxiliary} from '@taiga-ui/core/tokens/auxiliary';\nimport {TuiSelectOption} from '@taiga-ui/kit/components/select';\nimport {TUI_TIME_TEXTS} from '@taiga-ui/kit/tokens';\nimport {tuiMaskito} from '@taiga-ui/kit/utils';\n\nimport {TUI_INPUT_TIME_OPTIONS} from './input-time.options';\n\n@Directive({\n standalone: true,\n selector: 'input[tuiInputTime]',\n providers: [\n tuiAsControl(TuiInputTimeDirective),\n tuiAsTextfieldAccessor(TuiInputTimeDirective),\n tuiAsAuxiliary(TuiInputTimeDirective),\n tuiValueTransformerFrom(TUI_INPUT_TIME_OPTIONS),\n tuiAsOptionContent(TuiSelectOption),\n ],\n hostDirectives: [TuiWithTextfield, MaskitoDirective],\n host: {\n inputmode: 'numeric',\n '[disabled]': 'disabled()',\n '(click)': 'toggle()',\n '(input)': 'onInput($event.target.value)',\n },\n})\nexport class TuiInputTimeDirective\n extends TuiControl<TuiTime | null>\n implements TuiTextfieldAccessor<TuiTime | null>\n{\n private readonly textfield = inject(TuiTextfieldDirective);\n private readonly dropdown = inject(TuiDropdownDirective);\n private readonly open = tuiDropdownOpen();\n private readonly options = inject(TUI_INPUT_TIME_OPTIONS);\n private readonly fillers = toSignal(inject(TUI_TIME_TEXTS));\n\n protected readonly icon = tuiTextfieldIconBinding(TUI_INPUT_TIME_OPTIONS);\n protected readonly dropdownEnabled = tuiDropdownEnabled(\n computed(() => !this.native && this.interactive()),\n );\n\n protected readonly filler = tuiDirectiveBinding(\n TuiTextfieldComponent,\n 'fillerSetter',\n computed((fillers = this.fillers()) => fillers?.[this.timeMode()] ?? ''),\n {},\n );\n\n protected readonly mask = tuiMaskito(\n computed(() =>\n this.computeMask({\n ...this.options,\n mode: this.timeMode(),\n step: this.interactive() && !this.dropdown._content() ? 1 : 0,\n }),\n ),\n );\n\n @Input()\n public accept: readonly TuiTime[] = [];\n\n public readonly native =\n tuiInjectElement<HTMLInputElement>().type === 'time' && inject(TUI_IS_MOBILE);\n\n public readonly timeMode = signal(this.options.mode);\n\n // TODO(v5): use signal inputs\n @Input('mode')\n public set modeSetter(x: MaskitoTimeMode) {\n this.timeMode.set(x);\n }\n\n public setValue(value: TuiTime | null): void {\n this.onChange(value);\n this.textfield.value.set(value?.toString(this.timeMode()) ?? '');\n\n if (!value) {\n this.open.set(true);\n }\n }\n\n public override writeValue(value: TuiTime | null): void {\n super.writeValue(value);\n this.textfield.value.set(this.value()?.toString(this.timeMode()) ?? '');\n }\n\n protected onInput(value: string): void {\n const time =\n value.length === this.timeMode().length ? TuiTime.fromString(value) : null;\n const newValue =\n this.accept.length && time ? this.findNearestTime(time, this.accept) : time;\n\n this.control?.control?.updateValueAndValidity({emitEvent: false});\n this.onChange(newValue);\n\n if (newValue && newValue !== time) {\n this.textfield.value.set(newValue?.toString(this.timeMode()));\n }\n }\n\n protected toggle(): void {\n this.open.update((x) => !x);\n }\n\n private computeMask(params: MaskitoTimeParams): MaskitoOptions {\n const options = maskitoTimeOptionsGenerator(params);\n const {mode} = params;\n const inputModeSwitchPlugin = maskitoSelectionChangeHandler((element) => {\n element.inputMode =\n element.selectionStart! >= mode.indexOf(' AA') ? 'text' : 'numeric';\n });\n\n return {\n ...options,\n plugins: options.plugins.concat(\n mode.includes('AA') ? inputModeSwitchPlugin : [],\n ),\n };\n }\n\n private findNearestTime(value: TuiTime, items: readonly TuiTime[]): TuiTime | null {\n // eslint-disable-next-line no-restricted-syntax\n return items.reduce((previous, current) =>\n Math.abs(current.valueOf() - value.valueOf()) <\n Math.abs(previous.valueOf() - value.valueOf())\n ? current\n : previous,\n );\n }\n}\n","import {NgIf} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {MaskitoTimeMode} from '@maskito/kit';\nimport {TuiControl} from '@taiga-ui/cdk/classes';\nimport {TuiTime} from '@taiga-ui/cdk/date-time';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n TuiTextfieldContent,\n TuiTextfieldDirective,\n} from '@taiga-ui/core/components/textfield';\n\nimport {TuiInputTimeDirective} from './input-time.directive';\n\n@Component({\n standalone: true,\n selector: 'input[tuiInputTime][type=\"time\"]',\n imports: [NgIf, TuiTextfieldContent],\n templateUrl: './input-time.template.html',\n styleUrls: ['./input-time.style.less'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n ngSkipHydration: 'true',\n '[type]': '\"text\"',\n '[attr.list]': 'null',\n },\n})\nexport class TuiInputTimeComponent {\n private readonly control: TuiControl<TuiTime | null> = inject(TuiControl);\n\n protected readonly list = tuiInjectElement().getAttribute('list');\n protected readonly host = inject(TuiInputTimeDirective);\n protected readonly textfield = inject(TuiTextfieldDirective);\n protected readonly value = computed((value = this.control.value()) =>\n value\n ? value.toString(this.host.timeMode().replace(' AA', '') as MaskitoTimeMode)\n : '',\n );\n\n protected readonly step = computed((mode = this.host.timeMode()) => {\n switch (mode) {\n case 'HH:MM:SS':\n case 'HH:MM:SS AA':\n return 1;\n case 'HH:MM:SS.MSS':\n case 'HH:MM:SS.MSS AA':\n return 0.001;\n default:\n return 60;\n }\n });\n\n protected setValue(value: string): void {\n const mode = this.host.timeMode();\n const time = TuiTime.fromString(value);\n\n this.control.onChange(time);\n this.textfield.value.set(time.toString(mode));\n }\n}\n","<ng-container *ngIf=\"host.native\">\n <input\n *tuiTextfieldContent\n type=\"time\"\n [attr.list]=\"list\"\n [step]=\"step()\"\n [value]=\"value()\"\n (change)=\"setValue($any($event.target).value)\"\n />\n</ng-container>\n","import {TuiInputTimeComponent} from './input-time.component';\nimport {TuiInputTimeDirective} from './input-time.directive';\n\nexport const TuiInputTime = [TuiInputTimeDirective, TuiInputTimeComponent] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaa,MAAA,8BAA8B,GAAwB;AAC/D,IAAA,IAAI,EAAE,MAAM,YAAY;AACxB,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,oBAAoB,EAAE,EAAE;AACxB,IAAA,gBAAgB,EAAE,IAAI;EACxB;AAEK,MAAM,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,GAAG,gBAAgB,CACjF,8BAA8B;;ACWlC,MAkBa,qBACT,SAAQ,UAA0B,CAAA;AAnBtC,IAAA,WAAA,GAAA;;AAsBqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC1C,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACxC,IAAI,CAAA,IAAA,GAAG,eAAe,EAAE,CAAC;AACzB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;QACzC,IAAO,CAAA,OAAA,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAEzC,QAAA,IAAA,CAAA,IAAI,GAAG,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;AACvD,QAAA,IAAA,CAAA,eAAe,GAAG,kBAAkB,CACnD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,CACrD,CAAC;AAEiB,QAAA,IAAA,CAAA,MAAM,GAAG,mBAAmB,CAC3C,qBAAqB,EACrB,c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EAAA,QAAA,EAAA,kRAAA,EAAA,MAAA,EAAA,CAAA,wVAAA,CAAA,EAAA,CAAA;;;ME5BQ,YAAY,GAAG,CAAC,qBAAqB,EAAE,qBAAqB;;ACHzE;;AAEG;;;;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Pipe } from '@angular/core';
|
|
4
|
-
import { tuiPure } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
5
|
-
import { TuiTextfieldComponent } from '@taiga-ui/core/components/textfield';
|
|
6
|
-
import { TUI_ITEMS_HANDLERS } from '@taiga-ui/core/directives/items-handlers';
|
|
7
|
-
import { tuiIsFlat } from '@taiga-ui/kit/utils';
|
|
8
|
-
|
|
9
|
-
class TuiHideSelectedPipe {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.textfield = inject(TuiTextfieldComponent);
|
|
12
|
-
this.handlers = inject(TUI_ITEMS_HANDLERS);
|
|
13
|
-
}
|
|
14
|
-
transform(items) {
|
|
15
|
-
if (!items) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
const value = this.textfield.control?.value || [];
|
|
19
|
-
return tuiIsFlat(items)
|
|
20
|
-
? this.filter(items, value, this.handlers.identityMatcher())
|
|
21
|
-
: this.filter2d(items, value, this.handlers.identityMatcher());
|
|
22
|
-
}
|
|
23
|
-
filter2d(items, value, matcher) {
|
|
24
|
-
return items.map((subItems) => this.filter(subItems, value, matcher));
|
|
25
|
-
}
|
|
26
|
-
filter(items, value, matcher) {
|
|
27
|
-
return items.filter((item) => value.every((selected) => !matcher(selected, item)));
|
|
28
|
-
}
|
|
29
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiHideSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
30
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TuiHideSelectedPipe, isStandalone: true, name: "tuiHideSelected", pure: false }); }
|
|
31
|
-
}
|
|
32
|
-
__decorate([
|
|
33
|
-
tuiPure
|
|
34
|
-
], TuiHideSelectedPipe.prototype, "filter2d", null);
|
|
35
|
-
__decorate([
|
|
36
|
-
tuiPure
|
|
37
|
-
], TuiHideSelectedPipe.prototype, "filter", null);
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiHideSelectedPipe, decorators: [{
|
|
39
|
-
type: Pipe,
|
|
40
|
-
args: [{
|
|
41
|
-
standalone: true,
|
|
42
|
-
name: 'tuiHideSelected',
|
|
43
|
-
pure: false,
|
|
44
|
-
}]
|
|
45
|
-
}], propDecorators: { filter2d: [], filter: [] } });
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Generated bundle index. Do not edit.
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
export { TuiHideSelectedPipe };
|
|
52
|
-
//# sourceMappingURL=taiga-ui-kit-pipes-hide-selected.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-pipes-hide-selected.mjs","sources":["../../../projects/kit/pipes/hide-selected/hide-selected.pipe.ts","../../../projects/kit/pipes/hide-selected/taiga-ui-kit-pipes-hide-selected.ts"],"sourcesContent":["import type {PipeTransform} from '@angular/core';\nimport {inject, Pipe} from '@angular/core';\nimport type {TuiIdentityMatcher} from '@taiga-ui/cdk/types';\nimport {tuiPure} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TuiTextfieldComponent} from '@taiga-ui/core/components/textfield';\nimport {TUI_ITEMS_HANDLERS} from '@taiga-ui/core/directives/items-handlers';\nimport {tuiIsFlat} from '@taiga-ui/kit/utils';\n\n@Pipe({\n standalone: true,\n name: 'tuiHideSelected',\n pure: false,\n})\nexport class TuiHideSelectedPipe implements PipeTransform {\n private readonly textfield = inject(TuiTextfieldComponent);\n private readonly handlers = inject(TUI_ITEMS_HANDLERS);\n\n public transform<T>(items: readonly T[] | null): readonly T[] | null;\n public transform<T>(\n items: ReadonlyArray<readonly T[]> | null,\n ): ReadonlyArray<readonly T[]> | null;\n public transform<T>(\n items: ReadonlyArray<readonly T[]> | readonly T[] | null,\n ): ReadonlyArray<readonly T[]> | readonly T[] | null {\n if (!items) {\n return null;\n }\n\n const value = this.textfield.control?.value || [];\n\n return tuiIsFlat(items)\n ? this.filter(items, value, this.handlers.identityMatcher())\n : this.filter2d(items, value, this.handlers.identityMatcher());\n }\n\n @tuiPure\n private filter2d<T>(\n items: ReadonlyArray<readonly T[]>,\n value: readonly T[],\n matcher: TuiIdentityMatcher<T>,\n ): ReadonlyArray<readonly T[]> {\n return items.map((subItems) => this.filter(subItems, value, matcher));\n }\n\n @tuiPure\n private filter<T>(\n items: readonly T[],\n value: readonly T[],\n matcher: TuiIdentityMatcher<T>,\n ): readonly T[] {\n return items.filter((item) =>\n value.every((selected) => !matcher(selected, item)),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAQA,MAKa,mBAAmB,CAAA;AALhC,IAAA,WAAA,GAAA;AAMqB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAC1C,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAuC1D,KAAA;AAjCU,IAAA,SAAS,CACZ,KAAwD,EAAA;QAExD,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;QAElD,OAAO,SAAS,CAAC,KAAK,CAAC;AACnB,cAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,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CAAA,EAAA,cAAA,EAAA,EAAA,QAAQ,MASR,MAAM,EAAA,EAAA,EAAA,EAAA,CAAA;;AC7ClB;;AAEG;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TuiHideSelectedPipe implements PipeTransform {
|
|
4
|
-
private readonly textfield;
|
|
5
|
-
private readonly handlers;
|
|
6
|
-
transform<T>(items: readonly T[] | null): readonly T[] | null;
|
|
7
|
-
transform<T>(items: ReadonlyArray<readonly T[]> | null): ReadonlyArray<readonly T[]> | null;
|
|
8
|
-
private filter2d;
|
|
9
|
-
private filter;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TuiHideSelectedPipe, never>;
|
|
11
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<TuiHideSelectedPipe, "tuiHideSelected", true>;
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './hide-selected.pipe';
|
package/utils/inject-value.d.ts
DELETED