@d4k-ui/nbx-inputs 21.0.12 → 21.1.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/CHANGELOG.md +44 -0
- package/LICENSE.txt +22 -0
- package/README.md +494 -10
- package/fesm2022/d4k-ui-nbx-inputs.mjs +459 -165
- package/fesm2022/d4k-ui-nbx-inputs.mjs.map +1 -1
- package/package.json +4 -3
- package/types/d4k-ui-nbx-inputs.d.ts +81 -22
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d4k-ui/nbx-inputs",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
+
"@angular/cdk": "^21.2.6",
|
|
6
7
|
"@angular/common": "^21.2.8",
|
|
7
8
|
"@angular/core": "^21.2.8",
|
|
8
|
-
"@d4k-ui/theme": "^21.0.12",
|
|
9
9
|
"@angular/forms": "^21.2.8",
|
|
10
|
-
"@
|
|
10
|
+
"@d4k-ui/theme": "^21.1.2",
|
|
11
|
+
"rxjs": "^7.4.0"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"tslib": "^2.3.0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnDestroy, Signal, AfterContentInit, DestroyRef, OnInit, OnChanges, AfterViewInit, ElementRef, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { OnDestroy, Signal, AfterContentInit, DestroyRef, OnInit, OnChanges, AfterViewInit, ElementRef, SimpleChanges, TemplateRef } from '@angular/core';
|
|
3
3
|
import { ValidationErrors, AbstractControl, FormControl, ControlValueAccessor, FormGroup } from '@angular/forms';
|
|
4
|
-
import { NbComponentStatus, NbComponentSize } from '@d4k-ui/theme';
|
|
4
|
+
import { NbComponentStatus, NbComponentSize, NbDialogRef, NbCalendarRange, NbTagComponent } from '@d4k-ui/theme';
|
|
5
5
|
import { OverlayConfig } from '@angular/cdk/overlay';
|
|
6
6
|
import { Observable } from 'rxjs';
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ declare class NbxClipboardDirective implements OnDestroy {
|
|
|
12
12
|
private elementRef;
|
|
13
13
|
readonly value: _angular_core.InputSignal<unknown>;
|
|
14
14
|
readonly nbxClipboardCopyType: _angular_core.InputSignal<nbxClipboardCopyType>;
|
|
15
|
-
onClick():
|
|
15
|
+
onClick(event: Event): void;
|
|
16
16
|
ngOnDestroy(): void;
|
|
17
17
|
private showAnimation;
|
|
18
18
|
private overlayRef;
|
|
@@ -31,8 +31,8 @@ interface NbxLabelInfoType {
|
|
|
31
31
|
text: string;
|
|
32
32
|
status?: NbComponentStatus;
|
|
33
33
|
}
|
|
34
|
-
type NbxInputValidationMessages = Record<string,
|
|
35
|
-
type
|
|
34
|
+
type NbxInputValidationMessages = Record<string, NbxValidatorsErrorsMessageValue>;
|
|
35
|
+
type NbxValidatorsErrorsMessageValue = string | {
|
|
36
36
|
dataKey: string;
|
|
37
37
|
messageFunction: (arg: string) => string;
|
|
38
38
|
};
|
|
@@ -97,7 +97,7 @@ declare class NbxControlValueAccessorBaseDirective<T, L extends NbxInputLabelPos
|
|
|
97
97
|
registerOnTouched(fn: any): void;
|
|
98
98
|
setDisabledState(isDisabled: boolean): void;
|
|
99
99
|
get hasRequiredValidator(): boolean;
|
|
100
|
-
private
|
|
100
|
+
private getStyleVars;
|
|
101
101
|
private subscribeToStateChange;
|
|
102
102
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxControlValueAccessorBaseDirective<any, any, any>, never>;
|
|
103
103
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NbxControlValueAccessorBaseDirective<any, any, any>, never, never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "labelInfo": { "alias": "labelInfo"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; "withCopyButton": { "alias": "withCopyButton"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "customErrorsMessages": { "alias": "customErrorsMessages"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -109,11 +109,18 @@ declare class NbxCustomTooltipComponent {
|
|
|
109
109
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxCustomTooltipComponent, "nbx-custom-tooltip", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
type NumberType = 'int' | 'float';
|
|
112
113
|
declare class IntOrFloatDirective {
|
|
113
|
-
readonly nbxIntOrFloat: _angular_core.InputSignal<
|
|
114
|
+
readonly nbxIntOrFloat: _angular_core.InputSignal<NumberType>;
|
|
114
115
|
private readonly elRef;
|
|
115
116
|
onKeyPress(event: KeyboardEvent): void;
|
|
116
117
|
constructor();
|
|
118
|
+
private validateKey;
|
|
119
|
+
private canTypeMinus;
|
|
120
|
+
/**
|
|
121
|
+
* @returns true if the value of the field was changed
|
|
122
|
+
*/
|
|
123
|
+
private sanitizeValue;
|
|
117
124
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<IntOrFloatDirective, never>;
|
|
118
125
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<IntOrFloatDirective, "[nbxIntOrFloat]", never, { "nbxIntOrFloat": { "alias": "nbxIntOrFloat"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
119
126
|
}
|
|
@@ -173,13 +180,13 @@ declare class NbxInputColorSelectComponent extends NbxControlValueAccessorBaseDi
|
|
|
173
180
|
/**
|
|
174
181
|
* @description for correct work you need to provide NbDatepickerModule.forRoot() in you root providers list
|
|
175
182
|
*/
|
|
176
|
-
declare class NbxInputDatePickerComponent extends NbxControlValueAccessorBaseDirective<
|
|
183
|
+
declare class NbxInputDatePickerComponent extends NbxControlValueAccessorBaseDirective<Date> {
|
|
177
184
|
readonly minDate: _angular_core.InputSignal<string | Date | null>;
|
|
178
185
|
readonly maxDate: _angular_core.InputSignal<string | Date | null>;
|
|
179
186
|
readonly format: _angular_core.InputSignal<string | undefined>;
|
|
180
187
|
readonly dateChanged: _angular_core.OutputEmitterRef<Date>;
|
|
181
188
|
constructor();
|
|
182
|
-
dateSelected(event:
|
|
189
|
+
dateSelected(event: Date): void;
|
|
183
190
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxInputDatePickerComponent, never>;
|
|
184
191
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputDatePickerComponent, "nbx-input-date-picker", never, { "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, { "dateChanged": "dateChanged"; }, never, ["*"], true, never>;
|
|
185
192
|
}
|
|
@@ -191,15 +198,15 @@ interface DateRangeObject {
|
|
|
191
198
|
/**
|
|
192
199
|
* @description for correct work you need to provide NbDatepickerModule.forRoot() in you root providers list
|
|
193
200
|
*/
|
|
194
|
-
declare class NbxInputDateRangePickerComponent extends NbxControlValueAccessorBaseDirective<DateRangeObject> {
|
|
201
|
+
declare class NbxInputDateRangePickerComponent extends NbxControlValueAccessorBaseDirective<DateRangeObject> implements OnDestroy {
|
|
195
202
|
private dateService;
|
|
196
203
|
readonly minDate: _angular_core.InputSignal<Date | null>;
|
|
197
204
|
readonly maxDate: _angular_core.InputSignal<Date | null>;
|
|
198
205
|
readonly format: _angular_core.InputSignal<string | undefined>;
|
|
199
206
|
readonly dateRangeChanged: _angular_core.OutputEmitterRef<DateRangeObject | null>;
|
|
200
|
-
protected inputControl: FormControl<any>;
|
|
201
207
|
constructor();
|
|
202
|
-
|
|
208
|
+
ngOnDestroy(): void;
|
|
209
|
+
dateChanged(event: DateRangeObject): void;
|
|
203
210
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxInputDateRangePickerComponent, never>;
|
|
204
211
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputDateRangePickerComponent, "nbx-input-date-range-picker", never, { "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, { "dateRangeChanged": "dateRangeChanged"; }, never, ["*"], true, never>;
|
|
205
212
|
}
|
|
@@ -207,14 +214,14 @@ declare class NbxInputDateRangePickerComponent extends NbxControlValueAccessorBa
|
|
|
207
214
|
/**
|
|
208
215
|
* @description for correct work you need to provide NbDatepickerModule.forRoot() and NbTimepickerModule.forRoot() in you root providers list
|
|
209
216
|
*/
|
|
210
|
-
declare class NbxInputDateTimePickerComponent extends NbxControlValueAccessorBaseDirective<
|
|
217
|
+
declare class NbxInputDateTimePickerComponent extends NbxControlValueAccessorBaseDirective<Date> {
|
|
211
218
|
readonly minDate: _angular_core.InputSignal<string | Date | null>;
|
|
212
219
|
readonly maxDate: _angular_core.InputSignal<string | Date | null>;
|
|
213
220
|
readonly format: _angular_core.InputSignal<string | undefined>;
|
|
214
221
|
readonly step: _angular_core.InputSignal<number>;
|
|
215
222
|
readonly dateChanged: _angular_core.OutputEmitterRef<Date>;
|
|
216
223
|
constructor();
|
|
217
|
-
dateSelected(event:
|
|
224
|
+
dateSelected(event: Date): void;
|
|
218
225
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxInputDateTimePickerComponent, never>;
|
|
219
226
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputDateTimePickerComponent, "nbx-input-date-time-picker", never, { "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; }, { "dateChanged": "dateChanged"; }, never, ["*"], true, never>;
|
|
220
227
|
}
|
|
@@ -262,6 +269,49 @@ declare class NbxInputNumberComponent extends NbxControlValueAccessorBaseDirecti
|
|
|
262
269
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputNumberComponent, "nbx-input-number", never, { "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "onlyInt": { "alias": "onlyInt"; "required": false; "isSignal": true; }; }, { "inputKeyup": "inputKeyup"; }, never, ["*"], true, never>;
|
|
263
270
|
}
|
|
264
271
|
|
|
272
|
+
interface RangeObject {
|
|
273
|
+
start: Date;
|
|
274
|
+
end: Date;
|
|
275
|
+
}
|
|
276
|
+
type PeriodType = 'yesterday' | 'this_week' | 'this_month' | 'this_quarter' | 'this_half_year' | 'this_year';
|
|
277
|
+
/**
|
|
278
|
+
* @description for correct work you need to provide NbDialogModule.forRoot() in you root providers list
|
|
279
|
+
*/
|
|
280
|
+
declare class NbxInputPeriodSelectComponent extends NbxControlValueAccessorBaseDirective<RangeObject> {
|
|
281
|
+
private readonly dialogService;
|
|
282
|
+
private readonly toastrService;
|
|
283
|
+
readonly rangeDialog: _angular_core.Signal<TemplateRef<object>>;
|
|
284
|
+
readonly rangeSelected: _angular_core.OutputEmitterRef<RangeObject>;
|
|
285
|
+
readonly initValue: _angular_core.InputSignal<PeriodType | undefined>;
|
|
286
|
+
readonly rangeSelectControl: FormControl<PeriodType | null>;
|
|
287
|
+
/**
|
|
288
|
+
* @description you can set to true for show errors if not provide formControl
|
|
289
|
+
*/
|
|
290
|
+
private get todayDate();
|
|
291
|
+
private get dataListObj();
|
|
292
|
+
protected readonly periodsOptions: NbxSelectOption<PeriodType | 'custom_range'>[];
|
|
293
|
+
protected dialogRef: NbDialogRef<unknown> | undefined;
|
|
294
|
+
protected customRange: NbCalendarRange<Date>;
|
|
295
|
+
constructor();
|
|
296
|
+
changeSelection(value: PeriodType | 'custom_range'): void;
|
|
297
|
+
setValue(range: RangeObject): void;
|
|
298
|
+
openDialog(): void;
|
|
299
|
+
writeValue(value: RangeObject): void;
|
|
300
|
+
setDisabledState(isDisabled: boolean): void;
|
|
301
|
+
protected closeCustomRangeDialog(): void;
|
|
302
|
+
private currentWeekMondayDate;
|
|
303
|
+
private currentQuarteStartDate;
|
|
304
|
+
private lastHalfYearStartDate;
|
|
305
|
+
private setCustomRange;
|
|
306
|
+
/**
|
|
307
|
+
* @param end
|
|
308
|
+
* @returns Date with plus 24 hours
|
|
309
|
+
*/
|
|
310
|
+
private getCustomCorrectRangeEnd;
|
|
311
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxInputPeriodSelectComponent, never>;
|
|
312
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputPeriodSelectComponent, "nbx-input-period-select", never, { "initValue": { "alias": "initValue"; "required": false; "isSignal": true; }; }, { "rangeSelected": "rangeSelected"; }, never, never, true, never>;
|
|
313
|
+
}
|
|
314
|
+
|
|
265
315
|
declare class NbxInputSelectComponent extends NbxControlValueAccessorBaseDirective<string | string[]> {
|
|
266
316
|
readonly multiple: _angular_core.InputSignal<boolean>;
|
|
267
317
|
readonly optionsListClass: _angular_core.InputSignal<string>;
|
|
@@ -277,7 +327,7 @@ declare class NbxInputSelectComponent extends NbxControlValueAccessorBaseDirecti
|
|
|
277
327
|
}
|
|
278
328
|
|
|
279
329
|
declare class NbxInputTextComponent extends NbxControlValueAccessorBaseDirective<string | number> {
|
|
280
|
-
readonly type: _angular_core.InputSignal<"
|
|
330
|
+
readonly type: _angular_core.InputSignal<"text" | "search" | "email" | "tel">;
|
|
281
331
|
readonly min: _angular_core.InputSignal<number | null>;
|
|
282
332
|
readonly max: _angular_core.InputSignal<number | null>;
|
|
283
333
|
readonly inputKeyup: _angular_core.OutputEmitterRef<string>;
|
|
@@ -286,15 +336,24 @@ declare class NbxInputTextComponent extends NbxControlValueAccessorBaseDirective
|
|
|
286
336
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputTextComponent, "nbx-input-text", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; }, { "inputKeyup": "inputKeyup"; }, never, ["*"], true, never>;
|
|
287
337
|
}
|
|
288
338
|
|
|
339
|
+
declare class NbxInputTagsComponent extends NbxControlValueAccessorBaseDirective<(string | number)[]> {
|
|
340
|
+
readonly tagInput: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
341
|
+
readonly options: _angular_core.InputSignal<NbxSelectOption<any, any>[]>;
|
|
342
|
+
readonly selectedChange: _angular_core.OutputEmitterRef<(string | number)[]>;
|
|
343
|
+
protected readonly tags: _angular_core.Signal<(string | number)[]>;
|
|
344
|
+
onTagRemove(tagToRemove: NbTagComponent): void;
|
|
345
|
+
onTagAdd(value: string | number): void;
|
|
346
|
+
private setTags;
|
|
347
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxInputTagsComponent, never>;
|
|
348
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputTagsComponent, "nbx-input-tags", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; }, { "selectedChange": "selectedChange"; }, never, ["*"], true, never>;
|
|
349
|
+
}
|
|
350
|
+
|
|
289
351
|
declare class NbxInputTextareaComponent extends NbxControlValueAccessorBaseDirective<string> {
|
|
290
|
-
readonly textareaInput: _angular_core.Signal<ElementRef<HTMLDivElement
|
|
352
|
+
readonly textareaInput: _angular_core.Signal<ElementRef<HTMLDivElement>>;
|
|
291
353
|
readonly inputKeyup: _angular_core.OutputEmitterRef<string>;
|
|
292
354
|
readonly rows: _angular_core.InputSignal<number | null>;
|
|
293
355
|
constructor();
|
|
294
|
-
|
|
295
|
-
protected keyup(): void;
|
|
296
|
-
private get innerHTMLValue();
|
|
297
|
-
private setTextAreaValue;
|
|
356
|
+
protected onInput(): void;
|
|
298
357
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NbxInputTextareaComponent, never>;
|
|
299
358
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NbxInputTextareaComponent, "nbx-input-textarea", never, { "rows": { "alias": "rows"; "required": false; "isSignal": true; }; }, { "inputKeyup": "inputKeyup"; }, never, ["*"], true, never>;
|
|
300
359
|
}
|
|
@@ -376,5 +435,5 @@ declare const NbxValidators: {
|
|
|
376
435
|
email: (control: AbstractControl) => Record<string, any> | null;
|
|
377
436
|
};
|
|
378
437
|
|
|
379
|
-
export { IntOrFloatDirective, NbxClipboardDirective, NbxControlValueAccessorBaseDirective, NbxCustomTooltipComponent, NbxInputAutocompleteComponent, NbxInputColorSelectComponent, NbxInputDatePickerComponent, NbxInputDateRangePickerComponent, NbxInputDateTimePickerComponent, NbxInputErrorsComponent, NbxInputLabelComponent, NbxInputMultiselectAutocompleteComponent, NbxInputNumberComponent, NbxInputSelectComponent, NbxInputTextComponent, NbxInputTextareaComponent, NbxInputWrapperComponent, NbxValidators, NbxValidatorsErrorsMessage, filterAndSortOptionsBySearch, filterOptionsBySearch, getFilteredBySearchArray, getOnlyDirtyControlsValuesRecursive, getRandomId, isQueryIncludesInObject, markAllControlsAsDirty, resizeObservable, sortOptionsBySearchIndex };
|
|
380
|
-
export type { INbxControlContext, NbxInputLabelPositionType, NbxInputValidationMessages, NbxLabelInfoType,
|
|
438
|
+
export { IntOrFloatDirective, NbxClipboardDirective, NbxControlValueAccessorBaseDirective, NbxCustomTooltipComponent, NbxInputAutocompleteComponent, NbxInputColorSelectComponent, NbxInputDatePickerComponent, NbxInputDateRangePickerComponent, NbxInputDateTimePickerComponent, NbxInputErrorsComponent, NbxInputLabelComponent, NbxInputMultiselectAutocompleteComponent, NbxInputNumberComponent, NbxInputPeriodSelectComponent, NbxInputSelectComponent, NbxInputTagsComponent, NbxInputTextComponent, NbxInputTextareaComponent, NbxInputWrapperComponent, NbxValidators, NbxValidatorsErrorsMessage, filterAndSortOptionsBySearch, filterOptionsBySearch, getFilteredBySearchArray, getOnlyDirtyControlsValuesRecursive, getRandomId, isQueryIncludesInObject, markAllControlsAsDirty, resizeObservable, sortOptionsBySearchIndex };
|
|
439
|
+
export type { INbxControlContext, NbxInputLabelPositionType, NbxInputValidationMessages, NbxLabelInfoType, NbxSelectOption, NbxValidatorsErrorsMessageValue, PeriodType, RangeObject };
|