protected updateWithValue()

in projects/libs/flex-layout/flex/flex/flex.ts [260:283]


  protected updateWithValue(value: string) {
    const addFlexToParent = this.layoutConfig.addFlexToParent !== false;
    if (this.direction === undefined) {
      this.direction = this.getFlexFlowDirection(this.parentElement!, addFlexToParent);
    }
    if (this.wrap === undefined) {
      this.wrap = this.hasWrap(this.parentElement!);
    }
    const direction = this.direction;
    const isHorizontal = direction.startsWith('row');
    const hasWrap = this.wrap;
    if (isHorizontal && hasWrap) {
      this.styleCache = flexRowWrapCache;
    } else if (isHorizontal && !hasWrap) {
      this.styleCache = flexRowCache;
    } else if (!isHorizontal && hasWrap) {
      this.styleCache = flexColumnWrapCache;
    } else if (!isHorizontal && !hasWrap) {
      this.styleCache = flexColumnCache;
    }
    const basis = String(value).replace(';', '');
    const parts = validateBasis(basis, this.flexGrow, this.flexShrink);
    this.addStyles(parts.join(' '), {direction, hasWrap});
  }