@ng-nest/ui 16.0.2 → 16.0.4
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/auto-complete/auto-complete.component.d.ts +4 -1
- package/cascade/cascade.component.d.ts +4 -1
- package/color-picker/color-picker.component.d.ts +4 -1
- package/core/functions/parent-path.d.ts +1 -0
- package/date-picker/date-picker.component.d.ts +4 -1
- package/date-picker/date-range.component.d.ts +2 -0
- package/esm2022/auto-complete/auto-complete.component.mjs +35 -7
- package/esm2022/cascade/cascade.component.mjs +36 -8
- package/esm2022/color-picker/color-picker.component.mjs +36 -8
- package/esm2022/core/functions/parent-path.mjs +10 -1
- package/esm2022/date-picker/date-picker.component.mjs +36 -9
- package/esm2022/date-picker/date-range.component.mjs +31 -6
- package/esm2022/form/control.component.mjs +2 -2
- package/esm2022/form/form.property.mjs +1 -1
- package/esm2022/input-number/input-number.component.mjs +14 -10
- package/esm2022/select/select.component.mjs +37 -9
- package/esm2022/table/table-body.component.mjs +2 -1
- package/esm2022/tabs/tab-content.component.mjs +3 -3
- package/esm2022/time-picker/time-picker.component.mjs +32 -6
- package/esm2022/tree-select/tree-select.component.mjs +36 -8
- package/fesm2022/ng-nest-ui-auto-complete.mjs +34 -7
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +35 -8
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color-picker.mjs +34 -7
- package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-core.mjs +10 -1
- package/fesm2022/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-date-picker.mjs +60 -8
- package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +1 -1
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs +13 -10
- package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +37 -10
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table.mjs +1 -0
- package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tabs.mjs +2 -2
- package/fesm2022/ng-nest-ui-tabs.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-picker.mjs +31 -5
- package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-select.mjs +35 -8
- package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
- package/form/form.property.d.ts +10 -0
- package/input-number/input-number.component.d.ts +3 -1
- package/package.json +19 -19
- package/select/select.component.d.ts +4 -1
- package/time-picker/time-picker.component.d.ts +2 -0
- package/tree-select/tree-select.component.d.ts +4 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, Pipe, HostBinding, HostListener, ViewChild, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ViewEncapsulation, ChangeDetectionStrategy, Pipe, HostBinding, HostListener, ViewChild, inject, NgModule } from '@angular/core';
|
|
3
3
|
import { __decorate } from 'tslib';
|
|
4
4
|
import * as i2 from '@ng-nest/ui/core';
|
|
5
|
-
import { XWithConfig, XInputBoolean, XDataConvert, XProperty, XIsFunction, XIsChange, XDateYearWeek, XIsNull, XChunk, XDateWeek, XDateQuarter, XDateYearQuarter, XIsUndefined, XIsEmpty, XAddDays, XConnectBaseAnimation, XIsDate, XIsNumber, XIsString, XClearClass, XAddMonths, XAddYears, XIsArray } from '@ng-nest/ui/core';
|
|
5
|
+
import { XWithConfig, XInputBoolean, XDataConvert, XProperty, XIsFunction, XIsChange, XDateYearWeek, XIsNull, XChunk, XDateWeek, XDateQuarter, XDateYearQuarter, XIsUndefined, XIsEmpty, XAddDays, XConnectBaseAnimation, XIsDate, XIsNumber, XIsString, XParents, XClearClass, XAddMonths, XAddYears, XIsArray } from '@ng-nest/ui/core';
|
|
6
6
|
import { XControlValueAccessor, XValueAccessor, XBaseFormModule } from '@ng-nest/ui/base-form';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
|
-
import { map, takeUntil } from 'rxjs/operators';
|
|
7
|
+
import { Subject, fromEvent } from 'rxjs';
|
|
8
|
+
import { map, takeUntil, filter } from 'rxjs/operators';
|
|
9
9
|
import * as i1 from '@angular/common';
|
|
10
|
-
import { DatePipe, LowerCasePipe, CommonModule } from '@angular/common';
|
|
10
|
+
import { DatePipe, LowerCasePipe, DOCUMENT, CommonModule } from '@angular/common';
|
|
11
11
|
import * as i3 from '@ng-nest/ui/i18n';
|
|
12
12
|
import { XI18nModule } from '@ng-nest/ui/i18n';
|
|
13
13
|
import * as i3$1 from '@ng-nest/ui/time-picker';
|
|
@@ -2040,7 +2040,7 @@ class XDatePickerComponent extends XDatePickerProperty {
|
|
|
2040
2040
|
return this.locale.selectDate;
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
|
-
constructor(renderer, configService, cdr, portalService, viewContainerRef, datePipe, i18n, overlay) {
|
|
2043
|
+
constructor(renderer, configService, cdr, portalService, viewContainerRef, datePipe, i18n, elementRef, overlay) {
|
|
2044
2044
|
super();
|
|
2045
2045
|
this.renderer = renderer;
|
|
2046
2046
|
this.configService = configService;
|
|
@@ -2049,6 +2049,7 @@ class XDatePickerComponent extends XDatePickerProperty {
|
|
|
2049
2049
|
this.viewContainerRef = viewContainerRef;
|
|
2050
2050
|
this.datePipe = datePipe;
|
|
2051
2051
|
this.i18n = i18n;
|
|
2052
|
+
this.elementRef = elementRef;
|
|
2052
2053
|
this.overlay = overlay;
|
|
2053
2054
|
this.modelType = 'date';
|
|
2054
2055
|
this.isInput = false;
|
|
@@ -2065,12 +2066,14 @@ class XDatePickerComponent extends XDatePickerProperty {
|
|
|
2065
2066
|
this.closeSubject = new Subject();
|
|
2066
2067
|
this.locale = {};
|
|
2067
2068
|
this._unSubject = new Subject();
|
|
2069
|
+
this.document = inject(DOCUMENT);
|
|
2068
2070
|
}
|
|
2069
2071
|
ngOnInit() {
|
|
2070
2072
|
this.setFlex(this.datePicker.nativeElement, this.renderer, this.justify, this.align, this.direction);
|
|
2071
2073
|
this.setFormat();
|
|
2072
2074
|
this.setClassMap();
|
|
2073
2075
|
this.setSubject();
|
|
2076
|
+
this.setParantScroll();
|
|
2074
2077
|
}
|
|
2075
2078
|
ngAfterViewInit() {
|
|
2076
2079
|
this.setPortal();
|
|
@@ -2146,6 +2149,30 @@ class XDatePickerComponent extends XDatePickerProperty {
|
|
|
2146
2149
|
this.cdr.detectChanges();
|
|
2147
2150
|
}
|
|
2148
2151
|
}
|
|
2152
|
+
setParantScroll() {
|
|
2153
|
+
if (!this.document)
|
|
2154
|
+
return;
|
|
2155
|
+
const parents = XParents(this.elementRef.nativeElement);
|
|
2156
|
+
let firstScroll = null;
|
|
2157
|
+
for (let item of parents) {
|
|
2158
|
+
if (item.clientHeight < item.scrollHeight) {
|
|
2159
|
+
firstScroll = item;
|
|
2160
|
+
break;
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
if (firstScroll && firstScroll.tagName !== 'BODY') {
|
|
2164
|
+
fromEvent(firstScroll, 'scroll')
|
|
2165
|
+
.pipe(filter(() => this.portalAttached()), takeUntil(this._unSubject))
|
|
2166
|
+
.subscribe(() => {
|
|
2167
|
+
this.portal?.overlayRef?.updatePosition();
|
|
2168
|
+
const eract = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2169
|
+
const frect = firstScroll.getBoundingClientRect();
|
|
2170
|
+
if (eract.top + eract.height - frect.top < 0 || eract.bottom > frect.bottom) {
|
|
2171
|
+
this.closeSubject.next();
|
|
2172
|
+
}
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2149
2176
|
clearEmit() {
|
|
2150
2177
|
this.value = null;
|
|
2151
2178
|
this.numberValue = '';
|
|
@@ -2289,13 +2316,13 @@ class XDatePickerComponent extends XDatePickerProperty {
|
|
|
2289
2316
|
this.ngOnInit();
|
|
2290
2317
|
this.cdr.detectChanges();
|
|
2291
2318
|
}
|
|
2292
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: XDatePickerComponent, deps: [{ token: i0.Renderer2 }, { token: i2.XConfigService }, { token: i0.ChangeDetectorRef }, { token: i2$1.XPortalService }, { token: i0.ViewContainerRef }, { token: i1.DatePipe }, { token: i3.XI18nService }, { token: i5$1.Overlay }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2319
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: XDatePickerComponent, deps: [{ token: i0.Renderer2 }, { token: i2.XConfigService }, { token: i0.ChangeDetectorRef }, { token: i2$1.XPortalService }, { token: i0.ViewContainerRef }, { token: i1.DatePipe }, { token: i3.XI18nService }, { token: i0.ElementRef }, { token: i5$1.Overlay }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2293
2320
|
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: XDatePickerComponent, selector: "x-date-picker", providers: [XValueAccessor(XDatePickerComponent), DatePipe], viewQueries: [{ propertyName: "datePicker", first: true, predicate: ["datePicker"], descendants: true, static: true }, { propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #datePicker class=\"x-date-picker\">\r\n <div class=\"x-date-picker-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n [justify]=\"justify\"\r\n [align]=\"align\"\r\n [direction]=\"direction\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [validator]=\"validator\"\r\n [icon]=\"icon\"\r\n [placeholder]=\"getPlaceholder\"\r\n [readonly]=\"readonly\"\r\n [clearable]=\"clearable && inputClearable\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTpl\"\r\n [valueTplContext]=\"valueTplContext\"\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [before]=\"before\"\r\n [after]=\"after\"\r\n [pattern]=\"pattern\"\r\n [message]=\"message\"\r\n [pointer]=\"pointer\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xInput)=\"onInput()\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-date-picker{display:inline-block;width:12rem}.x-date-picker{margin:0;padding:0;width:100%}.x-date-picker x-input{width:100%}\n"], dependencies: [{ kind: "directive", type: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i6$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i7.XInputComponent, selector: "x-input" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
2294
2321
|
}
|
|
2295
2322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: XDatePickerComponent, decorators: [{
|
|
2296
2323
|
type: Component,
|
|
2297
2324
|
args: [{ selector: `${XDatePickerPrefix}`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XDatePickerComponent), DatePipe], template: "<div #datePicker class=\"x-date-picker\">\r\n <div class=\"x-date-picker-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label\"\r\n [labelWidth]=\"labelWidth\"\r\n [labelAlign]=\"labelAlign\"\r\n [justify]=\"justify\"\r\n [align]=\"align\"\r\n [direction]=\"direction\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [validator]=\"validator\"\r\n [icon]=\"icon\"\r\n [placeholder]=\"getPlaceholder\"\r\n [readonly]=\"readonly\"\r\n [clearable]=\"clearable && inputClearable\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTpl\"\r\n [valueTplContext]=\"valueTplContext\"\r\n [size]=\"size\"\r\n [bordered]=\"bordered\"\r\n [before]=\"before\"\r\n [after]=\"after\"\r\n [pattern]=\"pattern\"\r\n [message]=\"message\"\r\n [pointer]=\"pointer\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xInput)=\"onInput()\"\r\n (xClick)=\"showPortal()\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";x-date-picker{display:inline-block;width:12rem}.x-date-picker{margin:0;padding:0;width:100%}.x-date-picker x-input{width:100%}\n"] }]
|
|
2298
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i2.XConfigService }, { type: i0.ChangeDetectorRef }, { type: i2$1.XPortalService }, { type: i0.ViewContainerRef }, { type: i1.DatePipe }, { type: i3.XI18nService }, { type: i5$1.Overlay }]; }, propDecorators: { datePicker: [{
|
|
2325
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i2.XConfigService }, { type: i0.ChangeDetectorRef }, { type: i2$1.XPortalService }, { type: i0.ViewContainerRef }, { type: i1.DatePipe }, { type: i3.XI18nService }, { type: i0.ElementRef }, { type: i5$1.Overlay }]; }, propDecorators: { datePicker: [{
|
|
2299
2326
|
type: ViewChild,
|
|
2300
2327
|
args: ['datePicker', { static: true }]
|
|
2301
2328
|
}], inputCom: [{
|
|
@@ -2724,6 +2751,7 @@ class XDateRangeComponent extends XDateRangeProperty {
|
|
|
2724
2751
|
this.flexClass = [];
|
|
2725
2752
|
this.locale = {};
|
|
2726
2753
|
this._unSubject = new Subject();
|
|
2754
|
+
this.document = inject(DOCUMENT);
|
|
2727
2755
|
}
|
|
2728
2756
|
ngOnInit() {
|
|
2729
2757
|
this.setFlex(this.dateRange.nativeElement, this.renderer, this.justify, this.align, this.direction);
|
|
@@ -2770,6 +2798,30 @@ class XDateRangeComponent extends XDateRangeProperty {
|
|
|
2770
2798
|
setHostTypeClass() {
|
|
2771
2799
|
this.renderer.addClass(this.elementRef.nativeElement, `x-date-range-${this.type}`);
|
|
2772
2800
|
}
|
|
2801
|
+
setParantScroll() {
|
|
2802
|
+
if (!this.document)
|
|
2803
|
+
return;
|
|
2804
|
+
const parents = XParents(this.elementRef.nativeElement);
|
|
2805
|
+
let firstScroll = null;
|
|
2806
|
+
for (let item of parents) {
|
|
2807
|
+
if (item.clientHeight < item.scrollHeight) {
|
|
2808
|
+
firstScroll = item;
|
|
2809
|
+
break;
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
if (firstScroll && firstScroll.tagName !== 'BODY') {
|
|
2813
|
+
fromEvent(firstScroll, 'scroll')
|
|
2814
|
+
.pipe(filter(() => this.portalAttached()), takeUntil(this._unSubject))
|
|
2815
|
+
.subscribe(() => {
|
|
2816
|
+
this.portal?.overlayRef?.updatePosition();
|
|
2817
|
+
const eract = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2818
|
+
const frect = firstScroll.getBoundingClientRect();
|
|
2819
|
+
if (eract.top + eract.height - frect.top < 0 || eract.bottom > frect.bottom) {
|
|
2820
|
+
this.closeSubject.next();
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2773
2825
|
setFormat() {
|
|
2774
2826
|
if (this.format !== 'yyyy-MM-dd')
|
|
2775
2827
|
return;
|