@ng-doc/ui-kit 22.0.0-beta.1 → 22.0.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/README.md +20 -29
- package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs +43 -22
- package/fesm2022/ng-doc-ui-kit-cdk-combobox-host.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs +24 -13
- package/fesm2022/ng-doc-ui-kit-classes-base-input.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs +62 -22
- package/fesm2022/ng-doc-ui-kit-classes-overlay-ref.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs +39 -14
- package/fesm2022/ng-doc-ui-kit-components-blockquote.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs +30 -18
- package/fesm2022/ng-doc-ui-kit-components-button-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs +12 -9
- package/fesm2022/ng-doc-ui-kit-components-button-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-button.mjs +15 -24
- package/fesm2022/ng-doc-ui-kit-components-button.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs +13 -13
- package/fesm2022/ng-doc-ui-kit-components-checkbox.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs +14 -9
- package/fesm2022/ng-doc-ui-kit-components-clear-control.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-combobox.mjs +30 -26
- package/fesm2022/ng-doc-ui-kit-components-combobox.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs +37 -38
- package/fesm2022/ng-doc-ui-kit-components-data-list-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-data-list.mjs +32 -39
- package/fesm2022/ng-doc-ui-kit-components-data-list.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs +23 -20
- package/fesm2022/ng-doc-ui-kit-components-dialog-outlet.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-dot.mjs +20 -16
- package/fesm2022/ng-doc-ui-kit-components-dot.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs +120 -125
- package/fesm2022/ng-doc-ui-kit-components-dropdown.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-expander.mjs +17 -17
- package/fesm2022/ng-doc-ui-kit-components-expander.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs +4 -4
- package/fesm2022/ng-doc-ui-kit-components-floated-border.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs +16 -17
- package/fesm2022/ng-doc-ui-kit-components-floated-content.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs +20 -12
- package/fesm2022/ng-doc-ui-kit-components-focus-control.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-icon.mjs +175 -54
- package/fesm2022/ng-doc-ui-kit-components-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs +43 -46
- package/fesm2022/ng-doc-ui-kit-components-input-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-label.mjs +14 -16
- package/fesm2022/ng-doc-ui-kit-components-label.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-line.mjs +7 -4
- package/fesm2022/ng-doc-ui-kit-components-line.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-list.mjs +24 -8
- package/fesm2022/ng-doc-ui-kit-components-list.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs +9 -4
- package/fesm2022/ng-doc-ui-kit-components-magnifier-controller.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs +39 -18
- package/fesm2022/ng-doc-ui-kit-components-magnifier.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-option-group.mjs +22 -27
- package/fesm2022/ng-doc-ui-kit-components-option-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-option.mjs +28 -22
- package/fesm2022/ng-doc-ui-kit-components-option.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs +56 -52
- package/fesm2022/ng-doc-ui-kit-components-overlay-container.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs +19 -21
- package/fesm2022/ng-doc-ui-kit-components-overlay-pointer.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-pane.mjs +91 -69
- package/fesm2022/ng-doc-ui-kit-components-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-selection.mjs +173 -76
- package/fesm2022/ng-doc-ui-kit-components-selection.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs +23 -22
- package/fesm2022/ng-doc-ui-kit-components-sidenav.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-spinner.mjs +14 -12
- package/fesm2022/ng-doc-ui-kit-components-spinner.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs +86 -61
- package/fesm2022/ng-doc-ui-kit-components-tab-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs +16 -13
- package/fesm2022/ng-doc-ui-kit-components-tab-routes-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-tag.mjs +23 -24
- package/fesm2022/ng-doc-ui-kit-components-tag.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-text.mjs +37 -52
- package/fesm2022/ng-doc-ui-kit-components-text.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-toggle.mjs +82 -57
- package/fesm2022/ng-doc-ui-kit-components-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs +7 -4
- package/fesm2022/ng-doc-ui-kit-components-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs +13 -10
- package/fesm2022/ng-doc-ui-kit-directives-autofocus.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs +30 -26
- package/fesm2022/ng-doc-ui-kit-directives-checked-change.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-data.mjs +8 -5
- package/fesm2022/ng-doc-ui-kit-directives-data.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs +19 -18
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-handler.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs +7 -9
- package/fesm2022/ng-doc-ui-kit-directives-dropdown-origin.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs +22 -19
- package/fesm2022/ng-doc-ui-kit-directives-event-switcher.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs +30 -25
- package/fesm2022/ng-doc-ui-kit-directives-focus-catcher.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs +13 -16
- package/fesm2022/ng-doc-ui-kit-directives-focusable.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs +90 -0
- package/fesm2022/ng-doc-ui-kit-directives-fullscreen.mjs.map +1 -0
- package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs +34 -28
- package/fesm2022/ng-doc-ui-kit-directives-hotkey.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs +10 -12
- package/fesm2022/ng-doc-ui-kit-directives-input-number.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs +9 -12
- package/fesm2022/ng-doc-ui-kit-directives-input-string.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs +7 -4
- package/fesm2022/ng-doc-ui-kit-directives-radio-group.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs +16 -22
- package/fesm2022/ng-doc-ui-kit-directives-rotator.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs +105 -101
- package/fesm2022/ng-doc-ui-kit-directives-tooltip.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-directives.mjs +1 -1
- package/fesm2022/ng-doc-ui-kit-interceptors.mjs +24 -21
- package/fesm2022/ng-doc-ui-kit-interceptors.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-observables.mjs +2 -58
- package/fesm2022/ng-doc-ui-kit-observables.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-as-array.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-bind.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-execute.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs +3 -4
- package/fesm2022/ng-doc-ui-kit-pipes-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-dialog.mjs +14 -8
- package/fesm2022/ng-doc-ui-kit-services-dialog.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-notify.mjs +13 -8
- package/fesm2022/ng-doc-ui-kit-services-notify.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs +15 -11
- package/fesm2022/ng-doc-ui-kit-services-overlay-strategy.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-overlay.mjs +20 -9
- package/fesm2022/ng-doc-ui-kit-services-overlay.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-services-scroll.mjs +11 -13
- package/fesm2022/ng-doc-ui-kit-services-scroll.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-tokens.mjs +29 -3
- package/fesm2022/ng-doc-ui-kit-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-ui-kit-types.mjs +0 -1
- package/fesm2022/ng-doc-ui-kit-types.mjs.map +1 -1
- package/package.json +31 -33
- package/styles/main.css +275 -38
- package/types/ng-doc-ui-kit-cdk-combobox-host.d.ts +16 -8
- package/types/ng-doc-ui-kit-classes-base-input.d.ts +12 -1
- package/types/ng-doc-ui-kit-classes-overlay-ref.d.ts +27 -4
- package/types/ng-doc-ui-kit-components-blockquote.d.ts +22 -5
- package/types/ng-doc-ui-kit-components-button-icon.d.ts +23 -5
- package/types/ng-doc-ui-kit-components-button-toggle.d.ts +5 -1
- package/types/ng-doc-ui-kit-components-button.d.ts +6 -6
- package/types/ng-doc-ui-kit-components-checkbox.d.ts +5 -3
- package/types/ng-doc-ui-kit-components-clear-control.d.ts +7 -0
- package/types/ng-doc-ui-kit-components-combobox.d.ts +19 -9
- package/types/ng-doc-ui-kit-components-data-list-group.d.ts +16 -11
- package/types/ng-doc-ui-kit-components-data-list.d.ts +21 -11
- package/types/ng-doc-ui-kit-components-dialog-outlet.d.ts +11 -6
- package/types/ng-doc-ui-kit-components-dot.d.ts +10 -5
- package/types/ng-doc-ui-kit-components-dropdown.d.ts +39 -27
- package/types/ng-doc-ui-kit-components-expander.d.ts +9 -7
- package/types/ng-doc-ui-kit-components-floated-content.d.ts +8 -6
- package/types/ng-doc-ui-kit-components-focus-control.d.ts +10 -4
- package/types/ng-doc-ui-kit-components-icon.d.ts +49 -14
- package/types/ng-doc-ui-kit-components-input-wrapper.d.ts +31 -17
- package/types/ng-doc-ui-kit-components-label.d.ts +8 -5
- package/types/ng-doc-ui-kit-components-line.d.ts +3 -0
- package/types/ng-doc-ui-kit-components-list.d.ts +14 -3
- package/types/ng-doc-ui-kit-components-magnifier-controller.d.ts +5 -1
- package/types/ng-doc-ui-kit-components-magnifier.d.ts +19 -4
- package/types/ng-doc-ui-kit-components-option-group.d.ts +12 -8
- package/types/ng-doc-ui-kit-components-option.d.ts +9 -2
- package/types/ng-doc-ui-kit-components-overlay-container.d.ts +18 -15
- package/types/ng-doc-ui-kit-components-overlay-pointer.d.ts +10 -6
- package/types/ng-doc-ui-kit-components-pane.d.ts +25 -9
- package/types/ng-doc-ui-kit-components-selection.d.ts +59 -21
- package/types/ng-doc-ui-kit-components-sidenav.d.ts +17 -8
- package/types/ng-doc-ui-kit-components-spinner.d.ts +7 -3
- package/types/ng-doc-ui-kit-components-tab-group.d.ts +43 -22
- package/types/ng-doc-ui-kit-components-tab-routes-group.d.ts +4 -2
- package/types/ng-doc-ui-kit-components-tag.d.ts +13 -6
- package/types/ng-doc-ui-kit-components-text.d.ts +21 -19
- package/types/ng-doc-ui-kit-components-toggle.d.ts +13 -7
- package/types/ng-doc-ui-kit-components-wrapper.d.ts +3 -0
- package/types/ng-doc-ui-kit-directives-autofocus.d.ts +7 -5
- package/types/ng-doc-ui-kit-directives-checked-change.d.ts +15 -11
- package/types/ng-doc-ui-kit-directives-data.d.ts +6 -4
- package/types/ng-doc-ui-kit-directives-dropdown-handler.d.ts +5 -3
- package/types/ng-doc-ui-kit-directives-dropdown-origin.d.ts +0 -2
- package/types/ng-doc-ui-kit-directives-event-switcher.d.ts +11 -6
- package/types/ng-doc-ui-kit-directives-focus-catcher.d.ts +11 -8
- package/types/ng-doc-ui-kit-directives-focusable.d.ts +6 -3
- package/types/ng-doc-ui-kit-directives-fullscreen.d.ts +39 -0
- package/types/ng-doc-ui-kit-directives-hotkey.d.ts +14 -7
- package/types/ng-doc-ui-kit-directives-input-number.d.ts +3 -2
- package/types/ng-doc-ui-kit-directives-input-string.d.ts +2 -2
- package/types/ng-doc-ui-kit-directives-radio-group.d.ts +4 -0
- package/types/ng-doc-ui-kit-directives-rotator.d.ts +8 -8
- package/types/ng-doc-ui-kit-directives-tooltip.d.ts +35 -23
- package/types/ng-doc-ui-kit-directives.d.ts +1 -1
- package/types/ng-doc-ui-kit-interceptors.d.ts +18 -2
- package/types/ng-doc-ui-kit-interfaces.d.ts +20 -4
- package/types/ng-doc-ui-kit-observables.d.ts +2 -19
- package/types/ng-doc-ui-kit-services-dialog.d.ts +10 -1
- package/types/ng-doc-ui-kit-services-notify.d.ts +9 -1
- package/types/ng-doc-ui-kit-services-overlay-strategy.d.ts +5 -3
- package/types/ng-doc-ui-kit-services-overlay.d.ts +14 -3
- package/types/ng-doc-ui-kit-services-scroll.d.ts +4 -5
- package/types/ng-doc-ui-kit-types.d.ts +2 -2
- package/fesm2022/ng-doc-ui-kit-decorators.mjs +0 -53
- package/fesm2022/ng-doc-ui-kit-decorators.mjs.map +0 -1
- package/fesm2022/ng-doc-ui-kit-directives-let.mjs +0 -43
- package/fesm2022/ng-doc-ui-kit-directives-let.mjs.map +0 -1
- package/types/ng-doc-ui-kit-decorators.d.ts +0 -12
- package/types/ng-doc-ui-kit-directives-let.d.ts +0 -22
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, contentChild, TemplateRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import { NgDocComboboxHostComponent } from '@ng-doc/ui-kit/cdk/combobox-host';
|
|
5
5
|
import { NgDocListHost } from '@ng-doc/ui-kit/classes/list-host';
|
|
6
6
|
import { NgDocClearControlComponent } from '@ng-doc/ui-kit/components/clear-control';
|
|
7
7
|
import { NgDocDropdownComponent } from '@ng-doc/ui-kit/components/dropdown';
|
|
8
|
+
import { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';
|
|
8
9
|
import { NgDocInputWrapperComponent } from '@ng-doc/ui-kit/components/input-wrapper';
|
|
9
10
|
import { NgDocDataDirective } from '@ng-doc/ui-kit/directives/data';
|
|
10
11
|
import { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher';
|
|
@@ -12,29 +13,44 @@ import { NgDocInputStringDirective } from '@ng-doc/ui-kit/directives/input-strin
|
|
|
12
13
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
13
14
|
import { DIControl, provideHostControl } from 'di-controls';
|
|
14
15
|
|
|
16
|
+
/**
|
|
17
|
+
* A select with an optional text field. Its options are an `ng-doc-list` in a template marked
|
|
18
|
+
* with the `ngDocData` directive.
|
|
19
|
+
*/
|
|
15
20
|
class NgDocComboboxComponent extends DIControl {
|
|
16
21
|
constructor() {
|
|
17
22
|
super();
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
23
|
+
/** Whether the text field is read-only: the value is picked from the list only. */
|
|
24
|
+
this.readonly = input(false, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/** Placeholder of the text field. */
|
|
27
|
+
this.placeholder = input('Chose the value', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** Whether the clear button is shown. */
|
|
30
|
+
this.clearButton = input(true, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "clearButton" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Content shown at the right of the field. */
|
|
33
|
+
this.rightContent = input('', /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "rightContent" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Content that shows the value while the field is not being edited. */
|
|
36
|
+
this.valueContent = input('', /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "valueContent" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** The template of the options, marked with the `ngDocData` directive. */
|
|
39
|
+
this.data = contentChild(NgDocDataDirective, { ...(ngDevMode ? { debugName: "data" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
24
40
|
}
|
|
25
41
|
get listHostOrigin() {
|
|
26
42
|
return this.elementRef.nativeElement;
|
|
27
43
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
44
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocComboboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
45
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocComboboxComponent, isStandalone: true, selector: "ng-doc-combobox", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clearButton: { classPropertyName: "clearButton", publicName: "clearButton", isSignal: true, isRequired: false, transformFunction: null }, rightContent: { classPropertyName: "rightContent", publicName: "rightContent", isSignal: true, isRequired: false, transformFunction: null }, valueContent: { classPropertyName: "valueContent", publicName: "valueContent", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
30
46
|
provideHostControl(NgDocComboboxComponent),
|
|
31
47
|
{
|
|
32
48
|
provide: NgDocListHost,
|
|
33
49
|
useExisting: NgDocComboboxComponent,
|
|
34
50
|
},
|
|
35
|
-
], queries: [{ propertyName: "data", first: true, predicate: NgDocDataDirective, descendants: true, read: TemplateRef }], usesInheritance: true, ngImport: i0, template: "<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly\" [placeholder]=\"placeholder\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent\"></ng-container>\n @if (clearButton) {\n <ng-doc-clear-control></ng-doc-clear-control>\n }\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n", styles: [":host{display:block;width:100%}\n"], dependencies: [{ kind: "component", type: NgDocComboboxHostComponent, selector: "ng-doc-combobox-host", inputs: ["compareFn", "displayValueFn"] }, { kind: "component", type: NgDocInputWrapperComponent, selector: "ng-doc-input-wrapper", inputs: ["blurContent", "blurContext", "align"] }, { kind: "directive", type: NgDocFocusCatcherDirective, selector: "[ngDocFocusCatcher]", outputs: ["focusEvent", "blurEvent"], exportAs: ["ngDocFocusCatcher"] }, { kind: "directive", type: NgDocInputStringDirective, selector: "input[ngDocInputString]" }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: NgDocClearControlComponent, selector: "ng-doc-clear-control" }, { kind: "component", type: NgDocDropdownComponent, selector: "ng-doc-dropdown", inputs: ["content", "origin", "closeIfOutsideClick", "closeIfInnerClick", "withArrow", "borderOffset", "panelClass", "contactBorder", "hasBackdrop", "positions", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
51
|
+
], queries: [{ propertyName: "data", first: true, predicate: NgDocDataDirective, descendants: true, read: TemplateRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent() : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly()\" [placeholder]=\"placeholder()\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent()\"></ng-container>\n @if (clearButton()) {\n <ng-doc-clear-control></ng-doc-clear-control>\n }\n @if (readonly()) {\n <ng-doc-icon\n class=\"ng-doc-combobox-chevron\"\n icon=\"chevron-right\"\n aria-hidden=\"true\"></ng-doc-icon>\n }\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data() ?? null\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n", styles: [":host{display:block;width:100%}.ng-doc-combobox-chevron{flex:none;width:24px;transform:rotate(90deg);--ng-doc-icon-color: var(--ng-doc-text-muted)}\n"], dependencies: [{ kind: "component", type: NgDocComboboxHostComponent, selector: "ng-doc-combobox-host", inputs: ["compareFn", "displayValueFn"] }, { kind: "component", type: NgDocInputWrapperComponent, selector: "ng-doc-input-wrapper", inputs: ["blurContent", "blurContext", "align"] }, { kind: "directive", type: NgDocFocusCatcherDirective, selector: "[ngDocFocusCatcher]", outputs: ["focusEvent", "blurEvent"], exportAs: ["ngDocFocusCatcher"] }, { kind: "directive", type: NgDocInputStringDirective, selector: "input[ngDocInputString]" }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: NgDocClearControlComponent, selector: "ng-doc-clear-control" }, { kind: "component", type: NgDocDropdownComponent, selector: "ng-doc-dropdown", inputs: ["content", "origin", "closeIfOutsideClick", "closeIfInnerClick", "withArrow", "borderOffset", "panelClass", "contactBorder", "hasBackdrop", "positions", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
52
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocComboboxComponent, decorators: [{
|
|
38
54
|
type: Component,
|
|
39
55
|
args: [{ selector: 'ng-doc-combobox', providers: [
|
|
40
56
|
provideHostControl(NgDocComboboxComponent),
|
|
@@ -50,22 +66,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
50
66
|
PolymorpheusOutlet,
|
|
51
67
|
NgDocClearControlComponent,
|
|
52
68
|
NgDocDropdownComponent,
|
|
69
|
+
NgDocIconComponent,
|
|
53
70
|
NgTemplateOutlet,
|
|
54
|
-
], template: "<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly\" [placeholder]=\"placeholder\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent\"></ng-container>\n @if (clearButton) {\n <ng-doc-clear-control></ng-doc-clear-control>\n }\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n", styles: [":host{display:block;width:100%}\n"] }]
|
|
55
|
-
}], ctorParameters: () => [], propDecorators: { readonly: [{
|
|
56
|
-
type: Input
|
|
57
|
-
}], placeholder: [{
|
|
58
|
-
type: Input
|
|
59
|
-
}], clearButton: [{
|
|
60
|
-
type: Input
|
|
61
|
-
}], rightContent: [{
|
|
62
|
-
type: Input
|
|
63
|
-
}], valueContent: [{
|
|
64
|
-
type: Input
|
|
65
|
-
}], data: [{
|
|
66
|
-
type: ContentChild,
|
|
67
|
-
args: [NgDocDataDirective, { read: TemplateRef }]
|
|
68
|
-
}] } });
|
|
71
|
+
], template: "<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent() : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly()\" [placeholder]=\"placeholder()\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent()\"></ng-container>\n @if (clearButton()) {\n <ng-doc-clear-control></ng-doc-clear-control>\n }\n @if (readonly()) {\n <ng-doc-icon\n class=\"ng-doc-combobox-chevron\"\n icon=\"chevron-right\"\n aria-hidden=\"true\"></ng-doc-icon>\n }\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data() ?? null\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n", styles: [":host{display:block;width:100%}.ng-doc-combobox-chevron{flex:none;width:24px;transform:rotate(90deg);--ng-doc-icon-color: var(--ng-doc-text-muted)}\n"] }]
|
|
72
|
+
}], ctorParameters: () => [], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearButton", required: false }] }], rightContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "rightContent", required: false }] }], valueContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueContent", required: false }] }], data: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NgDocDataDirective), { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
69
73
|
|
|
70
74
|
/**
|
|
71
75
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-combobox.mjs","sources":["../../../../libs/ui-kit/components/combobox/combobox.component.ts","../../../../libs/ui-kit/components/combobox/combobox.component.html","../../../../libs/ui-kit/components/combobox/ng-doc-ui-kit-components-combobox.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-combobox.mjs","sources":["../../../../libs/ui-kit/components/combobox/combobox.component.ts","../../../../libs/ui-kit/components/combobox/combobox.component.html","../../../../libs/ui-kit/components/combobox/ng-doc-ui-kit-components-combobox.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n contentChild,\n input,\n TemplateRef,\n} from '@angular/core';\nimport { NgDocComboboxHostComponent } from '@ng-doc/ui-kit/cdk/combobox-host';\nimport { NgDocListHost } from '@ng-doc/ui-kit/classes/list-host';\nimport { NgDocClearControlComponent } from '@ng-doc/ui-kit/components/clear-control';\nimport { NgDocDropdownComponent } from '@ng-doc/ui-kit/components/dropdown';\nimport { NgDocIconComponent } from '@ng-doc/ui-kit/components/icon';\nimport { NgDocInputWrapperComponent } from '@ng-doc/ui-kit/components/input-wrapper';\nimport { NgDocDataDirective } from '@ng-doc/ui-kit/directives/data';\nimport { NgDocFocusCatcherDirective } from '@ng-doc/ui-kit/directives/focus-catcher';\nimport { NgDocInputStringDirective } from '@ng-doc/ui-kit/directives/input-string';\nimport { NgDocContextWithImplicit } from '@ng-doc/ui-kit/interfaces';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\nimport { DIControl, provideHostControl } from 'di-controls';\n\n/**\n * A select with an optional text field. Its options are an `ng-doc-list` in a template marked\n * with the `ngDocData` directive.\n */\n@Component({\n selector: 'ng-doc-combobox',\n templateUrl: './combobox.component.html',\n styleUrls: ['./combobox.component.scss'],\n providers: [\n provideHostControl(NgDocComboboxComponent),\n {\n provide: NgDocListHost,\n useExisting: NgDocComboboxComponent,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocComboboxHostComponent,\n NgDocInputWrapperComponent,\n NgDocFocusCatcherDirective,\n NgDocInputStringDirective,\n PolymorpheusOutlet,\n NgDocClearControlComponent,\n NgDocDropdownComponent,\n NgDocIconComponent,\n NgTemplateOutlet,\n ],\n})\nexport class NgDocComboboxComponent<T> extends DIControl<T> implements NgDocListHost {\n /** Whether the text field is read-only: the value is picked from the list only. */\n readonly readonly = input<boolean>(false);\n\n /** Placeholder of the text field. */\n readonly placeholder = input<string>('Chose the value');\n\n /** Whether the clear button is shown. */\n readonly clearButton = input<boolean>(true);\n\n /** Content shown at the right of the field. */\n readonly rightContent = input<NgDocContent>('');\n\n /** Content that shows the value while the field is not being edited. */\n readonly valueContent = input<NgDocContent<NgDocContextWithImplicit<T | null>>>('');\n\n /** The template of the options, marked with the `ngDocData` directive. */\n readonly data = contentChild(NgDocDataDirective, { read: TemplateRef });\n\n constructor() {\n super();\n }\n\n get listHostOrigin(): HTMLElement {\n return this.elementRef.nativeElement;\n }\n}\n","<ng-doc-combobox-host>\n <ng-doc-input-wrapper\n ngDocFocusCatcher\n [blurContent]=\"hasValue ? valueContent() : ''\"\n [blurContext]=\"model()\">\n <input ngDocInputString [readonly]=\"readonly()\" [placeholder]=\"placeholder()\" />\n <ng-container ngDocInputWrapperRight>\n <ng-container *polymorpheusOutlet=\"rightContent()\"></ng-container>\n @if (clearButton()) {\n <ng-doc-clear-control></ng-doc-clear-control>\n }\n @if (readonly()) {\n <ng-doc-icon\n class=\"ng-doc-combobox-chevron\"\n icon=\"chevron-right\"\n aria-hidden=\"true\"></ng-doc-icon>\n }\n </ng-container>\n <ng-doc-dropdown [content]=\"dropdownContent\" [closeIfInnerClick]=\"true\">\n <ng-template #dropdownContent>\n <ng-container *ngTemplateOutlet=\"data() ?? null\"></ng-container>\n </ng-template>\n </ng-doc-dropdown>\n </ng-doc-input-wrapper>\n</ng-doc-combobox-host>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA;;;AAGG;AAyBG,MAAO,sBAA0B,SAAQ,SAAY,CAAA;AAmBzD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;QAlBA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK;qFAAC;;QAGhC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,iBAAiB;wFAAC;;QAG9C,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,IAAI;wFAAC;;QAGlC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAe,EAAE;yFAAC;;QAGtC,IAAA,CAAA,YAAY,GAAG,KAAK,CAAmD,EAAE;yFAAC;;QAG1E,IAAA,CAAA,IAAI,GAAG,YAAY,CAAC,kBAAkB,4EAAI,IAAI,EAAE,WAAW,EAAA,CAAG;IAIvE;AAEA,IAAA,IAAI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa;IACtC;8GAzBW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,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A,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,kBAAkB,CAAA,EAAA,EAAA,GAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnExE;;AAEG;;;;"}
|
|
@@ -1,49 +1,52 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
3
|
import { NgDocDataListComponent } from '@ng-doc/ui-kit/components/data-list';
|
|
5
4
|
import { NgDocListComponent } from '@ng-doc/ui-kit/components/list';
|
|
6
5
|
import { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';
|
|
7
6
|
import { NgDocOptionGroupComponent, NgDocOptionGroupHeaderDirective } from '@ng-doc/ui-kit/components/option-group';
|
|
8
7
|
import { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';
|
|
9
8
|
import { NG_DOC_DEFAULT_STRINGIFY } from '@ng-doc/ui-kit/constants';
|
|
10
|
-
import { ngDocMakePure } from '@ng-doc/ui-kit/decorators';
|
|
11
9
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
12
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Data list whose options are grouped by `itemGroupFn`, with a header per group.
|
|
13
|
+
*/
|
|
13
14
|
class NgDocDataListGroupComponent extends NgDocDataListComponent {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const itemGroup =
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
/** Returns the group of an item. Without it, no option is shown. */
|
|
18
|
+
this.itemGroupFn = input(/* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [undefined, { debugName: "itemGroupFn" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Content of a group header; its context is the group. */
|
|
21
|
+
this.groupContent = input(({ $implicit }) => NG_DOC_DEFAULT_STRINGIFY($implicit), /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "groupContent" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** Items by group, in the order in which the groups first appear. */
|
|
24
|
+
this.groups = computed(() => {
|
|
25
|
+
const itemGroupFn = this.itemGroupFn();
|
|
26
|
+
const groups = new Map();
|
|
27
|
+
if (itemGroupFn) {
|
|
28
|
+
this.items()?.forEach((item) => {
|
|
29
|
+
const itemGroup = itemGroupFn(item);
|
|
30
|
+
const groupItems = groups.get(itemGroup);
|
|
31
|
+
if (groupItems) {
|
|
32
|
+
groupItems.push(item);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
groups.set(itemGroup, [item]);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return groups;
|
|
40
|
+
}, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
42
|
+
/** The groups, in the order in which they first appear. */
|
|
43
|
+
this.groupItems = computed(() => Array.from(this.groups().keys()), /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "groupItems" }] : /* istanbul ignore next */ []));
|
|
36
45
|
}
|
|
37
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
38
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDataListGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
47
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDataListGroupComponent, isStandalone: true, selector: "ng-doc-data-list-group", inputs: { itemGroupFn: { classPropertyName: "itemGroupFn", publicName: "itemGroupFn", isSignal: true, isRequired: false, transformFunction: null }, groupContent: { classPropertyName: "groupContent", publicName: "groupContent", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<ng-doc-list>\n @if (items()?.length) {\n @for (group of groupItems(); track group) {\n <ng-doc-option-group>\n <!-- The context literals are memoized per group and item, like a pure pipe. -->\n <span\n *polymorpheusOutlet=\"groupContent() as groupText; context: { $implicit: group }\"\n ngDocOptionGroupHeader>\n {{ groupText }}\n </span>\n @for (item of groups().get(group); track trackByFn()($index, item)) {\n <ng-doc-option [value]=\"defineValueFn()(item)\" [disabled]=\"itemDisabledFn()(item)\">\n <ng-container *polymorpheusOutlet=\"itemContent() as text; context: { $implicit: item }\">\n {{ text }}\n </ng-container>\n </ng-doc-option>\n }\n </ng-doc-option-group>\n }\n } @else {\n <div class=\"ng-doc-empty-message\" ng-doc-text>\n @if (emptyContent()) {\n <ng-container *polymorpheusOutlet=\"emptyContent() as text\"> {{ text }} </ng-container>\n }\n </div>\n }\n</ng-doc-list>\n", styles: [":host{display:block;max-height:var(--ng-doc-list-size)}ng-doc-option-group:not(:last-child){margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}.ng-doc-empty-message{padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);--ng-doc-font-size: 13px;--ng-doc-line-height: 22px}\n"], dependencies: [{ kind: "component", type: NgDocListComponent, selector: "ng-doc-list" }, { kind: "component", type: NgDocOptionGroupComponent, selector: "ng-doc-option-group" }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: NgDocOptionGroupHeaderDirective, selector: "[ngDocOptionGroupHeader]" }, { kind: "component", type: NgDocOptionComponent, selector: "ng-doc-option" }, { kind: "component", type: NgDocTextComponent, selector: "[ng-doc-text]", inputs: ["size", "color", "align", "absoluteContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
39
48
|
}
|
|
40
|
-
|
|
41
|
-
ngDocMakePure,
|
|
42
|
-
__metadata("design:type", Function),
|
|
43
|
-
__metadata("design:paramtypes", [Object]),
|
|
44
|
-
__metadata("design:returntype", Object)
|
|
45
|
-
], NgDocDataListGroupComponent.prototype, "getGroupContext", null);
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocDataListGroupComponent, decorators: [{
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDataListGroupComponent, decorators: [{
|
|
47
50
|
type: Component,
|
|
48
51
|
args: [{ selector: 'ng-doc-data-list-group', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
49
52
|
NgDocListComponent,
|
|
@@ -52,12 +55,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
52
55
|
NgDocOptionGroupHeaderDirective,
|
|
53
56
|
NgDocOptionComponent,
|
|
54
57
|
NgDocTextComponent,
|
|
55
|
-
], template: "<ng-doc-list>\n @if (items
|
|
56
|
-
}], propDecorators: { itemGroupFn: [{
|
|
57
|
-
type: Input
|
|
58
|
-
}], groupContent: [{
|
|
59
|
-
type: Input
|
|
60
|
-
}], getGroupContext: [] } });
|
|
58
|
+
], template: "<ng-doc-list>\n @if (items()?.length) {\n @for (group of groupItems(); track group) {\n <ng-doc-option-group>\n <!-- The context literals are memoized per group and item, like a pure pipe. -->\n <span\n *polymorpheusOutlet=\"groupContent() as groupText; context: { $implicit: group }\"\n ngDocOptionGroupHeader>\n {{ groupText }}\n </span>\n @for (item of groups().get(group); track trackByFn()($index, item)) {\n <ng-doc-option [value]=\"defineValueFn()(item)\" [disabled]=\"itemDisabledFn()(item)\">\n <ng-container *polymorpheusOutlet=\"itemContent() as text; context: { $implicit: item }\">\n {{ text }}\n </ng-container>\n </ng-doc-option>\n }\n </ng-doc-option-group>\n }\n } @else {\n <div class=\"ng-doc-empty-message\" ng-doc-text>\n @if (emptyContent()) {\n <ng-container *polymorpheusOutlet=\"emptyContent() as text\"> {{ text }} </ng-container>\n }\n </div>\n }\n</ng-doc-list>\n", styles: [":host{display:block;max-height:var(--ng-doc-list-size)}ng-doc-option-group:not(:last-child){margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}.ng-doc-empty-message{padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);--ng-doc-font-size: 13px;--ng-doc-line-height: 22px}\n"] }]
|
|
59
|
+
}], propDecorators: { itemGroupFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemGroupFn", required: false }] }], groupContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupContent", required: false }] }] } });
|
|
61
60
|
|
|
62
61
|
/**
|
|
63
62
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-data-list-group.mjs","sources":["../../../../libs/ui-kit/components/data-list-group/data-list-group.component.ts","../../../../libs/ui-kit/components/data-list-group/data-list-group.component.html","../../../../libs/ui-kit/components/data-list-group/ng-doc-ui-kit-components-data-list-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-data-list-group.mjs","sources":["../../../../libs/ui-kit/components/data-list-group/data-list-group.component.ts","../../../../libs/ui-kit/components/data-list-group/data-list-group.component.html","../../../../libs/ui-kit/components/data-list-group/ng-doc-ui-kit-components-data-list-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, Signal } from '@angular/core';\nimport { NgDocDataListComponent } from '@ng-doc/ui-kit/components/data-list';\nimport { NgDocListComponent } from '@ng-doc/ui-kit/components/list';\nimport { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';\nimport {\n NgDocOptionGroupComponent,\n NgDocOptionGroupHeaderDirective,\n} from '@ng-doc/ui-kit/components/option-group';\nimport { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';\nimport { NG_DOC_DEFAULT_STRINGIFY } from '@ng-doc/ui-kit/constants';\nimport { NgDocContextWithImplicit } from '@ng-doc/ui-kit/interfaces';\nimport { NgDocContent, NgDocGroupFn } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n/**\n * Data list whose options are grouped by `itemGroupFn`, with a header per group.\n */\n@Component({\n selector: 'ng-doc-data-list-group',\n templateUrl: './data-list-group.component.html',\n styleUrls: ['./data-list-group.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocListComponent,\n NgDocOptionGroupComponent,\n PolymorpheusOutlet,\n NgDocOptionGroupHeaderDirective,\n NgDocOptionComponent,\n NgDocTextComponent,\n ],\n})\nexport class NgDocDataListGroupComponent<T, G> extends NgDocDataListComponent<T> {\n /** Returns the group of an item. Without it, no option is shown. */\n readonly itemGroupFn = input<NgDocGroupFn<T, G>>();\n\n /** Content of a group header; its context is the group. */\n readonly groupContent = input<NgDocContent<NgDocContextWithImplicit<G>>>(\n ({ $implicit }: NgDocContextWithImplicit<G>) => NG_DOC_DEFAULT_STRINGIFY($implicit),\n );\n\n /** Items by group, in the order in which the groups first appear. */\n readonly groups: Signal<Map<G, T[]>> = computed(() => {\n const itemGroupFn: NgDocGroupFn<T, G> | undefined = this.itemGroupFn();\n const groups: Map<G, T[]> = new Map<G, T[]>();\n\n if (itemGroupFn) {\n this.items()?.forEach((item: T) => {\n const itemGroup: G = itemGroupFn(item);\n const groupItems: T[] | undefined = groups.get(itemGroup);\n\n if (groupItems) {\n groupItems.push(item);\n } else {\n groups.set(itemGroup, [item]);\n }\n });\n }\n\n return groups;\n });\n\n /** The groups, in the order in which they first appear. */\n readonly groupItems: Signal<G[]> = computed(() => Array.from(this.groups().keys()));\n}\n","<ng-doc-list>\n @if (items()?.length) {\n @for (group of groupItems(); track group) {\n <ng-doc-option-group>\n <!-- The context literals are memoized per group and item, like a pure pipe. -->\n <span\n *polymorpheusOutlet=\"groupContent() as groupText; context: { $implicit: group }\"\n ngDocOptionGroupHeader>\n {{ groupText }}\n </span>\n @for (item of groups().get(group); track trackByFn()($index, item)) {\n <ng-doc-option [value]=\"defineValueFn()(item)\" [disabled]=\"itemDisabledFn()(item)\">\n <ng-container *polymorpheusOutlet=\"itemContent() as text; context: { $implicit: item }\">\n {{ text }}\n </ng-container>\n </ng-doc-option>\n }\n </ng-doc-option-group>\n }\n } @else {\n <div class=\"ng-doc-empty-message\" ng-doc-text>\n @if (emptyContent()) {\n <ng-container *polymorpheusOutlet=\"emptyContent() as text\"> {{ text }} </ng-container>\n }\n </div>\n }\n</ng-doc-list>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAcA;;AAEG;AAeG,MAAO,2BAAkC,SAAQ,sBAAyB,CAAA;AAdhF,IAAA,WAAA,GAAA;;;AAgBW,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAsB;;AAGzC,QAAA,IAAA,CAAA,YAAY,GA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BAA+B;wBAC/B,oBAAoB;wBACpB,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EAAA,0hCAAA,EAAA,MAAA,EAAA,CAAA,kSAAA,CAAA,EAAA;;;AE7BH;;AAEG;;;;"}
|
|
@@ -1,57 +1,50 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
3
|
import { asArray } from '@ng-doc/core/helpers/as-array';
|
|
5
4
|
import { NgDocListComponent } from '@ng-doc/ui-kit/components/list';
|
|
6
5
|
import { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';
|
|
7
6
|
import { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';
|
|
8
7
|
import { NG_DOC_DEFAULT_STRINGIFY, NG_DOC_ALWAYS_FALSE_HANDLER, NG_DOC_DEFAULT_HANDLER } from '@ng-doc/ui-kit/constants';
|
|
9
|
-
import { ngDocMakePure } from '@ng-doc/ui-kit/decorators';
|
|
10
8
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
11
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Keyboard-navigable list of options built from `items`.
|
|
12
|
+
*/
|
|
12
13
|
class NgDocDataListComponent {
|
|
13
14
|
constructor() {
|
|
14
|
-
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
/** Whether the list takes focus when it opens. */
|
|
16
|
+
this.autofocus = input(true, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "autofocus" }] : /* istanbul ignore next */ []));
|
|
18
|
+
/** Items to show. */
|
|
19
|
+
this.items = input([], /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
21
|
+
/** Content of an option; its context is the item. */
|
|
22
|
+
this.itemContent = input(({ $implicit }) => NG_DOC_DEFAULT_STRINGIFY($implicit), /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "itemContent" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** Content shown when there are no items. */
|
|
25
|
+
this.emptyContent = input('', /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "emptyContent" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** Returns `true` for items whose option is disabled. */
|
|
28
|
+
this.itemDisabledFn = input(NG_DOC_ALWAYS_FALSE_HANDLER, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "itemDisabledFn" }] : /* istanbul ignore next */ []));
|
|
30
|
+
/** Maps an item to the value its option selects. */
|
|
31
|
+
this.defineValueFn = input(NG_DOC_DEFAULT_HANDLER, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "defineValueFn" }] : /* istanbul ignore next */ []));
|
|
33
|
+
/** Identifies items across changes of `items`. */
|
|
34
|
+
this.trackByFn = input((_index, item) => item, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "trackByFn" }] : /* istanbul ignore next */ []));
|
|
24
36
|
}
|
|
37
|
+
/** Returns the items as an array. */
|
|
25
38
|
getItems() {
|
|
26
|
-
return asArray(this.items);
|
|
39
|
+
return asArray(this.items());
|
|
27
40
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDataListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDataListComponent, isStandalone: true, selector: "ng-doc-data-list", inputs: { autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, itemContent: { classPropertyName: "itemContent", publicName: "itemContent", isSignal: true, isRequired: false, transformFunction: null }, emptyContent: { classPropertyName: "emptyContent", publicName: "emptyContent", isSignal: true, isRequired: false, transformFunction: null }, itemDisabledFn: { classPropertyName: "itemDisabledFn", publicName: "itemDisabledFn", isSignal: true, isRequired: false, transformFunction: null }, defineValueFn: { classPropertyName: "defineValueFn", publicName: "defineValueFn", isSignal: true, isRequired: false, transformFunction: null }, trackByFn: { classPropertyName: "trackByFn", publicName: "trackByFn", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-doc-list>\n @if (items()?.length) {\n @for (item of items(); track trackByFn()($index, item)) {\n <ng-doc-option [value]=\"defineValueFn()(item)\" [disabled]=\"itemDisabledFn()(item)\">\n <!-- The context literal is memoized per item, like a pure pipe. -->\n <ng-container *polymorpheusOutlet=\"itemContent() as text; context: { $implicit: item }\">\n {{ text }}\n </ng-container>\n </ng-doc-option>\n }\n } @else {\n <div class=\"ng-doc-empty-message\" ng-doc-text>\n @if (emptyContent()) {\n <ng-container *polymorpheusOutlet=\"emptyContent() as text\"> {{ text }} </ng-container>\n }\n </div>\n }\n</ng-doc-list>\n", styles: [":host{display:block;height:100%;overflow:auto;max-height:var(--ng-doc-list-size)}.ng-doc-empty-message{padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);--ng-doc-font-size: 14px;--ng-doc-line-height: 22px}ng-doc-checkbox{pointer-events:none}\n"], dependencies: [{ kind: "component", type: NgDocListComponent, selector: "ng-doc-list" }, { kind: "component", type: NgDocOptionComponent, selector: "ng-doc-option" }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: NgDocTextComponent, selector: "[ng-doc-text]", inputs: ["size", "color", "align", "absoluteContent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
30
43
|
}
|
|
31
|
-
|
|
32
|
-
ngDocMakePure,
|
|
33
|
-
__metadata("design:type", Function),
|
|
34
|
-
__metadata("design:paramtypes", [Object]),
|
|
35
|
-
__metadata("design:returntype", Object)
|
|
36
|
-
], NgDocDataListComponent.prototype, "getContext", null);
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgDocDataListComponent, decorators: [{
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDataListComponent, decorators: [{
|
|
38
45
|
type: Component,
|
|
39
|
-
args: [{ selector: 'ng-doc-data-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocListComponent, NgDocOptionComponent, PolymorpheusOutlet, NgDocTextComponent], template: "<ng-doc-list>\n @if (items
|
|
40
|
-
}], propDecorators: { autofocus: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], items: [{
|
|
43
|
-
type: Input
|
|
44
|
-
}], itemContent: [{
|
|
45
|
-
type: Input
|
|
46
|
-
}], emptyContent: [{
|
|
47
|
-
type: Input
|
|
48
|
-
}], itemDisabledFn: [{
|
|
49
|
-
type: Input
|
|
50
|
-
}], defineValueFn: [{
|
|
51
|
-
type: Input
|
|
52
|
-
}], trackByFn: [{
|
|
53
|
-
type: Input
|
|
54
|
-
}], getContext: [] } });
|
|
46
|
+
args: [{ selector: 'ng-doc-data-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocListComponent, NgDocOptionComponent, PolymorpheusOutlet, NgDocTextComponent], template: "<ng-doc-list>\n @if (items()?.length) {\n @for (item of items(); track trackByFn()($index, item)) {\n <ng-doc-option [value]=\"defineValueFn()(item)\" [disabled]=\"itemDisabledFn()(item)\">\n <!-- The context literal is memoized per item, like a pure pipe. -->\n <ng-container *polymorpheusOutlet=\"itemContent() as text; context: { $implicit: item }\">\n {{ text }}\n </ng-container>\n </ng-doc-option>\n }\n } @else {\n <div class=\"ng-doc-empty-message\" ng-doc-text>\n @if (emptyContent()) {\n <ng-container *polymorpheusOutlet=\"emptyContent() as text\"> {{ text }} </ng-container>\n }\n </div>\n }\n</ng-doc-list>\n", styles: [":host{display:block;height:100%;overflow:auto;max-height:var(--ng-doc-list-size)}.ng-doc-empty-message{padding:var(--ng-doc-base-gutter) calc(var(--ng-doc-base-gutter) * 2);--ng-doc-font-size: 14px;--ng-doc-line-height: 22px}ng-doc-checkbox{pointer-events:none}\n"] }]
|
|
47
|
+
}], propDecorators: { autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], itemContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemContent", required: false }] }], emptyContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyContent", required: false }] }], itemDisabledFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabledFn", required: false }] }], defineValueFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "defineValueFn", required: false }] }], trackByFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByFn", required: false }] }] } });
|
|
55
48
|
|
|
56
49
|
/**
|
|
57
50
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-data-list.mjs","sources":["../../../../libs/ui-kit/components/data-list/data-list.component.ts","../../../../libs/ui-kit/components/data-list/data-list.component.html","../../../../libs/ui-kit/components/data-list/ng-doc-ui-kit-components-data-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component,
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-data-list.mjs","sources":["../../../../libs/ui-kit/components/data-list/data-list.component.ts","../../../../libs/ui-kit/components/data-list/data-list.component.html","../../../../libs/ui-kit/components/data-list/ng-doc-ui-kit-components-data-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, TrackByFunction } from '@angular/core';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocListComponent } from '@ng-doc/ui-kit/components/list';\nimport { NgDocOptionComponent } from '@ng-doc/ui-kit/components/option';\nimport { NgDocTextComponent } from '@ng-doc/ui-kit/components/text';\nimport {\n NG_DOC_ALWAYS_FALSE_HANDLER,\n NG_DOC_DEFAULT_HANDLER,\n NG_DOC_DEFAULT_STRINGIFY,\n} from '@ng-doc/ui-kit/constants';\nimport { NgDocContextWithImplicit } from '@ng-doc/ui-kit/interfaces';\nimport { NgDocBooleanHandler, NgDocContent, NgDocDefineValueFunction } from '@ng-doc/ui-kit/types';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\n\n/**\n * Keyboard-navigable list of options built from `items`.\n */\n@Component({\n selector: 'ng-doc-data-list',\n templateUrl: './data-list.component.html',\n styleUrls: ['./data-list.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocListComponent, NgDocOptionComponent, PolymorpheusOutlet, NgDocTextComponent],\n})\nexport class NgDocDataListComponent<T> {\n /** Whether the list takes focus when it opens. */\n readonly autofocus = input<boolean>(true);\n\n /** Items to show. */\n readonly items = input<readonly T[] | null>([]);\n\n /** Content of an option; its context is the item. */\n readonly itemContent = input<NgDocContent<NgDocContextWithImplicit<T>>>(\n ({ $implicit }: NgDocContextWithImplicit<T>) => NG_DOC_DEFAULT_STRINGIFY($implicit),\n );\n\n /** Content shown when there are no items. */\n readonly emptyContent = input<NgDocContent>('');\n\n /** Returns `true` for items whose option is disabled. */\n readonly itemDisabledFn = input<NgDocBooleanHandler<T>>(NG_DOC_ALWAYS_FALSE_HANDLER);\n\n /** Maps an item to the value its option selects. */\n readonly defineValueFn =\n input<NgDocDefineValueFunction<unknown, unknown>>(NG_DOC_DEFAULT_HANDLER);\n\n /** Identifies items across changes of `items`. */\n readonly trackByFn = input<TrackByFunction<T>>((_index: number, item: T) => item);\n\n /** Returns the items as an array. */\n getItems(): T[] {\n return asArray(this.items());\n }\n}\n","<ng-doc-list>\n @if (items()?.length) {\n @for (item of items(); track trackByFn()($index, item)) {\n <ng-doc-option [value]=\"defineValueFn()(item)\" [disabled]=\"itemDisabledFn()(item)\">\n <!-- The context literal is memoized per item, like a pure pipe. -->\n <ng-container *polymorpheusOutlet=\"itemContent() as text; context: { $implicit: item }\">\n {{ text }}\n </ng-container>\n </ng-doc-option>\n }\n } @else {\n <div class=\"ng-doc-empty-message\" ng-doc-text>\n @if (emptyContent()) {\n <ng-container *polymorpheusOutlet=\"emptyContent() as text\"> {{ text }} </ng-container>\n }\n </div>\n }\n</ng-doc-list>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAcA;;AAEG;MAQU,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,SAAS,GAAG,KAAK,CAAU,IAAI;sFAAC;;QAGhC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAsB,EAAE;kFAAC;;AAGtC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAC1B,CAAC,EAAE,SAAS,EAA+B,KAAK,wBAAwB,CAAC,SAAS,CAAC;wFACpF;;QAGQ,IAAA,CAAA,YAAY,GAAG,KAAK,CAAe,EAAE;yFAAC;;QAGtC,IAAA,CAAA,cAAc,GAAG,KAAK,CAAyB,2BAA2B;2FAAC;;QAG3E,IAAA,CAAA,aAAa,GACpB,KAAK,CAA6C,sBAAsB;0FAAC;;QAGlE,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,CAAC,MAAc,EAAE,IAAO,KAAK,IAAI;sFAAC;AAMlF,IAAA;;IAHC,QAAQ,GAAA;AACN,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC9B;8GA5BW,sBAAsB,EAAA,IA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QAAA,ECxBnC,urBAkBA,EAAA,MAAA,EAAA,CAAA,yQAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIY,kBAAkB,wDAAE,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,kBAAkB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,2BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,kBAAkB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,OAAA,EAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAE/E,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,kBAAkB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,urBAAA,EAAA,MAAA,EAAA,CAAA,yQAAA,CAAA,EAAA;;;AEtB7F;;AAEG;;;;"}
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, viewChild, contentChild, inject, DestroyRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { Router, ActivatedRoute
|
|
4
|
+
import { RouterOutlet, Router, ActivatedRoute } from '@angular/router';
|
|
5
5
|
import { NgDocDialogService } from '@ng-doc/ui-kit/services/dialog';
|
|
6
6
|
import { Subject, switchMap, NEVER, merge } from 'rxjs';
|
|
7
7
|
import { takeUntil, map, startWith } from 'rxjs/operators';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Shows the projected router outlet in a dialog while one of its routes is active, and navigates
|
|
11
|
+
* back to the parent route when the dialog closes.
|
|
12
|
+
*/
|
|
9
13
|
class DialogOutletComponent {
|
|
10
14
|
constructor() {
|
|
15
|
+
/** Options of the dialog. */
|
|
16
|
+
this.config = input(/* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [undefined, { debugName: "config" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.outletContent = viewChild.required('outletContent', /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "outletContent" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.routerOutlet = contentChild(RouterOutlet, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "routerOutlet" }] : /* istanbul ignore next */ []));
|
|
11
22
|
this.router = inject(Router);
|
|
12
23
|
this.route = inject(ActivatedRoute);
|
|
13
24
|
this.dialogService = inject(NgDocDialogService);
|
|
14
25
|
this.destroyRef = inject(DestroyRef);
|
|
15
26
|
}
|
|
16
27
|
ngAfterContentInit() {
|
|
17
|
-
|
|
28
|
+
const routerOutlet = this.routerOutlet();
|
|
29
|
+
if (routerOutlet) {
|
|
18
30
|
const dialogRef = new Subject();
|
|
19
31
|
dialogRef
|
|
20
|
-
.pipe(switchMap((dialogRef) => dialogRef.beforeClose().pipe(takeUntil(
|
|
32
|
+
.pipe(switchMap((dialogRef) => dialogRef.beforeClose().pipe(takeUntil(routerOutlet.deactivateEvents ?? NEVER))), takeUntilDestroyed(this.destroyRef))
|
|
21
33
|
.subscribe(() => {
|
|
22
34
|
const url = this.route.pathFromRoot
|
|
23
35
|
.map((r) => r.snapshot.url)
|
|
@@ -26,11 +38,11 @@ class DialogOutletComponent {
|
|
|
26
38
|
.join('/');
|
|
27
39
|
this.router.navigateByUrl(url);
|
|
28
40
|
});
|
|
29
|
-
merge(
|
|
30
|
-
.pipe(startWith(
|
|
41
|
+
merge(routerOutlet.activateEvents.pipe(map(() => true)), routerOutlet.deactivateEvents.pipe(map(() => false)))
|
|
42
|
+
.pipe(startWith(routerOutlet.isActivated), takeUntilDestroyed(this.destroyRef))
|
|
31
43
|
.subscribe((activated) => {
|
|
32
44
|
if (activated) {
|
|
33
|
-
this.dialogRef = this.dialogService.open(this.outletContent, this.config);
|
|
45
|
+
this.dialogRef = this.dialogService.open(this.outletContent(), this.config());
|
|
34
46
|
dialogRef.next(this.dialogRef);
|
|
35
47
|
}
|
|
36
48
|
else {
|
|
@@ -39,18 +51,17 @@ class DialogOutletComponent {
|
|
|
39
51
|
});
|
|
40
52
|
}
|
|
41
53
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: DialogOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
55
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.1", type: DialogOutletComponent, isStandalone: true, selector: "ng-doc-dialog-outlet", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "routerOutlet", first: true, predicate: RouterOutlet, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "outletContent", first: true, predicate: ["outletContent"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
44
56
|
<ng-template #outletContent>
|
|
45
57
|
<ng-content></ng-content>
|
|
46
58
|
</ng-template>
|
|
47
59
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
48
60
|
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: DialogOutletComponent, decorators: [{
|
|
50
62
|
type: Component,
|
|
51
63
|
args: [{
|
|
52
64
|
selector: 'ng-doc-dialog-outlet',
|
|
53
|
-
standalone: true,
|
|
54
65
|
template: `
|
|
55
66
|
<ng-template #outletContent>
|
|
56
67
|
<ng-content></ng-content>
|
|
@@ -58,15 +69,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
58
69
|
`,
|
|
59
70
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
71
|
}]
|
|
61
|
-
}], propDecorators: { config: [{
|
|
62
|
-
type: Input
|
|
63
|
-
}], outletContent: [{
|
|
64
|
-
type: ViewChild,
|
|
65
|
-
args: ['outletContent', { static: true }]
|
|
66
|
-
}], routerOutlet: [{
|
|
67
|
-
type: ContentChild,
|
|
68
|
-
args: [RouterOutlet]
|
|
69
|
-
}] } });
|
|
72
|
+
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], outletContent: [{ type: i0.ViewChild, args: ['outletContent', { isSignal: true }] }], routerOutlet: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RouterOutlet), { isSignal: true }] }] } });
|
|
70
73
|
|
|
71
74
|
/**
|
|
72
75
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-ui-kit-components-dialog-outlet.mjs","sources":["../../../../libs/ui-kit/components/dialog-outlet/dialog-outlet.component.ts","../../../../libs/ui-kit/components/dialog-outlet/ng-doc-ui-kit-components-dialog-outlet.ts"],"sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n
|
|
1
|
+
{"version":3,"file":"ng-doc-ui-kit-components-dialog-outlet.mjs","sources":["../../../../libs/ui-kit/components/dialog-outlet/dialog-outlet.component.ts","../../../../libs/ui-kit/components/dialog-outlet/ng-doc-ui-kit-components-dialog-outlet.ts"],"sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n DestroyRef,\n inject,\n input,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport { NgDocOverlayRef } from '@ng-doc/ui-kit/classes/overlay-ref';\nimport { NgDocDialogConfig, NgDocDialogService } from '@ng-doc/ui-kit/services/dialog';\nimport { merge, NEVER, Subject, switchMap } from 'rxjs';\nimport { map, startWith, takeUntil } from 'rxjs/operators';\n\n/**\n * Shows the projected router outlet in a dialog while one of its routes is active, and navigates\n * back to the parent route when the dialog closes.\n */\n@Component({\n selector: 'ng-doc-dialog-outlet',\n template: `\n <ng-template #outletContent>\n <ng-content></ng-content>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DialogOutletComponent implements AfterContentInit {\n /** Options of the dialog. */\n readonly config = input<NgDocDialogConfig>();\n\n readonly outletContent = viewChild.required<TemplateRef<never>>('outletContent');\n\n readonly routerOutlet = contentChild(RouterOutlet);\n\n dialogRef?: NgDocOverlayRef;\n\n protected readonly router: Router = inject(Router);\n protected readonly route: ActivatedRoute = inject(ActivatedRoute);\n protected readonly dialogService: NgDocDialogService = inject(NgDocDialogService);\n protected readonly destroyRef = inject(DestroyRef);\n\n ngAfterContentInit(): void {\n const routerOutlet: RouterOutlet | undefined = this.routerOutlet();\n\n if (routerOutlet) {\n const dialogRef = new Subject<NgDocOverlayRef>();\n\n dialogRef\n .pipe(\n switchMap((dialogRef: NgDocOverlayRef) =>\n dialogRef.beforeClose().pipe(takeUntil(routerOutlet.deactivateEvents ?? NEVER)),\n ),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe(() => {\n const url = this.route.pathFromRoot\n .map((r) => r.snapshot.url)\n .filter((f) => !!f[0])\n .map(([f]) => f.path)\n .join('/');\n\n this.router.navigateByUrl(url);\n });\n\n merge(\n routerOutlet.activateEvents.pipe(map(() => true)),\n routerOutlet.deactivateEvents.pipe(map(() => false)),\n )\n .pipe(startWith(routerOutlet.isActivated), takeUntilDestroyed(this.destroyRef))\n .subscribe((activated: boolean) => {\n if (activated) {\n this.dialogRef = this.dialogService.open(this.outletContent(), this.config());\n\n dialogRef.next(this.dialogRef);\n } else {\n this.dialogRef?.close();\n }\n });\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAkBA;;;AAGG;MAUU,qBAAqB,CAAA;AATlC,IAAA,WAAA,GAAA;;AAWW,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK;8FAAqB;AAEnC,QAAA,IAAA,CAAA,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAqB,eAAe;0FAAC;QAEvE,IAAA,CAAA,YAAY,GAAG,YAAY,CAAC,YAAY;yFAAC;AAI/B,QAAA,IAAA,CAAA,MAAM,GAAW,MAAM,CAAC,MAAM,CAAC;AAC/B,QAAA,IAAA,CAAA,KAAK,GAAmB,MAAM,CAAC,cAAc,CAAC;AAC9C,QAAA,IAAA,CAAA,aAAa,GAAuB,MAAM,CAAC,kBAAkB,CAAC;AAC9D,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAyCnD,IAAA;IAvCC,kBAAkB,GAAA;AAChB,QAAA,MAAM,YAAY,GAA6B,IAAI,CAAC,YAAY,EAAE;QAElE,IAAI,YAAY,EAAE;AAChB,YAAA,MAAM,SAAS,GAAG,IAAI,OAAO,EAAmB;YAEhD;AACG,iBAAA,IAAI,CACH,SAAS,CAAC,CAAC,SAA0B,KACnC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,gBAAgB,IAAI,KAAK,CAAC,CAAC,CAChF,EACD,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC;iBAEpC,SAAS,C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