How to use the ng-zorro-antd/core.isNotNil function in ng-zorro-antd

To help you get started, we’ve selected a few ng-zorro-antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NG-ZORRO / ng-zorro-antd / components / tree / nz-tree.component.ts View on Github external
set nzSearchValue(value: string) {
    this._searchValue = value;
    this.nzTreeService.searchExpand(value);
    if (isNotNil(value)) {
      this.nzSearchValueChange.emit(this.nzTreeService.formatEvent('search', null, null));
      /**
       * @deprecated 9.0.0 - use `nzOnSearchNode` instead.
       * Hide warning, need remove next version
       */
      this.nzOnSearchNode.emit(this.nzTreeService.formatEvent('search', null, null));
    }
  }
github NG-ZORRO / ng-zorro-antd / components / time-picker / nz-time-picker-panel.component.ts View on Github external
set nzDisabledMinutes(value: (hour: number) => number[]) {
    if (isNotNil(value)) {
      this._disabledMinutes = value;
      this.buildMinutes();
    }
  }
github NG-ZORRO / ng-zorro-antd / components / input-number / nz-input-number.component.ts View on Github external
getMaxPrecision(currentValue: string | number, ratio: number): number {
    if (isNotNil(this.nzPrecision)) {
      return this.nzPrecision;
    }
    const ratioPrecision = this.getPrecision(ratio);
    const stepPrecision = this.getPrecision(this.nzStep);
    const currentValuePrecision = this.getPrecision(currentValue as number);
    if (!currentValue) {
      return ratioPrecision + stepPrecision;
    }
    return Math.max(currentValuePrecision, ratioPrecision + stepPrecision);
  }
github NG-ZORRO / ng-zorro-antd / components / grid / nz-col.directive.ts View on Github external
setClassMap(): void {
    const classMap = {
      [`${this.prefixCls}`]: true,
      [`${this.prefixCls}-${this.nzSpan}`]: isNotNil(this.nzSpan),
      [`${this.prefixCls}-order-${this.nzOrder}`]: isNotNil(this.nzOrder),
      [`${this.prefixCls}-offset-${this.nzOffset}`]: isNotNil(this.nzOffset),
      [`${this.prefixCls}-pull-${this.nzPull}`]: isNotNil(this.nzPull),
      [`${this.prefixCls}-push-${this.nzPush}`]: isNotNil(this.nzPush),
      ...this.generateClass()
    };
    this.nzUpdateHostClassService.updateHostClass(this.el, classMap);
  }
github NG-ZORRO / ng-zorro-antd / components / input-number / nz-input-number.component.ts View on Github external
toNumber(num: string | number): number {
    if (this.isNotCompleteNumber(num)) {
      return num as number;
    }
    if (isNotNil(this.nzPrecision)) {
      return Number(Number(num).toFixed(this.nzPrecision));
    }
    return Number(num);
  }
github NG-ZORRO / ng-zorro-antd / components / grid / nz-col.directive.ts View on Github external
setClassMap(): void {
    const classMap = {
      [`${this.prefixCls}`]: true,
      [`${this.prefixCls}-${this.nzSpan}`]: isNotNil(this.nzSpan),
      [`${this.prefixCls}-order-${this.nzOrder}`]: isNotNil(this.nzOrder),
      [`${this.prefixCls}-offset-${this.nzOffset}`]: isNotNil(this.nzOffset),
      [`${this.prefixCls}-pull-${this.nzPull}`]: isNotNil(this.nzPull),
      [`${this.prefixCls}-push-${this.nzPush}`]: isNotNil(this.nzPush),
      ...this.generateClass()
    };
    this.nzUpdateHostClassService.updateHostClass(this.el, classMap);
  }
github NG-ZORRO / ng-zorro-antd / components / time-picker / nz-time-picker-panel.component.ts View on Github external
isSelected12Hours(value: { index: number; value: string }): boolean {
    return (
      value.value.toUpperCase() === this.time.selected12Hours ||
      (!isNotNil(this.time.selected12Hours) && value.value.toUpperCase() === this.time.default12Hours)
    );
  }
github NG-ZORRO / ng-zorro-antd / components / grid / nz-col.directive.ts View on Github external
setClassMap(): void {
    const classMap = {
      [`${this.prefixCls}`]: true,
      [`${this.prefixCls}-${this.nzSpan}`]: isNotNil(this.nzSpan),
      [`${this.prefixCls}-order-${this.nzOrder}`]: isNotNil(this.nzOrder),
      [`${this.prefixCls}-offset-${this.nzOffset}`]: isNotNil(this.nzOffset),
      [`${this.prefixCls}-pull-${this.nzPull}`]: isNotNil(this.nzPull),
      [`${this.prefixCls}-push-${this.nzPush}`]: isNotNil(this.nzPush),
      ...this.generateClass()
    };
    this.nzUpdateHostClassService.updateHostClass(this.el, classMap);
  }
github NG-ZORRO / ng-zorro-antd / components / time-picker / time-holder.ts View on Github external
setValue(value: Date | undefined, use12Hours?: boolean): this {
    if (isNotNil(use12Hours)) {
      this._use12Hours = use12Hours as boolean;
    }
    this.value = value;
    return this;
  }