avancement planning
This commit is contained in:
+26
-28
@@ -6,7 +6,7 @@ import { OverlayModule, CdkConnectedOverlay } from '@angular/cdk/overlay';
|
||||
import { _getEventTarget } from '@angular/cdk/platform';
|
||||
import { NgTemplateOutlet, SlicePipe } from '@angular/common';
|
||||
import * as i0 from '@angular/core';
|
||||
import { inject, ChangeDetectorRef, EventEmitter, ElementRef, booleanAttribute, numberAttribute, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, DestroyRef, NgZone, Renderer2, computed, signal, forwardRef, HostListener, ViewChildren, ViewChild, NgModule } from '@angular/core';
|
||||
import { inject, ChangeDetectorRef, EventEmitter, ElementRef, booleanAttribute, numberAttribute, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, DestroyRef, NgZone, Renderer2, signal, computed, forwardRef, HostListener, ViewChildren, ViewChild, NgModule } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { BehaviorSubject, Subject, of, merge } from 'rxjs';
|
||||
@@ -796,7 +796,7 @@ let NzCascaderComponent = (() => {
|
||||
*/
|
||||
shouldShowEmpty = false;
|
||||
el = this.elementRef.nativeElement;
|
||||
menuVisible = false;
|
||||
menuVisible = signal(false, ...(ngDevMode ? [{ debugName: "menuVisible" }] : []));
|
||||
isLoading = false;
|
||||
labelRenderText;
|
||||
labelRenderContext = {};
|
||||
@@ -882,9 +882,7 @@ let NzCascaderComponent = (() => {
|
||||
ngOnInit() {
|
||||
this.nzFormStatusService?.formStatusChanges
|
||||
.pipe(distinctUntilChanged((pre, cur) => pre.status === cur.status && pre.hasFeedback === cur.hasFeedback), withLatestFrom(this.nzFormNoStatusService ? this.nzFormNoStatusService.noFormStatus : of(false)), map(([{ status, hasFeedback }, noStatus]) => ({ status: noStatus ? '' : status, hasFeedback })), takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe(({ status, hasFeedback }) => {
|
||||
this.setStatusStyles(status, hasFeedback);
|
||||
});
|
||||
.subscribe(({ status, hasFeedback }) => this.setStatusStyles(status, hasFeedback));
|
||||
const srv = this.cascaderService;
|
||||
srv.$redraw.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
||||
// These operations would not mutate data.
|
||||
@@ -919,9 +917,9 @@ let NzCascaderComponent = (() => {
|
||||
this.inputValue = '';
|
||||
this.dropdownWidthStyle = '';
|
||||
});
|
||||
this.i18nService.localeChange.pipe(startWith(), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
||||
this.setLocale();
|
||||
});
|
||||
this.i18nService.localeChange
|
||||
.pipe(startWith(), takeUntilDestroyed(this.destroyRef))
|
||||
.subscribe(() => this.setLocale());
|
||||
this.size.set(this.nzSize);
|
||||
this.dir = this.directionality.value;
|
||||
this.directionality.change.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
||||
@@ -1015,7 +1013,7 @@ let NzCascaderComponent = (() => {
|
||||
}
|
||||
}
|
||||
setMenuVisible(visible) {
|
||||
if (this.nzDisabled || this.menuVisible === visible) {
|
||||
if (this.nzDisabled || this.menuVisible() === visible) {
|
||||
return;
|
||||
}
|
||||
if (visible) {
|
||||
@@ -1026,7 +1024,7 @@ let NzCascaderComponent = (() => {
|
||||
else {
|
||||
this.inputValue = '';
|
||||
}
|
||||
this.menuVisible = visible;
|
||||
this.menuVisible.set(visible);
|
||||
this.nzVisibleChange.emit(visible);
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
@@ -1088,7 +1086,7 @@ let NzCascaderComponent = (() => {
|
||||
}
|
||||
}
|
||||
handleInputBlur() {
|
||||
this.menuVisible ? this.focus() : this.blur();
|
||||
this.menuVisible() ? this.focus() : this.blur();
|
||||
}
|
||||
handleInputFocus() {
|
||||
this.focus();
|
||||
@@ -1104,7 +1102,7 @@ let NzCascaderComponent = (() => {
|
||||
this.focus();
|
||||
}
|
||||
if (this.isActionTrigger('click')) {
|
||||
this.delaySetMenuVisible(!this.menuVisible, 100);
|
||||
this.delaySetMenuVisible(!this.menuVisible(), 100);
|
||||
}
|
||||
this.onTouched();
|
||||
}
|
||||
@@ -1116,7 +1114,7 @@ let NzCascaderComponent = (() => {
|
||||
}
|
||||
onTriggerMouseLeave(event) {
|
||||
if (this.nzDisabled ||
|
||||
!this.menuVisible ||
|
||||
!this.menuVisible() ||
|
||||
this.isOpening ||
|
||||
!this.isActionTrigger('hover') ||
|
||||
this.openControlled) {
|
||||
@@ -1415,7 +1413,7 @@ let NzCascaderComponent = (() => {
|
||||
* and may exceed the boundary of browser's window.
|
||||
*/
|
||||
reposition() {
|
||||
if (this.overlay && this.overlay.overlayRef && this.menuVisible) {
|
||||
if (this.overlay && this.overlay.overlayRef && this.menuVisible()) {
|
||||
Promise.resolve().then(() => {
|
||||
this.overlay.overlayRef.updatePosition();
|
||||
this.cdr.markForCheck();
|
||||
@@ -1516,7 +1514,7 @@ let NzCascaderComponent = (() => {
|
||||
return;
|
||||
}
|
||||
// Press any keys above to reopen menu.
|
||||
if (!this.menuVisible && keyCode !== BACKSPACE && keyCode !== ESCAPE && !this.openControlled) {
|
||||
if (!this.menuVisible() && keyCode !== BACKSPACE && keyCode !== ESCAPE && !this.openControlled) {
|
||||
// The `setMenuVisible` runs `detectChanges()`, so we don't need to run `markForCheck()` additionally.
|
||||
return this.ngZone.run(() => this.setMenuVisible(true));
|
||||
}
|
||||
@@ -1524,7 +1522,7 @@ let NzCascaderComponent = (() => {
|
||||
if (this.inSearchingMode && (keyCode === BACKSPACE || keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW)) {
|
||||
return;
|
||||
}
|
||||
if (!this.menuVisible) {
|
||||
if (!this.menuVisible()) {
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
@@ -1567,7 +1565,7 @@ let NzCascaderComponent = (() => {
|
||||
});
|
||||
}
|
||||
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzCascaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
||||
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzCascaderComponent, isStandalone: true, selector: "nz-cascader, [nz-cascader]", inputs: { nzOpen: "nzOpen", nzOptions: "nzOptions", nzOptionRender: "nzOptionRender", nzShowInput: ["nzShowInput", "nzShowInput", booleanAttribute], nzShowArrow: ["nzShowArrow", "nzShowArrow", booleanAttribute], nzAllowClear: ["nzAllowClear", "nzAllowClear", booleanAttribute], nzAutoFocus: ["nzAutoFocus", "nzAutoFocus", booleanAttribute], nzChangeOnSelect: ["nzChangeOnSelect", "nzChangeOnSelect", booleanAttribute], nzDisabled: ["nzDisabled", "nzDisabled", booleanAttribute], nzColumnClassName: "nzColumnClassName", nzExpandTrigger: "nzExpandTrigger", nzValueProperty: "nzValueProperty", nzLabelProperty: "nzLabelProperty", nzLabelRender: "nzLabelRender", nzVariant: "nzVariant", nzNotFoundContent: "nzNotFoundContent", nzSize: "nzSize", nzBackdrop: "nzBackdrop", nzShowSearch: "nzShowSearch", nzPlaceHolder: "nzPlaceHolder", nzMenuClassName: "nzMenuClassName", nzMenuStyle: "nzMenuStyle", nzMouseLeaveDelay: ["nzMouseLeaveDelay", "nzMouseLeaveDelay", numberAttribute], nzMouseEnterDelay: ["nzMouseEnterDelay", "nzMouseEnterDelay", numberAttribute], nzStatus: "nzStatus", nzMultiple: ["nzMultiple", "nzMultiple", booleanAttribute], nzMaxTagCount: "nzMaxTagCount", nzPlacement: "nzPlacement", nzTriggerAction: "nzTriggerAction", nzChangeOn: "nzChangeOn", nzLoadData: "nzLoadData", nzDisplayWith: "nzDisplayWith", nzPrefix: "nzPrefix", nzSuffixIcon: "nzSuffixIcon", nzExpandIcon: "nzExpandIcon" }, outputs: { nzVisibleChange: "nzVisibleChange", nzSelectionChange: "nzSelectionChange", nzRemoved: "nzRemoved", nzClear: "nzClear" }, host: { listeners: { "click": "onTriggerClick()", "mouseenter": "onTriggerMouseEnter()", "mouseleave": "onTriggerMouseLeave($event)" }, properties: { "attr.tabIndex": "\"0\"", "class.ant-select-in-form-item": "!!nzFormStatusService", "class.ant-select-lg": "finalSize() === \"large\"", "class.ant-select-sm": "finalSize() === \"small\"", "class.ant-select-allow-clear": "nzAllowClear", "class.ant-select-show-arrow": "nzShowArrow", "class.ant-select-show-search": "!!nzShowSearch", "class.ant-select-disabled": "nzDisabled", "class.ant-select-borderless": "nzVariant === 'borderless'", "class.ant-select-filled": "nzVariant === 'filled'", "class.ant-select-underlined": "nzVariant === 'underlined'", "class.ant-select-open": "menuVisible", "class.ant-select-focused": "isFocused", "class.ant-select-multiple": "nzMultiple", "class.ant-select-single": "!nzMultiple", "class.ant-select-rtl": "dir === 'rtl'" } }, providers: [
|
||||
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzCascaderComponent, isStandalone: true, selector: "nz-cascader, [nz-cascader]", inputs: { nzOpen: "nzOpen", nzOptions: "nzOptions", nzOptionRender: "nzOptionRender", nzShowInput: ["nzShowInput", "nzShowInput", booleanAttribute], nzShowArrow: ["nzShowArrow", "nzShowArrow", booleanAttribute], nzAllowClear: ["nzAllowClear", "nzAllowClear", booleanAttribute], nzAutoFocus: ["nzAutoFocus", "nzAutoFocus", booleanAttribute], nzChangeOnSelect: ["nzChangeOnSelect", "nzChangeOnSelect", booleanAttribute], nzDisabled: ["nzDisabled", "nzDisabled", booleanAttribute], nzColumnClassName: "nzColumnClassName", nzExpandTrigger: "nzExpandTrigger", nzValueProperty: "nzValueProperty", nzLabelProperty: "nzLabelProperty", nzLabelRender: "nzLabelRender", nzVariant: "nzVariant", nzNotFoundContent: "nzNotFoundContent", nzSize: "nzSize", nzBackdrop: "nzBackdrop", nzShowSearch: "nzShowSearch", nzPlaceHolder: "nzPlaceHolder", nzMenuClassName: "nzMenuClassName", nzMenuStyle: "nzMenuStyle", nzMouseLeaveDelay: ["nzMouseLeaveDelay", "nzMouseLeaveDelay", numberAttribute], nzMouseEnterDelay: ["nzMouseEnterDelay", "nzMouseEnterDelay", numberAttribute], nzStatus: "nzStatus", nzMultiple: ["nzMultiple", "nzMultiple", booleanAttribute], nzMaxTagCount: "nzMaxTagCount", nzPlacement: "nzPlacement", nzTriggerAction: "nzTriggerAction", nzChangeOn: "nzChangeOn", nzLoadData: "nzLoadData", nzDisplayWith: "nzDisplayWith", nzPrefix: "nzPrefix", nzSuffixIcon: "nzSuffixIcon", nzExpandIcon: "nzExpandIcon" }, outputs: { nzVisibleChange: "nzVisibleChange", nzSelectionChange: "nzSelectionChange", nzRemoved: "nzRemoved", nzClear: "nzClear" }, host: { listeners: { "click": "onTriggerClick()", "mouseenter": "onTriggerMouseEnter()", "mouseleave": "onTriggerMouseLeave($event)" }, properties: { "attr.tabIndex": "\"0\"", "class.ant-select-in-form-item": "!!nzFormStatusService", "class.ant-select-lg": "finalSize() === \"large\"", "class.ant-select-sm": "finalSize() === \"small\"", "class.ant-select-allow-clear": "nzAllowClear", "class.ant-select-show-arrow": "nzShowArrow", "class.ant-select-show-search": "!!nzShowSearch", "class.ant-select-disabled": "nzDisabled", "class.ant-select-borderless": "nzVariant === 'borderless'", "class.ant-select-filled": "nzVariant === 'filled'", "class.ant-select-underlined": "nzVariant === 'underlined'", "class.ant-select-open": "menuVisible()", "class.ant-select-focused": "isFocused", "class.ant-select-multiple": "nzMultiple", "class.ant-select-single": "!nzMultiple", "class.ant-select-rtl": "dir === 'rtl'" } }, providers: [
|
||||
{
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
useExisting: forwardRef(() => NzCascaderComponent),
|
||||
@@ -1612,7 +1610,7 @@ let NzCascaderComponent = (() => {
|
||||
[mirrorSync]="true"
|
||||
[disabled]="nzDisabled"
|
||||
[autofocus]="nzAutoFocus"
|
||||
[focusTrigger]="menuVisible"
|
||||
[focusTrigger]="menuVisible()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1625,7 +1623,7 @@ let NzCascaderComponent = (() => {
|
||||
[mirrorSync]="false"
|
||||
[disabled]="nzDisabled"
|
||||
[autofocus]="nzAutoFocus"
|
||||
[focusTrigger]="menuVisible"
|
||||
[focusTrigger]="menuVisible()"
|
||||
/>
|
||||
|
||||
@if (showLabelRender) {
|
||||
@@ -1650,7 +1648,7 @@ let NzCascaderComponent = (() => {
|
||||
@if (nzShowArrow) {
|
||||
<span class="ant-select-arrow" [class.ant-select-arrow-loading]="isLoading">
|
||||
@if (!isLoading) {
|
||||
<nz-icon [nzType]="$any(nzSuffixIcon)" [class.ant-cascader-picker-arrow-expand]="menuVisible" />
|
||||
<nz-icon [nzType]="$any(nzSuffixIcon)" [class.ant-cascader-picker-arrow-expand]="menuVisible()" />
|
||||
} @else {
|
||||
<nz-icon nzType="loading" />
|
||||
}
|
||||
@@ -1673,7 +1671,7 @@ let NzCascaderComponent = (() => {
|
||||
[cdkConnectedOverlayOrigin]="overlayOrigin"
|
||||
[cdkConnectedOverlayPositions]="positions"
|
||||
[cdkConnectedOverlayTransformOriginOn]="'.ant-cascader-dropdown'"
|
||||
[cdkConnectedOverlayOpen]="menuVisible"
|
||||
[cdkConnectedOverlayOpen]="menuVisible()"
|
||||
(overlayOutsideClick)="onClickOutside($event)"
|
||||
(detach)="closeMenu()"
|
||||
(positionChange)="onPositionChange($event)"
|
||||
@@ -1695,7 +1693,7 @@ let NzCascaderComponent = (() => {
|
||||
#menu
|
||||
class="ant-cascader-menus"
|
||||
[class.ant-cascader-rtl]="dir === 'rtl'"
|
||||
[class.ant-cascader-menus-hidden]="!menuVisible"
|
||||
[class.ant-cascader-menus-hidden]="!menuVisible()"
|
||||
[class.ant-cascader-menu-empty]="shouldShowEmpty"
|
||||
[class]="nzMenuClassName"
|
||||
[style]="nzMenuStyle"
|
||||
@@ -1788,7 +1786,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
||||
[mirrorSync]="true"
|
||||
[disabled]="nzDisabled"
|
||||
[autofocus]="nzAutoFocus"
|
||||
[focusTrigger]="menuVisible"
|
||||
[focusTrigger]="menuVisible()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1801,7 +1799,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
||||
[mirrorSync]="false"
|
||||
[disabled]="nzDisabled"
|
||||
[autofocus]="nzAutoFocus"
|
||||
[focusTrigger]="menuVisible"
|
||||
[focusTrigger]="menuVisible()"
|
||||
/>
|
||||
|
||||
@if (showLabelRender) {
|
||||
@@ -1826,7 +1824,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
||||
@if (nzShowArrow) {
|
||||
<span class="ant-select-arrow" [class.ant-select-arrow-loading]="isLoading">
|
||||
@if (!isLoading) {
|
||||
<nz-icon [nzType]="$any(nzSuffixIcon)" [class.ant-cascader-picker-arrow-expand]="menuVisible" />
|
||||
<nz-icon [nzType]="$any(nzSuffixIcon)" [class.ant-cascader-picker-arrow-expand]="menuVisible()" />
|
||||
} @else {
|
||||
<nz-icon nzType="loading" />
|
||||
}
|
||||
@@ -1849,7 +1847,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
||||
[cdkConnectedOverlayOrigin]="overlayOrigin"
|
||||
[cdkConnectedOverlayPositions]="positions"
|
||||
[cdkConnectedOverlayTransformOriginOn]="'.ant-cascader-dropdown'"
|
||||
[cdkConnectedOverlayOpen]="menuVisible"
|
||||
[cdkConnectedOverlayOpen]="menuVisible()"
|
||||
(overlayOutsideClick)="onClickOutside($event)"
|
||||
(detach)="closeMenu()"
|
||||
(positionChange)="onPositionChange($event)"
|
||||
@@ -1871,7 +1869,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
||||
#menu
|
||||
class="ant-cascader-menus"
|
||||
[class.ant-cascader-rtl]="dir === 'rtl'"
|
||||
[class.ant-cascader-menus-hidden]="!menuVisible"
|
||||
[class.ant-cascader-menus-hidden]="!menuVisible()"
|
||||
[class.ant-cascader-menu-empty]="shouldShowEmpty"
|
||||
[class]="nzMenuClassName"
|
||||
[style]="nzMenuStyle"
|
||||
@@ -1942,7 +1940,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
||||
'[class.ant-select-borderless]': `nzVariant === 'borderless'`,
|
||||
'[class.ant-select-filled]': `nzVariant === 'filled'`,
|
||||
'[class.ant-select-underlined]': `nzVariant === 'underlined'`,
|
||||
'[class.ant-select-open]': 'menuVisible',
|
||||
'[class.ant-select-open]': 'menuVisible()',
|
||||
'[class.ant-select-focused]': 'isFocused',
|
||||
'[class.ant-select-multiple]': 'nzMultiple',
|
||||
'[class.ant-select-single]': '!nzMultiple',
|
||||
|
||||
Reference in New Issue
Block a user