How to use the @dynatrace/barista-components/core.addCssClass function in @dynatrace/barista-components

To help you get started, we’ve selected a few @dynatrace/barista-components 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 dynatrace-oss / barista / components / chart / src / selection-area / selection-area.ts View on Github external
.subscribe((resize: number) => {
          // show drag arrows on drag release but only if the stream is not a drag handle
          // 0 is initial drag and -1 is mouse release
          if (this._chart._range && resize < 1) {
            this._chart._range._reflectRangeReleased(isMouseRelease(resize));

            // if the drag is completed we can emit a stateChanges
            if (isMouseRelease(resize)) {
              this._chart._range._emitDragEnd();
              this._chart._range.focus();
            }
          }

          // every drag regardless of if it is a handle or initial drag should have the grab cursors
          if (resize >= 0) {
            addCssClass(this._elementRef.nativeElement, GRAB_CURSOR_CLASS);
          } else {
            removeCssClass(this._elementRef.nativeElement, GRAB_CURSOR_CLASS);
          }
        });
    }
github dynatrace-oss / barista / components / selection-area / src / selection-area-container.ts View on Github external
private _togglePointerEvents(touching: boolean): void {
    if (touching) {
      addCssClass(this._selectedArea.nativeElement, 'dt-no-pointer');
    } else {
      removeCssClass(this._selectedArea.nativeElement, 'dt-no-pointer');
    }
  }
github dynatrace-oss / barista / components / chart / src / range / range.ts View on Github external
private _reflectRangeValid(): void {
    if (!this._valid) {
      addCssClass(this._elementRef.nativeElement, DT_RANGE_INVALID_CLASS);
    } else {
      removeCssClass(this._elementRef.nativeElement, DT_RANGE_INVALID_CLASS);
    }
  }
github dynatrace-oss / barista / components / selection-area / src / selection-area.ts View on Github external
private _createGlobalContainerInBody(): void {
    const container = this._renderer.createElement('div');

    addCssClass(container, 'dt-selection-area-global-container');
    this._renderer.appendChild(document.body, container);
    globalContainerElement = container;
  }
}
github dynatrace-oss / barista / components / chart / src / selection-area-deprecated / chart-selection-area-origin.ts View on Github external
private _applyAttributesAndClassesToPlotBackground(): void {
    this._plotBackground = this._chart.container.nativeElement.querySelector(
      '.highcharts-plot-background',
    ) as SVGRectElement;
    addCssClass(this._plotBackground, 'dt-selection-area-origin-cursor');
    this._plotBackground.setAttribute('tabindex', this.tabIndex.toString());
  }
github dynatrace-oss / barista / components / drawer / src / drawer-container.ts View on Github external
private _toggleOpenClass(isOpen: boolean): void {
    if (isOpen) {
      addCssClass(this._elementRef.nativeElement, DT_DRAWER_OPEN_CLASS);
    } else {
      removeCssClass(this._elementRef.nativeElement, DT_DRAWER_OPEN_CLASS);
    }
  }
github dynatrace-oss / barista / components / radio / src / radio.ts View on Github external
private _onInputFocusChange(focusOrigin: FocusOrigin): void {
    const element = this._elementRef.nativeElement;

    if (focusOrigin === 'keyboard') {
      addCssClass(element, 'dt-radio-focused', this._renderer);
    } else if (!focusOrigin) {
      removeCssClass(element, 'dt-radio-focused', this._renderer);
      if (this._radioGroup) {
        this._radioGroup._touch();
      }
    }
  }
}