@d4k-ui/nbx-inputs 21.0.11 → 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
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Injector, DestroyRef, input, signal, computed,
|
|
2
|
+
import { inject, ElementRef, Injector, DestroyRef, input, signal, computed, afterRenderEffect, Directive, Component, HostListener, ChangeDetectionStrategy, viewChild, viewChildren, output, forwardRef, afterNextRender } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
4
4
|
import * as i1$2 from '@angular/forms';
|
|
5
|
-
import { FormControl, FormArray, FormGroup, FormControlName, FormArrayName, NgControl, Validators, ValueChangeEvent, StatusChangeEvent, PristineChangeEvent, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { FormControl, FormArray, FormGroup, FormControlName, FormArrayName, NgControl, Validators, ValueChangeEvent, StatusChangeEvent, PristineChangeEvent, TouchedChangeEvent, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
6
|
import { Observable, finalize, throttleTime, startWith, map } from 'rxjs';
|
|
7
7
|
import { Clipboard } from '@angular/cdk/clipboard';
|
|
8
8
|
import * as i1$1 from '@angular/cdk/overlay';
|
|
9
9
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
10
10
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
11
|
-
import {
|
|
12
|
-
import { NbIconComponent, NbTooltipDirective, NbOptionComponent, NbOptionListComponent, NbCheckboxComponent, NbInputDirective, NbButtonComponent, NbFormFieldComponent, NbSuffixDirective, NbDatepickerDirective, NbDatepickerComponent, NbDateService, NbRangepickerComponent, NbDateTimePickerComponent, NbSelectComponent } from '@d4k-ui/theme';
|
|
11
|
+
import { NbIconComponent, NbTooltipDirective, NbOptionComponent, NbOptionListComponent, NbCheckboxComponent, NbInputDirective, NbButtonComponent, NbFormFieldComponent, NbSuffixDirective, NbDatepickerDirective, NbDatepickerComponent, NbDateService, NbRangepickerComponent, NbDateTimePickerComponent, NbSelectComponent, NbDialogService, NbToastrService, NbCalendarRangeComponent, NbCardComponent, NbCardBodyComponent, NbCardFooterComponent, NbCardHeaderComponent, NbTagComponent, NbTagListComponent, NbTagInputDirective, NbAutocompleteComponent, NbAutocompleteDirective } from '@d4k-ui/theme';
|
|
13
12
|
import { KeyValuePipe } from '@angular/common';
|
|
14
13
|
import * as i1 from '@angular/cdk/scrolling';
|
|
15
14
|
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
@@ -169,8 +168,14 @@ class NbxControlValueAccessorBaseDirective {
|
|
|
169
168
|
};
|
|
170
169
|
}
|
|
171
170
|
constructor() {
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
afterRenderEffect({
|
|
172
|
+
write: () => {
|
|
173
|
+
// set the variables one by one: overwriting the whole style attribute drops host `[style]` bindings of subclasses
|
|
174
|
+
const style = this.elementRef.nativeElement.style;
|
|
175
|
+
for (const [name, value] of Object.entries(this.getStyleVars(this.size(), this.status()))) {
|
|
176
|
+
style.setProperty(name, value);
|
|
177
|
+
}
|
|
178
|
+
},
|
|
174
179
|
});
|
|
175
180
|
}
|
|
176
181
|
ngAfterContentInit() {
|
|
@@ -234,8 +239,14 @@ class NbxControlValueAccessorBaseDirective {
|
|
|
234
239
|
get hasRequiredValidator() {
|
|
235
240
|
return !!this.control?.hasValidator(Validators.required);
|
|
236
241
|
}
|
|
237
|
-
|
|
238
|
-
return
|
|
242
|
+
getStyleVars(size, status) {
|
|
243
|
+
return {
|
|
244
|
+
'--nbx-input-background-color': `var(--input-${status}-background-color)`,
|
|
245
|
+
'--nbx-input-font-size': `var(--input-${size}-text-font-size, 1rem)`,
|
|
246
|
+
'--nbx-input-font-weight': `var(--input-${size}-text-font-weight)`,
|
|
247
|
+
'--nbx-input-line-height': `var(--input-${size}-text-line-height)`,
|
|
248
|
+
'--nbx-input-text-color': `var(--input-${status}-text-color)`,
|
|
249
|
+
};
|
|
239
250
|
}
|
|
240
251
|
subscribeToStateChange(control) {
|
|
241
252
|
if (!control) {
|
|
@@ -255,41 +266,35 @@ class NbxControlValueAccessorBaseDirective {
|
|
|
255
266
|
if (event instanceof PristineChangeEvent) {
|
|
256
267
|
this.dirty.set(!event.pristine);
|
|
257
268
|
}
|
|
269
|
+
if (event instanceof TouchedChangeEvent) {
|
|
270
|
+
this.touched.set(event.touched);
|
|
271
|
+
}
|
|
258
272
|
});
|
|
259
273
|
}
|
|
260
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
261
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
274
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxControlValueAccessorBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
275
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.26", type: NbxControlValueAccessorBaseDirective, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, labelInfo: { classPropertyName: "labelInfo", publicName: "labelInfo", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, withCopyButton: { classPropertyName: "withCopyButton", publicName: "withCopyButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, customErrorsMessages: { classPropertyName: "customErrorsMessages", publicName: "customErrorsMessages", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
262
276
|
}
|
|
263
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxControlValueAccessorBaseDirective, decorators: [{
|
|
264
278
|
type: Directive
|
|
265
279
|
}], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], labelInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelInfo", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], withCopyButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "withCopyButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], customErrorsMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "customErrorsMessages", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }] } });
|
|
266
280
|
|
|
267
281
|
class NbxCustomTooltipComponent {
|
|
268
282
|
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
269
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
270
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
283
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxCustomTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
284
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: NbxCustomTooltipComponent, isStandalone: true, selector: "nbx-custom-tooltip", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "animate.enter": "nbx-tooltip-enter", "animate.leave": "nbx-tooltip-leave" } }, ngImport: i0, template: `<div class="tooltip-wrap">
|
|
271
285
|
{{ text() }}
|
|
272
286
|
<div class="triangle"></div>
|
|
273
|
-
</div>`, isInline: true, styles: [".tooltip-wrap{background-color:#000000e6;color:#fff;padding:5px;border-radius:5px;position:relative}div.triangle{position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid rgba(0,0,0,.9)}\n"]
|
|
274
|
-
trigger('tooltip', [
|
|
275
|
-
transition(':enter', [style({ opacity: 0 }), animate(200, style({ opacity: 1 }))]),
|
|
276
|
-
transition(':leave', [animate(200, style({ opacity: 0 }))]),
|
|
277
|
-
]),
|
|
278
|
-
] });
|
|
287
|
+
</div>`, isInline: true, styles: [":host.nbx-tooltip-enter{animation:nbx-tooltip-fade-in .2s ease}:host.nbx-tooltip-leave{animation:nbx-tooltip-fade-out .2s ease forwards}@keyframes nbx-tooltip-fade-in{0%{opacity:0}to{opacity:1}}@keyframes nbx-tooltip-fade-out{0%{opacity:1}to{opacity:0}}.tooltip-wrap{background-color:#000000e6;color:#fff;padding:5px;border-radius:5px;position:relative}div.triangle{position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid rgba(0,0,0,.9)}\n"] });
|
|
279
288
|
}
|
|
280
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxCustomTooltipComponent, decorators: [{
|
|
281
290
|
type: Component,
|
|
282
291
|
args: [{ standalone: true, selector: 'nbx-custom-tooltip', template: `<div class="tooltip-wrap">
|
|
283
292
|
{{ text() }}
|
|
284
293
|
<div class="triangle"></div>
|
|
285
294
|
</div>`, host: {
|
|
286
|
-
'
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
transition(':enter', [style({ opacity: 0 }), animate(200, style({ opacity: 1 }))]),
|
|
290
|
-
transition(':leave', [animate(200, style({ opacity: 0 }))]),
|
|
291
|
-
]),
|
|
292
|
-
], styles: [".tooltip-wrap{background-color:#000000e6;color:#fff;padding:5px;border-radius:5px;position:relative}div.triangle{position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid rgba(0,0,0,.9)}\n"] }]
|
|
295
|
+
'animate.enter': 'nbx-tooltip-enter',
|
|
296
|
+
'animate.leave': 'nbx-tooltip-leave',
|
|
297
|
+
}, styles: [":host.nbx-tooltip-enter{animation:nbx-tooltip-fade-in .2s ease}:host.nbx-tooltip-leave{animation:nbx-tooltip-fade-out .2s ease forwards}@keyframes nbx-tooltip-fade-in{0%{opacity:0}to{opacity:1}}@keyframes nbx-tooltip-fade-out{0%{opacity:1}to{opacity:0}}.tooltip-wrap{background-color:#000000e6;color:#fff;padding:5px;border-radius:5px;position:relative}div.triangle{position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid rgba(0,0,0,.9)}\n"] }]
|
|
293
298
|
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }] } });
|
|
294
299
|
|
|
295
300
|
function getPreparedCopyText(value, asJson = false) {
|
|
@@ -319,11 +324,12 @@ class NbxClipboardDirective {
|
|
|
319
324
|
elementRef = inject(ElementRef);
|
|
320
325
|
value = input('', { ...(ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {}), alias: 'nbxClipboard' });
|
|
321
326
|
nbxClipboardCopyType = input('string', ...(ngDevMode ? [{ debugName: "nbxClipboardCopyType" }] : /* istanbul ignore next */ []));
|
|
322
|
-
onClick() {
|
|
327
|
+
onClick(event) {
|
|
328
|
+
event.preventDefault();
|
|
329
|
+
event.stopPropagation();
|
|
323
330
|
this.copyToClipboard();
|
|
324
331
|
this.showAnimation();
|
|
325
332
|
this.showPopover();
|
|
326
|
-
return false;
|
|
327
333
|
}
|
|
328
334
|
ngOnDestroy() {
|
|
329
335
|
this.overlayRef?.dispose();
|
|
@@ -363,9 +369,10 @@ class NbxClipboardDirective {
|
|
|
363
369
|
const tooltipRef = this.overlayRef.attach(tooltipPortal);
|
|
364
370
|
tooltipRef.setInput('text', 'Copied');
|
|
365
371
|
}
|
|
372
|
+
// Only detach: the overlay keeps the tooltip until its `animate.leave` animation ends and then removes it.
|
|
373
|
+
// `dispose()` would remove it at once. The overlay is disposed on the next `show()` or on destroy.
|
|
366
374
|
hide() {
|
|
367
375
|
this.overlayRef.detach();
|
|
368
|
-
this.overlayRef.dispose();
|
|
369
376
|
}
|
|
370
377
|
getOverlayConfig() {
|
|
371
378
|
const positionStrategy = this.overlay
|
|
@@ -394,10 +401,10 @@ class NbxClipboardDirective {
|
|
|
394
401
|
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
395
402
|
});
|
|
396
403
|
}
|
|
397
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
398
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxClipboardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
405
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.26", type: NbxClipboardDirective, isStandalone: true, selector: "[nbxClipboard]", inputs: { value: { classPropertyName: "value", publicName: "nbxClipboard", isSignal: true, isRequired: false, transformFunction: null }, nbxClipboardCopyType: { classPropertyName: "nbxClipboardCopyType", publicName: "nbxClipboardCopyType", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.disabled": "!this.value() || null" } }, ngImport: i0 });
|
|
399
406
|
}
|
|
400
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxClipboardDirective, decorators: [{
|
|
401
408
|
type: Directive,
|
|
402
409
|
args: [{
|
|
403
410
|
selector: '[nbxClipboard]',
|
|
@@ -408,48 +415,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
408
415
|
}]
|
|
409
416
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "nbxClipboard", required: false }] }], nbxClipboardCopyType: [{ type: i0.Input, args: [{ isSignal: true, alias: "nbxClipboardCopyType", required: false }] }], onClick: [{
|
|
410
417
|
type: HostListener,
|
|
411
|
-
args: ['click']
|
|
418
|
+
args: ['click', ['$event']]
|
|
412
419
|
}] } });
|
|
413
420
|
|
|
421
|
+
function sanitizeNumber(value, type) {
|
|
422
|
+
// exponent form ("1e5") can't be cleaned by dropping characters, it has to be converted
|
|
423
|
+
const exponentValue = /e/i.test(value) ? Number(value) : NaN;
|
|
424
|
+
if (Number.isFinite(exponentValue)) {
|
|
425
|
+
return String(type === 'int' ? Math.trunc(exponentValue) : exponentValue);
|
|
426
|
+
}
|
|
427
|
+
const sign = value.trimStart().startsWith('-') ? '-' : '';
|
|
428
|
+
const [integer, ...fraction] = value.replace(/[^\d.]/g, '').split('.');
|
|
429
|
+
if (type === 'int' || !fraction.length) {
|
|
430
|
+
return sign + integer;
|
|
431
|
+
}
|
|
432
|
+
return `${sign}${integer}.${fraction.join('')}`;
|
|
433
|
+
}
|
|
414
434
|
class IntOrFloatDirective {
|
|
415
435
|
nbxIntOrFloat = input.required(...(ngDevMode ? [{ debugName: "nbxIntOrFloat" }] : /* istanbul ignore next */ []));
|
|
416
436
|
elRef = inject(ElementRef);
|
|
417
437
|
onKeyPress(event) {
|
|
418
|
-
|
|
419
|
-
const key = event.key;
|
|
420
|
-
if (type === 'int') {
|
|
421
|
-
// Allow only digits
|
|
422
|
-
if (!/^\d$/.test(key)) {
|
|
423
|
-
event.preventDefault();
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
else if (type === 'float') {
|
|
427
|
-
// Allow digits and one dot
|
|
428
|
-
const input = event.target;
|
|
429
|
-
if (!/^\d$/.test(key) && !(key === '.' && !input.value.includes('.'))) {
|
|
430
|
-
event.preventDefault();
|
|
431
|
-
}
|
|
432
|
-
}
|
|
438
|
+
this.validateKey(event);
|
|
433
439
|
}
|
|
434
440
|
constructor() {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
441
|
+
const element = this.elRef.nativeElement;
|
|
442
|
+
// capture phase: the value has to be clean before the form value accessor reads it on the same event
|
|
443
|
+
const onInput = () => this.sanitizeValue();
|
|
444
|
+
element.addEventListener('input', onInput, { capture: true });
|
|
445
|
+
inject(DestroyRef).onDestroy(() => element.removeEventListener('input', onInput, { capture: true }));
|
|
446
|
+
let previousType;
|
|
447
|
+
afterRenderEffect({
|
|
448
|
+
write: () => {
|
|
449
|
+
const type = this.nbxIntOrFloat();
|
|
450
|
+
// a value set by the form stays as it is, the field is re-validated only when the type is switched later
|
|
451
|
+
if (previousType && previousType !== type && this.sanitizeValue()) {
|
|
452
|
+
element.dispatchEvent(new Event('input', { bubbles: true }));
|
|
442
453
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
}
|
|
454
|
+
previousType = type;
|
|
455
|
+
},
|
|
447
456
|
});
|
|
448
457
|
}
|
|
449
|
-
|
|
450
|
-
|
|
458
|
+
validateKey(event) {
|
|
459
|
+
const key = event.key;
|
|
460
|
+
// only printable characters are filtered, Enter (form submit) and shortcuts stay with the browser
|
|
461
|
+
if (key.length !== 1 || event.ctrlKey || event.metaKey) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
const input = event.target;
|
|
465
|
+
const allowed = /^\d$/.test(key) ||
|
|
466
|
+
(key === '-' && this.canTypeMinus(input)) ||
|
|
467
|
+
(key === '.' && this.nbxIntOrFloat() === 'float' && !input.value.includes('.'));
|
|
468
|
+
if (!allowed) {
|
|
469
|
+
event.preventDefault();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
canTypeMinus(input) {
|
|
473
|
+
const { value, selectionStart, selectionEnd } = input;
|
|
474
|
+
// number inputs don't expose the caret, so there the minus can't be limited to the start of the value
|
|
475
|
+
if (selectionStart === null) {
|
|
476
|
+
return !value.includes('-') && !input.validity.badInput;
|
|
477
|
+
}
|
|
478
|
+
return selectionStart === 0 && !value.slice(selectionEnd ?? 0).includes('-');
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* @returns true if the value of the field was changed
|
|
482
|
+
*/
|
|
483
|
+
sanitizeValue() {
|
|
484
|
+
const input = this.elRef.nativeElement;
|
|
485
|
+
if (typeof input.value !== 'string') {
|
|
486
|
+
return false;
|
|
487
|
+
}
|
|
488
|
+
const value = sanitizeNumber(input.value, this.nbxIntOrFloat());
|
|
489
|
+
if (input.value === value) {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
input.value = value;
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: IntOrFloatDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
496
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.26", type: IntOrFloatDirective, isStandalone: true, selector: "[nbxIntOrFloat]", inputs: { nbxIntOrFloat: { classPropertyName: "nbxIntOrFloat", publicName: "nbxIntOrFloat", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keypress": "onKeyPress($event)" } }, ngImport: i0 });
|
|
451
497
|
}
|
|
452
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: IntOrFloatDirective, decorators: [{
|
|
453
499
|
type: Directive,
|
|
454
500
|
args: [{
|
|
455
501
|
selector: '[nbxIntOrFloat]',
|
|
@@ -479,8 +525,8 @@ const NbxValidatorsErrorsMessage = {
|
|
|
479
525
|
messageFunction: (length = '0') => `Minimum length must be ${length}`,
|
|
480
526
|
},
|
|
481
527
|
email: 'Invalid email',
|
|
482
|
-
nbDatepickerMax: 'Date is later
|
|
483
|
-
nbDatepickerMin: 'Date is less
|
|
528
|
+
nbDatepickerMax: 'Date is later than possible',
|
|
529
|
+
nbDatepickerMin: 'Date is less than possible',
|
|
484
530
|
unknownError: 'Not acceptable value',
|
|
485
531
|
};
|
|
486
532
|
|
|
@@ -503,24 +549,25 @@ class NbxInputErrorsComponent {
|
|
|
503
549
|
if (typeof errorValue === 'string') {
|
|
504
550
|
return errorValue;
|
|
505
551
|
}
|
|
552
|
+
return 'Not acceptable value';
|
|
506
553
|
}
|
|
507
554
|
const message = this.errorMessages()[key];
|
|
508
555
|
if (typeof message === 'string') {
|
|
509
556
|
return message;
|
|
510
557
|
}
|
|
511
|
-
if (typeof errorValue
|
|
512
|
-
return message.messageFunction(errorValue
|
|
558
|
+
if (typeof errorValue === 'string') {
|
|
559
|
+
return message.messageFunction(errorValue);
|
|
513
560
|
}
|
|
514
|
-
return
|
|
561
|
+
return message.messageFunction(errorValue[message.dataKey]);
|
|
515
562
|
}
|
|
516
563
|
catch {
|
|
517
564
|
return 'Not acceptable value';
|
|
518
565
|
}
|
|
519
566
|
}
|
|
520
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
521
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
567
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
568
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxInputErrorsComponent, isStandalone: true, selector: "nbx-input-errors", inputs: { customErrorsMessages: { classPropertyName: "customErrorsMessages", publicName: "customErrorsMessages", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"input-errors\">\n @for(err of errors() | keyvalue; track err.key ){\n <div class=\"error\">{{ getErrorMessage(err.key, err.value) }}</div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
522
569
|
}
|
|
523
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputErrorsComponent, decorators: [{
|
|
524
571
|
type: Component,
|
|
525
572
|
args: [{ selector: 'nbx-input-errors', imports: [KeyValuePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"input-errors\">\n @for(err of errors() | keyvalue; track err.key ){\n <div class=\"error\">{{ getErrorMessage(err.key, err.value) }}</div>\n }\n</div>\n" }]
|
|
526
573
|
}], propDecorators: { customErrorsMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "customErrorsMessages", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: true }] }] } });
|
|
@@ -530,10 +577,10 @@ class NbxInputLabelComponent {
|
|
|
530
577
|
isRequired = input(false, ...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
531
578
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
532
579
|
inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
533
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
534
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
580
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
581
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxInputLabelComponent, isStandalone: true, selector: "nbx-input-label", inputs: { labelInfo: { classPropertyName: "labelInfo", publicName: "labelInfo", isSignal: true, isRequired: false, transformFunction: null }, isRequired: { classPropertyName: "isRequired", publicName: "isRequired", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"label-wrap\">\n <label [class]=\"{ required: isRequired(), disabled: disabled() }\" class=\"input-label\" [for]=\"inputId()\">\n <ng-content></ng-content>\n </label>\n @if (labelInfo()?.type === 'icon') {\n <nb-icon\n nbTooltip=\"{{ labelInfo()?.text }}\"\n [nbTooltipStatus]=\"labelInfo()?.status || 'primary'\"\n icon=\"alert-circle-outline\"\n class=\"label-info\"></nb-icon>\n }\n @if (labelInfo()?.type === 'text') {\n <span [title]=\"labelInfo()?.text\" class=\"label-info\">{{ labelInfo()?.text }}</span>\n }\n</div>\n", styles: [":host{transition:all .3s ease}.label-wrap{display:flex;gap:.2rem;font-size:var(--nbx-input-font-size)}.input-label:empty+.label-info{display:none}.input-label{font-weight:600;font-size:inherit;transition:font-size .3s ease}label:not(:empty).required:after{content:\"*\";position:relative;font-size:inherit;color:red;padding-left:.25rem;font-weight:600}label.input-label.disabled{color:var(--input-primary-disabled-text-color)}nb-icon{font-size:inherit}\n"], dependencies: [{ kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "directive", type: NbTooltipDirective, selector: "[nbTooltip]", inputs: ["nbTooltip", "nbTooltipPlacement", "nbTooltipAdjustment", "nbTooltipClass", "nbTooltipIcon", "nbTooltipStatus", "nbTooltipTrigger", "nbTooltipOffset", "nbTooltipDisabled"], outputs: ["nbTooltipShowStateChange"], exportAs: ["nbTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
535
582
|
}
|
|
536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputLabelComponent, decorators: [{
|
|
537
584
|
type: Component,
|
|
538
585
|
args: [{ selector: 'nbx-input-label', imports: [NbIconComponent, NbTooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"label-wrap\">\n <label [class]=\"{ required: isRequired(), disabled: disabled() }\" class=\"input-label\" [for]=\"inputId()\">\n <ng-content></ng-content>\n </label>\n @if (labelInfo()?.type === 'icon') {\n <nb-icon\n nbTooltip=\"{{ labelInfo()?.text }}\"\n [nbTooltipStatus]=\"labelInfo()?.status || 'primary'\"\n icon=\"alert-circle-outline\"\n class=\"label-info\"></nb-icon>\n }\n @if (labelInfo()?.type === 'text') {\n <span [title]=\"labelInfo()?.text\" class=\"label-info\">{{ labelInfo()?.text }}</span>\n }\n</div>\n", styles: [":host{transition:all .3s ease}.label-wrap{display:flex;gap:.2rem;font-size:var(--nbx-input-font-size)}.input-label:empty+.label-info{display:none}.input-label{font-weight:600;font-size:inherit;transition:font-size .3s ease}label:not(:empty).required:after{content:\"*\";position:relative;font-size:inherit;color:red;padding-left:.25rem;font-weight:600}label.input-label.disabled{color:var(--input-primary-disabled-text-color)}nb-icon{font-size:inherit}\n"] }]
|
|
539
586
|
}], propDecorators: { labelInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelInfo", required: false }] }], isRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRequired", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }] } });
|
|
@@ -573,10 +620,10 @@ class NbxInputWrapperComponent {
|
|
|
573
620
|
}
|
|
574
621
|
return true;
|
|
575
622
|
}, ...(ngDevMode ? [{ debugName: "isControlHasValue" }] : /* istanbul ignore next */ []));
|
|
576
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
577
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
623
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
624
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxInputWrapperComponent, isStandalone: true, selector: "nbx-input-wrapper", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, isInputHasButton: { classPropertyName: "isInputHasButton", publicName: "isInputHasButton", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, copyAsJson: { classPropertyName: "copyAsJson", publicName: "copyAsJson", isSignal: true, isRequired: false, transformFunction: null }, floatLabelOnlyBySearch: { classPropertyName: "floatLabelOnlyBySearch", publicName: "floatLabelOnlyBySearch", isSignal: true, isRequired: false, transformFunction: null }, searchHasValue: { classPropertyName: "searchHasValue", publicName: "searchHasValue", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "labelContent", first: true, predicate: ["labelContent"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div class=\"nbx-input-wrap\" [class.invalid]=\"context().errorDisplayedState()\">\n <div\n class=\"input-fieldset\"\n [class]=\"context().labelPosition()\"\n [class.has-value]=\"isControlHasValue()\"\n [class.no-label]=\"!isLabelHasContent()\">\n @if (context().labelPosition() !== 'none') {\n <nbx-input-label\n [labelInfo]=\"context().labelInfo()\"\n [isRequired]=\"context().hasRequiredValidator\"\n [disabled]=\"context().disabled()\"\n [inputId]=\"inputId()\"\n #labelContent>\n <ng-content #labelContent select=\"[label-content]\"></ng-content>\n </nbx-input-label>\n }\n <div class=\"input-content-wrap\">\n <ng-content></ng-content>\n @if (context().withCopyButton(); as copyType) {\n <button\n type=\"button\"\n [class.move-left]=\"isInputHasButton()\"\n [id]=\"inputId() + '-copy-button'\"\n class=\"copy-button\"\n [nbxClipboard]=\"context().value()\"\n [nbxClipboardCopyType]=\"copyType\">\n <nb-icon icon=\"copy-outline\"></nb-icon>\n </button>\n }\n </div>\n </div>\n <nbx-input-errors\n [customErrorsMessages]=\"context().customErrorsMessages()\"\n [errors]=\"context().errors()\"></nbx-input-errors>\n</div>\n", styles: [".nbx-input-wrap .input-fieldset{position:relative;display:flex;flex-direction:column;gap:.313rem}.nbx-input-wrap .input-fieldset.inline,.nbx-input-wrap .input-fieldset.inline-reverse{align-items:center}.nbx-input-wrap .input-fieldset.inline{flex-direction:row}.nbx-input-wrap .input-fieldset.inline-reverse{flex-direction:row-reverse}.nbx-input-wrap .input-fieldset.block-center{align-items:center}.nbx-input-wrap .input-fieldset.float nbx-input-label{pointer-events:none}.nbx-input-wrap .input-fieldset.float nbx-input-label::ng-deep .label-info{pointer-events:all}.nbx-input-wrap .input-fieldset.float ::ng-deep input::placeholder,.nbx-input-wrap .input-fieldset.float ::ng-deep textarea::placeholder,.nbx-input-wrap .input-fieldset.float ::ng-deep .select-button::placeholder,.nbx-input-wrap .input-fieldset.float ::ng-deep div.textarea-container::placeholder{opacity:0}.nbx-input-wrap .input-fieldset.float ::ng-deep div.textarea-container:before{opacity:0}.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep input::placeholder,.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep textarea::placeholder,.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep .select-button::placeholder,.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep div.textarea-container::placeholder{opacity:1}.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep div.textarea-container:before{opacity:1}.nbx-input-wrap .input-fieldset.float nbx-input-label ::ng-deep nb-icon{font-size:inherit}.nbx-input-wrap .input-fieldset.float nbx-input-label{background-color:var(--nbx-input-background-color);z-index:1;line-height:1;top:min(50%,1.3rem);transform:translateY(-50%);left:1rem;position:absolute}.nbx-input-wrap .input-fieldset.float:focus-within nbx-input-label ::ng-deep .label-wrap label,.nbx-input-wrap .input-fieldset.float.has-value nbx-input-label ::ng-deep .label-wrap label{font-size:calc(1em - 20%)}.nbx-input-wrap .input-fieldset.float:focus-within nbx-input-label,.nbx-input-wrap .input-fieldset.float.has-value nbx-input-label{left:.625rem;padding:0 .375rem;top:0}.nbx-input-wrap .input-fieldset.no-label{gap:0}.nbx-input-wrap ::ng-deep .input-errors{opacity:0;overflow:hidden;max-height:0;max-width:unset;transition:max-height .5s ease}.nbx-input-wrap.invalid::ng-deep input,.nbx-input-wrap.invalid::ng-deep textarea,.nbx-input-wrap.invalid::ng-deep .select-button,.nbx-input-wrap.invalid::ng-deep div.textarea-container{border-color:#ff0606!important}.nbx-input-wrap.invalid::ng-deep .input-errors{opacity:1;margin-top:.2rem;max-height:6rem;max-width:unset;color:#ff0606}.nbx-input-wrap .input-content-wrap{position:relative}.nbx-input-wrap .copy-button{border:none;outline:none;background:none;border-radius:5px;position:absolute;z-index:2;right:0;top:0;padding:.2rem}.nbx-input-wrap .copy-button.move-left{right:2.5rem}@media(hover:hover){.nbx-input-wrap .copy-button:hover{background-color:var(--option-hover-background-color)}}\n"], dependencies: [{ kind: "component", type: NbxInputErrorsComponent, selector: "nbx-input-errors", inputs: ["customErrorsMessages", "errors"] }, { kind: "component", type: NbxInputLabelComponent, selector: "nbx-input-label", inputs: ["labelInfo", "isRequired", "disabled", "inputId"] }, { kind: "directive", type: NbxClipboardDirective, selector: "[nbxClipboard]", inputs: ["nbxClipboard", "nbxClipboardCopyType"] }, { kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
578
625
|
}
|
|
579
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputWrapperComponent, decorators: [{
|
|
580
627
|
type: Component,
|
|
581
628
|
args: [{ selector: 'nbx-input-wrapper', imports: [NbxInputErrorsComponent, NbxInputLabelComponent, NbxClipboardDirective, NbIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"nbx-input-wrap\" [class.invalid]=\"context().errorDisplayedState()\">\n <div\n class=\"input-fieldset\"\n [class]=\"context().labelPosition()\"\n [class.has-value]=\"isControlHasValue()\"\n [class.no-label]=\"!isLabelHasContent()\">\n @if (context().labelPosition() !== 'none') {\n <nbx-input-label\n [labelInfo]=\"context().labelInfo()\"\n [isRequired]=\"context().hasRequiredValidator\"\n [disabled]=\"context().disabled()\"\n [inputId]=\"inputId()\"\n #labelContent>\n <ng-content #labelContent select=\"[label-content]\"></ng-content>\n </nbx-input-label>\n }\n <div class=\"input-content-wrap\">\n <ng-content></ng-content>\n @if (context().withCopyButton(); as copyType) {\n <button\n type=\"button\"\n [class.move-left]=\"isInputHasButton()\"\n [id]=\"inputId() + '-copy-button'\"\n class=\"copy-button\"\n [nbxClipboard]=\"context().value()\"\n [nbxClipboardCopyType]=\"copyType\">\n <nb-icon icon=\"copy-outline\"></nb-icon>\n </button>\n }\n </div>\n </div>\n <nbx-input-errors\n [customErrorsMessages]=\"context().customErrorsMessages()\"\n [errors]=\"context().errors()\"></nbx-input-errors>\n</div>\n", styles: [".nbx-input-wrap .input-fieldset{position:relative;display:flex;flex-direction:column;gap:.313rem}.nbx-input-wrap .input-fieldset.inline,.nbx-input-wrap .input-fieldset.inline-reverse{align-items:center}.nbx-input-wrap .input-fieldset.inline{flex-direction:row}.nbx-input-wrap .input-fieldset.inline-reverse{flex-direction:row-reverse}.nbx-input-wrap .input-fieldset.block-center{align-items:center}.nbx-input-wrap .input-fieldset.float nbx-input-label{pointer-events:none}.nbx-input-wrap .input-fieldset.float nbx-input-label::ng-deep .label-info{pointer-events:all}.nbx-input-wrap .input-fieldset.float ::ng-deep input::placeholder,.nbx-input-wrap .input-fieldset.float ::ng-deep textarea::placeholder,.nbx-input-wrap .input-fieldset.float ::ng-deep .select-button::placeholder,.nbx-input-wrap .input-fieldset.float ::ng-deep div.textarea-container::placeholder{opacity:0}.nbx-input-wrap .input-fieldset.float ::ng-deep div.textarea-container:before{opacity:0}.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep input::placeholder,.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep textarea::placeholder,.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep .select-button::placeholder,.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep div.textarea-container::placeholder{opacity:1}.nbx-input-wrap .input-fieldset.float:focus-within ::ng-deep div.textarea-container:before{opacity:1}.nbx-input-wrap .input-fieldset.float nbx-input-label ::ng-deep nb-icon{font-size:inherit}.nbx-input-wrap .input-fieldset.float nbx-input-label{background-color:var(--nbx-input-background-color);z-index:1;line-height:1;top:min(50%,1.3rem);transform:translateY(-50%);left:1rem;position:absolute}.nbx-input-wrap .input-fieldset.float:focus-within nbx-input-label ::ng-deep .label-wrap label,.nbx-input-wrap .input-fieldset.float.has-value nbx-input-label ::ng-deep .label-wrap label{font-size:calc(1em - 20%)}.nbx-input-wrap .input-fieldset.float:focus-within nbx-input-label,.nbx-input-wrap .input-fieldset.float.has-value nbx-input-label{left:.625rem;padding:0 .375rem;top:0}.nbx-input-wrap .input-fieldset.no-label{gap:0}.nbx-input-wrap ::ng-deep .input-errors{opacity:0;overflow:hidden;max-height:0;max-width:unset;transition:max-height .5s ease}.nbx-input-wrap.invalid::ng-deep input,.nbx-input-wrap.invalid::ng-deep textarea,.nbx-input-wrap.invalid::ng-deep .select-button,.nbx-input-wrap.invalid::ng-deep div.textarea-container{border-color:#ff0606!important}.nbx-input-wrap.invalid::ng-deep .input-errors{opacity:1;margin-top:.2rem;max-height:6rem;max-width:unset;color:#ff0606}.nbx-input-wrap .input-content-wrap{position:relative}.nbx-input-wrap .copy-button{border:none;outline:none;background:none;border-radius:5px;position:absolute;z-index:2;right:0;top:0;padding:.2rem}.nbx-input-wrap .copy-button.move-left{right:2.5rem}@media(hover:hover){.nbx-input-wrap .copy-button:hover{background-color:var(--option-hover-background-color)}}\n"] }]
|
|
582
629
|
}], propDecorators: { labelContent: [{ type: i0.ViewChild, args: ['labelContent', { ...{ read: ElementRef }, isSignal: true }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], isInputHasButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "isInputHasButton", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], copyAsJson: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyAsJson", required: false }] }], floatLabelOnlyBySearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabelOnlyBySearch", required: false }] }], searchHasValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchHasValue", required: false }] }] } });
|
|
@@ -640,10 +687,10 @@ class NbxSelectOptionsListComponent {
|
|
|
640
687
|
optionsList[index]?.nativeElement.focus();
|
|
641
688
|
}
|
|
642
689
|
}
|
|
643
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
644
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
690
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxSelectOptionsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
691
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxSelectOptionsListComponent, isStandalone: true, selector: "nbx-select-options-list", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsListClass: { classPropertyName: "optionsListClass", publicName: "optionsListClass", isSignal: true, isRequired: false, transformFunction: null }, enableVirtualScroll: { classPropertyName: "enableVirtualScroll", publicName: "enableVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSizePX: { classPropertyName: "virtualScrollItemSizePX", publicName: "virtualScrollItemSizePX", isSignal: true, isRequired: false, transformFunction: null }, multi: { classPropertyName: "multi", publicName: "multi", isSignal: true, isRequired: false, transformFunction: null }, selectedValues: { classPropertyName: "selectedValues", publicName: "selectedValues", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { optionClicked: "optionClicked", selectAll: "selectAll", tabClicked: "tabClicked" }, viewQueries: [{ propertyName: "optionsList", predicate: ["optionItem"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "virtualScrollContainer", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<nb-option-list\n #optionsListContainer\n [style.--all-elements-height]=\"options().length * virtualScrollItemSizePX() + 'px'\"\n [style.--element-height]=\"virtualScrollItemSizePX() + 'px'\"\n (keydown)=\"keydown($event)\"\n [class.multi]=\"multi()\"\n [class.with-virtual-scroll]=\"enableVirtualScroll()\"\n [class]=\"optionsListClass()\">\n @if (multi()) {\n <nb-option\n [disabled]=\"isAllSelected()\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); selectAllOptions()\"\n >Select all</nb-option\n >\n }\n @if (enableVirtualScroll()) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"virtualScrollItemSizePX()\"\n maxBufferPx=\"600\"\n minBufferPx=\"600\"\n class=\"virtual-scroll-viewport\">\n <nb-option\n #optionItem\n *cdkVirtualFor=\"let option of options(); let i = index\"\n class=\"virtual-scroll-item\"\n [disabled]=\"option.disabled\"\n [id]=\"'nb-option-' + option.value\"\n [tabindex]=\"i\"\n [value]=\"option.value\"\n (keyup.enter)=\"optionClickedHandler(option, i)\"\n (click)=\"optionClickedHandler(option, i)\">\n @if (multi()) {\n <nb-checkbox\n class=\"multiselect-autocomplete-checkbox\"\n status=\"primary\"\n [disabled]=\"option.disabled\"\n [checked]=\"selectedValues().includes(option.value)\"\n >{{ option.title }}</nb-checkbox\n >\n } @else {\n {{ option.title }}\n }\n </nb-option>\n </cdk-virtual-scroll-viewport>\n } @else {\n @for (option of options(); track $index) {\n @if (option) {\n <nb-option\n #optionItem\n [disabled]=\"option.disabled\"\n [id]=\"'nb-option-' + option.value\"\n [tabindex]=\"$index\"\n [value]=\"option.value\"\n (keyup.enter)=\"optionClickedHandler(option, $index)\"\n (click)=\"optionClickedHandler(option, $index)\">\n @if (multi()) {\n <nb-checkbox\n class=\"multiselect-autocomplete-checkbox\"\n status=\"primary\"\n [disabled]=\"option.disabled\"\n [checked]=\"selectedValues().includes(option.value)\"\n >{{ option.title }}</nb-checkbox\n >\n } @else {\n {{ option.title }}\n }\n </nb-option>\n }\n }\n }\n</nb-option-list>\n", styles: [":host{width:100%;position:relative;z-index:9999;background-color:var(--option-list-background-color);box-shadow:var(--shadow)}nb-option-list{width:100%;display:block}nb-option-list.with-virtual-scroll ::ng-deep .option-list{overflow:hidden}nb-option-list.multi.with-virtual-scroll ::ng-deep .option-list{overflow:hidden}nb-option-list.multi.with-virtual-scroll ::ng-deep .option-list .virtual-scroll-viewport{max-height:calc(var(--option-list-max-height) - var(--element-height))}.virtual-scroll-viewport{height:var(--all-elements-height);max-height:var(--option-list-max-height)}.virtual-scroll-item{height:38px}\n"], dependencies: [{ kind: "component", type: NbOptionComponent, selector: "nb-option", inputs: ["value", "disabled"], outputs: ["selectionChange"] }, { kind: "component", type: NbOptionListComponent, selector: "nb-option-list", inputs: ["size", "position"] }, { kind: "component", type: NbCheckboxComponent, selector: "nb-checkbox", inputs: ["checked", "disabled", "status", "indeterminate"], outputs: ["checkedChange"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
645
692
|
}
|
|
646
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxSelectOptionsListComponent, decorators: [{
|
|
647
694
|
type: Component,
|
|
648
695
|
args: [{ selector: 'nbx-select-options-list', imports: [NbOptionComponent, NbOptionListComponent, NbCheckboxComponent, ScrollingModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nb-option-list\n #optionsListContainer\n [style.--all-elements-height]=\"options().length * virtualScrollItemSizePX() + 'px'\"\n [style.--element-height]=\"virtualScrollItemSizePX() + 'px'\"\n (keydown)=\"keydown($event)\"\n [class.multi]=\"multi()\"\n [class.with-virtual-scroll]=\"enableVirtualScroll()\"\n [class]=\"optionsListClass()\">\n @if (multi()) {\n <nb-option\n [disabled]=\"isAllSelected()\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); selectAllOptions()\"\n >Select all</nb-option\n >\n }\n @if (enableVirtualScroll()) {\n <cdk-virtual-scroll-viewport\n [itemSize]=\"virtualScrollItemSizePX()\"\n maxBufferPx=\"600\"\n minBufferPx=\"600\"\n class=\"virtual-scroll-viewport\">\n <nb-option\n #optionItem\n *cdkVirtualFor=\"let option of options(); let i = index\"\n class=\"virtual-scroll-item\"\n [disabled]=\"option.disabled\"\n [id]=\"'nb-option-' + option.value\"\n [tabindex]=\"i\"\n [value]=\"option.value\"\n (keyup.enter)=\"optionClickedHandler(option, i)\"\n (click)=\"optionClickedHandler(option, i)\">\n @if (multi()) {\n <nb-checkbox\n class=\"multiselect-autocomplete-checkbox\"\n status=\"primary\"\n [disabled]=\"option.disabled\"\n [checked]=\"selectedValues().includes(option.value)\"\n >{{ option.title }}</nb-checkbox\n >\n } @else {\n {{ option.title }}\n }\n </nb-option>\n </cdk-virtual-scroll-viewport>\n } @else {\n @for (option of options(); track $index) {\n @if (option) {\n <nb-option\n #optionItem\n [disabled]=\"option.disabled\"\n [id]=\"'nb-option-' + option.value\"\n [tabindex]=\"$index\"\n [value]=\"option.value\"\n (keyup.enter)=\"optionClickedHandler(option, $index)\"\n (click)=\"optionClickedHandler(option, $index)\">\n @if (multi()) {\n <nb-checkbox\n class=\"multiselect-autocomplete-checkbox\"\n status=\"primary\"\n [disabled]=\"option.disabled\"\n [checked]=\"selectedValues().includes(option.value)\"\n >{{ option.title }}</nb-checkbox\n >\n } @else {\n {{ option.title }}\n }\n </nb-option>\n }\n }\n }\n</nb-option-list>\n", styles: [":host{width:100%;position:relative;z-index:9999;background-color:var(--option-list-background-color);box-shadow:var(--shadow)}nb-option-list{width:100%;display:block}nb-option-list.with-virtual-scroll ::ng-deep .option-list{overflow:hidden}nb-option-list.multi.with-virtual-scroll ::ng-deep .option-list{overflow:hidden}nb-option-list.multi.with-virtual-scroll ::ng-deep .option-list .virtual-scroll-viewport{max-height:calc(var(--option-list-max-height) - var(--element-height))}.virtual-scroll-viewport{height:var(--all-elements-height);max-height:var(--option-list-max-height)}.virtual-scroll-item{height:38px}\n"] }]
|
|
649
696
|
}], propDecorators: { optionsList: [{ type: i0.ViewChildren, args: ['optionItem', { ...{ read: ElementRef }, isSignal: true }] }], virtualScrollContainer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionsListClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsListClass", required: false }] }], enableVirtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableVirtualScroll", required: false }] }], virtualScrollItemSizePX: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollItemSizePX", required: false }] }], optionClicked: [{ type: i0.Output, args: ["optionClicked"] }], selectAll: [{ type: i0.Output, args: ["selectAll"] }], tabClicked: [{ type: i0.Output, args: ["tabClicked"] }], multi: [{ type: i0.Input, args: [{ isSignal: true, alias: "multi", required: false }] }], selectedValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedValues", required: false }] }] } });
|
|
@@ -766,16 +813,16 @@ class NbxInputAutocompleteComponent extends NbxControlValueAccessorBaseDirective
|
|
|
766
813
|
this.searchControl.enable({ emitEvent: false });
|
|
767
814
|
}
|
|
768
815
|
}
|
|
769
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
770
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.
|
|
816
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
817
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.26", type: NbxInputAutocompleteComponent, isStandalone: true, selector: "nbx-input-autocomplete", inputs: { optionsListClass: { classPropertyName: "optionsListClass", publicName: "optionsListClass", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, virtualScrollItemSizePX: { classPropertyName: "virtualScrollItemSizePX", publicName: "virtualScrollItemSizePX", isSignal: true, isRequired: false, transformFunction: null }, enableVirtualScroll: { classPropertyName: "enableVirtualScroll", publicName: "enableVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, anyStringInput: { classPropertyName: "anyStringInput", publicName: "anyStringInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectChanged: "selectChanged" }, providers: [
|
|
771
818
|
{
|
|
772
819
|
provide: NG_VALUE_ACCESSOR,
|
|
773
820
|
useExisting: forwardRef(() => NbxInputAutocompleteComponent),
|
|
774
821
|
multi: true,
|
|
775
822
|
},
|
|
776
|
-
], viewQueries: [{ propertyName: "optionsListContainer", first: true, predicate: ["optionsListContainer"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nbx-input-wrapper\n (keydown.tab)=\"toggleOverlay(false)\"\n [context]=\"getContext()\"\n [inputId]=\"getInputId('input-autocomplete')\"\n [searchHasValue]=\"!!searchControl.value\">\n <ng-content label-content></ng-content>\n <input\n #inputElement\n #trigger=\"cdkOverlayOrigin\"\n type=\"text\"\n [status]=\"status()\"\n [size]=\"size()\"\n (click)=\"toggleOverlay(true)\"\n (focus)=\"toggleOverlay(true)\"\n (input)=\"toggleOverlay(true)\"\n (keydown.arrowdown)=\"$event.preventDefault(); switchFocusToOptions()\"\n autocomplete=\"off\"\n [id]=\"getInputId('input-autocomplete')\"\n [formControl]=\"searchControl\"\n [placeholder]=\"placeholder()\"\n nbInput\n cdkOverlayOrigin\n fullWidth />\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"overlayVisible()\"\n [cdkConnectedOverlayWidth]=\"clientWidth()\"\n (overlayOutsideClick)=\"toggleOverlay(false)\"\n (detach)=\"toggleOverlay(false)\">\n <nbx-select-options-list\n #optionsListContainer\n [optionsListClass]=\"optionsListClass()\"\n [virtualScrollItemSizePX]=\"virtualScrollItemSizePX()\"\n [enableVirtualScroll]=\"enableVirtualScroll()\"\n (optionClicked)=\"optionSelected($any($event))\"\n (tabClicked)=\"moveFocusToNextElement()\"\n [options]=\"filteredOptions()\"></nbx-select-options-list>\n </ng-template>\n</nbx-input-wrapper>\n", dependencies: [{ kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "component", type: NbxSelectOptionsListComponent, selector: "nbx-select-options-list", inputs: ["options", "optionsListClass", "enableVirtualScroll", "virtualScrollItemSizePX", "multi", "selectedValues"], outputs: ["optionClicked", "selectAll", "tabClicked"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["
|
|
823
|
+
], viewQueries: [{ propertyName: "optionsListContainer", first: true, predicate: ["optionsListContainer"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<nbx-input-wrapper\n (keydown.tab)=\"toggleOverlay(false)\"\n [context]=\"getContext()\"\n [inputId]=\"getInputId('input-autocomplete')\"\n [searchHasValue]=\"!!searchControl.value\">\n <ng-content label-content></ng-content>\n <input\n #inputElement\n #trigger=\"cdkOverlayOrigin\"\n type=\"text\"\n [status]=\"status()\"\n [size]=\"size()\"\n (click)=\"toggleOverlay(true)\"\n (focus)=\"toggleOverlay(true)\"\n (input)=\"toggleOverlay(true)\"\n (keydown.arrowdown)=\"$event.preventDefault(); switchFocusToOptions()\"\n autocomplete=\"off\"\n [id]=\"getInputId('input-autocomplete')\"\n [formControl]=\"searchControl\"\n [placeholder]=\"placeholder()\"\n nbInput\n cdkOverlayOrigin\n fullWidth />\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"overlayVisible()\"\n [cdkConnectedOverlayWidth]=\"clientWidth()\"\n (overlayOutsideClick)=\"toggleOverlay(false)\"\n (detach)=\"toggleOverlay(false)\">\n <nbx-select-options-list\n #optionsListContainer\n [optionsListClass]=\"optionsListClass()\"\n [virtualScrollItemSizePX]=\"virtualScrollItemSizePX()\"\n [enableVirtualScroll]=\"enableVirtualScroll()\"\n (optionClicked)=\"optionSelected($any($event))\"\n (tabClicked)=\"moveFocusToNextElement()\"\n [options]=\"filteredOptions()\"></nbx-select-options-list>\n </ng-template>\n</nbx-input-wrapper>\n", dependencies: [{ kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "component", type: NbxSelectOptionsListComponent, selector: "nbx-select-options-list", inputs: ["options", "optionsListClass", "enableVirtualScroll", "virtualScrollItemSizePX", "multi", "selectedValues"], outputs: ["optionClicked", "selectAll", "tabClicked"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
777
824
|
}
|
|
778
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputAutocompleteComponent, decorators: [{
|
|
779
826
|
type: Component,
|
|
780
827
|
args: [{ selector: 'nbx-input-autocomplete', imports: [
|
|
781
828
|
NbxInputWrapperComponent,
|
|
@@ -813,8 +860,8 @@ class NbxInputColorSelectComponent extends NbxControlValueAccessorBaseDirective
|
|
|
813
860
|
toggleOverlay(state) {
|
|
814
861
|
this.overlayVisible.update((old) => state ?? !old);
|
|
815
862
|
}
|
|
816
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
817
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
863
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputColorSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
864
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxInputColorSelectComponent, isStandalone: true, selector: "nbx-input-color-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, withTitle: { classPropertyName: "withTitle", publicName: "withTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorSelected: "colorSelected" }, host: { properties: { "style": "{\n '--nbx-color-input-disabled-text-color': 'var(--input-' + status() + '-disabled-text-color)',\n '--nbx-color-input-hover-background-color': 'var(--select-outline-' + status() + '-hover-background-color)',\n '--nbx-color-input-border-color': 'var(--select-outline-' + status() + '-border-color)',\n '--nbx-color-input-disabled-border-color': 'var(--select-outline-' + status() + '-disabled-border-color)',\n '--nbx-color-input-padding': 'var(--select-outline-' + size() + '-padding)',\n }" }, classAttribute: "input-control" }, providers: [
|
|
818
865
|
{
|
|
819
866
|
provide: NG_VALUE_ACCESSOR,
|
|
820
867
|
useExisting: forwardRef(() => NbxInputColorSelectComponent),
|
|
@@ -822,7 +869,7 @@ class NbxInputColorSelectComponent extends NbxControlValueAccessorBaseDirective
|
|
|
822
869
|
},
|
|
823
870
|
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('color-select-input')\">\n <ng-content label-content></ng-content>\n <div class=\"input-color-wrap\">\n <div class=\"nb-form-control-container nb-form-field-control-with-suffix\">\n <button\n type=\"button\"\n [disabled]=\"disabled()\"\n (click)=\"!disabled() ? toggleOverlay() : false\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n [id]=\"getInputId('color-select-input')\"\n class=\"select-button\">\n @if (selectedOption(); as selected) {\n @if (!selected.customData || withTitle()) {\n {{ selected.title }}\n }\n @if (selected.customData) {\n <div class=\"color-round\" [style.backgroundColor]=\"selected.customData\"></div>\n }\n } @else {\n @if (withTitle()) {\n <span> none </span>\n }\n <nb-icon icon=\"slash-outline\"></nb-icon>\n }\n\n <nb-icon icon=\"chevron-down-outline\" [class.active]=\"overlayVisible()\"></nb-icon>\n </button>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"overlayVisible()\"\n (overlayOutsideClick)=\"toggleOverlay(false)\">\n <div class=\"color-options-list\" [class.with-title]=\"withTitle()\">\n <button\n type=\"button\"\n class=\"color-option\"\n id=\"color-option-reset\"\n (click)=\"valueChanged($any(null)); toggleOverlay(false); colorSelected.emit(null)\">\n @if (withTitle()) {\n <div class=\"option-with-title\">\n none\n <nb-icon icon=\"slash-outline\"></nb-icon>\n </div>\n } @else {\n <nb-icon icon=\"slash-outline\"></nb-icon>\n }\n </button>\n @for (option of options(); track $index) {\n <button\n type=\"button\"\n class=\"color-option\"\n id=\"color-option-{{ $index }}\"\n [class.selected]=\"option.value === value()\"\n (click)=\"valueChanged(option.value); toggleOverlay(false); colorSelected.emit(option.value)\">\n @if (option.customData) {\n @if (withTitle()) {\n <div class=\"option-with-title\">\n {{ option.title }}\n <div class=\"color-round\" [style.backgroundColor]=\"option.customData\"></div>\n </div>\n } @else {\n <div class=\"color-round\" [style.backgroundColor]=\"option.customData\"></div>\n }\n } @else {\n {{ option.title }}\n }\n </button>\n }\n </div>\n </ng-template>\n </div>\n </div>\n</nbx-input-wrapper>\n", styles: ["@charset \"UTF-8\";button{padding:0;border:none;outline:none;background:none}.input-color-wrap{display:flex;align-items:center;width:100%;max-width:100%}.input-color-wrap .nb-form-control-container{width:100%}.select-button{background-color:var(--nbx-input-background-color);border-color:var(--nbx-color-input-border-color);color:var(--nbx-input-text-color);font-size:var(--nbx-input-font-size);font-weight:var(--nbx-input-font-weight);line-height:var(--nbx-input-line-height, 1);border-style:var(--select-outline-border-style);border-width:var(--select-outline-border-width);border-radius:var(--select-rectangle-border-radius);padding:var(--nbx-color-input-padding);display:flex;align-items:center;gap:.5rem}.select-button:disabled{border-color:var(--nbx-color-input-disabled-border-color);color:var(--nbx-color-input-disabled-text-color)}.select-button:hover{background-color:var(--nbx-color-input-hover-background-color)}.select-button nb-icon.active{transform:rotate(180deg)}.select-button nb-icon{font-size:inherit}.select-button .color-round{width:var(--nbx-input-line-height, 1.2em);height:var(--nbx-input-line-height, 1.2em)}.color-options-list{display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem;padding:.5rem;background-color:var(--option-list-background-color);border-color:var(--option-list-border-color);border-style:var(--option-list-border-style);border-width:var(--option-list-border-width);border-radius:var(--option-list-border-radius);box-shadow:var(--option-list-shadow);overflow:hidden}.color-options-list .color-option{padding:.1rem;color:var(--option-text-color);font-weight:600;position:relative}@media(hover:hover){.color-options-list .color-option:hover{background-color:var(--option-hover-background-color)}}.color-options-list .color-option.selected{z-index:1}.color-options-list .color-option.selected .color-round:after{z-index:2;content:\"\\2713\";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:1rem;color:#fff}.color-options-list.with-title{grid-template-columns:1fr;padding:.5rem 0}.color-options-list.with-title .color-option{padding:.5rem 1rem}.color-options-list.with-title .color-option.selected{background-color:var(--option-hover-background-color)}.color-options-list .option-with-title{display:flex;gap:.2rem;justify-content:space-between}.color-round{position:relative;width:1.2em;height:1.2em;border-radius:50%}\n"], dependencies: [{ kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
824
871
|
}
|
|
825
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputColorSelectComponent, decorators: [{
|
|
826
873
|
type: Component,
|
|
827
874
|
args: [{ selector: 'nbx-input-color-select', imports: [NbIconComponent, NbxInputWrapperComponent, ReactiveFormsModule, OverlayModule], host: {
|
|
828
875
|
class: 'input-control',
|
|
@@ -856,16 +903,16 @@ class NbxInputDatePickerComponent extends NbxControlValueAccessorBaseDirective {
|
|
|
856
903
|
dateSelected(event) {
|
|
857
904
|
this.dateChanged.emit(event);
|
|
858
905
|
}
|
|
859
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
860
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
906
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputDatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
907
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: NbxInputDatePickerComponent, isStandalone: true, selector: "nbx-input-date-picker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChanged: "dateChanged" }, providers: [
|
|
861
908
|
{
|
|
862
909
|
provide: NG_VALUE_ACCESSOR,
|
|
863
910
|
useExisting: forwardRef(() => NbxInputDatePickerComponent),
|
|
864
911
|
multi: true,
|
|
865
912
|
},
|
|
866
|
-
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-picker')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('date-picker')\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"datePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n
|
|
913
|
+
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-picker')\">\n <ng-content label-content></ng-content>\n <!-- the picker has to stand before the input: its format must be bound before the datepicker directive reads it -->\n <nb-datepicker\n #datePicker\n style=\"display: none\"\n [format]=\"format()\"\n (dateChange)=\"dateSelected($event)\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"></nb-datepicker>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('date-picker')\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"datePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n</nbx-input-wrapper>\n", dependencies: [{ kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "component", type: NbButtonComponent, selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbFormFieldComponent, selector: "nb-form-field" }, { kind: "directive", type: NbSuffixDirective, selector: "[nbSuffix]" }, { kind: "directive", type: NbDatepickerDirective, selector: "input[nbDatepicker]", inputs: ["nbDatepicker"] }, { kind: "component", type: NbDatepickerComponent, selector: "nb-datepicker", inputs: ["date"], outputs: ["dateChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
867
914
|
}
|
|
868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
915
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputDatePickerComponent, decorators: [{
|
|
869
916
|
type: Component,
|
|
870
917
|
args: [{ standalone: true, selector: 'nbx-input-date-picker', providers: [
|
|
871
918
|
{
|
|
@@ -883,9 +930,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
883
930
|
NbSuffixDirective,
|
|
884
931
|
NbDatepickerDirective,
|
|
885
932
|
NbDatepickerComponent,
|
|
886
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-picker')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('date-picker')\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"datePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n
|
|
933
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-picker')\">\n <ng-content label-content></ng-content>\n <!-- the picker has to stand before the input: its format must be bound before the datepicker directive reads it -->\n <nb-datepicker\n #datePicker\n style=\"display: none\"\n [format]=\"format()\"\n (dateChange)=\"dateSelected($event)\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"></nb-datepicker>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('date-picker')\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"datePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n</nbx-input-wrapper>\n" }]
|
|
887
934
|
}], ctorParameters: () => [], propDecorators: { minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], dateChanged: [{ type: i0.Output, args: ["dateChanged"] }] } });
|
|
888
935
|
|
|
936
|
+
/**
|
|
937
|
+
* Range pickers share one NbDateService, so its compareDates patch is installed by the first picker
|
|
938
|
+
* and removed only when the last one is destroyed.
|
|
939
|
+
*/
|
|
940
|
+
const compareDatesPatches = new WeakMap();
|
|
889
941
|
/**
|
|
890
942
|
* @description for correct work you need to provide NbDatepickerModule.forRoot() in you root providers list
|
|
891
943
|
*/
|
|
@@ -895,9 +947,14 @@ class NbxInputDateRangePickerComponent extends NbxControlValueAccessorBaseDirect
|
|
|
895
947
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
896
948
|
format = input(...(ngDevMode ? [undefined, { debugName: "format" }] : /* istanbul ignore next */ []));
|
|
897
949
|
dateRangeChanged = output();
|
|
898
|
-
inputControl = new FormControl();
|
|
899
950
|
constructor() {
|
|
900
951
|
super();
|
|
952
|
+
const patch = compareDatesPatches.get(this.dateService);
|
|
953
|
+
if (patch) {
|
|
954
|
+
patch.users++;
|
|
955
|
+
return;
|
|
956
|
+
}
|
|
957
|
+
compareDatesPatches.set(this.dateService, { users: 1, original: this.dateService.compareDates });
|
|
901
958
|
this.dateService.compareDates = (date1, date2) => {
|
|
902
959
|
const date1Time = date1.getTime();
|
|
903
960
|
if (date2 instanceof Date) {
|
|
@@ -919,20 +976,26 @@ class NbxInputDateRangePickerComponent extends NbxControlValueAccessorBaseDirect
|
|
|
919
976
|
return 0;
|
|
920
977
|
};
|
|
921
978
|
}
|
|
979
|
+
ngOnDestroy() {
|
|
980
|
+
const patch = compareDatesPatches.get(this.dateService);
|
|
981
|
+
if (patch && --patch.users === 0) {
|
|
982
|
+
this.dateService.compareDates = patch.original;
|
|
983
|
+
compareDatesPatches.delete(this.dateService);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
922
986
|
dateChanged(event) {
|
|
923
987
|
this.dateRangeChanged.emit(event);
|
|
924
|
-
return;
|
|
925
988
|
}
|
|
926
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
927
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
989
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputDateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
990
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: NbxInputDateRangePickerComponent, isStandalone: true, selector: "nbx-input-date-range-picker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateRangeChanged: "dateRangeChanged" }, providers: [
|
|
928
991
|
{
|
|
929
992
|
provide: NG_VALUE_ACCESSOR,
|
|
930
993
|
useExisting: forwardRef(() => NbxInputDateRangePickerComponent),
|
|
931
994
|
multi: true,
|
|
932
995
|
},
|
|
933
|
-
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-range-picker')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"dateRangePicker\"\n [formControl]=\"control\"\n [id]=\"getInputId('date-range-picker')\" />\n <button\n type=\"button\"\n [disabled]=\"disabled()\"\n [id]=\"getInputId('date-range-picker') + '-reset-button'\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n
|
|
996
|
+
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-range-picker')\">\n <ng-content label-content></ng-content>\n <!-- the picker has to stand before the input: its format must be bound before the datepicker directive reads it -->\n <nb-rangepicker\n #dateRangePicker\n style=\"display: none\"\n [format]=\"format()\"\n (rangeChange)=\"dateChanged($event)\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"></nb-rangepicker>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"dateRangePicker\"\n [formControl]=\"control\"\n [id]=\"getInputId('date-range-picker')\" />\n <button\n type=\"button\"\n [disabled]=\"disabled()\"\n [id]=\"getInputId('date-range-picker') + '-reset-button'\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n</nbx-input-wrapper>\n", dependencies: [{ kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "component", type: NbButtonComponent, selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbFormFieldComponent, selector: "nb-form-field" }, { kind: "directive", type: NbSuffixDirective, selector: "[nbSuffix]" }, { kind: "directive", type: NbDatepickerDirective, selector: "input[nbDatepicker]", inputs: ["nbDatepicker"] }, { kind: "component", type: NbRangepickerComponent, selector: "nb-rangepicker", inputs: ["range"], outputs: ["rangeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
934
997
|
}
|
|
935
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputDateRangePickerComponent, decorators: [{
|
|
936
999
|
type: Component,
|
|
937
1000
|
args: [{ standalone: true, selector: 'nbx-input-date-range-picker', providers: [
|
|
938
1001
|
{
|
|
@@ -950,7 +1013,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
950
1013
|
NbSuffixDirective,
|
|
951
1014
|
NbDatepickerDirective,
|
|
952
1015
|
NbRangepickerComponent,
|
|
953
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-range-picker')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"dateRangePicker\"\n [formControl]=\"control\"\n [id]=\"getInputId('date-range-picker')\" />\n <button\n type=\"button\"\n [disabled]=\"disabled()\"\n [id]=\"getInputId('date-range-picker') + '-reset-button'\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n
|
|
1016
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-range-picker')\">\n <ng-content label-content></ng-content>\n <!-- the picker has to stand before the input: its format must be bound before the datepicker directive reads it -->\n <nb-rangepicker\n #dateRangePicker\n style=\"display: none\"\n [format]=\"format()\"\n (rangeChange)=\"dateChanged($event)\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"></nb-rangepicker>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [nbDatepicker]=\"dateRangePicker\"\n [formControl]=\"control\"\n [id]=\"getInputId('date-range-picker')\" />\n <button\n type=\"button\"\n [disabled]=\"disabled()\"\n [id]=\"getInputId('date-range-picker') + '-reset-button'\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n</nbx-input-wrapper>\n" }]
|
|
954
1017
|
}], ctorParameters: () => [], propDecorators: { minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], dateRangeChanged: [{ type: i0.Output, args: ["dateRangeChanged"] }] } });
|
|
955
1018
|
|
|
956
1019
|
/**
|
|
@@ -968,16 +1031,16 @@ class NbxInputDateTimePickerComponent extends NbxControlValueAccessorBaseDirecti
|
|
|
968
1031
|
dateSelected(event) {
|
|
969
1032
|
this.dateChanged.emit(event);
|
|
970
1033
|
}
|
|
971
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
972
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1034
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputDateTimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1035
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: NbxInputDateTimePickerComponent, isStandalone: true, selector: "nbx-input-date-time-picker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dateChanged: "dateChanged" }, providers: [
|
|
973
1036
|
{
|
|
974
1037
|
provide: NG_VALUE_ACCESSOR,
|
|
975
1038
|
useExisting: forwardRef(() => NbxInputDateTimePickerComponent),
|
|
976
1039
|
multi: true,
|
|
977
1040
|
},
|
|
978
|
-
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-time-picker')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [id]=\"getInputId('date-time-picker')\"\n [nbDatepicker]=\"dateTimePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n
|
|
1041
|
+
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-time-picker')\">\n <ng-content label-content></ng-content>\n <!-- the picker has to stand before the input: its format must be bound before the datepicker directive reads it -->\n <nb-date-timepicker\n #dateTimePicker\n style=\"display: none\"\n (dateTimeChange)=\"dateSelected($event)\"\n singleColumn\n [step]=\"step()\"\n [format]=\"format()\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"></nb-date-timepicker>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [id]=\"getInputId('date-time-picker')\"\n [nbDatepicker]=\"dateTimePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n</nbx-input-wrapper>\n", dependencies: [{ kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "component", type: NbButtonComponent, selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbFormFieldComponent, selector: "nb-form-field" }, { kind: "directive", type: NbSuffixDirective, selector: "[nbSuffix]" }, { kind: "directive", type: NbDatepickerDirective, selector: "input[nbDatepicker]", inputs: ["nbDatepicker"] }, { kind: "component", type: NbDateTimePickerComponent, selector: "nb-date-timepicker", inputs: ["step", "title", "applyButtonText", "currentTimeButtonText", "showCurrentTimeButton", "twelveHoursFormat", "showAmPmLabel", "withSeconds", "singleColumn"], outputs: ["dateTimeChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
979
1042
|
}
|
|
980
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1043
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputDateTimePickerComponent, decorators: [{
|
|
981
1044
|
type: Component,
|
|
982
1045
|
args: [{ selector: 'nbx-input-date-time-picker', providers: [
|
|
983
1046
|
{
|
|
@@ -995,7 +1058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
995
1058
|
NbSuffixDirective,
|
|
996
1059
|
NbDatepickerDirective,
|
|
997
1060
|
NbDateTimePickerComponent,
|
|
998
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-time-picker')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [id]=\"getInputId('date-time-picker')\"\n [nbDatepicker]=\"dateTimePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n
|
|
1061
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('date-time-picker')\">\n <ng-content label-content></ng-content>\n <!-- the picker has to stand before the input: its format must be bound before the datepicker directive reads it -->\n <nb-date-timepicker\n #dateTimePicker\n style=\"display: none\"\n (dateTimeChange)=\"dateSelected($event)\"\n singleColumn\n [step]=\"step()\"\n [format]=\"format()\"\n [min]=\"minDate()\"\n [max]=\"maxDate()\"></nb-date-timepicker>\n <nb-form-field>\n <input\n fullWidth\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [id]=\"getInputId('date-time-picker')\"\n [nbDatepicker]=\"dateTimePicker\"\n [formControl]=\"control\" />\n <button\n type=\"button\"\n [id]=\"getInputId('date-picker') + '-reset-button'\"\n [disabled]=\"disabled()\"\n title=\"Clear\"\n nbSuffix\n nbButton\n appearance=\"ghost\"\n (click)=\"control.reset()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </nb-form-field>\n</nbx-input-wrapper>\n" }]
|
|
999
1062
|
}], ctorParameters: () => [], propDecorators: { minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], dateChanged: [{ type: i0.Output, args: ["dateChanged"] }] } });
|
|
1000
1063
|
|
|
1001
1064
|
class NbxInputMultiselectAutocompleteComponent extends NbxControlValueAccessorBaseDirective {
|
|
@@ -1019,7 +1082,7 @@ class NbxInputMultiselectAutocompleteComponent extends NbxControlValueAccessorBa
|
|
|
1019
1082
|
const option = this.options().find((option) => option.value === current);
|
|
1020
1083
|
if (!option)
|
|
1021
1084
|
return prev;
|
|
1022
|
-
return
|
|
1085
|
+
return `${prev}${prev ? ', ' : ''}${option.title}`;
|
|
1023
1086
|
}, '');
|
|
1024
1087
|
}, ...(ngDevMode ? [{ debugName: "selectedTitlesString" }] : /* istanbul ignore next */ []));
|
|
1025
1088
|
overlayVisible = signal(false, ...(ngDevMode ? [{ debugName: "overlayVisible" }] : /* istanbul ignore next */ []));
|
|
@@ -1059,13 +1122,9 @@ class NbxInputMultiselectAutocompleteComponent extends NbxControlValueAccessorBa
|
|
|
1059
1122
|
this.setSelected(value || [], true);
|
|
1060
1123
|
}
|
|
1061
1124
|
optionClicked(value) {
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
}
|
|
1066
|
-
else {
|
|
1067
|
-
newValue = this.selectedValues().filter((insideValue) => insideValue !== value);
|
|
1068
|
-
}
|
|
1125
|
+
const newValue = this.selectedValues().includes(value)
|
|
1126
|
+
? this.selectedValues().filter((insideValue) => insideValue !== value)
|
|
1127
|
+
: [...this.selectedValues(), value];
|
|
1069
1128
|
this.setSelected(newValue);
|
|
1070
1129
|
}
|
|
1071
1130
|
moveFocusToNextElement() {
|
|
@@ -1113,16 +1172,16 @@ class NbxInputMultiselectAutocompleteComponent extends NbxControlValueAccessorBa
|
|
|
1113
1172
|
}
|
|
1114
1173
|
}
|
|
1115
1174
|
}
|
|
1116
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1117
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.
|
|
1175
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputMultiselectAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1176
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.26", type: NbxInputMultiselectAutocompleteComponent, isStandalone: true, selector: "nbx-input-multiselect-autocomplete", inputs: { optionsListClass: { classPropertyName: "optionsListClass", publicName: "optionsListClass", isSignal: true, isRequired: false, transformFunction: null }, selectedOnTop: { classPropertyName: "selectedOnTop", publicName: "selectedOnTop", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSizePX: { classPropertyName: "virtualScrollItemSizePX", publicName: "virtualScrollItemSizePX", isSignal: true, isRequired: false, transformFunction: null }, enableVirtualScroll: { classPropertyName: "enableVirtualScroll", publicName: "enableVirtualScroll", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, providers: [
|
|
1118
1177
|
{
|
|
1119
1178
|
provide: NG_VALUE_ACCESSOR,
|
|
1120
1179
|
useExisting: forwardRef(() => NbxInputMultiselectAutocompleteComponent),
|
|
1121
1180
|
multi: true,
|
|
1122
1181
|
},
|
|
1123
|
-
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsListContainer", first: true, predicate: ["optionsListContainer"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper\n [context]=\"getContext()\"\n [searchHasValue]=\"!!searchControl.value\"\n (keydown.tab)=\"toggleOverlay(false)\"\n [isInputHasButton]=\"true\"\n [inputId]=\"getInputId('multiselect-autocomplete-input')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n nbInput\n cdkOverlayOrigin\n #inputElement\n #trigger=\"cdkOverlayOrigin\"\n [status]=\"status()\"\n [size]=\"size()\"\n (click)=\"toggleOverlay(true)\"\n (focus)=\"toggleOverlay(true)\"\n (input)=\"toggleOverlay(true)\"\n (keydown.arrowdown)=\"$event.preventDefault(); switchFocusToOptions()\"\n [class.has-value]=\"selectedTitlesString()\"\n [formControl]=\"searchControl\"\n [id]=\"getInputId('multiselect-autocomplete-input')\"\n fullWidth\n [placeholder]=\"selectedTitlesString() || placeholder()\"\n type=\"text\" />\n\n <button\n title=\"Clear\"\n type=\"button\"\n [disabled]=\"disabled()\"\n [size]=\"size()\"\n [status]=\"status()\"\n nbSuffix\n nbButton\n [id]=\"getInputId('multi-autocomplete-input') + '-clear-button'\"\n appearance=\"ghost\"\n (click)=\"resetSelection()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"overlayVisible()\"\n [cdkConnectedOverlayWidth]=\"clientWidth()\"\n (overlayOutsideClick)=\"toggleOverlay(false)\"\n (detach)=\"toggleOverlay(false)\">\n <nbx-select-options-list\n #optionsListContainer\n [multi]=\"true\"\n [optionsListClass]=\"optionsListClass()\"\n [virtualScrollItemSizePX]=\"virtualScrollItemSizePX()\"\n [enableVirtualScroll]=\"enableVirtualScroll()\"\n [selectedValues]=\"selectedValues()\"\n (selectAll)=\"selectAllOptions()\"\n (optionClicked)=\"optionClicked($event.value)\"\n (tabClicked)=\"moveFocusToNextElement()\"\n [options]=\"filteredOptions()\"></nbx-select-options-list>\n </ng-template>\n </nb-form-field>\n</nbx-input-wrapper>\n", styles: [".options{padding:0}.options nb-checkbox{display:inline-flex;height:100%;width:100%}input::placeholder{font-size:var(--nbx-input-font-size)!important;line-height:var(--nbx-input-line-height);opacity:1!important}input.has-value::placeholder{font-weight:var(--nbx-input-font-weight);color:var(--nbx-input-text-color)}.d-inline-flex{display:inline-flex}.w-100{width:100%}.multiselect-autocomplete-checkbox ::ng-deep label{padding:var(--option-medium-padding, .5rem);width:100%}.input-container{position:relative}.input-container input:focus~.selected-text-container{left:5rem;max-width:80%;background-color:var(--input-basic-focus-background-color)}.input-container input:focus:hover~.selected-text-container{background-color:var(--input-basic-focus-and-hover-background-color)}.input-container input:hover~.selected-text-container{background-color:var(--input-basic-hover-background-color)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["
|
|
1182
|
+
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "optionsListContainer", first: true, predicate: ["optionsListContainer"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper\n [context]=\"getContext()\"\n [searchHasValue]=\"!!searchControl.value\"\n (keydown.tab)=\"toggleOverlay(false)\"\n [isInputHasButton]=\"true\"\n [inputId]=\"getInputId('multiselect-autocomplete-input')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <input\n nbInput\n cdkOverlayOrigin\n #inputElement\n #trigger=\"cdkOverlayOrigin\"\n [status]=\"status()\"\n [size]=\"size()\"\n (click)=\"toggleOverlay(true)\"\n (focus)=\"toggleOverlay(true)\"\n (input)=\"toggleOverlay(true)\"\n (keydown.arrowdown)=\"$event.preventDefault(); switchFocusToOptions()\"\n [class.has-value]=\"selectedTitlesString()\"\n [formControl]=\"searchControl\"\n [id]=\"getInputId('multiselect-autocomplete-input')\"\n fullWidth\n [placeholder]=\"selectedTitlesString() || placeholder()\"\n type=\"text\" />\n\n <button\n title=\"Clear\"\n type=\"button\"\n [disabled]=\"disabled()\"\n [size]=\"size()\"\n [status]=\"status()\"\n nbSuffix\n nbButton\n [id]=\"getInputId('multi-autocomplete-input') + '-clear-button'\"\n appearance=\"ghost\"\n (click)=\"resetSelection()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"overlayVisible()\"\n [cdkConnectedOverlayWidth]=\"clientWidth()\"\n (overlayOutsideClick)=\"toggleOverlay(false)\"\n (detach)=\"toggleOverlay(false)\">\n <nbx-select-options-list\n #optionsListContainer\n [multi]=\"true\"\n [optionsListClass]=\"optionsListClass()\"\n [virtualScrollItemSizePX]=\"virtualScrollItemSizePX()\"\n [enableVirtualScroll]=\"enableVirtualScroll()\"\n [selectedValues]=\"selectedValues()\"\n (selectAll)=\"selectAllOptions()\"\n (optionClicked)=\"optionClicked($event.value)\"\n (tabClicked)=\"moveFocusToNextElement()\"\n [options]=\"filteredOptions()\"></nbx-select-options-list>\n </ng-template>\n </nb-form-field>\n</nbx-input-wrapper>\n", styles: [".options{padding:0}.options nb-checkbox{display:inline-flex;height:100%;width:100%}input::placeholder{font-size:var(--nbx-input-font-size)!important;line-height:var(--nbx-input-line-height);opacity:1!important}input.has-value::placeholder{font-weight:var(--nbx-input-font-weight);color:var(--nbx-input-text-color)}.d-inline-flex{display:inline-flex}.w-100{width:100%}.multiselect-autocomplete-checkbox ::ng-deep label{padding:var(--option-medium-padding, .5rem);width:100%}.input-container{position:relative}.input-container input:focus~.selected-text-container{left:5rem;max-width:80%;background-color:var(--input-basic-focus-background-color)}.input-container input:focus:hover~.selected-text-container{background-color:var(--input-basic-focus-and-hover-background-color)}.input-container input:hover~.selected-text-container{background-color:var(--input-basic-hover-background-color)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i1$1.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "component", type: NbButtonComponent, selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]" }, { kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbFormFieldComponent, selector: "nb-form-field" }, { kind: "directive", type: NbSuffixDirective, selector: "[nbSuffix]" }, { kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "component", type: NbxSelectOptionsListComponent, selector: "nbx-select-options-list", inputs: ["options", "optionsListClass", "enableVirtualScroll", "virtualScrollItemSizePX", "multi", "selectedValues"], outputs: ["optionClicked", "selectAll", "tabClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1124
1183
|
}
|
|
1125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputMultiselectAutocompleteComponent, decorators: [{
|
|
1126
1185
|
type: Component,
|
|
1127
1186
|
args: [{ selector: 'nbx-input-multiselect-autocomplete', imports: [
|
|
1128
1187
|
ReactiveFormsModule,
|
|
@@ -1153,16 +1212,16 @@ class NbxInputNumberComponent extends NbxControlValueAccessorBaseDirective {
|
|
|
1153
1212
|
inputKeyUp(target) {
|
|
1154
1213
|
this.inputKeyup.emit(target.value);
|
|
1155
1214
|
}
|
|
1156
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1157
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1215
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputNumberComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1216
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: NbxInputNumberComponent, isStandalone: true, selector: "nbx-input-number", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, onlyInt: { classPropertyName: "onlyInt", publicName: "onlyInt", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputKeyup: "inputKeyup" }, providers: [
|
|
1158
1217
|
{
|
|
1159
1218
|
provide: NG_VALUE_ACCESSOR,
|
|
1160
1219
|
useExisting: forwardRef(() => NbxInputNumberComponent),
|
|
1161
1220
|
multi: true,
|
|
1162
1221
|
},
|
|
1163
|
-
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-number')\">\n <ng-content label-content></ng-content>\n\n <input\n (keydown.arrowDown)=\"$event.preventDefault()\"\n (keydown.arrowUp)=\"$event.preventDefault()\"\n (wheel)=\"$event.preventDefault()\"\n [formControl]=\"control\"\n (input)=\"inputKeyUp($any($event.target))\"\n fullWidth\n [nbxIntOrFloat]=\"onlyInt() ? 'int' : 'float'\"\n [status]=\"status()\"\n [size]=\"size()\"\n nbInput\n [id]=\"getInputId('input-number')\"\n [min]=\"min()\"\n [max]=\"max()\"\n [placeholder]=\"placeholder()\"\n type=\"number\" />\n</nbx-input-wrapper>\n", styles: ["input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}\n"], dependencies: [{ kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["
|
|
1222
|
+
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-number')\">\n <ng-content label-content></ng-content>\n\n <input\n (keydown.arrowDown)=\"$event.preventDefault()\"\n (keydown.arrowUp)=\"$event.preventDefault()\"\n (wheel)=\"$event.preventDefault()\"\n [formControl]=\"control\"\n (input)=\"inputKeyUp($any($event.target))\"\n fullWidth\n [nbxIntOrFloat]=\"onlyInt() ? 'int' : 'float'\"\n [status]=\"status()\"\n [size]=\"size()\"\n nbInput\n [id]=\"getInputId('input-number')\"\n [min]=\"min()\"\n [max]=\"max()\"\n [placeholder]=\"placeholder()\"\n type=\"number\" />\n</nbx-input-wrapper>\n", styles: ["input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}\n"], dependencies: [{ kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$2.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "directive", type: IntOrFloatDirective, selector: "[nbxIntOrFloat]", inputs: ["nbxIntOrFloat"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1164
1223
|
}
|
|
1165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputNumberComponent, decorators: [{
|
|
1166
1225
|
type: Component,
|
|
1167
1226
|
args: [{ selector: 'nbx-input-number', providers: [
|
|
1168
1227
|
{
|
|
@@ -1198,16 +1257,16 @@ class NbxInputSelectComponent extends NbxControlValueAccessorBaseDirective {
|
|
|
1198
1257
|
this.selectedChange.emit(this.control.value);
|
|
1199
1258
|
});
|
|
1200
1259
|
}
|
|
1201
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1202
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
1260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxInputSelectComponent, isStandalone: true, selector: "nbx-input-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, optionsListClass: { classPropertyName: "optionsListClass", publicName: "optionsListClass", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, providers: [
|
|
1203
1262
|
{
|
|
1204
1263
|
provide: NG_VALUE_ACCESSOR,
|
|
1205
1264
|
useExisting: forwardRef(() => NbxInputSelectComponent),
|
|
1206
1265
|
multi: true,
|
|
1207
1266
|
},
|
|
1208
|
-
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('select-input')\">\n <ng-content label-content></ng-content>\n <div class=\"select-wrapper\">\n <div class=\"nb-form-control-container nb-form-field-control-with-suffix\">\n <nb-select\n [multiple]=\"multiple()\"\n [optionsListClass]=\"optionsListClass()\"\n [class.multiple]=\"multiple()\"\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('select-input')\"\n fullWidth\n [formControl]=\"control\"\n [placeholder]=\"placeholder()\"\n (selectedChange)=\"selectedChangeEvent()\">\n @if (multiple()) {\n <nb-option\n [disabled]=\"isAllSelected()\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); selectAll()\"\n [value]=\"null\">\n Select all\n </nb-option>\n }\n @for (option of options(); track $index) {\n <nb-option [value]=\"option.value\" [disabled]=\"option?.disabled\">\n {{ option.title }}\n </nb-option>\n }\n </nb-select>\n </div>\n @if (multiple()) {\n <div\n [class]=\"['nb-form-field-suffix-' + size(), 'nb-form-field-addon-' + status()]\"\n class=\"nb-form-field-addon ng-star-inserted\">\n <button\n type=\"button\"\n title=\"Clear\"\n [id]=\"getInputId('select-input') + '-clear-button'\"\n nbButton\n appearance=\"ghost\"\n (click)=\"resetForm()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </div>\n }\n </div>\n</nbx-input-wrapper>\n", styles: [".select-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.select-wrapper .nb-form-control-container{width:100%}nb-select.multiple::ng-deep .select-button nb-icon{display:none}\n"], dependencies: [{ kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbSelectComponent, selector: "nb-select", inputs: ["size", "status", "shape", "appearance", "optionsListClass", "optionsPanelClass", "optionsWidth", "disabled", "fullWidth", "placeholder", "compareWith", "selected", "multiple", "optionsOverlayOffset", "scrollStrategy"
|
|
1267
|
+
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('select-input')\">\n <ng-content label-content></ng-content>\n <div class=\"select-wrapper\">\n <div class=\"nb-form-control-container nb-form-field-control-with-suffix\">\n <nb-select\n [multiple]=\"multiple()\"\n [optionsListClass]=\"optionsListClass()\"\n [class.multiple]=\"multiple()\"\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('select-input')\"\n fullWidth\n [formControl]=\"control\"\n [placeholder]=\"placeholder()\"\n (selectedChange)=\"selectedChangeEvent()\">\n @if (multiple()) {\n <nb-option\n [disabled]=\"isAllSelected()\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); selectAll()\"\n [value]=\"null\">\n Select all\n </nb-option>\n }\n @for (option of options(); track $index) {\n <nb-option [value]=\"option.value\" [disabled]=\"option?.disabled\">\n {{ option.title }}\n </nb-option>\n }\n </nb-select>\n </div>\n @if (multiple()) {\n <div\n [class]=\"['nb-form-field-suffix-' + size(), 'nb-form-field-addon-' + status()]\"\n class=\"nb-form-field-addon ng-star-inserted\">\n <button\n type=\"button\"\n title=\"Clear\"\n [id]=\"getInputId('select-input') + '-clear-button'\"\n nbButton\n appearance=\"ghost\"\n (click)=\"resetForm()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </div>\n }\n </div>\n</nbx-input-wrapper>\n", styles: [".select-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.select-wrapper .nb-form-control-container{width:100%}nb-select.multiple::ng-deep .select-button nb-icon{display:none}\n"], dependencies: [{ kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbSelectComponent, selector: "nb-select", inputs: ["size", "status", "shape", "appearance", "optionsListClass", "optionsPanelClass", "optionsWidth", "disabled", "fullWidth", "placeholder", "compareWith", "selected", "multiple", "optionsOverlayOffset", "scrollStrategy"], outputs: ["selectedChange"] }, { kind: "component", type: NbOptionComponent, selector: "nb-option", inputs: ["value", "disabled"], outputs: ["selectionChange"] }, { kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbButtonComponent, selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1209
1268
|
}
|
|
1210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1269
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputSelectComponent, decorators: [{
|
|
1211
1270
|
type: Component,
|
|
1212
1271
|
args: [{ selector: 'nbx-input-select', imports: [
|
|
1213
1272
|
NbIconComponent,
|
|
@@ -1225,6 +1284,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1225
1284
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [isInputHasButton]=\"true\" [inputId]=\"getInputId('select-input')\">\n <ng-content label-content></ng-content>\n <div class=\"select-wrapper\">\n <div class=\"nb-form-control-container nb-form-field-control-with-suffix\">\n <nb-select\n [multiple]=\"multiple()\"\n [optionsListClass]=\"optionsListClass()\"\n [class.multiple]=\"multiple()\"\n [status]=\"status()\"\n [size]=\"size()\"\n [id]=\"getInputId('select-input')\"\n fullWidth\n [formControl]=\"control\"\n [placeholder]=\"placeholder()\"\n (selectedChange)=\"selectedChangeEvent()\">\n @if (multiple()) {\n <nb-option\n [disabled]=\"isAllSelected()\"\n (click)=\"$event.preventDefault(); $event.stopPropagation(); selectAll()\"\n [value]=\"null\">\n Select all\n </nb-option>\n }\n @for (option of options(); track $index) {\n <nb-option [value]=\"option.value\" [disabled]=\"option?.disabled\">\n {{ option.title }}\n </nb-option>\n }\n </nb-select>\n </div>\n @if (multiple()) {\n <div\n [class]=\"['nb-form-field-suffix-' + size(), 'nb-form-field-addon-' + status()]\"\n class=\"nb-form-field-addon ng-star-inserted\">\n <button\n type=\"button\"\n title=\"Clear\"\n [id]=\"getInputId('select-input') + '-clear-button'\"\n nbButton\n appearance=\"ghost\"\n (click)=\"resetForm()\">\n <nb-icon icon=\"backspace-outline\" pack=\"eva\"> </nb-icon>\n </button>\n </div>\n }\n </div>\n</nbx-input-wrapper>\n", styles: [".select-wrapper{display:flex;align-items:center;width:100%;max-width:100%}.select-wrapper .nb-form-control-container{width:100%}nb-select.multiple::ng-deep .select-button nb-icon{display:none}\n"] }]
|
|
1226
1285
|
}], ctorParameters: () => [], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], optionsListClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsListClass", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
|
|
1227
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* @description for correct work you need to provide NbDialogModule.forRoot() in you root providers list
|
|
1289
|
+
*/
|
|
1290
|
+
class NbxInputPeriodSelectComponent extends NbxControlValueAccessorBaseDirective {
|
|
1291
|
+
dialogService = inject(NbDialogService);
|
|
1292
|
+
toastrService = inject(NbToastrService);
|
|
1293
|
+
rangeDialog = viewChild.required('rangeDialog');
|
|
1294
|
+
rangeSelected = output();
|
|
1295
|
+
initValue = input(...(ngDevMode ? [undefined, { debugName: "initValue" }] : /* istanbul ignore next */ []));
|
|
1296
|
+
rangeSelectControl = new FormControl(null);
|
|
1297
|
+
/**
|
|
1298
|
+
* @description you can set to true for show errors if not provide formControl
|
|
1299
|
+
*/
|
|
1300
|
+
get todayDate() {
|
|
1301
|
+
return new Date();
|
|
1302
|
+
}
|
|
1303
|
+
get dataListObj() {
|
|
1304
|
+
const today = this.todayDate;
|
|
1305
|
+
return {
|
|
1306
|
+
yesterday: {
|
|
1307
|
+
start: new Date(today.getFullYear(), today.getMonth(), today.getDate() - 1, 0),
|
|
1308
|
+
end: new Date(new Date().setHours(0, 0, 0, 0)),
|
|
1309
|
+
},
|
|
1310
|
+
this_week: {
|
|
1311
|
+
start: this.currentWeekMondayDate(),
|
|
1312
|
+
end: today,
|
|
1313
|
+
},
|
|
1314
|
+
this_month: {
|
|
1315
|
+
start: new Date(new Date(new Date().setDate(1)).setHours(0, 0, 0, 0)),
|
|
1316
|
+
end: today,
|
|
1317
|
+
},
|
|
1318
|
+
this_quarter: {
|
|
1319
|
+
start: this.currentQuarteStartDate(),
|
|
1320
|
+
end: today,
|
|
1321
|
+
},
|
|
1322
|
+
this_half_year: {
|
|
1323
|
+
start: this.lastHalfYearStartDate(),
|
|
1324
|
+
end: today,
|
|
1325
|
+
},
|
|
1326
|
+
this_year: {
|
|
1327
|
+
start: new Date(today.getFullYear(), 0, 1),
|
|
1328
|
+
end: today,
|
|
1329
|
+
},
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
periodsOptions = [
|
|
1333
|
+
{
|
|
1334
|
+
title: 'Yesterday',
|
|
1335
|
+
value: 'yesterday',
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
title: 'Week',
|
|
1339
|
+
value: 'this_week',
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
title: 'Month',
|
|
1343
|
+
value: 'this_month',
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
title: 'Quarter',
|
|
1347
|
+
value: 'this_quarter',
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
title: 'Half year',
|
|
1351
|
+
value: 'this_half_year',
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
title: 'Year',
|
|
1355
|
+
value: 'this_year',
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
title: 'Custom range',
|
|
1359
|
+
value: 'custom_range',
|
|
1360
|
+
},
|
|
1361
|
+
];
|
|
1362
|
+
dialogRef;
|
|
1363
|
+
customRange;
|
|
1364
|
+
constructor() {
|
|
1365
|
+
super();
|
|
1366
|
+
// the form control is connected during the first render, an earlier write would not reach it
|
|
1367
|
+
afterNextRender(() => {
|
|
1368
|
+
const initValue = this.initValue();
|
|
1369
|
+
if (initValue) {
|
|
1370
|
+
this.rangeSelectControl.setValue(initValue);
|
|
1371
|
+
this.changeSelection(initValue);
|
|
1372
|
+
}
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
changeSelection(value) {
|
|
1376
|
+
if (value === 'custom_range') {
|
|
1377
|
+
this.openDialog();
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
this.setValue(this.dataListObj[value]);
|
|
1381
|
+
}
|
|
1382
|
+
setValue(range) {
|
|
1383
|
+
this.valueChanged(range);
|
|
1384
|
+
this.rangeSelected.emit(range);
|
|
1385
|
+
}
|
|
1386
|
+
openDialog() {
|
|
1387
|
+
this.dialogRef = this.dialogService.open(this.rangeDialog());
|
|
1388
|
+
}
|
|
1389
|
+
writeValue(value) {
|
|
1390
|
+
super.writeValue(value);
|
|
1391
|
+
if (this.control?.dirty) {
|
|
1392
|
+
this.rangeSelectControl.markAsDirty();
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
setDisabledState(isDisabled) {
|
|
1396
|
+
super.setDisabledState(isDisabled);
|
|
1397
|
+
if (isDisabled) {
|
|
1398
|
+
this.rangeSelectControl.disable();
|
|
1399
|
+
}
|
|
1400
|
+
else {
|
|
1401
|
+
this.rangeSelectControl.enable();
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
closeCustomRangeDialog() {
|
|
1405
|
+
if (!this.customRange?.start || !this.customRange?.end) {
|
|
1406
|
+
this.toastrService.show('You need to set the all range');
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
this.setCustomRange();
|
|
1410
|
+
this.dialogRef?.close();
|
|
1411
|
+
}
|
|
1412
|
+
currentWeekMondayDate() {
|
|
1413
|
+
const today = new Date(new Date().setHours(0, 0, 0, 0));
|
|
1414
|
+
const dayToday = today.getDay() || 7;
|
|
1415
|
+
if (dayToday === 1) {
|
|
1416
|
+
return today;
|
|
1417
|
+
}
|
|
1418
|
+
return new Date(today.setDate(today.getDate() - (dayToday - 1)));
|
|
1419
|
+
}
|
|
1420
|
+
currentQuarteStartDate() {
|
|
1421
|
+
const today = this.todayDate;
|
|
1422
|
+
const currentMonth = today.getMonth() + 1;
|
|
1423
|
+
let startQuarterMonthIndex = 0;
|
|
1424
|
+
if (currentMonth > 9) {
|
|
1425
|
+
startQuarterMonthIndex = 9;
|
|
1426
|
+
}
|
|
1427
|
+
else if (currentMonth > 6) {
|
|
1428
|
+
startQuarterMonthIndex = 6;
|
|
1429
|
+
}
|
|
1430
|
+
else if (currentMonth > 3) {
|
|
1431
|
+
startQuarterMonthIndex = 3;
|
|
1432
|
+
}
|
|
1433
|
+
return new Date(today.getFullYear(), startQuarterMonthIndex, 1);
|
|
1434
|
+
}
|
|
1435
|
+
lastHalfYearStartDate() {
|
|
1436
|
+
const today = this.todayDate;
|
|
1437
|
+
return new Date(today.getFullYear(), today.getMonth() - 5, 1);
|
|
1438
|
+
}
|
|
1439
|
+
setCustomRange() {
|
|
1440
|
+
const data = {
|
|
1441
|
+
start: this.customRange.start,
|
|
1442
|
+
end: this.getCustomCorrectRangeEnd(this.customRange?.end),
|
|
1443
|
+
};
|
|
1444
|
+
this.setValue(data);
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* @param end
|
|
1448
|
+
* @returns Date with plus 24 hours
|
|
1449
|
+
*/
|
|
1450
|
+
getCustomCorrectRangeEnd(end) {
|
|
1451
|
+
if (!end)
|
|
1452
|
+
return this.todayDate;
|
|
1453
|
+
const endDate = new Date(new Date(end).getTime() + 86399900);
|
|
1454
|
+
return endDate;
|
|
1455
|
+
}
|
|
1456
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputPeriodSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1457
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.26", type: NbxInputPeriodSelectComponent, isStandalone: true, selector: "nbx-input-period-select", inputs: { initValue: { classPropertyName: "initValue", publicName: "initValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rangeSelected: "rangeSelected" }, providers: [
|
|
1458
|
+
{
|
|
1459
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1460
|
+
useExisting: forwardRef(() => NbxInputPeriodSelectComponent),
|
|
1461
|
+
multi: true,
|
|
1462
|
+
},
|
|
1463
|
+
], viewQueries: [{ propertyName: "rangeDialog", first: true, predicate: ["rangeDialog"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<nbx-input-select\n [id]=\"'period-range-input'\"\n [formControl]=\"rangeSelectControl\"\n [labelPosition]=\"labelPosition()\"\n [placeholder]=\"placeholder()\"\n [status]=\"status()\"\n [size]=\"size()\"\n [options]=\"periodsOptions\"\n (selectedChange)=\"changeSelection($any($event))\"\n >Period</nbx-input-select\n>\n\n<ng-template #rangeDialog let-ref=\"dialogRef\">\n <nb-card>\n <nb-card-header>Choose the period you need</nb-card-header>\n <nb-card-body>\n <nb-calendar-range [(range)]=\"customRange\"></nb-calendar-range>\n </nb-card-body>\n <nb-card-footer>\n <button type=\"button\" (click)=\"ref.close(false)\" nbButton>Cancel</button>\n <button type=\"button\" (click)=\"closeCustomRangeDialog()\" nbButton>Set range</button>\n </nb-card-footer>\n </nb-card>\n</ng-template>\n", dependencies: [{ kind: "component", type: NbCalendarRangeComponent, selector: "nb-calendar-range", inputs: ["boundingMonth", "startView", "min", "max", "filter", "dayCellComponent", "monthCellComponent", "yearCellComponent", "size", "visibleDate", "showNavigation", "range", "showWeekNumber", "weekNumberSymbol", "firstDayOfWeek"], outputs: ["rangeChange"] }, { kind: "component", type: NbCardComponent, selector: "nb-card", inputs: ["size", "status", "accent"] }, { kind: "component", type: NbCardBodyComponent, selector: "nb-card-body" }, { kind: "component", type: NbCardFooterComponent, selector: "nb-card-footer" }, { kind: "component", type: NbCardHeaderComponent, selector: "nb-card-header" }, { kind: "component", type: NbButtonComponent, selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbxInputSelectComponent, selector: "nbx-input-select", inputs: ["multiple", "optionsListClass", "options"], outputs: ["selectedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1464
|
+
}
|
|
1465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputPeriodSelectComponent, decorators: [{
|
|
1466
|
+
type: Component,
|
|
1467
|
+
args: [{ selector: 'nbx-input-period-select', imports: [
|
|
1468
|
+
NbCalendarRangeComponent,
|
|
1469
|
+
NbCardComponent,
|
|
1470
|
+
NbCardBodyComponent,
|
|
1471
|
+
NbCardFooterComponent,
|
|
1472
|
+
NbCardHeaderComponent,
|
|
1473
|
+
NbButtonComponent,
|
|
1474
|
+
ReactiveFormsModule,
|
|
1475
|
+
NbxInputSelectComponent,
|
|
1476
|
+
], providers: [
|
|
1477
|
+
{
|
|
1478
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1479
|
+
useExisting: forwardRef(() => NbxInputPeriodSelectComponent),
|
|
1480
|
+
multi: true,
|
|
1481
|
+
},
|
|
1482
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-select\n [id]=\"'period-range-input'\"\n [formControl]=\"rangeSelectControl\"\n [labelPosition]=\"labelPosition()\"\n [placeholder]=\"placeholder()\"\n [status]=\"status()\"\n [size]=\"size()\"\n [options]=\"periodsOptions\"\n (selectedChange)=\"changeSelection($any($event))\"\n >Period</nbx-input-select\n>\n\n<ng-template #rangeDialog let-ref=\"dialogRef\">\n <nb-card>\n <nb-card-header>Choose the period you need</nb-card-header>\n <nb-card-body>\n <nb-calendar-range [(range)]=\"customRange\"></nb-calendar-range>\n </nb-card-body>\n <nb-card-footer>\n <button type=\"button\" (click)=\"ref.close(false)\" nbButton>Cancel</button>\n <button type=\"button\" (click)=\"closeCustomRangeDialog()\" nbButton>Set range</button>\n </nb-card-footer>\n </nb-card>\n</ng-template>\n" }]
|
|
1483
|
+
}], ctorParameters: () => [], propDecorators: { rangeDialog: [{ type: i0.ViewChild, args: ['rangeDialog', { isSignal: true }] }], rangeSelected: [{ type: i0.Output, args: ["rangeSelected"] }], initValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initValue", required: false }] }] } });
|
|
1484
|
+
|
|
1228
1485
|
class NbxInputTextComponent extends NbxControlValueAccessorBaseDirective {
|
|
1229
1486
|
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
1230
1487
|
min = input(null, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
@@ -1233,16 +1490,16 @@ class NbxInputTextComponent extends NbxControlValueAccessorBaseDirective {
|
|
|
1233
1490
|
inputKeyUp(target) {
|
|
1234
1491
|
this.inputKeyup.emit(target.value);
|
|
1235
1492
|
}
|
|
1236
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1237
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1493
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1494
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: NbxInputTextComponent, isStandalone: true, selector: "nbx-input-text", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputKeyup: "inputKeyup" }, providers: [
|
|
1238
1495
|
{
|
|
1239
1496
|
provide: NG_VALUE_ACCESSOR,
|
|
1240
1497
|
useExisting: forwardRef(() => NbxInputTextComponent),
|
|
1241
1498
|
multi: true,
|
|
1242
1499
|
},
|
|
1243
|
-
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-' + type())\">\n <ng-content label-content></ng-content>\n\n <input\n [formControl]=\"control\"\n (input)=\"inputKeyUp($any($event.target))\"\n fullWidth\n [id]=\"getInputId('input-' + type())\"\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n type=\"
|
|
1500
|
+
], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-' + type())\">\n <ng-content label-content></ng-content>\n\n <input\n [formControl]=\"control\"\n (input)=\"inputKeyUp($any($event.target))\"\n fullWidth\n [id]=\"getInputId('input-' + type())\"\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\" />\n</nbx-input-wrapper>\n", styles: ["input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}\n"], dependencies: [{ kind: "directive", type: NbInputDirective, selector: "input[nbInput],textarea[nbInput]", inputs: ["size", "status", "shape", "fullWidth"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1244
1501
|
}
|
|
1245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputTextComponent, decorators: [{
|
|
1246
1503
|
type: Component,
|
|
1247
1504
|
args: [{ standalone: true, selector: 'nbx-input-text', providers: [
|
|
1248
1505
|
{
|
|
@@ -1250,57 +1507,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1250
1507
|
useExisting: forwardRef(() => NbxInputTextComponent),
|
|
1251
1508
|
multi: true,
|
|
1252
1509
|
},
|
|
1253
|
-
], imports: [NbInputDirective, ReactiveFormsModule, NbxInputWrapperComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-' + type())\">\n <ng-content label-content></ng-content>\n\n <input\n [formControl]=\"control\"\n (input)=\"inputKeyUp($any($event.target))\"\n fullWidth\n [id]=\"getInputId('input-' + type())\"\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n type=\"
|
|
1510
|
+
], imports: [NbInputDirective, ReactiveFormsModule, NbxInputWrapperComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-' + type())\">\n <ng-content label-content></ng-content>\n\n <input\n [formControl]=\"control\"\n (input)=\"inputKeyUp($any($event.target))\"\n fullWidth\n [id]=\"getInputId('input-' + type())\"\n nbInput\n [status]=\"status()\"\n [size]=\"size()\"\n [placeholder]=\"placeholder()\"\n [type]=\"type()\" />\n</nbx-input-wrapper>\n", styles: ["input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}\n"] }]
|
|
1254
1511
|
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], inputKeyup: [{ type: i0.Output, args: ["inputKeyup"] }] } });
|
|
1255
1512
|
|
|
1513
|
+
class NbxInputTagsComponent extends NbxControlValueAccessorBaseDirective {
|
|
1514
|
+
tagInput = viewChild('tagInput', ...(ngDevMode ? [{ debugName: "tagInput" }] : /* istanbul ignore next */ []));
|
|
1515
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
1516
|
+
selectedChange = output();
|
|
1517
|
+
tags = computed(() => this.value() ?? [], ...(ngDevMode ? [{ debugName: "tags" }] : /* istanbul ignore next */ []));
|
|
1518
|
+
onTagRemove(tagToRemove) {
|
|
1519
|
+
this.setTags(this.tags().filter((tag) => String(tag) !== tagToRemove.text()));
|
|
1520
|
+
}
|
|
1521
|
+
onTagAdd(value) {
|
|
1522
|
+
if (value !== '' && value != null && !this.tags().includes(value)) {
|
|
1523
|
+
this.setTags([...this.tags(), value]);
|
|
1524
|
+
}
|
|
1525
|
+
const inputEl = this.tagInput()?.nativeElement;
|
|
1526
|
+
if (inputEl) {
|
|
1527
|
+
inputEl.value = '';
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
setTags(tags) {
|
|
1531
|
+
this.valueChanged(tags);
|
|
1532
|
+
this.selectedChange.emit(tags);
|
|
1533
|
+
}
|
|
1534
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputTagsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1535
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: NbxInputTagsComponent, isStandalone: true, selector: "nbx-input-tags", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, providers: [
|
|
1536
|
+
{
|
|
1537
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1538
|
+
useExisting: forwardRef(() => NbxInputTagsComponent),
|
|
1539
|
+
multi: true,
|
|
1540
|
+
},
|
|
1541
|
+
], viewQueries: [{ propertyName: "tagInput", first: true, predicate: ["tagInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('tags-input')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <nb-tag-list (tagRemove)=\"onTagRemove($event)\">\n @for (tag of tags(); track tag) {\n <nb-tag [text]=\"tag.toString()\" removable></nb-tag>\n }\n <input #tagInput type=\"text\" [placeholder]=\"placeholder()\" nbTagInput (tagAdd)=\"onTagAdd($event.value)\"\n [nbAutocomplete]=\"autocomplete\" fullWidth />\n </nb-tag-list>\n\n <nb-icon nbSuffix icon=\"search\" pack=\"eva\"></nb-icon>\n </nb-form-field>\n\n <nb-autocomplete #autocomplete (selectedChange)=\"onTagAdd($event)\">\n @for (option of options(); track option.value) {\n <nb-option [value]=\"option.value\">{{ option.title }}</nb-option>\n }\n </nb-autocomplete>\n</nbx-input-wrapper>", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: NbTagComponent, selector: "nb-tag", inputs: ["text", "selected", "removable", "appearance", "status", "size", "role"], outputs: ["remove", "selectedChange"], exportAs: ["nbTag"] }, { kind: "component", type: NbTagListComponent, selector: "nb-tag-list", inputs: ["size", "tabIndex", "role", "multiple"], outputs: ["tagRemove"], exportAs: ["nbTagList"] }, { kind: "directive", type: NbTagInputDirective, selector: "input[nbTagInput]", inputs: ["separatorKeys"], outputs: ["tagAdd"], exportAs: ["nbTagInput"] }, { kind: "component", type: NbAutocompleteComponent, selector: "nb-autocomplete", inputs: ["handleDisplayFn", "size", "activeFirst", "optionsListClass", "optionsPanelClass", "optionsWidth"], outputs: ["selectedChange"] }, { kind: "directive", type: NbAutocompleteDirective, selector: "input[nbAutocomplete]", inputs: ["nbAutocomplete", "overlayOffset", "scrollStrategy", "customOverlayHost"], outputs: ["customOverlayHostChange"] }, { kind: "component", type: NbOptionComponent, selector: "nb-option", inputs: ["value", "disabled"], outputs: ["selectionChange"] }, { kind: "component", type: NbIconComponent, selector: "nb-icon", inputs: ["icon", "pack", "options", "status", "config"], outputs: ["iconChange", "packChange", "optionsChange", "statusChange"] }, { kind: "component", type: NbFormFieldComponent, selector: "nb-form-field" }, { kind: "directive", type: NbSuffixDirective, selector: "[nbSuffix]" }, { kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1542
|
+
}
|
|
1543
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputTagsComponent, decorators: [{
|
|
1544
|
+
type: Component,
|
|
1545
|
+
args: [{ standalone: true, selector: 'nbx-input-tags', imports: [
|
|
1546
|
+
ReactiveFormsModule,
|
|
1547
|
+
NbTagComponent,
|
|
1548
|
+
NbTagListComponent,
|
|
1549
|
+
NbTagInputDirective,
|
|
1550
|
+
NbAutocompleteComponent,
|
|
1551
|
+
NbAutocompleteDirective,
|
|
1552
|
+
NbOptionComponent,
|
|
1553
|
+
NbIconComponent,
|
|
1554
|
+
NbFormFieldComponent,
|
|
1555
|
+
NbSuffixDirective,
|
|
1556
|
+
NbxInputWrapperComponent,
|
|
1557
|
+
], providers: [
|
|
1558
|
+
{
|
|
1559
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1560
|
+
useExisting: forwardRef(() => NbxInputTagsComponent),
|
|
1561
|
+
multi: true,
|
|
1562
|
+
},
|
|
1563
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('tags-input')\">\n <ng-content label-content></ng-content>\n <nb-form-field>\n <nb-tag-list (tagRemove)=\"onTagRemove($event)\">\n @for (tag of tags(); track tag) {\n <nb-tag [text]=\"tag.toString()\" removable></nb-tag>\n }\n <input #tagInput type=\"text\" [placeholder]=\"placeholder()\" nbTagInput (tagAdd)=\"onTagAdd($event.value)\"\n [nbAutocomplete]=\"autocomplete\" fullWidth />\n </nb-tag-list>\n\n <nb-icon nbSuffix icon=\"search\" pack=\"eva\"></nb-icon>\n </nb-form-field>\n\n <nb-autocomplete #autocomplete (selectedChange)=\"onTagAdd($event)\">\n @for (option of options(); track option.value) {\n <nb-option [value]=\"option.value\">{{ option.title }}</nb-option>\n }\n </nb-autocomplete>\n</nbx-input-wrapper>" }]
|
|
1564
|
+
}], propDecorators: { tagInput: [{ type: i0.ViewChild, args: ['tagInput', { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
|
|
1565
|
+
|
|
1256
1566
|
class NbxInputTextareaComponent extends NbxControlValueAccessorBaseDirective {
|
|
1257
|
-
textareaInput = viewChild('textareaInput'
|
|
1567
|
+
textareaInput = viewChild.required('textareaInput');
|
|
1258
1568
|
inputKeyup = output();
|
|
1259
1569
|
rows = input(null, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
1260
1570
|
constructor() {
|
|
1261
1571
|
super();
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
this.
|
|
1266
|
-
|
|
1572
|
+
afterRenderEffect({
|
|
1573
|
+
write: () => {
|
|
1574
|
+
const value = this.value() ?? '';
|
|
1575
|
+
const element = this.textareaInput().nativeElement;
|
|
1576
|
+
// skip the write when the DOM is already in sync, otherwise the caret jumps to the start while typing
|
|
1577
|
+
if (element.textContent !== value) {
|
|
1578
|
+
element.textContent = value;
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1267
1581
|
});
|
|
1268
1582
|
}
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
if (selection && selection.rangeCount > 0) {
|
|
1274
|
-
const range = selection.getRangeAt(0);
|
|
1275
|
-
range.deleteContents();
|
|
1276
|
-
range.insertNode(document.createTextNode(pasteData || ''));
|
|
1277
|
-
range.collapse(false);
|
|
1278
|
-
this.valueChanged(this.innerHTMLValue || '');
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
keyup() {
|
|
1282
|
-
this.valueChanged(this.innerHTMLValue);
|
|
1283
|
-
this.inputKeyup.emit(this.innerHTMLValue);
|
|
1284
|
-
}
|
|
1285
|
-
get innerHTMLValue() {
|
|
1286
|
-
return this.textareaInput()?.nativeElement.innerHTML || '';
|
|
1287
|
-
}
|
|
1288
|
-
setTextAreaValue(value) {
|
|
1289
|
-
const nativeElement = this.textareaInput()?.nativeElement;
|
|
1290
|
-
if (nativeElement) {
|
|
1291
|
-
nativeElement.innerHTML = value;
|
|
1292
|
-
}
|
|
1583
|
+
onInput() {
|
|
1584
|
+
const value = this.textareaInput().nativeElement.textContent ?? '';
|
|
1585
|
+
this.valueChanged(value);
|
|
1586
|
+
this.inputKeyup.emit(value);
|
|
1293
1587
|
}
|
|
1294
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1295
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.
|
|
1588
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1589
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.26", type: NbxInputTextareaComponent, isStandalone: true, selector: "nbx-input-textarea", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputKeyup: "inputKeyup" }, host: { properties: { "style": "{\n '--nbx-input-disabled-text-color': 'var(--input-' + status() + '-disabled-text-color)',\n '--nbx-input-disabled-border-color': 'var(--input-' + status() + '-disabled-border-color)',\n }" }, classAttribute: "input-control" }, providers: [
|
|
1296
1590
|
{
|
|
1297
1591
|
provide: NG_VALUE_ACCESSOR,
|
|
1298
1592
|
useExisting: forwardRef(() => NbxInputTextareaComponent),
|
|
1299
1593
|
multi: true,
|
|
1300
1594
|
},
|
|
1301
|
-
], viewQueries: [{ propertyName: "textareaInput", first: true, predicate: ["textareaInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-textarea')\">\n <ng-content label-content></ng-content>\n <div\n #textareaInput\n role=\"none\"\n [id]=\"getInputId('input-textarea')\"\n [attr.placeholder]=\"placeholder()\"\n [class.disabled]=\"disabled()\"\n [class]=\"['size-' + size(), 'status-' + status()]\"\n [style]=\"
|
|
1595
|
+
], viewQueries: [{ propertyName: "textareaInput", first: true, predicate: ["textareaInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-textarea')\">\n <ng-content label-content></ng-content>\n <div\n #textareaInput\n role=\"none\"\n [id]=\"getInputId('input-textarea')\"\n [attr.placeholder]=\"placeholder()\"\n [class.disabled]=\"disabled()\"\n [class]=\"['size-' + size(), 'status-' + status()]\"\n [style.min-height]=\"'calc(1.2rem * ' + (rows() || 0) + ' + 1rem)'\"\n class=\"textarea-container input-full-width shape-rectangle nb-transition\"\n [attr.contenteditable]=\"disabled() ? 'false' : 'plaintext-only'\"\n nbInput\n fullWidth\n (input)=\"onInput()\"></div>\n</nbx-input-wrapper>\n", styles: [".textarea-container{white-space:pre-wrap}.textarea-container *{background-color:inherit!important}.textarea-container.disabled{color:var(--nbx-input-disabled-text-color);border-color:var(--nbx-input-disabled-border-color);line-break:anywhere}.input-fieldset .has-value [placeholder]:before{content:\"\"}[placeholder]:empty:before{content:attr(placeholder);color:var(--input-primary-placeholder-text-color);font-weight:400}[placeholder]:not(:empty):focus:before{content:\"\"}\n"], dependencies: [{ kind: "component", type: NbxInputWrapperComponent, selector: "nbx-input-wrapper", inputs: ["context", "isInputHasButton", "inputId", "copyAsJson", "floatLabelOnlyBySearch", "searchHasValue"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1302
1596
|
}
|
|
1303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: NbxInputTextareaComponent, decorators: [{
|
|
1304
1598
|
type: Component,
|
|
1305
1599
|
args: [{ selector: 'nbx-input-textarea', host: {
|
|
1306
1600
|
class: 'input-control',
|
|
@@ -1314,7 +1608,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
1314
1608
|
useExisting: forwardRef(() => NbxInputTextareaComponent),
|
|
1315
1609
|
multi: true,
|
|
1316
1610
|
},
|
|
1317
|
-
], imports: [NbxInputWrapperComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-textarea')\">\n <ng-content label-content></ng-content>\n <div\n #textareaInput\n role=\"none\"\n [id]=\"getInputId('input-textarea')\"\n [attr.placeholder]=\"placeholder()\"\n [class.disabled]=\"disabled()\"\n [class]=\"['size-' + size(), 'status-' + status()]\"\n [style]=\"
|
|
1611
|
+
], imports: [NbxInputWrapperComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nbx-input-wrapper [context]=\"getContext()\" [inputId]=\"getInputId('input-textarea')\">\n <ng-content label-content></ng-content>\n <div\n #textareaInput\n role=\"none\"\n [id]=\"getInputId('input-textarea')\"\n [attr.placeholder]=\"placeholder()\"\n [class.disabled]=\"disabled()\"\n [class]=\"['size-' + size(), 'status-' + status()]\"\n [style.min-height]=\"'calc(1.2rem * ' + (rows() || 0) + ' + 1rem)'\"\n class=\"textarea-container input-full-width shape-rectangle nb-transition\"\n [attr.contenteditable]=\"disabled() ? 'false' : 'plaintext-only'\"\n nbInput\n fullWidth\n (input)=\"onInput()\"></div>\n</nbx-input-wrapper>\n", styles: [".textarea-container{white-space:pre-wrap}.textarea-container *{background-color:inherit!important}.textarea-container.disabled{color:var(--nbx-input-disabled-text-color);border-color:var(--nbx-input-disabled-border-color);line-break:anywhere}.input-fieldset .has-value [placeholder]:before{content:\"\"}[placeholder]:empty:before{content:attr(placeholder);color:var(--input-primary-placeholder-text-color);font-weight:400}[placeholder]:not(:empty):focus:before{content:\"\"}\n"] }]
|
|
1318
1612
|
}], ctorParameters: () => [], propDecorators: { textareaInput: [{ type: i0.ViewChild, args: ['textareaInput', { isSignal: true }] }], inputKeyup: [{ type: i0.Output, args: ["inputKeyup"] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }] } });
|
|
1319
1613
|
|
|
1320
1614
|
const urlRegExp = new RegExp(/^https?:\/\/(www\.)?[a-zA-Z0-9-]{1,63}(\.[a-zA-Z0-9-]{1,63})*\.[a-zA-Z]{2,6}(\/[-a-zA-Z0-9@:%._+~#?&//=]*)?$/);
|
|
@@ -1334,5 +1628,5 @@ const NbxValidators = {
|
|
|
1334
1628
|
* Generated bundle index. Do not edit.
|
|
1335
1629
|
*/
|
|
1336
1630
|
|
|
1337
|
-
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 };
|
|
1631
|
+
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 };
|
|
1338
1632
|
//# sourceMappingURL=d4k-ui-nbx-inputs.mjs.map
|