avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+3 -3
View File
@@ -16,13 +16,13 @@ An enterprise-class Angular UI component library based on Ant Design.
[![CodeFactor](https://www.codefactor.io/repository/github/ng-zorro/ng-zorro-antd/badge?style=flat-square)](https://www.codefactor.io/repository/github/ng-zorro/ng-zorro-antd)
[![Codecov](https://img.shields.io/codecov/c/github/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://codecov.io/gh/NG-ZORRO/ng-zorro-antd)
[![GitHub Release Date](https://img.shields.io/github/release-date/NG-ZORRO/ng-zorro-antd.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/releases)
[![NPM package](https://img.shields.io/npm/v/ng-zorro-antd.svg?style=flat-square)](https://www.npmjs.org/package/ng-zorro-antd)
[![NPM package](https://img.shields.io/npm/v/ng-zorro-antd.svg?style=flat-square)](https://npmjs.org/package/ng-zorro-antd)
[![NPM downloads](http://img.shields.io/npm/dm/ng-zorro-antd.svg?style=flat-square)](https://npmjs.org/package/ng-zorro-antd)
[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE)
[![Discord](https://img.shields.io/discord/748677963142135818?label=Discord&style=flat-square)](https://discord.com/channels/748677963142135818)
[![Discord](https://img.shields.io/discord/1433686455925870594?style=flat-square&logo=discord&label=Discord)](https://discord.com/channels/1433686455925870594/1433686456706138195)
[![VSCode Extension](https://img.shields.io/badge/extension%20for-VSCode-blue.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=cipchk.ng-zorro-vscode)
[![Code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Twitter](https://img.shields.io/badge/Twitter-NG--ZORRO-blue.svg?style=flat-square&logo=twitter)](https://twitter.com/ng_zorro)
[![X](https://img.shields.io/badge/NG--ZORRO-blue.svg?style=flat-square&logo=x)](http://x.com/ng_zorro)
</div>
+1
View File
@@ -23,6 +23,7 @@ interface SimpleRect {
declare class NzAffixComponent implements AfterViewInit, OnChanges, OnInit {
nzConfigService: NzConfigService;
private scrollSrv;
private ngZone;
private platform;
private renderer;
private nzResizeObserver;
+2 -2
View File
@@ -94,7 +94,7 @@
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -136,7 +136,7 @@
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,5 +1,5 @@
import * as i0 from '@angular/core';
import { OnChanges, AfterViewInit, AfterContentInit, OnInit, ElementRef, Renderer2, SimpleChanges } from '@angular/core';
import { OnChanges, AfterViewInit, AfterContentInit, OnInit, ElementRef, SimpleChanges } from '@angular/core';
import { Direction } from '@angular/cdk/bidi';
import { NzConfigKey } from 'ng-zorro-antd/core/config';
import { NzSizeLDSType } from 'ng-zorro-antd/core/types';
@@ -41,12 +41,12 @@ declare class NzButtonComponent implements OnChanges, AfterViewInit, AfterConten
readonly iconDir: i0.Signal<NzIconDirective | undefined>;
readonly loadingIconDir: i0.Signal<NzIconDirective | undefined>;
readonly iconOnly: i0.Signal<boolean>;
insertSpan(nodes: NodeList, renderer: Renderer2): void;
constructor();
ngOnInit(): void;
ngOnChanges({ nzLoading, nzSize }: SimpleChanges): void;
ngAfterViewInit(): void;
ngAfterContentInit(): void;
insertSpan(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzButtonComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzButtonComponent, "button[nz-button], a[nz-button]", ["nzButton"], { "nzBlock": { "alias": "nzBlock"; "required": false; }; "nzGhost": { "alias": "nzGhost"; "required": false; }; "nzSearch": { "alias": "nzSearch"; "required": false; }; "nzLoading": { "alias": "nzLoading"; "required": false; }; "nzDanger": { "alias": "nzDanger"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "nzType": { "alias": "nzType"; "required": false; }; "nzShape": { "alias": "nzShape"; "required": false; }; "nzSize": { "alias": "nzSize"; "required": false; }; }, {}, ["iconDir", "nzIconDirectiveElement"], ["*"], true, [{ directive: typeof i1.NzSpaceCompactItemDirective; inputs: {}; outputs: {}; }]>;
static ngAcceptInputType_nzBlock: unknown;
+2 -2
View File
@@ -251,7 +251,7 @@
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -293,7 +293,7 @@
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -322,7 +322,7 @@ declare class NzCascaderComponent extends NzTreeBase implements NzCascaderCompon
*/
shouldShowEmpty: boolean;
el: HTMLElement;
menuVisible: boolean;
readonly menuVisible: i0.WritableSignal<boolean>;
isLoading: boolean;
labelRenderText?: string;
labelRenderContext: {};
+1 -2
View File
@@ -1,6 +1,6 @@
import { TinyColor, Numberify } from '@ctrl/tinycolor';
import * as _angular_forms from '@angular/forms';
import { ControlValueAccessor, ValidatorFn, FormGroup, FormControl } from '@angular/forms';
import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
import * as i0 from '@angular/core';
import { OnInit, OnChanges, TemplateRef, EventEmitter, SimpleChanges } from '@angular/core';
import { NzSizeLDSType, NzSafeAny } from 'ng-zorro-antd/core/types';
@@ -144,7 +144,6 @@ declare class NzColorFormatComponent implements OnChanges, OnInit {
format: NzColorPickerFormatType;
}>;
readonly nzOnFormatChange: EventEmitter<NzColorPickerFormatType>;
validatorFn(): ValidatorFn;
validateForm: FormGroup<{
isFormat: FormControl<NzColorPickerFormatType | null>;
hex: FormControl<string | null>;
+9 -1
View File
@@ -5,7 +5,7 @@ import { Direction } from '@angular/cdk/bidi';
import { SafeUrl } from '@angular/platform-browser';
import { ThemeType } from '@ant-design/icons-angular';
import { NzBreakpointEnum } from 'ng-zorro-antd/core/services';
import { NzSafeAny, NzShapeSCType, NzSizeLDSType, NzSizeDSType, NzSizeMDSType, NzTSType } from 'ng-zorro-antd/core/types';
import { NzVariant, NzSafeAny, NzShapeSCType, NzSizeLDSType, NzSizeDSType, NzSizeMDSType, NzTSType } from 'ng-zorro-antd/core/types';
/**
* Use of this source code is governed by an MIT-style license that can be
@@ -79,6 +79,10 @@ interface Theme {
[key: string]: string | undefined;
}
interface SelectConfig {
nzVariant?: NzVariant;
/**
* @deprecated Will be removed in v21.0.0, please use `nzVariant` instead.
*/
nzBorderless?: boolean;
nzSuffixIcon?: TemplateRef<NzSafeAny> | string | null;
nzBackdrop?: boolean;
@@ -141,6 +145,7 @@ interface CarouselConfig {
interface CascaderConfig {
nzSize?: string;
nzBackdrop?: boolean;
nzVariant?: boolean;
}
interface CollapseConfig {
nzAccordion?: boolean;
@@ -154,6 +159,7 @@ interface DatePickerConfig {
nzSeparator?: string;
nzSuffixIcon?: string | TemplateRef<NzSafeAny>;
nzBackdrop?: boolean;
nzVariant?: NzVariant;
}
interface DescriptionsConfig {
nzBordered?: boolean;
@@ -279,6 +285,7 @@ interface TimePickerConfig {
nzUse12Hours?: string;
nzSuffixIcon?: string | TemplateRef<NzSafeAny>;
nzBackdrop?: boolean;
nzVariant?: NzVariant;
}
interface TreeConfig {
nzBlockNode?: boolean;
@@ -292,6 +299,7 @@ interface TreeSelectConfig {
nzHideUnMatched?: boolean;
nzSize?: 'large' | 'small' | 'default';
nzBackdrop?: boolean;
nzVariant?: NzVariant;
}
interface TypographyConfig {
nzEllipsisRows?: number;
+4 -5
View File
@@ -1,7 +1,7 @@
import * as i0 from '@angular/core';
import { AfterContentInit, OnInit, ViewContainerRef, EventEmitter, TemplateRef, AfterViewInit, OnChanges, ElementRef, SimpleChanges, EmbeddedViewRef } from '@angular/core';
import { NzConfigService, NzConfigKey } from 'ng-zorro-antd/core/config';
import { IndexableObject, NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzSafeAny, IndexableObject } from 'ng-zorro-antd/core/types';
import * as rxjs from 'rxjs';
import { BehaviorSubject } from 'rxjs';
import { AnimationEvent } from '@angular/animations';
@@ -18,21 +18,21 @@ declare class NzDropdownMenuComponent implements AfterContentInit, OnInit {
viewContainerRef: ViewContainerRef;
private directionality;
private destroyRef;
mouseState$: BehaviorSubject<boolean>;
noAnimation: NzNoAnimationDirective | null;
nzMenuService: MenuService;
isChildSubMenuOpen$: BehaviorSubject<boolean>;
descendantMenuItemClick$: rxjs.Subject<any>;
mouseState$: BehaviorSubject<boolean>;
animationStateChange$: EventEmitter<AnimationEvent>;
templateRef: TemplateRef<NzSafeAny>;
nzOverlayClassName: string;
nzOverlayStyle: IndexableObject;
nzArrow: boolean;
placement: NzPlacementType | 'bottom' | 'top';
templateRef: TemplateRef<NzSafeAny>;
dir: Direction;
onAnimationEvent(event: AnimationEvent): void;
setMouseState(visible: boolean): void;
setValue<T extends keyof NzDropdownMenuComponent>(key: T, value: this[T]): void;
noAnimation: NzNoAnimationDirective | null;
ngOnInit(): void;
ngAfterContentInit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NzDropdownMenuComponent, never>;
@@ -50,7 +50,6 @@ declare class NzDropDownDirective implements AfterViewInit, OnChanges {
private injector;
private portal?;
private overlayRef;
private positionStrategy;
private inputVisible$;
private nzTrigger$;
private overlayClose$;
+6 -5
View File
@@ -2,14 +2,14 @@ import { __esDecorate, __runInitializers } from 'tslib';
import { Directionality, BidiModule } from '@angular/cdk/bidi';
import { Platform, PlatformModule } from '@angular/cdk/platform';
import * as i0 from '@angular/core';
import { inject, Renderer2, ChangeDetectorRef, DestroyRef, EventEmitter, ElementRef, DOCUMENT, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { inject, NgZone, Renderer2, ChangeDetectorRef, DestroyRef, EventEmitter, ElementRef, DOCUMENT, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Subscription, ReplaySubject, merge } from 'rxjs';
import { Subscription, ReplaySubject, merge, fromEvent } from 'rxjs';
import { map, throttleTime } from 'rxjs/operators';
import { NzResizeObserver } from 'ng-zorro-antd/cdk/resize-observer';
import { WithConfig, NzConfigService } from 'ng-zorro-antd/core/config';
import { NzScrollService } from 'ng-zorro-antd/core/services';
import { fromEventOutsideAngular, shallowEqual, getStyleAsText, numberAttributeWithZeroFallback } from 'ng-zorro-antd/core/util';
import { shallowEqual, getStyleAsText, numberAttributeWithZeroFallback } from 'ng-zorro-antd/core/util';
/**
* Use of this source code is governed by an MIT-style license that can be
@@ -64,6 +64,7 @@ let NzAffixComponent = (() => {
}
nzConfigService = inject(NzConfigService);
scrollSrv = inject(NzScrollService);
ngZone = inject(NgZone);
platform = inject(Platform);
renderer = inject(Renderer2);
nzResizeObserver = inject(NzResizeObserver);
@@ -120,9 +121,9 @@ let NzAffixComponent = (() => {
}
this.removeListeners();
const el = this.target === window ? this.document.body : this.target;
this.positionChangeSubscription = merge(...Object.keys(AffixRespondEvents).map(evName => fromEventOutsideAngular(this.target, evName)), this.offsetChanged$.pipe(map(() => ({}))), this.nzResizeObserver.observe(el))
this.positionChangeSubscription = this.ngZone.runOutsideAngular(() => merge(...Object.keys(AffixRespondEvents).map(evName => fromEvent(this.target, evName)), this.offsetChanged$.pipe(map(() => ({}))), this.nzResizeObserver.observe(el))
.pipe(throttleTime(NZ_AFFIX_DEFAULT_SCROLL_TIME, undefined, { trailing: true }), takeUntilDestroyed(this.destroyRef))
.subscribe(e => this.updatePosition(e));
.subscribe(e => this.updatePosition(e)));
this.timeout = setTimeout(() => this.updatePosition({}));
}
removeListeners() {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -234,11 +234,11 @@ let NzBadgeComponent = (() => {
[nzOffset]="nzOffset"
[nzSize]="nzSize"
[nzTitle]="nzTitle"
[nzStyle]="nzStyle"
[nzStyle]="mergedStyle"
[nzDot]="nzDot"
[nzCount]="nzCount"
[nzOverflowCount]="nzOverflowCount"
[disableAnimation]="!!(nzStandalone || nzStatus || nzColor || noAnimation?.nzNoAnimation)"
[disableAnimation]="!!(nzStandalone || nzStatus || presetColor || noAnimation?.nzNoAnimation)"
[noAnimation]="!!noAnimation?.nzNoAnimation"
/>
}
@@ -275,11 +275,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
[nzOffset]="nzOffset"
[nzSize]="nzSize"
[nzTitle]="nzTitle"
[nzStyle]="nzStyle"
[nzStyle]="mergedStyle"
[nzDot]="nzDot"
[nzCount]="nzCount"
[nzOverflowCount]="nzOverflowCount"
[disableAnimation]="!!(nzStandalone || nzStatus || nzColor || noAnimation?.nzNoAnimation)"
[disableAnimation]="!!(nzStandalone || nzStatus || presetColor || noAnimation?.nzNoAnimation)"
[noAnimation]="!!noAnimation?.nzNoAnimation"
/>
}
File diff suppressed because one or more lines are too long
+15 -18
View File
@@ -60,30 +60,17 @@ let NzButtonComponent = (() => {
iconDir = contentChild(NzIconDirective, ...(ngDevMode ? [{ debugName: "iconDir" }] : []));
loadingIconDir = viewChild(NzIconDirective, ...(ngDevMode ? [{ debugName: "loadingIconDir" }] : []));
iconOnly = computed(() => this.elementOnly() && (!!this.iconDir() || !!this.loadingIconDir()), ...(ngDevMode ? [{ debugName: "iconOnly" }] : []));
insertSpan(nodes, renderer) {
nodes.forEach(node => {
if (node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0) {
const span = renderer.createElement('span');
const parent = renderer.parentNode(node);
renderer.insertBefore(parent, span, node);
renderer.appendChild(span, node);
}
});
}
constructor() {
onConfigChangeEventForComponent(NZ_CONFIG_MODULE_NAME, () => {
this.size.set(this.nzSize);
this.cdr.markForCheck();
});
let elementOnly = false;
afterEveryRender({
read: () => {
const { childNodes, children } = this.elementRef.nativeElement;
const hasText = Array.from(childNodes).some(node => node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0);
const visibleElementCount = Array.from(children).filter(element => element.style.display !== 'none').length;
elementOnly = !hasText && visibleElementCount === 1;
},
write: () => this.elementOnly.set(elementOnly)
const { children } = this.elementRef.nativeElement;
const visibleElement = Array.from(children).filter(element => element.style.display !== 'none');
this.elementOnly.set(visibleElement.length === 1);
}
});
}
ngOnInit() {
@@ -115,7 +102,7 @@ let NzButtonComponent = (() => {
}
}
ngAfterViewInit() {
this.insertSpan(this.elementRef.nativeElement.childNodes, this.renderer);
this.insertSpan();
}
ngAfterContentInit() {
this.loading$
@@ -130,6 +117,16 @@ let NzButtonComponent = (() => {
}
});
}
insertSpan() {
this.elementRef.nativeElement.childNodes.forEach(node => {
if (node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0) {
const span = this.renderer.createElement('span');
const parent = this.renderer.parentNode(node);
this.renderer.insertBefore(parent, span, node);
this.renderer.appendChild(span, node);
}
});
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzButtonComponent, isStandalone: true, selector: "button[nz-button], a[nz-button]", inputs: { nzBlock: ["nzBlock", "nzBlock", booleanAttribute], nzGhost: ["nzGhost", "nzGhost", booleanAttribute], nzSearch: ["nzSearch", "nzSearch", booleanAttribute], nzLoading: ["nzLoading", "nzLoading", booleanAttribute], nzDanger: ["nzDanger", "nzDanger", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], tabIndex: "tabIndex", nzType: "nzType", nzShape: "nzShape", nzSize: "nzSize" }, host: { properties: { "class.ant-btn-default": "nzType === 'default'", "class.ant-btn-primary": "nzType === 'primary'", "class.ant-btn-dashed": "nzType === 'dashed'", "class.ant-btn-link": "nzType === 'link'", "class.ant-btn-text": "nzType === 'text'", "class.ant-btn-circle": "nzShape === 'circle'", "class.ant-btn-round": "nzShape === 'round'", "class.ant-btn-lg": "finalSize() === 'large'", "class.ant-btn-sm": "finalSize() === 'small'", "class.ant-btn-dangerous": "nzDanger", "class.ant-btn-loading": "nzLoading", "class.ant-btn-background-ghost": "nzGhost", "class.ant-btn-block": "nzBlock", "class.ant-input-search-button": "nzSearch", "class.ant-btn-rtl": "dir === 'rtl'", "class.ant-btn-icon-only": "iconOnly()", "attr.tabindex": "disabled ? -1 : (tabIndex === null ? null : tabIndex)", "attr.disabled": "disabled || null" }, classAttribute: "ant-btn" }, providers: [{ provide: NZ_SPACE_COMPACT_ITEM_TYPE, useValue: 'btn' }], queries: [{ propertyName: "iconDir", first: true, predicate: NzIconDirective, descendants: true, isSignal: true }, { propertyName: "nzIconDirectiveElement", first: true, predicate: NzIconDirective, descendants: true, read: ElementRef }], viewQueries: [{ propertyName: "loadingIconDir", first: true, predicate: NzIconDirective, descendants: true, isSignal: true }], exportAs: ["nzButton"], usesOnChanges: true, hostDirectives: [{ directive: i1.NzSpaceCompactItemDirective }], ngImport: i0, template: `
@if (nzLoading) {
File diff suppressed because one or more lines are too long
+26 -28
View File
@@ -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',
File diff suppressed because one or more lines are too long
+77 -41
View File
@@ -8,8 +8,10 @@ import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';
import { NzPopoverDirective } from 'ng-zorro-antd/popover';
import { TinyColor } from '@ctrl/tinycolor';
import { filter, debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { NzInputDirective, NzInputGroupComponent } from 'ng-zorro-antd/input';
import { NzInputNumberComponent } from 'ng-zorro-antd/input-number';
import * as i3 from 'ng-zorro-antd/input';
import { NzInputModule } from 'ng-zorro-antd/input';
import * as i4 from 'ng-zorro-antd/input-number';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import * as i2 from 'ng-zorro-antd/select';
import { NzSelectModule } from 'ng-zorro-antd/select';
@@ -887,21 +889,9 @@ class NzColorFormatComponent {
nzDisabledAlpha = false;
formatChange = new EventEmitter();
nzOnFormatChange = new EventEmitter();
validatorFn() {
return (control) => {
const REGEXP = /^[0-9a-fA-F]{6}$/;
if (!control.value) {
return { error: true };
}
else if (!REGEXP.test(control.value)) {
return { error: true };
}
return null;
};
}
validateForm = this.formBuilder.nonNullable.group({
isFormat: this.formBuilder.control('hex'),
hex: this.formBuilder.control('1677FF', this.validatorFn()),
hex: this.formBuilder.control('1677FF', hexValidator),
hsbH: 215,
hsbS: 91,
hsbB: 100,
@@ -979,9 +969,9 @@ class NzColorFormatComponent {
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzColorFormatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzColorFormatComponent, isStandalone: true, selector: "nz-color-format", inputs: { format: "format", colorValue: "colorValue", clearColor: ["clearColor", "clearColor", booleanAttribute], nzDisabledAlpha: ["nzDisabledAlpha", "nzDisabledAlpha", booleanAttribute] }, outputs: { formatChange: "formatChange", nzOnFormatChange: "nzOnFormatChange" }, exportAs: ["nzColorFormat"], usesOnChanges: true, ngImport: i0, template: `
<div [formGroup]="validateForm" class="ant-color-picker-input-container">
<div class="ant-color-picker-input-container">
<div class="ant-color-picker-format-select">
<nz-select formControlName="isFormat" nzBorderless nzSize="small">
<nz-select [formControl]="validateForm.controls.isFormat" nzBorderless nzSize="small">
<nz-option nzValue="hex" nzLabel="HEX" />
<nz-option nzValue="hsb" nzLabel="HSB" />
<nz-option nzValue="rgb" nzLabel="RGB" />
@@ -992,16 +982,16 @@ class NzColorFormatComponent {
@switch (validateForm.controls.isFormat.value) {
@case ('hex') {
<div class="ant-color-picker-hex-input">
<nz-input-group nzPrefix="#" nzSize="small">
<input nz-input nzSize="small" formControlName="hex" />
</nz-input-group>
<nz-input-wrapper nzPrefix="#">
<input nz-input nzSize="small" [formControl]="validateForm.controls.hex" />
</nz-input-wrapper>
</div>
}
@case ('hsb') {
<div class="ant-color-picker-hsb-input">
<div class="ant-color-picker-steppers ant-color-picker-hsb-input">
<nz-input-number
formControlName="hsbH"
[formControl]="validateForm.controls.hsbH"
[nzMin]="0"
[nzMax]="360"
[nzStep]="1"
@@ -1011,7 +1001,7 @@ class NzColorFormatComponent {
</div>
<div class="ant-color-picker-steppers ant-color-picker-hsb-input">
<nz-input-number
formControlName="hsbS"
[formControl]="validateForm.controls.hsbS"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
@@ -1022,7 +1012,7 @@ class NzColorFormatComponent {
</div>
<div class="ant-color-picker-steppers ant-color-picker-hsb-input">
<nz-input-number
formControlName="hsbB"
[formControl]="validateForm.controls.hsbB"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
@@ -1036,13 +1026,31 @@ class NzColorFormatComponent {
@default {
<div class="ant-color-picker-rgb-input">
<div class="ant-color-picker-steppers ant-color-picker-rgb-input">
<nz-input-number formControlName="rgbR" [nzMin]="0" [nzMax]="255" [nzStep]="1" nzSize="small" />
<nz-input-number
[formControl]="validateForm.controls.rgbR"
[nzMin]="0"
[nzMax]="255"
[nzStep]="1"
nzSize="small"
/>
</div>
<div class="ant-color-picker-steppers ant-color-picker-rgb-input">
<nz-input-number formControlName="rgbG" [nzMin]="0" [nzMax]="255" [nzStep]="1" nzSize="small" />
<nz-input-number
[formControl]="validateForm.controls.rgbG"
[nzMin]="0"
[nzMax]="255"
[nzStep]="1"
nzSize="small"
/>
</div>
<div class="ant-color-picker-steppers ant-color-picker-rgb-input">
<nz-input-number formControlName="rgbB" [nzMin]="0" [nzMax]="255" [nzStep]="1" nzSize="small" />
<nz-input-number
[formControl]="validateForm.controls.rgbB"
[nzMin]="0"
[nzMax]="255"
[nzStep]="1"
nzSize="small"
/>
</div>
</div>
}
@@ -1052,7 +1060,7 @@ class NzColorFormatComponent {
@if (!nzDisabledAlpha) {
<div class="ant-color-picker-steppers ant-color-picker-alpha-input">
<nz-input-number
formControlName="roundA"
[formControl]="validateForm.controls.roundA"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
@@ -1063,7 +1071,7 @@ class NzColorFormatComponent {
</div>
}
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzPrefix", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "directive", type: NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled", "readonly"], exportAs: ["nzInput"] }, { kind: "component", type: NzInputGroupComponent, selector: "nz-input-group", inputs: ["nzAddOnBeforeIcon", "nzAddOnAfterIcon", "nzPrefixIcon", "nzSuffixIcon", "nzAddOnBefore", "nzAddOnAfter", "nzPrefix", "nzStatus", "nzSuffix", "nzSize", "nzSearch"], exportAs: ["nzInputGroup"] }, { kind: "component", type: NzInputNumberComponent, selector: "nz-input-number", inputs: ["nzId", "nzSize", "nzPlaceHolder", "nzStatus", "nzVariant", "nzStep", "nzMin", "nzMax", "nzPrecision", "nzParser", "nzFormatter", "nzDisabled", "nzReadOnly", "nzAutoFocus", "nzBordered", "nzKeyboard", "nzControls", "nzPrefix", "nzSuffix", "nzAddonBefore", "nzAddonAfter"], outputs: ["nzBlur", "nzFocus", "nzOnStep"], exportAs: ["nzInputNumber"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzPrefix", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i3.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled", "readonly"], exportAs: ["nzInput"] }, { kind: "component", type: i3.NzInputWrapperComponent, selector: "nz-input-wrapper,nz-input-password,nz-input-search", inputs: ["nzAllowClear", "nzPrefix", "nzSuffix", "nzAddonBefore", "nzAddonAfter"], outputs: ["nzClear"], exportAs: ["nzInputWrapper"] }, { kind: "ngmodule", type: NzInputNumberModule }, { kind: "component", type: i4.NzInputNumberComponent, selector: "nz-input-number", inputs: ["nzId", "nzSize", "nzPlaceHolder", "nzStatus", "nzVariant", "nzStep", "nzMin", "nzMax", "nzPrecision", "nzParser", "nzFormatter", "nzDisabled", "nzReadOnly", "nzAutoFocus", "nzBordered", "nzKeyboard", "nzControls", "nzPrefix", "nzSuffix", "nzAddonBefore", "nzAddonAfter"], outputs: ["nzBlur", "nzFocus", "nzOnStep"], exportAs: ["nzInputNumber"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzColorFormatComponent, decorators: [{
type: Component,
@@ -1071,11 +1079,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
selector: 'nz-color-format',
exportAs: 'nzColorFormat',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ReactiveFormsModule, NzSelectModule, NzInputDirective, NzInputGroupComponent, NzInputNumberComponent],
imports: [ReactiveFormsModule, NzSelectModule, NzInputModule, NzInputNumberModule],
template: `
<div [formGroup]="validateForm" class="ant-color-picker-input-container">
<div class="ant-color-picker-input-container">
<div class="ant-color-picker-format-select">
<nz-select formControlName="isFormat" nzBorderless nzSize="small">
<nz-select [formControl]="validateForm.controls.isFormat" nzBorderless nzSize="small">
<nz-option nzValue="hex" nzLabel="HEX" />
<nz-option nzValue="hsb" nzLabel="HSB" />
<nz-option nzValue="rgb" nzLabel="RGB" />
@@ -1086,16 +1094,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
@switch (validateForm.controls.isFormat.value) {
@case ('hex') {
<div class="ant-color-picker-hex-input">
<nz-input-group nzPrefix="#" nzSize="small">
<input nz-input nzSize="small" formControlName="hex" />
</nz-input-group>
<nz-input-wrapper nzPrefix="#">
<input nz-input nzSize="small" [formControl]="validateForm.controls.hex" />
</nz-input-wrapper>
</div>
}
@case ('hsb') {
<div class="ant-color-picker-hsb-input">
<div class="ant-color-picker-steppers ant-color-picker-hsb-input">
<nz-input-number
formControlName="hsbH"
[formControl]="validateForm.controls.hsbH"
[nzMin]="0"
[nzMax]="360"
[nzStep]="1"
@@ -1105,7 +1113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
</div>
<div class="ant-color-picker-steppers ant-color-picker-hsb-input">
<nz-input-number
formControlName="hsbS"
[formControl]="validateForm.controls.hsbS"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
@@ -1116,7 +1124,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
</div>
<div class="ant-color-picker-steppers ant-color-picker-hsb-input">
<nz-input-number
formControlName="hsbB"
[formControl]="validateForm.controls.hsbB"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
@@ -1130,13 +1138,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
@default {
<div class="ant-color-picker-rgb-input">
<div class="ant-color-picker-steppers ant-color-picker-rgb-input">
<nz-input-number formControlName="rgbR" [nzMin]="0" [nzMax]="255" [nzStep]="1" nzSize="small" />
<nz-input-number
[formControl]="validateForm.controls.rgbR"
[nzMin]="0"
[nzMax]="255"
[nzStep]="1"
nzSize="small"
/>
</div>
<div class="ant-color-picker-steppers ant-color-picker-rgb-input">
<nz-input-number formControlName="rgbG" [nzMin]="0" [nzMax]="255" [nzStep]="1" nzSize="small" />
<nz-input-number
[formControl]="validateForm.controls.rgbG"
[nzMin]="0"
[nzMax]="255"
[nzStep]="1"
nzSize="small"
/>
</div>
<div class="ant-color-picker-steppers ant-color-picker-rgb-input">
<nz-input-number formControlName="rgbB" [nzMin]="0" [nzMax]="255" [nzStep]="1" nzSize="small" />
<nz-input-number
[formControl]="validateForm.controls.rgbB"
[nzMin]="0"
[nzMax]="255"
[nzStep]="1"
nzSize="small"
/>
</div>
</div>
}
@@ -1146,7 +1172,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
@if (!nzDisabledAlpha) {
<div class="ant-color-picker-steppers ant-color-picker-alpha-input">
<nz-input-number
formControlName="roundA"
[formControl]="validateForm.controls.roundA"
[nzMin]="0"
[nzMax]="100"
[nzStep]="1"
@@ -1174,6 +1200,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
}], nzOnFormatChange: [{
type: Output
}] } });
const hexValidator = (control) => {
const REGEXP = /^[0-9a-fA-F]{6}$/;
if (!control.value) {
return { error: true };
}
else if (!REGEXP.test(control.value)) {
return { error: true };
}
return null;
};
/**
* Use of this source code is governed by an MIT-style license that can be
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -1,6 +1,5 @@
import * as i0 from '@angular/core';
import { inject, booleanAttribute, Input, Directive, NgModule } from '@angular/core';
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
import { inject, ANIMATION_MODULE_TYPE, booleanAttribute, Input, Directive, NgModule } from '@angular/core';
/**
* Use of this source code is governed by an MIT-style license that can be
@@ -1 +1 @@
{"version":3,"file":"ng-zorro-antd-core-no-animation.mjs","sources":["../../components/core/no-animation/nz-no-animation.directive.ts","../../components/core/no-animation/nz-no-animation.module.ts","../../components/core/no-animation/public-api.ts","../../components/core/no-animation/ng-zorro-antd-core-no-animation.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, Input, booleanAttribute, inject } from '@angular/core';\nimport { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';\n\n@Directive({\n selector: '[nzNoAnimation]',\n exportAs: 'nzNoAnimation',\n host: {\n '[class.nz-animate-disabled]': `nzNoAnimation || animationType === 'NoopAnimations'`\n }\n})\nexport class NzNoAnimationDirective {\n animationType = inject(ANIMATION_MODULE_TYPE, { optional: true });\n @Input({ transform: booleanAttribute }) nzNoAnimation: boolean = false;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NzNoAnimationDirective } from './nz-no-animation.directive';\n\n@NgModule({\n imports: [NzNoAnimationDirective],\n exports: [NzNoAnimationDirective]\n})\nexport class NzNoAnimationModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport { NzNoAnimationModule } from './nz-no-animation.module';\nexport { NzNoAnimationDirective } from './nz-no-animation.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MAYU,sBAAsB,CAAA;IACjC,aAAa,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,aAAa,GAAY,KAAK;uGAF3D,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,+GAEb,gBAAgB,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,2BAAA,EAAA,qDAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAFzB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAAE;AACJ,wBAAA,6BAA6B,EAAE,CAAA,mDAAA;AAChC;AACF,iBAAA;8BAGyC,aAAa,EAAA,CAAA;sBAApD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;;ACjBxC;;;AAGG;MAUU,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,OAAA,EAAA,CAHpB,sBAAsB,CAAA,EAAA,OAAA,EAAA,CACtB,sBAAsB,CAAA,EAAA,CAAA;wGAErB,mBAAmB,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE,CAAC,sBAAsB;AACjC,iBAAA;;;ACZD;;;AAGG;;ACHH;;AAEG;;;;"}
{"version":3,"file":"ng-zorro-antd-core-no-animation.mjs","sources":["../../components/core/no-animation/nz-no-animation.directive.ts","../../components/core/no-animation/nz-no-animation.module.ts","../../components/core/no-animation/public-api.ts","../../components/core/no-animation/ng-zorro-antd-core-no-animation.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ANIMATION_MODULE_TYPE, booleanAttribute, Directive, inject, Input } from '@angular/core';\n\n@Directive({\n selector: '[nzNoAnimation]',\n exportAs: 'nzNoAnimation',\n host: {\n '[class.nz-animate-disabled]': `nzNoAnimation || animationType === 'NoopAnimations'`\n }\n})\nexport class NzNoAnimationDirective {\n animationType = inject(ANIMATION_MODULE_TYPE, { optional: true });\n @Input({ transform: booleanAttribute }) nzNoAnimation: boolean = false;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NzNoAnimationDirective } from './nz-no-animation.directive';\n\n@NgModule({\n imports: [NzNoAnimationDirective],\n exports: [NzNoAnimationDirective]\n})\nexport class NzNoAnimationModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport { NzNoAnimationModule } from './nz-no-animation.module';\nexport { NzNoAnimationDirective } from './nz-no-animation.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;MAWU,sBAAsB,CAAA;IACjC,aAAa,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzB,aAAa,GAAY,KAAK;uGAF3D,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,+GAEb,gBAAgB,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,2BAAA,EAAA,qDAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAFzB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAAE;AACJ,wBAAA,6BAA6B,EAAE,CAAA,mDAAA;AAChC;AACF,iBAAA;8BAGyC,aAAa,EAAA,CAAA;sBAApD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;;AChBxC;;;AAGG;MAUU,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAnB,mBAAmB,EAAA,OAAA,EAAA,CAHpB,sBAAsB,CAAA,EAAA,OAAA,EAAA,CACtB,sBAAsB,CAAA,EAAA,CAAA;wGAErB,mBAAmB,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,sBAAsB,CAAC;oBACjC,OAAO,EAAE,CAAC,sBAAsB;AACjC,iBAAA;;;ACZD;;;AAGG;;ACHH;;AAEG;;;;"}
+1 -2
View File
@@ -1,7 +1,6 @@
import { Platform } from '@angular/cdk/platform';
import * as i0 from '@angular/core';
import { InjectionToken, makeEnvironmentProviders, inject, CSP_NONCE, NgZone, ElementRef, Input, Directive, NgModule } from '@angular/core';
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
import { InjectionToken, makeEnvironmentProviders, inject, CSP_NONCE, ANIMATION_MODULE_TYPE, NgZone, ElementRef, Input, Directive, NgModule } from '@angular/core';
/**
* Use of this source code is governed by an MIT-style license that can be
File diff suppressed because one or more lines are too long
+21 -26
View File
@@ -49,9 +49,6 @@ let NzDropDownDirective = (() => {
injector = inject(Injector);
portal;
overlayRef = null;
positionStrategy = createFlexibleConnectedPositionStrategy(this.injector, this.elementRef.nativeElement)
.withLockedPosition()
.withTransformOriginOn('.ant-dropdown');
inputVisible$ = new BehaviorSubject(false);
nzTrigger$ = new BehaviorSubject('hover');
overlayClose$ = new Subject();
@@ -74,9 +71,7 @@ let NzDropDownDirective = (() => {
});
}
setDropdownMenuValue(key, value) {
if (this.nzDropdownMenu) {
this.nzDropdownMenu.setValue(key, value);
}
this.nzDropdownMenu?.setValue(key, value);
}
ngAfterViewInit() {
if (this.nzDropdownMenu) {
@@ -106,7 +101,7 @@ let NzDropDownDirective = (() => {
const visible$ = merge(this.inputVisible$, domTriggerVisible$);
combineLatest([visible$, this.nzDropdownMenu.isChildSubMenuOpen$])
.pipe(map(([visible, sub]) => visible || sub), auditTime(150), distinctUntilChanged(), filter(() => this.platform.isBrowser), takeUntilDestroyed(this.destroyRef))
.subscribe((visible) => {
.subscribe(visible => {
const element = this.nzMatchWidthElement ? this.nzMatchWidthElement.nativeElement : nativeElement;
const triggerWidth = element.getBoundingClientRect().width;
if (this.nzVisible !== visible) {
@@ -114,26 +109,30 @@ let NzDropDownDirective = (() => {
}
this.nzVisible = visible;
if (visible) {
const positionStrategy = createFlexibleConnectedPositionStrategy(this.injector, this.elementRef.nativeElement)
.withLockedPosition()
.withTransformOriginOn('.ant-dropdown');
// Listen for placement changes to update the menu classes (arrow position)
positionStrategy.positionChanges
.pipe(filter(() => Boolean(this.overlayRef)), map(change => getPlacementName(change)), takeUntilDestroyed(this.destroyRef))
.subscribe(placement => {
if (placement) {
this.setDropdownMenuValue('placement', normalizePlacementForClass(placement));
}
});
/** set up overlayRef **/
if (!this.overlayRef) {
/** new overlay **/
this.overlayRef = createOverlayRef(this.injector, {
positionStrategy: this.positionStrategy,
positionStrategy,
minWidth: triggerWidth,
disposeOnNavigation: true,
hasBackdrop: this.nzBackdrop && this.nzTrigger === 'click',
scrollStrategy: createRepositionScrollStrategy(this.injector)
});
// Listen for placement changes to update the menu classes (arrow position)
this.positionStrategy.positionChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(change => {
const placement = getPlacementName(change);
if (placement) {
this.setDropdownMenuValue('placement', normalizePlacementForClass(placement));
}
});
merge(this.overlayRef.backdropClick(), this.overlayRef.detachments(), this.overlayRef
.outsidePointerEvents()
.pipe(filter((e) => !this.elementRef.nativeElement.contains(e.target))), this.overlayRef.keydownEvents().pipe(filter(e => e.keyCode === ESCAPE && !hasModifierKey(e))))
.pipe(filter(e => !this.elementRef.nativeElement.contains(e.target))), this.overlayRef.keydownEvents().pipe(filter(e => e.keyCode === ESCAPE && !hasModifierKey(e))))
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(() => {
this.overlayClose$.next(false);
@@ -150,7 +149,7 @@ let NzDropDownDirective = (() => {
? setConnectedPositionOffset(POSITION_MAP[position], TOOLTIP_OFFSET_MAP[position])
: POSITION_MAP[position];
});
this.positionStrategy.withPositions(positions);
positionStrategy.withPositions(positions);
/** reset portal if needed **/
if (!this.portal || this.portal.templateRef !== this.nzDropdownMenu.templateRef) {
this.portal = new TemplatePortal(this.nzDropdownMenu.templateRef, this.viewContainerRef);
@@ -162,16 +161,12 @@ let NzDropDownDirective = (() => {
}
else {
/** detach overlayRef if needed **/
if (this.overlayRef) {
this.overlayRef.detach();
}
this.overlayRef?.detach();
}
});
this.nzDropdownMenu.animationStateChange$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(event => {
if (event.toState === 'void') {
if (this.overlayRef) {
this.overlayRef.dispose();
}
this.overlayRef?.dispose();
this.overlayRef = null;
}
});
@@ -308,16 +303,17 @@ class NzDropdownMenuComponent {
viewContainerRef = inject(ViewContainerRef);
directionality = inject(Directionality);
destroyRef = inject(DestroyRef);
mouseState$ = new BehaviorSubject(false);
noAnimation = inject(NzNoAnimationDirective, { host: true, optional: true });
nzMenuService = inject(MenuService);
isChildSubMenuOpen$ = this.nzMenuService.isChildSubMenuOpen$;
descendantMenuItemClick$ = this.nzMenuService.descendantMenuItemClick$;
mouseState$ = new BehaviorSubject(false);
animationStateChange$ = new EventEmitter();
templateRef;
nzOverlayClassName = '';
nzOverlayStyle = {};
nzArrow = false;
placement = 'bottomLeft';
templateRef;
dir = 'ltr';
onAnimationEvent(event) {
this.animationStateChange$.emit(event);
@@ -329,7 +325,6 @@ class NzDropdownMenuComponent {
this[key] = value;
this.cdr.markForCheck();
}
noAnimation = inject(NzNoAnimationDirective, { host: true, optional: true });
ngOnInit() {
this.directionality.change?.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(direction => {
this.dir = direction;
File diff suppressed because one or more lines are too long
+12 -3
View File
@@ -1,5 +1,5 @@
import * as i0 from '@angular/core';
import { inject, ChangeDetectorRef, ViewEncapsulation, ChangeDetectionStrategy, Component, DestroyRef, input, booleanAttribute, Input, Directive, ContentChild, computed, NgModule } from '@angular/core';
import { inject, ChangeDetectorRef, ViewEncapsulation, ChangeDetectionStrategy, Component, DestroyRef, input, booleanAttribute, Input, Directive, ANIMATION_MODULE_TYPE, ContentChild, computed, NgModule } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { AbstractControl, NgModel, FormControlName, FormControlDirective, NgControl } from '@angular/forms';
import { Subject, Subscription } from 'rxjs';
@@ -169,6 +169,7 @@ class NzFormControlComponent {
i18n = inject(NzI18nService);
nzFormStatusService = inject(NzFormStatusService);
destroyRef = inject(DestroyRef);
animationType = inject(ANIMATION_MODULE_TYPE, { optional: true });
_hasFeedback = false;
validateChanges = Subscription.EMPTY;
validateString = null;
@@ -354,7 +355,11 @@ class NzFormControlComponent {
</div>
</div>
@if (innerTip) {
<div @helpMotion class="ant-form-item-explain ant-form-item-explain-connected">
<div
@helpMotion
[@.disabled]="animationType === 'NoopAnimations'"
class="ant-form-item-explain ant-form-item-explain-connected"
>
<div role="alert" [class]="['ant-form-item-explain-' + status]">
<ng-container *nzStringTemplateOutlet="innerTip; context: { $implicit: validateControl }">{{
innerTip
@@ -385,7 +390,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
</div>
</div>
@if (innerTip) {
<div @helpMotion class="ant-form-item-explain ant-form-item-explain-connected">
<div
@helpMotion
[@.disabled]="animationType === 'NoopAnimations'"
class="ant-form-item-explain ant-form-item-explain-connected"
>
<div role="alert" [class]="['ant-form-item-explain-' + status]">
<ng-container *nzStringTemplateOutlet="innerTip; context: { $implicit: validateControl }">{{
innerTip
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -207,8 +207,8 @@ class NzIconDirective extends IconDirective {
this.el = this._elementRef.nativeElement;
}
ngOnChanges(changes) {
const { nzType, nzTwotoneColor, nzTheme, nzRotate } = changes;
if (nzType || nzTwotoneColor || nzTheme) {
const { nzType, nzTwotoneColor, nzTheme, nzRotate, nzSpin } = changes;
if (nzType || nzTwotoneColor || nzTheme || nzSpin) {
// This is used to reduce the number of change detections
// while the icon is being loaded asynchronously.
this.ngZone.runOutsideAngular(() => this.changeIcon2());
File diff suppressed because one or more lines are too long
+62 -58
View File
@@ -1,6 +1,6 @@
import { Platform } from '@angular/cdk/platform';
import * as i0 from '@angular/core';
import { inject, NgZone, DestroyRef, ElementRef, Input, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component, input, model, contentChild, booleanAttribute, output, computed, InjectionToken, ViewContainerRef, signal, linkedSignal, effect, Renderer2, ChangeDetectorRef, ContentChildren, forwardRef, numberAttribute, ViewChildren, TemplateRef, afterNextRender, isDevMode, ContentChild, NgModule } from '@angular/core';
import { inject, NgZone, DestroyRef, ElementRef, Input, Directive, ChangeDetectionStrategy, ViewEncapsulation, Component, input, model, InjectionToken, ViewContainerRef, signal, booleanAttribute, linkedSignal, computed, effect, Renderer2, ChangeDetectorRef, ContentChildren, forwardRef, numberAttribute, ViewChildren, contentChild, output, TemplateRef, afterNextRender, isDevMode, ContentChild, NgModule } from '@angular/core';
import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
import { NzResizeService } from 'ng-zorro-antd/core/services';
import * as i2 from 'ng-zorro-antd/core/outlet';
@@ -332,60 +332,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
}]
}] });
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
class NzInputSearchDirective {
inputDir = contentChild.required(NzInputDirective);
inputRef = contentChild.required(NzInputDirective, { read: ElementRef });
nzEnterButton = input(false, ...(ngDevMode ? [{ debugName: "nzEnterButton" }] : []));
nzLoading = input(false, ...(ngDevMode ? [{ debugName: "nzLoading", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
nzSearch = output();
size = computed(() => this.inputDir().nzSize(), ...(ngDevMode ? [{ debugName: "size" }] : []));
search(event, source = 'input') {
if (!this.nzLoading()) {
this.nzSearch.emit({ value: this.inputRef().nativeElement.value, event, source });
}
}
onEnter(event) {
if (event.target === this.inputRef().nativeElement) {
this.search(event);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.0", type: NzInputSearchDirective, isStandalone: true, selector: "nz-input-search", inputs: { nzEnterButton: { classPropertyName: "nzEnterButton", publicName: "nzEnterButton", isSignal: true, isRequired: false, transformFunction: null }, nzLoading: { classPropertyName: "nzLoading", publicName: "nzLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nzSearch: "nzSearch" }, host: { listeners: { "keydown.enter": "onEnter($any($event))" }, properties: { "class.ant-input-search-large": "size() === 'large'", "class.ant-input-search-small": "size() === 'small'", "class.ant-input-search-with-button": "nzEnterButton() !== false" }, classAttribute: "ant-input-search" }, queries: [{ propertyName: "inputDir", first: true, predicate: NzInputDirective, descendants: true, isSignal: true }, { propertyName: "inputRef", first: true, predicate: NzInputDirective, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["nzInputSearch"], ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchDirective, decorators: [{
type: Directive,
args: [{
selector: 'nz-input-search',
exportAs: 'nzInputSearch',
host: {
class: 'ant-input-search',
'[class.ant-input-search-large]': `size() === 'large'`,
'[class.ant-input-search-small]': `size() === 'small'`,
'[class.ant-input-search-with-button]': 'nzEnterButton() !== false',
'(keydown.enter)': 'onEnter($any($event))'
}
}]
}] });
class NzInputSearchEnterButtonDirective {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchEnterButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: NzInputSearchEnterButtonDirective, isStandalone: true, selector: "[nzInputSearchEnterButton]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchEnterButtonDirective, decorators: [{
type: Directive,
args: [{
selector: '[nzInputSearchEnterButton]'
}]
}] });
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
const NZ_INPUT_WRAPPER = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'nz-input-wrapper' : '');
const NZ_INPUT_SEARCH = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'nz-input-search' : '');
/**
* Use of this source code is governed by an MIT-style license that can be
@@ -402,7 +354,7 @@ class NzInputDirective {
focusMonitor = inject(FocusMonitor);
hostView = inject(ViewContainerRef);
inputPasswordDir = inject(NzInputPasswordDirective, { host: true, optional: true });
inputSearchDir = inject(NzInputSearchDirective, { host: true, optional: true });
inputSearchDir = inject(NZ_INPUT_SEARCH, { host: true, optional: true });
ngControl = inject(NgControl, { self: true, optional: true });
value = signal(this.elementRef.nativeElement.value, ...(ngDevMode ? [{ debugName: "value" }] : []));
/**
@@ -1051,6 +1003,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
type: Input
}] } });
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
class NzInputSearchDirective {
inputDir = contentChild.required(NzInputDirective);
inputRef = contentChild.required(NzInputDirective, { read: ElementRef });
nzEnterButton = input(false, ...(ngDevMode ? [{ debugName: "nzEnterButton" }] : []));
nzLoading = input(false, ...(ngDevMode ? [{ debugName: "nzLoading", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
nzSearch = output();
size = computed(() => this.inputDir().nzSize(), ...(ngDevMode ? [{ debugName: "size" }] : []));
search(event, source = 'input') {
if (!this.nzLoading()) {
this.nzSearch.emit({ value: this.inputRef().nativeElement.value, event, source });
}
}
onEnter(event) {
if (event.target === this.inputRef().nativeElement) {
this.search(event);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "20.3.0", type: NzInputSearchDirective, isStandalone: true, selector: "nz-input-search", inputs: { nzEnterButton: { classPropertyName: "nzEnterButton", publicName: "nzEnterButton", isSignal: true, isRequired: false, transformFunction: null }, nzLoading: { classPropertyName: "nzLoading", publicName: "nzLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nzSearch: "nzSearch" }, host: { listeners: { "keydown.enter": "onEnter($any($event))" }, properties: { "class.ant-input-search-large": "size() === 'large'", "class.ant-input-search-small": "size() === 'small'", "class.ant-input-search-with-button": "nzEnterButton() !== false" }, classAttribute: "ant-input-search" }, providers: [{ provide: NZ_INPUT_SEARCH, useExisting: forwardRef(() => NzInputSearchDirective) }], queries: [{ propertyName: "inputDir", first: true, predicate: NzInputDirective, descendants: true, isSignal: true }, { propertyName: "inputRef", first: true, predicate: NzInputDirective, descendants: true, read: ElementRef, isSignal: true }], exportAs: ["nzInputSearch"], ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchDirective, decorators: [{
type: Directive,
args: [{
selector: 'nz-input-search',
exportAs: 'nzInputSearch',
providers: [{ provide: NZ_INPUT_SEARCH, useExisting: forwardRef(() => NzInputSearchDirective) }],
host: {
class: 'ant-input-search',
'[class.ant-input-search-large]': `size() === 'large'`,
'[class.ant-input-search-small]': `size() === 'small'`,
'[class.ant-input-search-with-button]': 'nzEnterButton() !== false',
'(keydown.enter)': 'onEnter($any($event))'
}
}]
}] });
class NzInputSearchEnterButtonDirective {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchEnterButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: NzInputSearchEnterButtonDirective, isStandalone: true, selector: "[nzInputSearchEnterButton]", ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzInputSearchEnterButtonDirective, decorators: [{
type: Directive,
args: [{
selector: '[nzInputSearchEnterButton]'
}]
}] });
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
@@ -1176,7 +1178,8 @@ class NzInputWrapperComponent {
@if (hasAddonAfter()) {
<span class="ant-input-group-addon">
@if (inputSearchDir) {
@let hasEnterButton = inputSearchEnterButton() ?? inputSearchDir.nzEnterButton() !== false;
@let nzEnterButton = inputSearchDir.nzEnterButton();
@let hasEnterButton = inputSearchEnterButton() ?? nzEnterButton !== false;
<button
nz-button
[nzType]="hasEnterButton ? 'primary' : 'default'"
@@ -1187,8 +1190,8 @@ class NzInputWrapperComponent {
(click)="inputSearchDir.search($event)"
>
<ng-content select="[nzInputSearchEnterButton]">
@if (typeof inputSearchDir.nzEnterButton() === 'string') {
{{ inputSearchDir.nzEnterButton() }}
@if (nzEnterButton && typeof nzEnterButton === 'string') {
{{ nzEnterButton }}
} @else {
<nz-icon nzType="search" nzTheme="outline" />
}
@@ -1294,7 +1297,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
@if (hasAddonAfter()) {
<span class="ant-input-group-addon">
@if (inputSearchDir) {
@let hasEnterButton = inputSearchEnterButton() ?? inputSearchDir.nzEnterButton() !== false;
@let nzEnterButton = inputSearchDir.nzEnterButton();
@let hasEnterButton = inputSearchEnterButton() ?? nzEnterButton !== false;
<button
nz-button
[nzType]="hasEnterButton ? 'primary' : 'default'"
@@ -1305,8 +1309,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
(click)="inputSearchDir.search($event)"
>
<ng-content select="[nzInputSearchEnterButton]">
@if (typeof inputSearchDir.nzEnterButton() === 'string') {
{{ inputSearchDir.nzEnterButton() }}
@if (nzEnterButton && typeof nzEnterButton === 'string') {
{{ nzEnterButton }}
} @else {
<nz-icon nzType="search" nzTheme="outline" />
}
@@ -1541,5 +1545,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
* Generated bundle index. Do not edit.
*/
export { NZ_INPUT_WRAPPER, NzAutosizeDirective, NzInputAddonAfterDirective, NzInputAddonBeforeDirective, NzInputDirective, NzInputGroupComponent, NzInputGroupSlotComponent, NzInputGroupWhitSuffixOrPrefixDirective, NzInputModule, NzInputOtpComponent, NzInputPasswordDirective, NzInputPasswordIconDirective, NzInputPrefixDirective, NzInputSearchDirective, NzInputSearchEnterButtonDirective, NzInputSuffixDirective, NzInputWrapperComponent, NzTextareaCountComponent };
export { NZ_INPUT_SEARCH, NZ_INPUT_WRAPPER, NzAutosizeDirective, NzInputAddonAfterDirective, NzInputAddonBeforeDirective, NzInputDirective, NzInputGroupComponent, NzInputGroupSlotComponent, NzInputGroupWhitSuffixOrPrefixDirective, NzInputModule, NzInputOtpComponent, NzInputPasswordDirective, NzInputPasswordIconDirective, NzInputPrefixDirective, NzInputSearchDirective, NzInputSearchEnterButtonDirective, NzInputSuffixDirective, NzInputWrapperComponent, NzTextareaCountComponent };
//# sourceMappingURL=ng-zorro-antd-input.mjs.map
File diff suppressed because one or more lines are too long
+57 -82
View File
@@ -1,7 +1,6 @@
import * as i0 from '@angular/core';
import { ViewEncapsulation, ChangeDetectionStrategy, Component, Directive, inject, ChangeDetectorRef, DestroyRef, Input, NgModule } from '@angular/core';
import { ViewEncapsulation, ChangeDetectionStrategy, Component, Directive, inject, input, computed, NgModule } from '@angular/core';
import { Directionality } from '@angular/cdk/bidi';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import * as i1 from 'ng-zorro-antd/core/outlet';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import * as i2 from 'ng-zorro-antd/icon';
@@ -1770,12 +1769,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
}] });
class NzResultIconDirective {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzResultIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: NzResultIconDirective, isStandalone: true, selector: "i[nz-result-icon], div[nz-result-icon]", exportAs: ["nzResultIcon"], ngImport: i0 });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: NzResultIconDirective, isStandalone: true, selector: "[nz-result-icon]", exportAs: ["nzResultIcon"], ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzResultIconDirective, decorators: [{
type: Directive,
args: [{
selector: 'i[nz-result-icon], div[nz-result-icon]',
selector: '[nz-result-icon]',
exportAs: 'nzResultIcon'
}]
}] });
@@ -1820,51 +1819,40 @@ const IconMap = {
};
const ExceptionStatus = ['404', '500', '403'];
class NzResultComponent {
cdr = inject(ChangeDetectorRef);
directionality = inject(Directionality);
destroyRef = inject(DestroyRef);
nzIcon;
nzTitle;
nzStatus = 'info';
nzSubTitle;
nzExtra;
icon;
isException = false;
dir = 'ltr';
ngOnInit() {
this.directionality.change?.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(direction => {
this.dir = direction;
this.cdr.detectChanges();
});
this.dir = this.directionality.value;
}
ngOnChanges() {
this.setStatusIcon();
}
setStatusIcon() {
const icon = this.nzIcon;
this.isException = ExceptionStatus.indexOf(this.nzStatus) !== -1;
this.icon = icon
? typeof icon === 'string'
? IconMap[icon] || icon
: icon
: this.isException
? undefined
: IconMap[this.nzStatus];
}
dir = inject(Directionality).valueSignal;
nzIcon = input(...(ngDevMode ? [undefined, { debugName: "nzIcon" }] : []));
nzTitle = input(...(ngDevMode ? [undefined, { debugName: "nzTitle" }] : []));
nzSubTitle = input(...(ngDevMode ? [undefined, { debugName: "nzSubTitle" }] : []));
nzExtra = input(...(ngDevMode ? [undefined, { debugName: "nzExtra" }] : []));
nzStatus = input('info', ...(ngDevMode ? [{ debugName: "nzStatus" }] : []));
class = computed(() => {
return {
'ant-result': true,
[`ant-result-${this.nzStatus()}`]: true,
'ant-result-rtl': this.dir() === 'rtl'
};
}, ...(ngDevMode ? [{ debugName: "class" }] : []));
isException = computed(() => ExceptionStatus.indexOf(this.nzStatus()) !== -1, ...(ngDevMode ? [{ debugName: "isException" }] : []));
icon = computed(() => {
const icon = this.nzIcon();
return typeof icon === 'string' ? IconMap[icon] || icon : icon;
}, ...(ngDevMode ? [{ debugName: "icon" }] : []));
defaultIcon = computed(() => IconMap[this.nzStatus()], ...(ngDevMode ? [{ debugName: "defaultIcon" }] : []));
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzResultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzResultComponent, isStandalone: true, selector: "nz-result", inputs: { nzIcon: "nzIcon", nzTitle: "nzTitle", nzStatus: "nzStatus", nzSubTitle: "nzSubTitle", nzExtra: "nzExtra" }, host: { properties: { "class.ant-result-success": "nzStatus === 'success'", "class.ant-result-error": "nzStatus === 'error'", "class.ant-result-info": "nzStatus === 'info'", "class.ant-result-warning": "nzStatus === 'warning'", "class.ant-result-rtl": "dir === 'rtl'" }, classAttribute: "ant-result" }, exportAs: ["nzResult"], usesOnChanges: true, ngImport: i0, template: `
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzResultComponent, isStandalone: true, selector: "nz-result", inputs: { nzIcon: { classPropertyName: "nzIcon", publicName: "nzIcon", isSignal: true, isRequired: false, transformFunction: null }, nzTitle: { classPropertyName: "nzTitle", publicName: "nzTitle", isSignal: true, isRequired: false, transformFunction: null }, nzSubTitle: { classPropertyName: "nzSubTitle", publicName: "nzSubTitle", isSignal: true, isRequired: false, transformFunction: null }, nzExtra: { classPropertyName: "nzExtra", publicName: "nzExtra", isSignal: true, isRequired: false, transformFunction: null }, nzStatus: { classPropertyName: "nzStatus", publicName: "nzStatus", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "class()" } }, exportAs: ["nzResult"], ngImport: i0, template: `
<div class="ant-result-icon">
@if (!isException) {
@if (icon) {
<ng-container *nzStringTemplateOutlet="icon; let icon">
@if (!isException()) {
@if (icon()) {
<ng-container *nzStringTemplateOutlet="icon(); let icon">
<nz-icon [nzType]="icon" nzTheme="fill" />
</ng-container>
} @else {
<ng-content select="[nz-result-icon]"></ng-content>
<ng-content select="[nz-result-icon]">
<nz-icon [nzType]="defaultIcon()" nzTheme="fill" />
</ng-content>
}
} @else {
@switch (nzStatus) {
@switch (nzStatus()) {
@case ('404') {
<nz-result-not-found />
}
@@ -1877,25 +1865,25 @@ class NzResultComponent {
}
}
</div>
@if (nzTitle) {
<div class="ant-result-title" *nzStringTemplateOutlet="nzTitle">
{{ nzTitle }}
@if (nzTitle()) {
<div class="ant-result-title" *nzStringTemplateOutlet="nzTitle()">
{{ nzTitle() }}
</div>
} @else {
<ng-content select="div[nz-result-title]"></ng-content>
}
@if (nzSubTitle) {
<div class="ant-result-subtitle" *nzStringTemplateOutlet="nzSubTitle">
{{ nzSubTitle }}
@if (nzSubTitle()) {
<div class="ant-result-subtitle" *nzStringTemplateOutlet="nzSubTitle()">
{{ nzSubTitle() }}
</div>
} @else {
<ng-content select="div[nz-result-subtitle]"></ng-content>
}
<ng-content select="nz-result-content, [nz-result-content]"></ng-content>
@if (nzExtra) {
<div class="ant-result-extra" *nzStringTemplateOutlet="nzExtra">
{{ nzExtra }}
@if (nzExtra()) {
<div class="ant-result-extra" *nzStringTemplateOutlet="nzExtra()">
{{ nzExtra() }}
</div>
} @else {
<ng-content select="div[nz-result-extra]"></ng-content>
@@ -1909,16 +1897,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
exportAs: 'nzResult',
template: `
<div class="ant-result-icon">
@if (!isException) {
@if (icon) {
<ng-container *nzStringTemplateOutlet="icon; let icon">
@if (!isException()) {
@if (icon()) {
<ng-container *nzStringTemplateOutlet="icon(); let icon">
<nz-icon [nzType]="icon" nzTheme="fill" />
</ng-container>
} @else {
<ng-content select="[nz-result-icon]"></ng-content>
<ng-content select="[nz-result-icon]">
<nz-icon [nzType]="defaultIcon()" nzTheme="fill" />
</ng-content>
}
} @else {
@switch (nzStatus) {
@switch (nzStatus()) {
@case ('404') {
<nz-result-not-found />
}
@@ -1931,37 +1921,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
}
}
</div>
@if (nzTitle) {
<div class="ant-result-title" *nzStringTemplateOutlet="nzTitle">
{{ nzTitle }}
@if (nzTitle()) {
<div class="ant-result-title" *nzStringTemplateOutlet="nzTitle()">
{{ nzTitle() }}
</div>
} @else {
<ng-content select="div[nz-result-title]"></ng-content>
}
@if (nzSubTitle) {
<div class="ant-result-subtitle" *nzStringTemplateOutlet="nzSubTitle">
{{ nzSubTitle }}
@if (nzSubTitle()) {
<div class="ant-result-subtitle" *nzStringTemplateOutlet="nzSubTitle()">
{{ nzSubTitle() }}
</div>
} @else {
<ng-content select="div[nz-result-subtitle]"></ng-content>
}
<ng-content select="nz-result-content, [nz-result-content]"></ng-content>
@if (nzExtra) {
<div class="ant-result-extra" *nzStringTemplateOutlet="nzExtra">
{{ nzExtra }}
@if (nzExtra()) {
<div class="ant-result-extra" *nzStringTemplateOutlet="nzExtra()">
{{ nzExtra() }}
</div>
} @else {
<ng-content select="div[nz-result-extra]"></ng-content>
}
`,
host: {
class: 'ant-result',
'[class.ant-result-success]': `nzStatus === 'success'`,
'[class.ant-result-error]': `nzStatus === 'error'`,
'[class.ant-result-info]': `nzStatus === 'info'`,
'[class.ant-result-warning]': `nzStatus === 'warning'`,
'[class.ant-result-rtl]': `dir === 'rtl'`
'[class]': 'class()'
},
imports: [
NzOutletModule,
@@ -1973,17 +1958,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
}]
}], propDecorators: { nzIcon: [{
type: Input
}], nzTitle: [{
type: Input
}], nzStatus: [{
type: Input
}], nzSubTitle: [{
type: Input
}], nzExtra: [{
type: Input
}] } });
}] });
/**
* Use of this source code is governed by an MIT-style license that can be
File diff suppressed because one or more lines are too long
+9 -3
View File
@@ -1,13 +1,13 @@
import { LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
import { NgTemplateOutlet } from '@angular/common';
import * as i0 from '@angular/core';
import { inject, signal, Injectable, ElementRef, DestroyRef, viewChild, TemplateRef, input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, ChangeDetectorRef, Injector, EventEmitter, viewChildren, contentChildren, afterNextRender, effect, forwardRef, Output, Input, NgModule } from '@angular/core';
import { inject, signal, Injectable, ANIMATION_MODULE_TYPE, ElementRef, DestroyRef, viewChild, TemplateRef, input, booleanAttribute, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, ChangeDetectorRef, Injector, EventEmitter, viewChildren, contentChildren, afterNextRender, effect, forwardRef, Output, Input, NgModule } from '@angular/core';
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ReplaySubject, Subject, of } from 'rxjs';
import { tap, switchMap, filter, take, map, bufferCount } from 'rxjs/operators';
import * as i1 from 'ng-zorro-antd/icon';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { _IdGenerator } from '@angular/cdk/a11y';
import { ReplaySubject, Subject } from 'rxjs';
import { __esDecorate, __runInitializers } from 'tslib';
import { Directionality } from '@angular/cdk/bidi';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
@@ -47,6 +47,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
class NzSegmentedItemComponent {
animationType = inject(ANIMATION_MODULE_TYPE, { optional: true });
service = inject(NzSegmentedService);
elementRef = inject(ElementRef);
destroyRef = inject(DestroyRef);
@@ -68,7 +69,12 @@ class NzSegmentedItemComponent {
if (value === this.nzValue()) {
this.service.activated$.next(this.elementRef.nativeElement);
}
}), switchMap(value => this.service.animationDone$.pipe(filter(event => event.toState === 'to' || event.toState === 'toVertical'), take(1), map(() => value))), filter(value => value === this.nzValue()), takeUntilDestroyed(this.destroyRef))
}), switchMap(value => {
if (this.animationType === 'NoopAnimations') {
return of(value);
}
return this.service.animationDone$.pipe(filter(event => event.toState === 'to' || event.toState === 'toVertical'), take(1), map(() => value));
}), filter(value => value === this.nzValue()), takeUntilDestroyed(this.destroyRef))
.subscribe(() => this.isChecked.set(true));
}
handleClick() {
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -1,5 +1,5 @@
import * as i0 from '@angular/core';
import { inject, ElementRef, Input, Component, input, TemplateRef, Directive, ChangeDetectionStrategy, ViewEncapsulation, booleanAttribute, EventEmitter, ChangeDetectorRef, Output, NgZone, DestroyRef, computed, ContentChildren, ViewChild, InjectionToken, ContentChild, QueryList, contentChildren, HOST_TAG_NAME, forwardRef, NgModule } from '@angular/core';
import { inject, ElementRef, Input, Component, input, TemplateRef, Directive, ChangeDetectionStrategy, ViewEncapsulation, booleanAttribute, EventEmitter, ChangeDetectorRef, Output, NgZone, DestroyRef, ANIMATION_MODULE_TYPE, computed, ContentChildren, ViewChild, InjectionToken, ContentChild, QueryList, contentChildren, HOST_TAG_NAME, forwardRef, NgModule } from '@angular/core';
import * as i1 from 'ng-zorro-antd/core/outlet';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import * as i2 from 'ng-zorro-antd/icon';
@@ -22,7 +22,6 @@ import { NzDropdownMenuComponent, NzDropDownDirective } from 'ng-zorro-antd/drop
import * as i3 from 'ng-zorro-antd/menu';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import { fromEventOutsideAngular, wrapIntoObservable } from 'ng-zorro-antd/core/util';
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
import { __esDecorate, __runInitializers } from 'tslib';
import { WithConfig, NzConfigService } from 'ng-zorro-antd/core/config';
import { warn, PREFIX } from 'ng-zorro-antd/core/logger';
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -4,7 +4,7 @@ import { Version } from '@angular/core';
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
const VERSION = new Version('20.4.0');
const VERSION = new Version('20.4.4');
/**
* Use of this source code is governed by an MIT-style license that can be
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"ng-zorro-antd-version.mjs","sources":["../../components/version/version.ts","../../components/version/public-api.ts","../../components/version/ng-zorro-antd-version.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Version } from '@angular/core';\n\nexport const VERSION = new Version('20.4.0');\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './version';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;AAGG;MAIU,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ;;ACP3C;;;AAGG;;ACHH;;AAEG;;;;"}
{"version":3,"file":"ng-zorro-antd-version.mjs","sources":["../../components/version/version.ts","../../components/version/public-api.ts","../../components/version/ng-zorro-antd-version.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Version } from '@angular/core';\n\nexport const VERSION = new Version('20.4.4');\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './version';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;AAGG;MAIU,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ;;ACP3C;;;AAGG;;ACHH;;AAEG;;;;"}
+1
View File
@@ -34,6 +34,7 @@ declare class NzFormControlComponent implements OnChanges, OnInit, AfterContentI
i18n: NzI18nService;
private nzFormStatusService;
private destroyRef;
protected readonly animationType: "NoopAnimations" | "BrowserAnimations" | null;
private _hasFeedback;
private validateChanges;
private validateString;
+40 -39
View File
@@ -1,5 +1,5 @@
import * as _angular_core from '@angular/core';
import { AfterViewInit, DoCheck, TemplateRef, OnInit, ViewContainerRef, ComponentRef, ElementRef, AfterContentInit, OnChanges, QueryList, SimpleChanges, InjectionToken } from '@angular/core';
import { AfterViewInit, DoCheck, TemplateRef, OnInit, ComponentRef, ElementRef, AfterContentInit, OnChanges, QueryList, SimpleChanges, InjectionToken } from '@angular/core';
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
import { Direction } from '@angular/cdk/bidi';
import * as ng_zorro_antd_core_types from 'ng-zorro-antd/core/types';
@@ -76,40 +76,6 @@ declare class NzInputGroupSlotComponent {
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NzInputGroupSlotComponent, "[nz-input-group-slot]", never, { "icon": { "alias": "icon"; "required": false; }; "type": { "alias": "type"; "required": false; }; "template": { "alias": "template"; "required": false; }; }, {}, never, ["*"], true, never>;
}
declare class NzInputPasswordDirective {
readonly nzVisibilityToggle: _angular_core.InputSignal<boolean>;
readonly nzVisible: _angular_core.ModelSignal<boolean>;
toggleVisible(): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputPasswordDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputPasswordDirective, "nz-input-password", ["nzInputPassword"], { "nzVisibilityToggle": { "alias": "nzVisibilityToggle"; "required": false; "isSignal": true; }; "nzVisible": { "alias": "nzVisible"; "required": false; "isSignal": true; }; }, { "nzVisible": "nzVisibleChange"; }, never, never, true, never>;
}
declare class NzInputPasswordIconDirective {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputPasswordIconDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputPasswordIconDirective, "[nzInputPasswordIcon]", never, {}, {}, never, never, true, never>;
}
declare class NzInputSearchDirective {
private readonly inputDir;
private readonly inputRef;
readonly nzEnterButton: _angular_core.InputSignal<string | boolean>;
readonly nzLoading: _angular_core.InputSignalWithTransform<boolean, unknown>;
readonly nzSearch: _angular_core.OutputEmitterRef<NzInputSearchEvent>;
readonly size: _angular_core.Signal<ng_zorro_antd_core_types.NzSizeLDSType>;
search(event: Event, source?: 'input' | 'clear'): void;
onEnter(event: KeyboardEvent): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputSearchDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputSearchDirective, "nz-input-search", ["nzInputSearch"], { "nzEnterButton": { "alias": "nzEnterButton"; "required": false; "isSignal": true; }; "nzLoading": { "alias": "nzLoading"; "required": false; "isSignal": true; }; }, { "nzSearch": "nzSearch"; }, ["inputDir", "inputRef"], never, true, never>;
}
declare class NzInputSearchEnterButtonDirective {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputSearchEnterButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputSearchEnterButtonDirective, "[nzInputSearchEnterButton]", never, {}, {}, never, never, true, never>;
}
interface NzInputSearchEvent {
value: string;
event: Event;
source: 'clear' | 'input';
}
declare class NzInputDirective implements OnInit {
private elementRef;
private compactSize;
@@ -118,9 +84,9 @@ declare class NzInputDirective implements OnInit {
private nzFormNoStatusService;
private inputWrapper;
private focusMonitor;
protected hostView: ViewContainerRef;
protected readonly inputPasswordDir: NzInputPasswordDirective | null;
protected readonly inputSearchDir: NzInputSearchDirective | null;
private hostView;
private readonly inputPasswordDir;
private readonly inputSearchDir;
readonly ngControl: NgControl | null;
readonly value: _angular_core.WritableSignal<string>;
/**
@@ -245,6 +211,40 @@ declare class NzInputOtpComponent implements ControlValueAccessor, OnChanges {
static ngAcceptInputType_disabled: unknown;
}
declare class NzInputPasswordDirective {
readonly nzVisibilityToggle: _angular_core.InputSignal<boolean>;
readonly nzVisible: _angular_core.ModelSignal<boolean>;
toggleVisible(): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputPasswordDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputPasswordDirective, "nz-input-password", ["nzInputPassword"], { "nzVisibilityToggle": { "alias": "nzVisibilityToggle"; "required": false; "isSignal": true; }; "nzVisible": { "alias": "nzVisible"; "required": false; "isSignal": true; }; }, { "nzVisible": "nzVisibleChange"; }, never, never, true, never>;
}
declare class NzInputPasswordIconDirective {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputPasswordIconDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputPasswordIconDirective, "[nzInputPasswordIcon]", never, {}, {}, never, never, true, never>;
}
declare class NzInputSearchDirective {
private readonly inputDir;
private readonly inputRef;
readonly nzEnterButton: _angular_core.InputSignal<string | boolean>;
readonly nzLoading: _angular_core.InputSignalWithTransform<boolean, unknown>;
readonly nzSearch: _angular_core.OutputEmitterRef<NzInputSearchEvent>;
readonly size: _angular_core.Signal<ng_zorro_antd_core_types.NzSizeLDSType>;
search(event: Event, source?: 'input' | 'clear'): void;
onEnter(event: KeyboardEvent): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputSearchDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputSearchDirective, "nz-input-search", ["nzInputSearch"], { "nzEnterButton": { "alias": "nzEnterButton"; "required": false; "isSignal": true; }; "nzLoading": { "alias": "nzLoading"; "required": false; "isSignal": true; }; }, { "nzSearch": "nzSearch"; }, ["inputDir", "inputRef"], never, true, never>;
}
declare class NzInputSearchEnterButtonDirective {
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NzInputSearchEnterButtonDirective, never>;
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NzInputSearchEnterButtonDirective, "[nzInputSearchEnterButton]", never, {}, {}, never, never, true, never>;
}
interface NzInputSearchEvent {
value: string;
event: Event;
source: 'clear' | 'input';
}
declare class NzInputWrapperComponent {
private readonly focusMonitor;
protected readonly inputPasswordDir: NzInputPasswordDirective | null;
@@ -347,6 +347,7 @@ declare class NzInputModule {
*/
declare const NZ_INPUT_WRAPPER: InjectionToken<NzInputWrapperComponent>;
declare const NZ_INPUT_SEARCH: InjectionToken<NzInputSearchDirective>;
export { NZ_INPUT_WRAPPER, NzAutosizeDirective, NzInputAddonAfterDirective, NzInputAddonBeforeDirective, NzInputDirective, NzInputGroupComponent, NzInputGroupSlotComponent, NzInputGroupWhitSuffixOrPrefixDirective, NzInputModule, NzInputOtpComponent, NzInputPasswordDirective, NzInputPasswordIconDirective, NzInputPrefixDirective, NzInputSearchDirective, NzInputSearchEnterButtonDirective, NzInputSuffixDirective, NzInputWrapperComponent, NzTextareaCountComponent };
export { NZ_INPUT_SEARCH, NZ_INPUT_WRAPPER, NzAutosizeDirective, NzInputAddonAfterDirective, NzInputAddonBeforeDirective, NzInputDirective, NzInputGroupComponent, NzInputGroupSlotComponent, NzInputGroupWhitSuffixOrPrefixDirective, NzInputModule, NzInputOtpComponent, NzInputPasswordDirective, NzInputPasswordIconDirective, NzInputPrefixDirective, NzInputSearchDirective, NzInputSearchEnterButtonDirective, NzInputSuffixDirective, NzInputWrapperComponent, NzTextareaCountComponent };
export type { AutoSizeType, NzInputSearchEvent };
+2 -2
View File
@@ -1239,7 +1239,7 @@ textarea.ant-pagination-options-quick-jumper input {
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -1281,7 +1281,7 @@ textarea.ant-pagination-options-quick-jumper input {
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -20170,7 +20170,7 @@ span.ant-radio + * {
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -20212,7 +20212,7 @@ span.ant-radio + * {
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -20170,7 +20170,7 @@ span.ant-radio + * {
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -20212,7 +20212,7 @@ span.ant-radio + * {
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
+2 -2
View File
@@ -20455,7 +20455,7 @@ span.ant-radio + * {
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -20497,7 +20497,7 @@ span.ant-radio + * {
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: rgba(255, 255, 255, 0.3);
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -20220,7 +20220,7 @@ span.ant-radio + * {
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -20262,7 +20262,7 @@ span.ant-radio + * {
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
File diff suppressed because one or more lines are too long
+19 -19
View File
@@ -1,6 +1,6 @@
{
"name": "ng-zorro-antd",
"version": "20.4.0",
"version": "20.4.4",
"license": "MIT",
"description": "An enterprise-class UI components based on Ant Design and Angular",
"schematics": "./schematics/collection.json",
@@ -370,10 +370,6 @@
"types": "./alert/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-alert.mjs"
},
"./anchor": {
"types": "./anchor/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-anchor.mjs"
},
"./auto-complete": {
"types": "./auto-complete/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-auto-complete.mjs"
@@ -650,9 +646,9 @@
"types": "./tooltip/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-tooltip.mjs"
},
"./transfer": {
"types": "./transfer/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-transfer.mjs"
"./anchor": {
"types": "./anchor/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-anchor.mjs"
},
"./tree": {
"types": "./tree/index.d.ts",
@@ -682,6 +678,10 @@
"types": "./water-mark/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-water-mark.mjs"
},
"./transfer": {
"types": "./transfer/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-transfer.mjs"
},
"./cdk/overflow": {
"types": "./cdk/overflow/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-cdk-overflow.mjs"
@@ -690,6 +690,10 @@
"types": "./cdk/resize-observer/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-cdk-resize-observer.mjs"
},
"./core/animation": {
"types": "./core/animation/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-animation.mjs"
},
"./core/color": {
"types": "./core/color/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-color.mjs"
@@ -718,14 +722,14 @@
"types": "./core/logger/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-logger.mjs"
},
"./core/animation": {
"types": "./core/animation/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-animation.mjs"
},
"./core/no-animation": {
"types": "./core/no-animation/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-no-animation.mjs"
},
"./core/outlet": {
"types": "./core/outlet/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-outlet.mjs"
},
"./core/overlay": {
"types": "./core/overlay/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-overlay.mjs"
@@ -734,9 +738,9 @@
"types": "./core/pipe/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-pipe.mjs"
},
"./core/outlet": {
"types": "./core/outlet/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-outlet.mjs"
"./core/polyfill": {
"types": "./core/polyfill/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-polyfill.mjs"
},
"./core/render": {
"types": "./core/render/index.d.ts",
@@ -766,10 +770,6 @@
"types": "./core/tree/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-tree.mjs"
},
"./core/polyfill": {
"types": "./core/polyfill/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-polyfill.mjs"
},
"./core/types": {
"types": "./core/types/index.d.ts",
"default": "./fesm2022/ng-zorro-antd-core-types.mjs"
+2 -2
View File
@@ -659,7 +659,7 @@ textarea.ant-pagination-options-quick-jumper input {
}
.ant-select-single.ant-select-sm {
height: 24px;
font-size: 12px;
font-size: 14px;
}
.ant-select-single.ant-select-sm .ant-select-selector {
display: flex;
@@ -701,7 +701,7 @@ textarea.ant-pagination-options-quick-jumper input {
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-item,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-search,
.ant-select-single.ant-select-sm.ant-select-show-arrow .ant-select-selection-placeholder {
padding-inline-end: 15px;
padding-inline-end: 18px;
}
.ant-select-single.ant-select-sm.ant-select-open .ant-select-selection-item {
color: #bfbfbf;
File diff suppressed because one or more lines are too long
+18 -24
View File
@@ -1,32 +1,26 @@
import * as i0 from '@angular/core';
import { OnChanges, OnInit, TemplateRef } from '@angular/core';
import { Direction } from '@angular/cdk/bidi';
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
import { TemplateRef } from '@angular/core';
type NzResultIconType = 'success' | 'error' | 'info' | 'warning';
type NzExceptionStatusType = '404' | '500' | '403';
type NzResultStatusType = NzExceptionStatusType | NzResultIconType;
declare class NzResultComponent implements OnChanges, OnInit {
private cdr;
private directionality;
private destroyRef;
nzIcon?: string | TemplateRef<void>;
nzTitle?: string | TemplateRef<void>;
nzStatus: NzResultStatusType;
nzSubTitle?: string | TemplateRef<void>;
nzExtra?: string | TemplateRef<void>;
icon?: string | TemplateRef<void>;
isException: boolean;
dir: Direction;
ngOnInit(): void;
ngOnChanges(): void;
private setStatusIcon;
declare class NzResultComponent {
private readonly dir;
readonly nzIcon: i0.InputSignal<string | TemplateRef<void> | undefined>;
readonly nzTitle: i0.InputSignal<string | TemplateRef<void> | undefined>;
readonly nzSubTitle: i0.InputSignal<string | TemplateRef<void> | undefined>;
readonly nzExtra: i0.InputSignal<string | TemplateRef<void> | undefined>;
readonly nzStatus: i0.InputSignal<NzResultStatusType>;
protected readonly class: i0.Signal<{
[x: string]: boolean;
'ant-result': boolean;
'ant-result-rtl': boolean;
}>;
readonly isException: i0.Signal<boolean>;
readonly icon: i0.Signal<string | TemplateRef<void> | undefined>;
readonly defaultIcon: i0.Signal<string>;
static ɵfac: i0.ɵɵFactoryDeclaration<NzResultComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzResultComponent, "nz-result", ["nzResult"], { "nzIcon": { "alias": "nzIcon"; "required": false; }; "nzTitle": { "alias": "nzTitle"; "required": false; }; "nzStatus": { "alias": "nzStatus"; "required": false; }; "nzSubTitle": { "alias": "nzSubTitle"; "required": false; }; "nzExtra": { "alias": "nzExtra"; "required": false; }; }, {}, never, ["[nz-result-icon]", "div[nz-result-title]", "div[nz-result-subtitle]", "nz-result-content, [nz-result-content]", "div[nz-result-extra]"], true, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NzResultComponent, "nz-result", ["nzResult"], { "nzIcon": { "alias": "nzIcon"; "required": false; "isSignal": true; }; "nzTitle": { "alias": "nzTitle"; "required": false; "isSignal": true; }; "nzSubTitle": { "alias": "nzSubTitle"; "required": false; "isSignal": true; }; "nzExtra": { "alias": "nzExtra"; "required": false; "isSignal": true; }; "nzStatus": { "alias": "nzStatus"; "required": false; "isSignal": true; }; }, {}, never, ["[nz-result-icon]", "div[nz-result-title]", "div[nz-result-subtitle]", "nz-result-content, [nz-result-content]", "div[nz-result-extra]"], true, never>;
}
declare class NzResultTitleDirective {
@@ -39,7 +33,7 @@ declare class NzResultSubtitleDirective {
}
declare class NzResultIconDirective {
static ɵfac: i0.ɵɵFactoryDeclaration<NzResultIconDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<NzResultIconDirective, "i[nz-result-icon], div[nz-result-icon]", ["nzResultIcon"], {}, {}, never, never, true, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<NzResultIconDirective, "[nz-result-icon]", ["nzResultIcon"], {}, {}, never, never, true, never>;
}
declare class NzResultContentDirective {
static ɵfac: i0.ɵɵFactoryDeclaration<NzResultContentDirective, never>;
@@ -1,6 +1,6 @@
<div class="example-input">
<nz-input-group nzSize="large" [nzSuffix]="suffixIcon">
<nz-input-wrapper>
<input
placeholder="input here"
nz-input
@@ -8,10 +8,8 @@
(ngModelChange)="onChange($event)"
[nzAutocomplete]="auto"
/>
</nz-input-group>
<ng-template #suffixIcon>
<nz-icon nzType="search" />
</ng-template>
<nz-icon nzInputSuffix nzType="search" />
</nz-input-wrapper>
<nz-autocomplete #auto>
@for (group of optionGroups; track group.title) {
<nz-auto-optgroup [nzLabel]="groupTitle">
@@ -17,7 +17,7 @@ interface AutocompleteOptionGroups {
encapsulation: ViewEncapsulation.None,
<% if(inlineTemplate) { %>template: `
<div class="example-input">
<nz-input-group nzSize="large" [nzSuffix]="suffixIcon">
<nz-input-wrapper>
<input
placeholder="input here"
nz-input
@@ -25,10 +25,8 @@ interface AutocompleteOptionGroups {
(ngModelChange)="onChange($event)"
[nzAutocomplete]="auto"
/>
</nz-input-group>
<ng-template #suffixIcon>
<nz-icon nzType="search" />
</ng-template>
<nz-icon nzInputSuffix nzType="search" />
</nz-input-wrapper>
<nz-autocomplete #auto>
@for (group of optionGroups; track group.title) {
<nz-auto-optgroup [nzLabel]="groupTitle">
@@ -1,18 +1,14 @@
<nz-input-group nzSearch nzSize="large" [nzAddOnAfter]="suffixIconButton">
<nz-input-search nzEnterButton>
<input
placeholder="input here"
nz-input
placeholder="input here"
nzSize="large"
[(ngModel)]="inputValue"
(input)="onChange($event)"
[nzAutocomplete]="auto"
/>
</nz-input-group>
<ng-template #suffixIconButton>
<button nz-button nzType="primary" nzSize="large" nzSearch>
<nz-icon nzType="search" nzTheme="outline" />
</button>
</ng-template>
</nz-input-search>
<nz-autocomplete #auto>
@for (option of options; track option.category) {
<nz-auto-option class="search-item" [nzValue]="option.category">
@@ -11,20 +11,16 @@ import { NzInputModule } from 'ng-zorro-antd/input';
imports: [FormsModule, NzAutocompleteModule, NzButtonModule, NzIconModule, NzInputModule],
encapsulation: ViewEncapsulation.None,
<% if(inlineTemplate) { %>template: `
<nz-input-group nzSearch nzSize="large" [nzAddOnAfter]="suffixIconButton">
<nz-input-search nzEnterButton>
<input
placeholder="input here"
nz-input
placeholder="input here"
nzSize="large"
[(ngModel)]="inputValue"
(input)="onChange($event)"
[nzAutocomplete]="auto"
/>
</nz-input-group>
<ng-template #suffixIconButton>
<button nz-button nzType="primary" nzSize="large" nzSearch>
<nz-icon nzType="search" nzTheme="outline" />
</button>
</ng-template>
</nz-input-search>
<nz-autocomplete #auto>
@for (option of options; track option.category) {
<nz-auto-option class="search-item" [nzValue]="option.category">
@@ -1,7 +0,0 @@
.change-options {
display: inline-block;
font-size: 12px;
margin-left: 8px;
}
@@ -1,4 +1 @@
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)"></nz-cascader>
<a (click)="changeNzOptions()" class="change-options">Change Options</a>
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzCascaderModule, NzCascaderOption } from 'ng-zorro-antd/cascader';
@@ -45,76 +45,15 @@ const options: NzCascaderOption[] = [
}
];
const otherOptions: NzCascaderOption[] = [
{
value: 'fujian',
label: 'Fujian',
children: [
{
value: 'xiamen',
label: 'Xiamen',
children: [
{
value: 'Kulangsu',
label: 'Kulangsu',
isLeaf: true
}
]
}
]
},
{
value: 'guangxi',
label: 'Guangxi',
children: [
{
value: 'guilin',
label: 'Guilin',
children: [
{
value: 'Lijiang',
label: 'Li Jiang River',
isLeaf: true
}
]
}
]
}
];
@Component({
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)"></nz-cascader>
<a (click)="changeNzOptions()" class="change-options">Change Options</a>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
.change-options {
display: inline-block;
font-size: 12px;
margin-left: 8px;
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
<% if(inlineTemplate) { %>template: `<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component implements OnInit {
nzOptions: NzCascaderOption[] | null = null;
export class <%= classify(name) %>Component {
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
ngOnInit(): void {
setTimeout(() => {
this.nzOptions = options;
}, 100);
}
changeNzOptions(): void {
if (this.nzOptions === options) {
this.nzOptions = otherOptions;
} else {
this.nzOptions = options;
}
}
onChanges(values: string): void {
console.log(values, this.values);
}
@@ -4,5 +4,5 @@
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
@@ -60,11 +60,11 @@ const options: NzCascaderOption[] = [
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
onChanges(values: string[]): void {
@@ -1,8 +1,3 @@
<nz-cascader
nzChangeOnSelect
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
<nz-cascader nzChangeOnSelect [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
@@ -49,16 +49,11 @@ const options: NzCascaderOption[] = [
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader
nzChangeOnSelect
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
<nz-cascader nzChangeOnSelect [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
onChanges(values: string[]): void {
@@ -7,5 +7,5 @@
[nzShowSearch]="true"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
@@ -63,11 +63,11 @@ const options = [
[nzShowSearch]="true"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
onChanges(values: string[]): void {
@@ -5,7 +5,7 @@
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
<ng-template #renderTpl let-labels="labels" let-selectedOptions="selectedOptions">
@for (label of labels; track label) {
@@ -58,7 +58,7 @@ const options: NzCascaderOption[] = [
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
<ng-template #renderTpl let-labels="labels" let-selectedOptions="selectedOptions">
@for (label of labels; track label) {
@@ -78,7 +78,7 @@ const options: NzCascaderOption[] = [
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
onChanges(values: string[]): void {
@@ -4,6 +4,6 @@
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
<ng-template #renderTpl let-option let-index="index">{{ index + 1 }}. {{ option.label }}</ng-template>
@@ -37,12 +37,12 @@ const options: NzCascaderOption[] = [
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
<ng-template #renderTpl let-option let-index="index">{{ index + 1 }}. {{ option.label }}</ng-template>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions = options;
readonly nzOptions = options;
values: string[] | null = null;
onChanges(values: string): void {
@@ -1,3 +1 @@
<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"></nz-cascader>
<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions()" (ngModelChange)="onChanges($event)" />
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, signal } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzCascaderModule, NzCascaderOption } from 'ng-zorro-antd/cascader';
@@ -48,12 +48,10 @@ const options: NzCascaderOption[] = [
@Component({
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"></nz-cascader>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
<% if(inlineTemplate) { %>template: `<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions()" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component implements OnInit {
nzOptions: NzCascaderOption[] | null = null;
readonly nzOptions = signal<NzCascaderOption[] | null>(null);
values: string[] = ['zhejiang', 'hangzhou', 'xihu'];
onChanges(values: string[]): void {
@@ -61,8 +59,6 @@ export class <%= classify(name) %>Component implements OnInit {
}
ngOnInit(): void {
setTimeout(() => {
this.nzOptions = options;
}, 500);
setTimeout(() => this.nzOptions.set(options), 500);
}
}
@@ -1,3 +1 @@
<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)"></nz-cascader>
<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)" />
@@ -54,9 +54,7 @@ const scenicspots: { [key: string]: Array<{ value: string; label: string; isLeaf
@Component({
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)"></nz-cascader>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
<% if(inlineTemplate) { %>template: `<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
values: string[] = ['zhejiang', 'hangzhou', 'xihu'];
@@ -1,3 +1 @@
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
@@ -48,25 +48,11 @@ const options: NzCascaderOption[] = [
@Component({
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)"></nz-cascader>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
<% if(inlineTemplate) { %>template: `<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] = ['zhejiang', 'hangzhou', 'xihu'];
/* // or like this:
values: any[] = [{
value: 'zhejiang',
label: 'Zhejiang'
}, {
value: 'hangzhou',
label: 'Hangzhou'
}, {
value: 'xihu',
label: 'West Lake'
}]; */
onChanges(values: string[]): void {
console.log(values, this.values);
@@ -1,3 +1 @@
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
@@ -49,12 +49,10 @@ const options: NzCascaderOption[] = [
@Component({
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)"></nz-cascader>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
<% if(inlineTemplate) { %>template: `<nz-cascader [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
onChanges(values: string[]): void {
@@ -1,8 +1,8 @@
<nz-cascader
[nzExpandTrigger]="'hover'"
nzExpandTrigger="hover"
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
@@ -50,15 +50,15 @@ const options: NzCascaderOption[] = [
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader
[nzExpandTrigger]="'hover'"
nzExpandTrigger="hover"
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
/>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
values: string[] | null = null;
onChanges(values: string[]): void {
@@ -1,3 +1 @@
<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)"></nz-cascader>
<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)" />
@@ -54,9 +54,7 @@ const scenicspots: { [key: string]: Array<{ value: string; label: string; isLeaf
@Component({
selector: '<%= selector %>',
imports: [FormsModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)"></nz-cascader>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
<% if(inlineTemplate) { %>template: `<nz-cascader [(ngModel)]="values" [nzLoadData]="loadData" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
values: string[] | null = null;
@@ -5,12 +5,7 @@
(nzOnCancel)="handleCancel($event)"
(nzOnOk)="handleOk($event)"
>
<nz-cascader
*nzModalContent
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
<nz-cascader *nzModalContent [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
</nz-modal>
<button nz-button (click)="open()">Open Dialog</button>
@@ -57,12 +57,7 @@ const options: NzCascaderOption[] = [
(nzOnCancel)="handleCancel($event)"
(nzOnOk)="handleOk($event)"
>
<nz-cascader
*nzModalContent
[nzOptions]="nzOptions"
[(ngModel)]="values"
(ngModelChange)="onChanges($event)"
></nz-cascader>
<nz-cascader *nzModalContent [nzOptions]="nzOptions" [(ngModel)]="values" (ngModelChange)="onChanges($event)" />
</nz-modal>
<button nz-button (click)="open()">Open Dialog</button>
@@ -6,5 +6,5 @@
(ngModelChange)="onChanges($event)"
nzMultiple
[nzMaxTagCount]="3"
></nz-cascader>
/>
@@ -51,11 +51,11 @@ const getOptions = (): NzCascaderOption[] => [
(ngModelChange)="onChanges($event)"
nzMultiple
[nzMaxTagCount]="3"
></nz-cascader>
/>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = getOptions();
readonly nzOptions: NzCascaderOption[] = getOptions();
values: NzSafeAny[][] | null = null;
onChanges(values: NzSafeAny[][]): void {
@@ -7,6 +7,6 @@
[nzOpen]="open"
(nzSelectionChange)="onSelectionChange($event)"
(nzVisibleChange)="onVisibleChange($event)"
></nz-cascader>
/>
</div>
@@ -59,12 +59,12 @@ const options: NzCascaderOption[] = [
[nzOpen]="open"
(nzSelectionChange)="onSelectionChange($event)"
(nzVisibleChange)="onVisibleChange($event)"
></nz-cascader>
/>
</div>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions = options;
readonly nzOptions = options;
values = ['zhejiang', 'hangzhou', 'xihu'];
open = false;
@@ -2,5 +2,5 @@
<nz-segmented [nzOptions]="placements" (nzValueChange)="setPlacement($event)"></nz-segmented>
<br />
<br />
<nz-cascader [nzOptions]="nzOptions" [nzPlacement]="placement"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" [nzPlacement]="placement" />
@@ -52,11 +52,11 @@ const options: NzCascaderOption[] = [
<nz-segmented [nzOptions]="placements" (nzValueChange)="setPlacement($event)"></nz-segmented>
<br />
<br />
<nz-cascader [nzOptions]="nzOptions" [nzPlacement]="placement"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" [nzPlacement]="placement" />
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
})
export class <%= classify(name) %>Component {
nzOptions: NzCascaderOption[] = options;
readonly nzOptions: NzCascaderOption[] = options;
placement: NzCascaderPlacement = 'topLeft';
readonly placements: NzCascaderPlacement[] = ['topLeft', 'topRight', 'bottomLeft', 'bottomRight'];
@@ -1,8 +1,8 @@
<nz-flex nzVertical nzGap="small">
<nz-cascader [nzOptions]="nzOptions" nzSuffixIcon="smile"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" nzExpandIcon="smile"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" [nzPrefix]="smile"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" nzSuffixIcon="smile" />
<nz-cascader [nzOptions]="nzOptions" nzExpandIcon="smile" />
<nz-cascader [nzOptions]="nzOptions" [nzPrefix]="smile" />
</nz-flex>
<ng-template #smile><nz-icon nzType="smile" /></ng-template>
@@ -51,9 +51,9 @@ const options: NzCascaderOption[] = [
imports: [NzCascaderModule, NzFlexModule, NzIconModule],
<% if(inlineTemplate) { %>template: `
<nz-flex nzVertical nzGap="small">
<nz-cascader [nzOptions]="nzOptions" nzSuffixIcon="smile"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" nzExpandIcon="smile"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" [nzPrefix]="smile"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" nzSuffixIcon="smile" />
<nz-cascader [nzOptions]="nzOptions" nzExpandIcon="smile" />
<nz-cascader [nzOptions]="nzOptions" [nzPrefix]="smile" />
</nz-flex>
<ng-template #smile><nz-icon nzType="smile" /></ng-template>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
@@ -1,6 +1,6 @@
<form [formGroup]="form" novalidate>
<nz-cascader [nzOptions]="nzOptions" formControlName="name"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" formControlName="name" />
</form>
<br />
<button nz-button (click)="reset()">Reset</button>
@@ -1,6 +1,6 @@
import { Component, inject, OnDestroy } from '@angular/core';
import { Component, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
import { Subscription } from 'rxjs';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzCascaderModule, NzCascaderOption } from 'ng-zorro-antd/cascader';
@@ -52,7 +52,7 @@ const options: NzCascaderOption[] = [
imports: [ReactiveFormsModule, NzButtonModule, NzCascaderModule],
<% if(inlineTemplate) { %>template: `
<form [formGroup]="form" novalidate>
<nz-cascader [nzOptions]="nzOptions" formControlName="name"></nz-cascader>
<nz-cascader [nzOptions]="nzOptions" formControlName="name" />
</form>
<br />
<button nz-button (click)="reset()">Reset</button>
@@ -64,16 +64,15 @@ const options: NzCascaderOption[] = [
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component implements OnDestroy {
export class <%= classify(name) %>Component {
private fb = inject(FormBuilder);
form = this.fb.group({
name: this.fb.control<string[] | null>(null, Validators.required)
});
nzOptions: NzCascaderOption[] = options;
changeSubscription: Subscription;
readonly nzOptions: NzCascaderOption[] = options;
constructor() {
this.changeSubscription = this.form.controls.name.valueChanges.subscribe(data => {
this.form.controls.name.valueChanges.pipe(takeUntilDestroyed()).subscribe(data => {
this.onChanges(data);
});
}
@@ -90,8 +89,4 @@ export class <%= classify(name) %>Component implements OnDestroy {
onChanges(values: string[] | null): void {
console.log(values);
}
ngOnDestroy(): void {
this.changeSubscription.unsubscribe();
}
}

Some files were not shown because too many files have changed in this diff Show More