@sebgroup/green-angular 4.5.0 → 4.6.1
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/esm2022/index.mjs +1 -1
- package/esm2022/lib/shared/on-scroll.directive.mjs +2 -2
- package/esm2022/src/lib/shared/on-scroll.directive.mjs +2 -2
- package/esm2022/src/v-angular/base-control-value-accessor/base-control-value-accessor.component.mjs +287 -0
- package/esm2022/src/v-angular/base-control-value-accessor/base-control-value-accessor.module.mjs +17 -0
- package/esm2022/src/v-angular/base-control-value-accessor/index.mjs +3 -0
- package/esm2022/src/v-angular/base-control-value-accessor/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs +5 -0
- package/esm2022/src/v-angular/breadcrumbs/breadcrumbs.component.mjs +25 -0
- package/esm2022/src/v-angular/breadcrumbs/breadcrumbs.module.mjs +20 -0
- package/esm2022/src/v-angular/breadcrumbs/index.mjs +3 -0
- package/esm2022/src/v-angular/breadcrumbs/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs +5 -0
- package/esm2022/src/v-angular/button/button.component.mjs +108 -0
- package/esm2022/src/v-angular/button/button.module.mjs +20 -0
- package/esm2022/src/v-angular/button/index.mjs +3 -0
- package/esm2022/src/v-angular/button/sebgroup-green-angular-src-v-angular-button.mjs +5 -0
- package/esm2022/src/v-angular/card/card.component.mjs +11 -0
- package/esm2022/src/v-angular/card/card.module.mjs +18 -0
- package/esm2022/src/v-angular/card/index.mjs +3 -0
- package/esm2022/src/v-angular/card/sebgroup-green-angular-src-v-angular-card.mjs +5 -0
- package/esm2022/src/v-angular/character-countdown/character-countdown.directive.mjs +51 -0
- package/esm2022/src/v-angular/character-countdown/character-countdown.module.mjs +18 -0
- package/esm2022/src/v-angular/character-countdown/index.mjs +3 -0
- package/esm2022/src/v-angular/character-countdown/sebgroup-green-angular-src-v-angular-character-countdown.mjs +5 -0
- package/esm2022/src/v-angular/checkbox/checkbox.component.mjs +72 -0
- package/esm2022/src/v-angular/checkbox/checkbox.module.mjs +19 -0
- package/esm2022/src/v-angular/checkbox/index.mjs +3 -0
- package/esm2022/src/v-angular/checkbox/sebgroup-green-angular-src-v-angular-checkbox.mjs +5 -0
- package/esm2022/src/v-angular/core/core.globals.mjs +20 -0
- package/esm2022/src/v-angular/core/core.utils.mjs +28 -0
- package/esm2022/src/v-angular/core/index.mjs +3 -0
- package/esm2022/src/v-angular/core/sebgroup-green-angular-src-v-angular-core.mjs +5 -0
- package/esm2022/src/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +256 -0
- package/esm2022/src/v-angular/dropdown/dropdown-list/index.mjs +2 -0
- package/esm2022/src/v-angular/dropdown/dropdown.component.mjs +239 -0
- package/esm2022/src/v-angular/dropdown/dropdown.module.mjs +22 -0
- package/esm2022/src/v-angular/dropdown/index.mjs +6 -0
- package/esm2022/src/v-angular/dropdown/sebgroup-green-angular-src-v-angular-dropdown.mjs +5 -0
- package/esm2022/src/v-angular/dropdown/typeahead/index.mjs +3 -0
- package/esm2022/src/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.mjs +98 -0
- package/esm2022/src/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.mjs +85 -0
- package/esm2022/src/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +132 -0
- package/esm2022/src/v-angular/dropdown/typeahead/typeahead.module.mjs +33 -0
- package/esm2022/src/v-angular/external-link/external-link.directive.mjs +37 -0
- package/esm2022/src/v-angular/external-link/external-link.module.mjs +18 -0
- package/esm2022/src/v-angular/external-link/index.mjs +3 -0
- package/esm2022/src/v-angular/external-link/sebgroup-green-angular-src-v-angular-external-link.mjs +5 -0
- package/esm2022/src/v-angular/i18n/i18n.json +12 -0
- package/esm2022/src/v-angular/i18n/i18n.module.mjs +83 -0
- package/esm2022/src/v-angular/i18n/i18n.test.module.mjs +89 -0
- package/esm2022/src/v-angular/i18n/index.mjs +3 -0
- package/esm2022/src/v-angular/i18n/sebgroup-green-angular-src-v-angular-i18n.mjs +5 -0
- package/esm2022/src/v-angular/info-circle/index.mjs +3 -0
- package/esm2022/src/v-angular/info-circle/info-circle.component.mjs +28 -0
- package/esm2022/src/v-angular/info-circle/info-circle.module.mjs +21 -0
- package/esm2022/src/v-angular/info-circle/sebgroup-green-angular-src-v-angular-info-circle.mjs +5 -0
- package/esm2022/src/v-angular/input/index.mjs +3 -0
- package/esm2022/src/v-angular/input/input.component.mjs +221 -0
- package/esm2022/src/v-angular/input/input.module.mjs +32 -0
- package/esm2022/src/v-angular/input/sebgroup-green-angular-src-v-angular-input.mjs +5 -0
- package/esm2022/src/v-angular/input-mask/config.mjs +9 -0
- package/esm2022/src/v-angular/input-mask/constants.mjs +2 -0
- package/esm2022/src/v-angular/input-mask/index.mjs +6 -0
- package/esm2022/src/v-angular/input-mask/input-mask-format.pipe.mjs +20 -0
- package/esm2022/src/v-angular/input-mask/input-mask.directive.mjs +165 -0
- package/esm2022/src/v-angular/input-mask/input-mask.module.mjs +35 -0
- package/esm2022/src/v-angular/input-mask/input-mask.types.mjs +2 -0
- package/esm2022/src/v-angular/input-mask/sebgroup-green-angular-src-v-angular-input-mask.mjs +5 -0
- package/esm2022/src/v-angular/modal/dialog/dialog.component.mjs +190 -0
- package/esm2022/src/v-angular/modal/fold-out/fold-out.component.mjs +56 -0
- package/esm2022/src/v-angular/modal/fold-out/fold-out.directive.mjs +19 -0
- package/esm2022/src/v-angular/modal/index.mjs +6 -0
- package/esm2022/src/v-angular/modal/modal.globals.mjs +20 -0
- package/esm2022/src/v-angular/modal/modal.module.mjs +40 -0
- package/esm2022/src/v-angular/modal/modal.types.mjs +2 -0
- package/esm2022/src/v-angular/modal/sebgroup-green-angular-src-v-angular-modal.mjs +5 -0
- package/esm2022/src/v-angular/modal/slide-out/slide-out.component.mjs +229 -0
- package/esm2022/src/v-angular/radio/index.mjs +3 -0
- package/esm2022/src/v-angular/radio/radio.component.mjs +130 -0
- package/esm2022/src/v-angular/radio/radio.module.mjs +20 -0
- package/esm2022/src/v-angular/radio/sebgroup-green-angular-src-v-angular-radio.mjs +5 -0
- package/esm2022/src/v-angular/slug/index.mjs +3 -0
- package/esm2022/src/v-angular/slug/sebgroup-green-angular-src-v-angular-slug.mjs +5 -0
- package/esm2022/src/v-angular/slug/slug.module.mjs +18 -0
- package/esm2022/src/v-angular/slug/slug.pipe.mjs +27 -0
- package/esm2022/src/v-angular/textarea/index.mjs +3 -0
- package/esm2022/src/v-angular/textarea/sebgroup-green-angular-src-v-angular-textarea.mjs +5 -0
- package/esm2022/src/v-angular/textarea/textarea.component.mjs +101 -0
- package/esm2022/src/v-angular/textarea/textarea.module.mjs +18 -0
- package/esm2022/src/v-angular/tooltip/index.mjs +3 -0
- package/esm2022/src/v-angular/tooltip/sebgroup-green-angular-src-v-angular-tooltip.mjs +5 -0
- package/esm2022/src/v-angular/tooltip/tooltip.directive.mjs +273 -0
- package/esm2022/src/v-angular/tooltip/tooltip.module.mjs +18 -0
- package/fesm2022/sebgroup-green-angular-src-lib-shared.mjs +1 -1
- package/fesm2022/sebgroup-green-angular-src-lib-shared.mjs.map +1 -1
- package/fesm2022/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs +308 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-base-control-value-accessor.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs +49 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-breadcrumbs.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs +131 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-button.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-card.mjs +33 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-card.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-character-countdown.mjs +73 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-character-countdown.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-checkbox.mjs +94 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-checkbox.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-core.mjs +54 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-core.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs +830 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-external-link.mjs +58 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-external-link.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-i18n.mjs +192 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-i18n.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs +53 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-info-circle.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-input-mask.mjs +226 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-input-mask.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs +256 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs +545 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-radio.mjs +153 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-radio.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-slug.mjs +49 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-slug.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs +122 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-tooltip.mjs +295 -0
- package/fesm2022/sebgroup-green-angular-src-v-angular-tooltip.mjs.map +1 -0
- package/fesm2022/sebgroup-green-angular.mjs +1 -1
- package/fesm2022/sebgroup-green-angular.mjs.map +1 -1
- package/package.json +115 -4
- package/src/v-angular/base-control-value-accessor/base-control-value-accessor.component.d.ts +124 -0
- package/src/v-angular/base-control-value-accessor/base-control-value-accessor.module.d.ts +7 -0
- package/src/v-angular/base-control-value-accessor/index.d.ts +2 -0
- package/src/v-angular/breadcrumbs/breadcrumbs.component.d.ts +18 -0
- package/src/v-angular/breadcrumbs/breadcrumbs.module.d.ts +10 -0
- package/src/v-angular/breadcrumbs/index.d.ts +2 -0
- package/src/v-angular/button/button.component.d.ts +62 -0
- package/src/v-angular/button/button.module.d.ts +10 -0
- package/src/v-angular/button/index.d.ts +2 -0
- package/src/v-angular/card/card.component.d.ts +5 -0
- package/src/v-angular/card/card.module.d.ts +8 -0
- package/src/v-angular/card/index.d.ts +2 -0
- package/src/v-angular/character-countdown/character-countdown.directive.d.ts +17 -0
- package/src/v-angular/character-countdown/character-countdown.module.d.ts +8 -0
- package/src/v-angular/character-countdown/index.d.ts +2 -0
- package/src/v-angular/checkbox/checkbox.component.d.ts +27 -0
- package/src/v-angular/checkbox/checkbox.module.d.ts +9 -0
- package/src/v-angular/checkbox/index.d.ts +2 -0
- package/src/v-angular/core/core.globals.d.ts +13 -0
- package/src/v-angular/core/core.utils.d.ts +22 -0
- package/src/v-angular/core/index.d.ts +2 -0
- package/src/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +89 -0
- package/src/v-angular/dropdown/dropdown-list/index.d.ts +1 -0
- package/src/v-angular/dropdown/dropdown.component.d.ts +99 -0
- package/src/v-angular/dropdown/dropdown.module.d.ts +12 -0
- package/src/v-angular/dropdown/index.d.ts +5 -0
- package/src/v-angular/dropdown/typeahead/index.d.ts +2 -0
- package/src/v-angular/dropdown/typeahead/typeahead-dropdown-list/typeahead-dropdown-list.component.d.ts +34 -0
- package/src/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.d.ts +34 -0
- package/src/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.d.ts +59 -0
- package/src/v-angular/dropdown/typeahead/typeahead.module.d.ts +11 -0
- package/src/v-angular/external-link/external-link.directive.d.ts +17 -0
- package/src/v-angular/external-link/external-link.module.d.ts +8 -0
- package/src/v-angular/external-link/index.d.ts +2 -0
- package/src/v-angular/i18n/i18n.module.d.ts +15 -0
- package/src/v-angular/i18n/i18n.test.module.d.ts +27 -0
- package/src/v-angular/i18n/index.d.ts +2 -0
- package/src/v-angular/info-circle/index.d.ts +2 -0
- package/src/v-angular/info-circle/info-circle.component.d.ts +16 -0
- package/src/v-angular/info-circle/info-circle.module.d.ts +10 -0
- package/src/v-angular/input/index.d.ts +2 -0
- package/src/v-angular/input/input.component.d.ts +90 -0
- package/src/v-angular/input/input.module.d.ts +11 -0
- package/src/v-angular/input-mask/config.d.ts +6 -0
- package/src/v-angular/input-mask/constants.d.ts +2 -0
- package/src/v-angular/input-mask/index.d.ts +5 -0
- package/src/v-angular/input-mask/input-mask-format.pipe.d.ts +8 -0
- package/src/v-angular/input-mask/input-mask.directive.d.ts +39 -0
- package/src/v-angular/input-mask/input-mask.module.d.ts +11 -0
- package/src/v-angular/input-mask/input-mask.types.d.ts +20 -0
- package/src/v-angular/modal/dialog/dialog.component.d.ts +55 -0
- package/src/v-angular/modal/fold-out/fold-out.component.d.ts +24 -0
- package/src/v-angular/modal/fold-out/fold-out.directive.d.ts +6 -0
- package/src/v-angular/modal/index.d.ts +5 -0
- package/src/v-angular/modal/modal.globals.d.ts +13 -0
- package/src/v-angular/modal/modal.module.d.ts +13 -0
- package/src/v-angular/modal/modal.types.d.ts +5 -0
- package/src/v-angular/modal/slide-out/slide-out.component.d.ts +76 -0
- package/src/v-angular/radio/index.d.ts +2 -0
- package/src/v-angular/radio/radio.component.d.ts +48 -0
- package/src/v-angular/radio/radio.module.d.ts +9 -0
- package/src/v-angular/slug/index.d.ts +2 -0
- package/src/v-angular/slug/slug.module.d.ts +8 -0
- package/src/v-angular/slug/slug.pipe.d.ts +12 -0
- package/src/v-angular/textarea/index.d.ts +2 -0
- package/src/v-angular/textarea/textarea.component.d.ts +44 -0
- package/src/v-angular/textarea/textarea.module.d.ts +8 -0
- package/src/v-angular/tooltip/index.d.ts +2 -0
- package/src/v-angular/tooltip/tooltip.directive.d.ts +106 -0
- package/src/v-angular/tooltip/tooltip.module.d.ts +8 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
|
+
import { NgControl } from '@angular/forms';
|
|
3
|
+
import { TranslocoScope } from '@ngneat/transloco';
|
|
4
|
+
import { NgvBaseControlValueAccessorComponent } from '@sebgroup/green-angular/src/v-angular/base-control-value-accessor';
|
|
5
|
+
import { DropdownUtils, Option, OptionBase, OptionGroup } from '@sebgroup/green-angular/src/v-angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* A dropdown allows the user to select an option from a list.
|
|
9
|
+
* Dropdowns enables users to make a quick selection of the available options for a specific entry.
|
|
10
|
+
* https://designlibrary.sebgroup.com/components/component-dropdown
|
|
11
|
+
*/
|
|
12
|
+
export declare class NgvDropdownComponent<K = string | null | undefined, V = string | null | undefined, T extends Option<K, V> = Option<K, V>> extends NgvBaseControlValueAccessorComponent implements OnDestroy, OnChanges {
|
|
13
|
+
ngControl: NgControl;
|
|
14
|
+
protected translocoScope: TranslocoScope;
|
|
15
|
+
protected cdr: ChangeDetectorRef;
|
|
16
|
+
protected dropdownUtils: DropdownUtils<K, V, T>;
|
|
17
|
+
/** Custom template for displaying selected option. */
|
|
18
|
+
selectedContentTpl: TemplateRef<OptionBase<T>> | undefined;
|
|
19
|
+
optionContentTpl: TemplateRef<OptionBase<any>> | undefined;
|
|
20
|
+
/** Special property used for selecting DOM elements during automated UI testing. */
|
|
21
|
+
thook: string;
|
|
22
|
+
/** Text shown before an option is selected. */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** List of {@link Option} and {@link OptionGroup} listed when dropdown is expanded. */
|
|
25
|
+
set options(value: OptionBase<T>[]);
|
|
26
|
+
get options(): OptionBase<T>[];
|
|
27
|
+
/** The additional amount to show when option is scrolled into view. */
|
|
28
|
+
scrollOffset: number;
|
|
29
|
+
/**
|
|
30
|
+
* Allow this component to add/ remove nullish options based on wether the control is required or not
|
|
31
|
+
* Defaults to true.
|
|
32
|
+
*/
|
|
33
|
+
allowControlNullishOption: boolean;
|
|
34
|
+
/** Text to highlight in option */
|
|
35
|
+
textToHighlight?: string;
|
|
36
|
+
/**
|
|
37
|
+
* If only one option exists in options[], default is to select it.
|
|
38
|
+
* This input can be used to alter that behaviour so it doesn't automatically
|
|
39
|
+
* select a value if it's the only one.
|
|
40
|
+
* Defaults to true.
|
|
41
|
+
*/
|
|
42
|
+
selectOnSingleOption: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Emits changes of the expanded state of the dropdown
|
|
45
|
+
*/
|
|
46
|
+
expandedChange: EventEmitter<boolean>;
|
|
47
|
+
/** @internal nullish option. */
|
|
48
|
+
get defaultNullishOption(): OptionBase<any>;
|
|
49
|
+
/** The current expanded state of the dropdown options. */
|
|
50
|
+
expanded: boolean;
|
|
51
|
+
/** The current option selected based on numeric index. */
|
|
52
|
+
activeIndex: number;
|
|
53
|
+
/** Subscribe if dropdown expanded to listen to click outside to close dropdown. */
|
|
54
|
+
private onClickSubscription;
|
|
55
|
+
keyEvent: KeyboardEvent;
|
|
56
|
+
private _options;
|
|
57
|
+
constructor(ngControl: NgControl, translocoScope: TranslocoScope, cdr: ChangeDetectorRef, dropdownUtils: DropdownUtils<K, V, T>);
|
|
58
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
59
|
+
ngOnDestroy(): void;
|
|
60
|
+
/** @internal override to correctly set state from form value */
|
|
61
|
+
writeValue(value: any): void;
|
|
62
|
+
/** @internal */
|
|
63
|
+
onSelectChange(option: T): void;
|
|
64
|
+
onKeyUp(event: KeyboardEvent): void;
|
|
65
|
+
/**
|
|
66
|
+
* Closes the dropdown on click outside.
|
|
67
|
+
*/
|
|
68
|
+
subscribeToOutsideClickEvent(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Set the dropdown value to given option.
|
|
71
|
+
* @param value the dropdown option to select.
|
|
72
|
+
*/
|
|
73
|
+
private updateModel;
|
|
74
|
+
/** Toggle the expanded state of the dropdown options. */
|
|
75
|
+
toggleDropdown(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Set the expanded state of the dropdown options. If true the options are shown below the field.
|
|
78
|
+
* Activate on click event to be able to close dropdown on click outside.
|
|
79
|
+
* @param state the expanded state which to set.
|
|
80
|
+
*/
|
|
81
|
+
setExpanded(state?: boolean): void;
|
|
82
|
+
/**
|
|
83
|
+
* Typecast anything to an {@link Option}.
|
|
84
|
+
* @param option the object to typecast.
|
|
85
|
+
*/
|
|
86
|
+
castOption(option: any): T;
|
|
87
|
+
/**
|
|
88
|
+
* Typecast anything to an {@link OptionGroup}.
|
|
89
|
+
* @param group the object to typecast.
|
|
90
|
+
*/
|
|
91
|
+
castGroup(group: any): OptionGroup<T>;
|
|
92
|
+
/**
|
|
93
|
+
* Returns true if argument is an {@link Option}.
|
|
94
|
+
* @param option the object to check.
|
|
95
|
+
*/
|
|
96
|
+
isOption(option: OptionBase<T>): option is OptionGroup<T>;
|
|
97
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvDropdownComponent<any, any, any>, [{ optional: true; self: true; }, { optional: true; }, null, null]>;
|
|
98
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgvDropdownComponent<any, any, any>, "nggv-dropdown", never, { "thook": { "alias": "thook"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "options": { "alias": "options"; "required": false; }; "scrollOffset": { "alias": "scrollOffset"; "required": false; }; "allowControlNullishOption": { "alias": "allowControlNullishOption"; "required": false; }; "textToHighlight": { "alias": "textToHighlight"; "required": false; }; "selectOnSingleOption": { "alias": "selectOnSingleOption"; "required": false; }; }, { "expandedChange": "expandedChange"; }, ["selectedContentTpl", "optionContentTpl"], ["*"], false, never>;
|
|
99
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./dropdown.component";
|
|
3
|
+
import * as i2 from "./dropdown-list/dropdown-list.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "./typeahead/typeahead.module";
|
|
6
|
+
import * as i5 from "@sebgroup/green-angular/src/v-angular/tooltip";
|
|
7
|
+
import * as i6 from "@sebgroup/green-angular/src/v-angular/i18n";
|
|
8
|
+
export declare class NgvDropdownModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvDropdownModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvDropdownModule, [typeof i1.NgvDropdownComponent, typeof i2.NgvDropdownListComponent], [typeof i3.CommonModule, typeof i4.NgvTypeaheadModule, typeof i5.NgvTooltipModule, typeof i6.NgvI18nModule], [typeof i1.NgvDropdownComponent, typeof i2.NgvDropdownListComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvDropdownModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { TranslocoScope } from '@ngneat/transloco';
|
|
3
|
+
import { OptionBase } from '@sebgroup/green-angular/src/v-angular/core';
|
|
4
|
+
import { NgvDropdownListComponent } from '../../dropdown-list/dropdown-list.component';
|
|
5
|
+
import { NgvInputComponent } from '@sebgroup/green-angular/src/v-angular/input';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class NgvTypeaheadDropdownListComponent extends NgvDropdownListComponent implements OnInit, OnDestroy {
|
|
8
|
+
protected translocoScope: TranslocoScope;
|
|
9
|
+
private element;
|
|
10
|
+
hostComponent: NgvInputComponent;
|
|
11
|
+
/** Formats each item that is displayed as an option. Only applies format if the option if it implement Option interface. */
|
|
12
|
+
resultFormatter?: (option: OptionBase<any>) => string;
|
|
13
|
+
/** Formats the selected item in the input when dropdown is opened. If no function is provided, it will display the value of the selected objects label property */
|
|
14
|
+
selectedFormatter?: (selected: OptionBase<any>) => string;
|
|
15
|
+
private _destroy$;
|
|
16
|
+
constructor(translocoScope: TranslocoScope, element: ElementRef);
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
ngOnDestroy(): void;
|
|
19
|
+
/** @Internal Subscribe to click outside dropdownList and input to close dropdownList */
|
|
20
|
+
private subscribeToOutsideClickEvent;
|
|
21
|
+
/** @Internal Update state of the host-input to reflect the selected value */
|
|
22
|
+
private handleSelectedValueChanges;
|
|
23
|
+
/** @Internal Expand the dropdown when input receives focus. If no state, set empty string in input */
|
|
24
|
+
private handleFocusChanges;
|
|
25
|
+
/**
|
|
26
|
+
* @internal Formats the selected option to display in the input. Interpolate the returned value
|
|
27
|
+
* since we don't know the return type or label type.
|
|
28
|
+
* @param value The selected value
|
|
29
|
+
* @returns The formatted value
|
|
30
|
+
*/
|
|
31
|
+
private formatSelected;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvTypeaheadDropdownListComponent, [{ optional: true; skipSelf: true; }, null]>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgvTypeaheadDropdownListComponent, "nggv-typeahead-dropdown-list", never, { "hostComponent": { "alias": "hostComponent"; "required": false; }; "resultFormatter": { "alias": "resultFormatter"; "required": false; }; "selectedFormatter": { "alias": "selectedFormatter"; "required": false; }; }, {}, never, never, false, never>;
|
|
34
|
+
}
|
package/src/v-angular/dropdown/typeahead/typeahead-highlight/typeahead-highlight.component.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class NgvTypeaheadHighlightComponent implements OnChanges {
|
|
4
|
+
/** The text that is displayed in the dropdown list */
|
|
5
|
+
textContent?: string;
|
|
6
|
+
/** The substring that should be highlighted within textContent */
|
|
7
|
+
textToHighlight?: string;
|
|
8
|
+
prefix?: string;
|
|
9
|
+
match?: string;
|
|
10
|
+
suffix?: string;
|
|
11
|
+
text: string;
|
|
12
|
+
input: string;
|
|
13
|
+
/**
|
|
14
|
+
* Regexp of characters that are allowed in textContent without being found in textToHighlight
|
|
15
|
+
* Allow whitespaces.
|
|
16
|
+
* */
|
|
17
|
+
allowedNonMatchingChars: RegExp;
|
|
18
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
19
|
+
private updateValues;
|
|
20
|
+
/**
|
|
21
|
+
* Function that finds the start and end index of where the input is located within the text to display.
|
|
22
|
+
* First occurence is returned. Allows for spaces to occur despite input not matching space.
|
|
23
|
+
* Loops through each character in splittedText and when a char in splittedText equlas the first character of
|
|
24
|
+
* splittedInput, evaluate wether it's match on the entire input.
|
|
25
|
+
* - If it's => return indexes.
|
|
26
|
+
* - If it's not => break out and check next char in outer loop.
|
|
27
|
+
* @param splittedText the text content splitted in an array
|
|
28
|
+
* @param splittedInput the input splitted in an array
|
|
29
|
+
* @returns { start: number, end: number } Indexes of where the match starts and ends in the text displatyed
|
|
30
|
+
*/
|
|
31
|
+
private getHighlightedPart;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvTypeaheadHighlightComponent, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgvTypeaheadHighlightComponent, "nggv-typeahead-highlight", never, { "textContent": { "alias": "textContent"; "required": false; }; "textToHighlight": { "alias": "textToHighlight"; "required": false; }; }, {}, never, never, false, never>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
|
2
|
+
import { NgControl } from '@angular/forms';
|
|
3
|
+
import { TranslocoScope } from '@ngneat/transloco';
|
|
4
|
+
import { OptionBase } from '@sebgroup/green-angular/src/v-angular/core';
|
|
5
|
+
import { NgvDropdownComponent } from '../../dropdown.component';
|
|
6
|
+
import { NgvInputComponent } from '@sebgroup/green-angular/src/v-angular/input';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class NgvTypeaheadInputComponent extends NgvInputComponent implements OnInit, OnDestroy {
|
|
9
|
+
private element;
|
|
10
|
+
private renderer2;
|
|
11
|
+
ngControl: NgControl;
|
|
12
|
+
protected translocoScope: TranslocoScope;
|
|
13
|
+
protected cdr: ChangeDetectorRef;
|
|
14
|
+
/** Reference to the host dropdown */
|
|
15
|
+
hostComponent: NgvDropdownComponent;
|
|
16
|
+
/** Formats each item that is displayed as an option. Only applies format if the option if it implement Option interface. */
|
|
17
|
+
resultFormatter?: (option: OptionBase<any>) => string;
|
|
18
|
+
/** Formats the selected item in the input when dropdown is opened. If no function is provided, it will display the value of the selected objects label property */
|
|
19
|
+
selectedFormatter?: (selected: OptionBase<any>) => string;
|
|
20
|
+
get dropdownButton(): HTMLElement;
|
|
21
|
+
/** Boolean to indicate wether the dropdown is expanded or not, to apply appropriate styling */
|
|
22
|
+
expanded: boolean;
|
|
23
|
+
/** Used to determine the height of the inputin html */
|
|
24
|
+
buttonHeight?: number;
|
|
25
|
+
constructor(element: ElementRef, renderer2: Renderer2, ngControl: NgControl, translocoScope: TranslocoScope, cdr: ChangeDetectorRef);
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* Allow space to be inputted as text
|
|
30
|
+
* @param event fired containing which key was released.
|
|
31
|
+
*/
|
|
32
|
+
onKeyUp(event: KeyboardEvent): void;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
* First time the dropdown is expanded, move the input sp it becomes a child of the dropdown button
|
|
36
|
+
* to better reflect semantics and styling.
|
|
37
|
+
*/
|
|
38
|
+
private moveInput;
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
* When dropdown is expanded, focus on the input. If a value is selected, set it in the input.
|
|
42
|
+
* When the dropdown is collapsed, empty the input from text.
|
|
43
|
+
*/
|
|
44
|
+
private handleExpandedChange;
|
|
45
|
+
/**
|
|
46
|
+
* @internal Formats the selected option to display in the input. Interpolate the returned value
|
|
47
|
+
* since we don't know the return type or label type.
|
|
48
|
+
* @param value The selected value
|
|
49
|
+
* @returns The formatted value
|
|
50
|
+
*/
|
|
51
|
+
private formatSelected;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the input programmatically instead of native HTML input event.
|
|
54
|
+
* @param input
|
|
55
|
+
*/
|
|
56
|
+
private setInput;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvTypeaheadInputComponent, [null, null, { optional: true; self: true; }, { optional: true; }, null]>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgvTypeaheadInputComponent, "nggv-typeahead-input", never, { "hostComponent": { "alias": "hostComponent"; "required": false; }; "resultFormatter": { "alias": "resultFormatter"; "required": false; }; "selectedFormatter": { "alias": "selectedFormatter"; "required": false; }; }, {}, never, never, false, never>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./typeahead-highlight/typeahead-highlight.component";
|
|
3
|
+
import * as i2 from "./typeahead-input/typeahead-input.component";
|
|
4
|
+
import * as i3 from "./typeahead-dropdown-list/typeahead-dropdown-list.component";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@sebgroup/green-angular/src/v-angular/tooltip";
|
|
7
|
+
export declare class NgvTypeaheadModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvTypeaheadModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvTypeaheadModule, [typeof i1.NgvTypeaheadHighlightComponent, typeof i2.NgvTypeaheadInputComponent, typeof i3.NgvTypeaheadDropdownListComponent], [typeof i4.CommonModule, typeof i5.NgvTooltipModule], [typeof i1.NgvTypeaheadHighlightComponent, typeof i2.NgvTypeaheadInputComponent, typeof i3.NgvTypeaheadDropdownListComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvTypeaheadModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { RouterLink } from '@angular/router';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Directive overrides routerLink attribute to allow external links. */
|
|
5
|
+
export declare class NgvExternalLinkDirective implements OnInit {
|
|
6
|
+
protected link: RouterLink;
|
|
7
|
+
/** If set to true, links will trigger a location change rather than an internal history push. */
|
|
8
|
+
external: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new ExternalLinkDirective
|
|
11
|
+
* @param link extracted routerLink metadata
|
|
12
|
+
*/
|
|
13
|
+
constructor(link: RouterLink);
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvExternalLinkDirective, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgvExternalLinkDirective, "a[routerLink]", never, { "external": { "alias": "external"; "required": false; }; }, {}, never, never, false, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./external-link.directive";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
export declare class NgvExternalLinkDirectiveModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvExternalLinkDirectiveModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvExternalLinkDirectiveModule, [typeof i1.NgvExternalLinkDirective], [typeof i2.CommonModule], [typeof i1.NgvExternalLinkDirective]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvExternalLinkDirectiveModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HashMap, TranslocoMissingHandler, TranslocoMissingHandlerData, TranslocoTranspiler } from '@ngneat/transloco';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@ngneat/transloco";
|
|
4
|
+
export declare class NgvMissingHandler implements TranslocoMissingHandler {
|
|
5
|
+
private transpiler;
|
|
6
|
+
constructor(transpiler: TranslocoTranspiler);
|
|
7
|
+
handle(key: string, _: TranslocoMissingHandlerData, params: HashMap): any;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvMissingHandler, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgvMissingHandler>;
|
|
10
|
+
}
|
|
11
|
+
export declare class NgvI18nModule {
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvI18nModule, never>;
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvI18nModule, never, never, [typeof i1.TranslocoModule]>;
|
|
14
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvI18nModule>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { HashMap, Translation, TranslocoConfig, TranslocoFallbackStrategy, TranslocoInterceptor, TranslocoMissingHandler, TranslocoTranspilerFunction } from '@ngneat/transloco';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
export declare class TranslocoMockPipe implements PipeTransform {
|
|
6
|
+
transform: (value: number) => number;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslocoMockPipe, never>;
|
|
8
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TranslocoMockPipe, "transloco", false>;
|
|
9
|
+
}
|
|
10
|
+
export declare class TranslocoMockTranspiler implements TranslocoTranspilerFunction {
|
|
11
|
+
transpile: (..._args: string[]) => string;
|
|
12
|
+
}
|
|
13
|
+
export declare class TranslocoMockMissingHandler implements TranslocoMissingHandler {
|
|
14
|
+
handle: (key: string, _: TranslocoConfig, _params: HashMap) => string;
|
|
15
|
+
}
|
|
16
|
+
export declare class TranslocoMockStrategy implements TranslocoFallbackStrategy {
|
|
17
|
+
getNextLangs: (_failedLang: string) => any;
|
|
18
|
+
}
|
|
19
|
+
export declare class TranslocoMockInterceptor implements TranslocoInterceptor {
|
|
20
|
+
preSaveTranslation(translation: Translation, _lang: string): Translation;
|
|
21
|
+
preSaveTranslationKey(_key: string, value: string, _lang: string): string;
|
|
22
|
+
}
|
|
23
|
+
export declare class NgvI18nTestModule {
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvI18nTestModule, never>;
|
|
25
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvI18nTestModule, [typeof TranslocoMockPipe], [typeof i1.CommonModule], [typeof TranslocoMockPipe]>;
|
|
26
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvI18nTestModule>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '@sebgroup/green-core/components/icon/icons/circle-info';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A button that will present an explanation to a problem/question.
|
|
5
|
+
* https://designlibrary.sebgroup.com/components/component-contextual-help-button
|
|
6
|
+
*/
|
|
7
|
+
export declare class NgvInfoCircleComponent {
|
|
8
|
+
/** Special property used for selecting DOM elements during automated UI testing. */
|
|
9
|
+
thook: string;
|
|
10
|
+
/**
|
|
11
|
+
* Text to display in tooltip when mouse hovers over icon.
|
|
12
|
+
*/
|
|
13
|
+
info: string;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvInfoCircleComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgvInfoCircleComponent, "nggv-info-circle", never, { "thook": { "alias": "thook"; "required": false; }; "info": { "alias": "info"; "required": false; }; }, {}, never, never, false, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./info-circle.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@sebgroup/green-angular/src/lib/shared";
|
|
5
|
+
import * as i4 from "@sebgroup/green-angular/src/v-angular/tooltip";
|
|
6
|
+
export declare class NgvInfoCircleModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvInfoCircleModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvInfoCircleModule, [typeof i1.NgvInfoCircleComponent], [typeof i2.CommonModule, typeof i3.NggCoreWrapperModule, typeof i4.NgvTooltipModule], [typeof i1.NgvInfoCircleComponent]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvInfoCircleModule>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { NgControl, UntypedFormControl } from '@angular/forms';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { TranslocoScope } from '@ngneat/transloco';
|
|
5
|
+
import type { InputmaskOptions } from '@sebgroup/green-angular/src/v-angular/input-mask';
|
|
6
|
+
import { NgvBaseControlValueAccessorComponent } from '@sebgroup/green-angular/src/v-angular/base-control-value-accessor';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Input fields allow users to add and edit text.
|
|
10
|
+
* https://designlibrary.sebgroup.com/components/component-input
|
|
11
|
+
*/
|
|
12
|
+
export declare class NgvInputComponent extends NgvBaseControlValueAccessorComponent implements OnInit, OnDestroy {
|
|
13
|
+
ngControl: NgControl;
|
|
14
|
+
protected translocoScope: TranslocoScope;
|
|
15
|
+
protected cdr: ChangeDetectorRef;
|
|
16
|
+
/** Adding .gds-form-item as a class to host element */
|
|
17
|
+
class: string;
|
|
18
|
+
/** Special property used for selecting DOM elements during automated UI testing. */
|
|
19
|
+
thook: string;
|
|
20
|
+
/** Type of input field. Should avoid types that modify field too much such as range. */
|
|
21
|
+
type: string;
|
|
22
|
+
/** Text shown before input has a written value. */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** If set to "on", hint for form autofill feature. */
|
|
25
|
+
autocomplete: string;
|
|
26
|
+
/** If set to true, the value will not be editable. */
|
|
27
|
+
readonly: boolean;
|
|
28
|
+
/** If set to true, enables the Angular template-driven email validator. */
|
|
29
|
+
email: boolean;
|
|
30
|
+
/** Minimum value required for numeric input types. */
|
|
31
|
+
min: number;
|
|
32
|
+
/** Maximum value required for numeric input types. */
|
|
33
|
+
max: number;
|
|
34
|
+
/** Incremental values that are valid for numeric input types. */
|
|
35
|
+
step: number;
|
|
36
|
+
/** Minimum length (number of characters) of value. */
|
|
37
|
+
set minLength(length: number);
|
|
38
|
+
/**
|
|
39
|
+
* Minimum length (number of characters) of value.
|
|
40
|
+
* @deprecated minlength triggers angular-template-validation. Use @Input() minLength instead.
|
|
41
|
+
*/
|
|
42
|
+
set minlength(length: number);
|
|
43
|
+
get minlength(): number;
|
|
44
|
+
/** Maximum length (number of characters) of value. */
|
|
45
|
+
set maxLength(length: number);
|
|
46
|
+
get maxlength(): number;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum length (number of characters) of value.
|
|
49
|
+
* @deprecated maxlength triggers angular-template-validation. Use @Input() maxLength instead.
|
|
50
|
+
*/
|
|
51
|
+
set maxlength(length: number);
|
|
52
|
+
private _maxlength;
|
|
53
|
+
private _minlength;
|
|
54
|
+
/** Wether to show label that tells how many characters are still left to be entered. Will only be set if maxLength is also set */
|
|
55
|
+
private _showCharacterCountDown;
|
|
56
|
+
set showCharacterCountdown(option: boolean);
|
|
57
|
+
get showCharacterCountdown(): boolean;
|
|
58
|
+
/** Pattern the value must match to be valid. */
|
|
59
|
+
pattern: string;
|
|
60
|
+
/** Amount of time to wait until emitting (ngvINput) event */
|
|
61
|
+
debounceTime: number;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
* Text to put in badge
|
|
65
|
+
*/
|
|
66
|
+
badgeText: string;
|
|
67
|
+
/** Settings for input mask if requested */
|
|
68
|
+
private _inputMask;
|
|
69
|
+
set inputMask(newInputMask: InputmaskOptions<any>);
|
|
70
|
+
get inputMask(): InputmaskOptions<any>;
|
|
71
|
+
/** Emits every time the value of the inner input field changes, independantly of updates on the formcontroller */
|
|
72
|
+
ngvInput: EventEmitter<any>;
|
|
73
|
+
private _formControl;
|
|
74
|
+
get control(): UntypedFormControl;
|
|
75
|
+
/** Returns if maxlength is used */
|
|
76
|
+
get hasMaxLength(): boolean;
|
|
77
|
+
/** Toggler for showing or hiding the input field */
|
|
78
|
+
hideInput$: Subject<boolean>;
|
|
79
|
+
protected inputChange$: Subject<any>;
|
|
80
|
+
protected _destroy$: Subject<boolean>;
|
|
81
|
+
constructor(ngControl: NgControl, translocoScope: TranslocoScope, cdr: ChangeDetectorRef);
|
|
82
|
+
ngOnInit(): void;
|
|
83
|
+
ngOnDestroy(): void;
|
|
84
|
+
writeValue(value: any): void;
|
|
85
|
+
cutTextAfterMaxLength(value: any): any;
|
|
86
|
+
/** @internal */
|
|
87
|
+
onInput(event: Event): void;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvInputComponent, [{ optional: true; self: true; }, { optional: true; }, null]>;
|
|
89
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgvInputComponent, "nggv-input", never, { "thook": { "alias": "thook"; "required": false; }; "type": { "alias": "type"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "email": { "alias": "email"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "step": { "alias": "step"; "required": false; }; "minLength": { "alias": "minLength"; "required": false; }; "minlength": { "alias": "minlength"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "showCharacterCountdown": { "alias": "showCharacterCountdown"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; "badgeText": { "alias": "badgeText"; "required": false; }; "inputMask": { "alias": "inputMask"; "required": false; }; }, { "ngvInput": "ngvInput"; }, never, ["[slot='prefix']", "[slot='suffix']", "*"], false, never>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./input.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@sebgroup/green-angular/src/v-angular/i18n";
|
|
5
|
+
import * as i4 from "@sebgroup/green-angular/src/v-angular/input-mask";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
export declare class NgvInputModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvInputModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvInputModule, [typeof i1.NgvInputComponent], [typeof i2.CommonModule, typeof i3.NgvI18nModule, typeof i4.NgvInputMaskModule, typeof i5.ReactiveFormsModule], [typeof i1.NgvInputComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvInputModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import type { InputmaskOptions } from './input-mask.types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class InputMaskFormatPipe implements PipeTransform {
|
|
5
|
+
transform<T = any>(value: any, options: InputmaskOptions<T>): any;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputMaskFormatPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<InputMaskFormatPipe, "ngvInputMaskFormat", false>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
|
|
2
|
+
import { AbstractControl, ControlValueAccessor, NgControl, Validator } from '@angular/forms';
|
|
3
|
+
import type Inputmask from 'inputmask';
|
|
4
|
+
import { InputMaskConfig } from './config';
|
|
5
|
+
import type { InputmaskOptions } from './input-mask.types';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class NgvInputMaskDirective<T = any> implements OnInit, AfterViewInit, OnDestroy, ControlValueAccessor, Validator {
|
|
8
|
+
ngControl: NgControl;
|
|
9
|
+
private platformId;
|
|
10
|
+
private elementRef;
|
|
11
|
+
private renderer;
|
|
12
|
+
private ngZone;
|
|
13
|
+
/** Input settings of directive */
|
|
14
|
+
ngvInputMask: InputmaskOptions<T>;
|
|
15
|
+
inputMaskPlugin: Inputmask.Instance | undefined;
|
|
16
|
+
nativeInputElement: HTMLInputElement | undefined;
|
|
17
|
+
defaultInputMaskConfig: InputMaskConfig;
|
|
18
|
+
private mutationObserver;
|
|
19
|
+
constructor(ngControl: NgControl, config: InputMaskConfig, platformId: string, elementRef: ElementRef<HTMLInputElement | any>, renderer: Renderer2, ngZone: NgZone);
|
|
20
|
+
onInput: (_: any) => void;
|
|
21
|
+
onTouched: (_: any) => void;
|
|
22
|
+
onKeyUp(event: KeyboardEvent): void;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
ngOnDestroy(): void;
|
|
25
|
+
initInputMask(): void;
|
|
26
|
+
ngAfterViewInit(): void;
|
|
27
|
+
get inputMaskOptions(): Inputmask.Options;
|
|
28
|
+
writeValue(value: string): void;
|
|
29
|
+
registerOnChange(fn: (_: T | null) => void): void;
|
|
30
|
+
registerOnTouched(fn: any): void;
|
|
31
|
+
validate: (control: AbstractControl) => {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
} | null;
|
|
34
|
+
setDisabledState(disabled: boolean): void;
|
|
35
|
+
private get control();
|
|
36
|
+
private setNativeInputElement;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvInputMaskDirective<any>, [{ optional: true; self: true; }, null, null, null, null, null]>;
|
|
38
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgvInputMaskDirective<any>, "[ngvInputMask]", never, { "ngvInputMask": { "alias": "ngvInputMask"; "required": false; }; }, {}, never, never, false, never>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { InputMaskConfig } from './config';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./input-mask.directive";
|
|
5
|
+
import * as i2 from "./input-mask-format.pipe";
|
|
6
|
+
export declare class NgvInputMaskModule {
|
|
7
|
+
static forRoot(config?: Partial<InputMaskConfig>): ModuleWithProviders<NgvInputMaskModule>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgvInputMaskModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgvInputMaskModule, [typeof i1.NgvInputMaskDirective, typeof i2.InputMaskFormatPipe], never, [typeof i1.NgvInputMaskDirective, typeof i2.InputMaskFormatPipe]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgvInputMaskModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type Inputmask from 'inputmask';
|
|
2
|
+
export type InputmaskOptions<T> = Inputmask.Options & {
|
|
3
|
+
parser?: (value: any) => T;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Useful when you want to add input-mask on input which is child of your component
|
|
7
|
+
*
|
|
8
|
+
* @since 2.1.0
|
|
9
|
+
*/
|
|
10
|
+
export type InputMaskConfig = {
|
|
11
|
+
/**
|
|
12
|
+
* If set true, MutationObserver will be used to look for changes until it finds input with inputSelector
|
|
13
|
+
*/
|
|
14
|
+
isAsync: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* CSS like selector, which will be used with `querySelector` to get the native input.
|
|
17
|
+
* If your input is loaded lazily, please use `isAsync` option with this
|
|
18
|
+
*/
|
|
19
|
+
inputSelector: string;
|
|
20
|
+
};
|