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