How to use the @clr/angular.ClrAlignment.CENTER function in @clr/angular

To help you get started, we’ve selected a few @clr/angular 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 vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is VERTICAL and there is a BOTTOM ViewportViolation', function(this: TestContext) {
          // Test a BOTTOM violataion
          const bottomViolation: ClrPopoverPosition = {
            axis: ClrAxis.VERTICAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };

          popoverContent.style.width = '25px';
          popoverContent.style.height = window.innerHeight + 'px';
          this.positionService.position = bottomViolation;
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleHorizontalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is HORIZONTAL and there is a RIGHT ViewportViolation', function(this: TestContext) {
          // // Test a right violation
          const rightViolation: ClrPopoverPosition = {
            axis: ClrAxis.HORIZONTAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };
          this.positionService.position = rightViolation;
          popoverContent.style.width = '25000px';
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy).toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is HORIZONTAL and there is a RIGHT ViewportViolation', function(this: TestContext) {
          // // Test a right violation
          const rightViolation: ClrPopoverPosition = {
            axis: ClrAxis.HORIZONTAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };
          this.positionService.position = rightViolation;
          popoverContent.style.width = '25000px';
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy).toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is HORIZONTAL and there is a RIGHT ViewportViolation', function(this: TestContext) {
          // // Test a right violation
          const rightViolation: ClrPopoverPosition = {
            axis: ClrAxis.HORIZONTAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };
          this.positionService.position = rightViolation;
          popoverContent.style.width = '25000px';
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy).toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is VERTICAL and there is a BOTTOM ViewportViolation', function(this: TestContext) {
          // Test a BOTTOM violataion
          const bottomViolation: ClrPopoverPosition = {
            axis: ClrAxis.VERTICAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };

          popoverContent.style.width = '25px';
          popoverContent.style.height = window.innerHeight + 'px';
          this.positionService.position = bottomViolation;
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleHorizontalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is VERTICAL and there is a BOTTOM ViewportViolation', function(this: TestContext) {
          // Test a BOTTOM violataion
          const bottomViolation: ClrPopoverPosition = {
            axis: ClrAxis.VERTICAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };

          popoverContent.style.width = '25px';
          popoverContent.style.height = window.innerHeight + 'px';
          this.positionService.position = bottomViolation;
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleHorizontalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is VERTICAL and there is a BOTTOM ViewportViolation', function(this: TestContext) {
          // Test a BOTTOM violataion
          const bottomViolation: ClrPopoverPosition = {
            axis: ClrAxis.VERTICAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };

          popoverContent.style.width = '25px';
          popoverContent.style.height = window.innerHeight + 'px';
          this.positionService.position = bottomViolation;
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleHorizontalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });
github vmware / clarity / src / clr-angular / utils / popover / providers / popover-position.service.spec.ts View on Github external
it('and aligns content when ClrAxis is HORIZONTAL and there is a RIGHT ViewportViolation', function(this: TestContext) {
          // // Test a right violation
          const rightViolation: ClrPopoverPosition = {
            axis: ClrAxis.HORIZONTAL,
            side: ClrSide.AFTER,
            anchor: ClrAlignment.CENTER,
            content: ClrAlignment.CENTER,
          };
          this.positionService.position = rightViolation;
          popoverContent.style.width = '25000px';
          document.body.appendChild(popoverContent);
          this.positionService.alignContent(popoverContent);
          expect(handleVerticalAxisOneViolationSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy).toHaveBeenCalled();
          expect(handleHorizontalAxisOneViolationSpy.calls.count()).toEqual(1);
          expect(handleVerticalAxisTwoViolationsSpy).not.toHaveBeenCalled();
          expect(handleHorizontalAxisTwoViolationsSpy).not.toHaveBeenCalled();
        });