How to use the @ptsecurity/mosaic/core.mixinTabIndex function in @ptsecurity/mosaic

To help you get started, we’ve selected a few @ptsecurity/mosaic 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 positive-js / mosaic / packages / mosaic / link / link.component.ts View on Github external
import {
    CanDisable, CanDisableCtor,
    HasTabIndex, HasTabIndexCtor,
    mixinDisabled,
    mixinTabIndex,
    toBoolean
} from '@ptsecurity/mosaic/core';


export class McLinkBase {
    constructor(public elementRef: ElementRef) {}
}

// tslint:disable-next-line: naming-convention
export const McLinkMixinBase: HasTabIndexCtor & CanDisableCtor & typeof McLinkBase
    = mixinTabIndex(mixinDisabled(McLinkBase));

@Directive({
    selector: 'a.mc-link',
    exportAs: 'mcLink',
    inputs: ['disabled'],
    host: {
        '[attr.disabled]': 'disabled || null',
        '[attr.tabindex]': 'tabIndex'
    }
})

export class McLink extends McLinkMixinBase implements OnDestroy, HasTabIndex, CanDisable {

    @Input()
    get disabled() {
        return this._disabled;
github positive-js / mosaic / src / lib / tree / tree-selection.ts View on Github external
) {}
}

export class McTreeSelectionChange {
    constructor(public source: McTreeSelection, public option: McTreeOption) {}
}

class McTreeSelectionBase extends CdkTree {
    constructor(differs: IterableDiffers, changeDetectorRef: ChangeDetectorRef) {
        super(differs, changeDetectorRef);
    }
}

/* tslint:disable-next-line:naming-convention */
const McTreeSelectionBaseMixin: HasTabIndexCtor & CanDisableCtor &
    typeof McTreeSelectionBase = mixinTabIndex(mixinDisabled(McTreeSelectionBase));


@Component({
    selector: 'mc-tree-selection',
    exportAs: 'mcTreeSelection',
    template: ``,
    host: {
        class: 'mc-tree-selection',

        '[attr.tabindex]': 'tabIndex',

        '(keydown)': 'onKeyDown($event)',
        '(window:resize)': 'updateScrollSize()'
    },
    styleUrls: ['./tree.css'],
    encapsulation: ViewEncapsulation.None,
github positive-js / mosaic / src / lib / radio / radio.component.ts View on Github external
// Boilerplate for applying mixins to McRadioButton.
/** @docs-private */
export class McRadioButtonBase {
    // Since the disabled property is manually defined for the McRadioButton and isn't set up in
    // the mixin base class. To be able to use the tabindex mixin, a disabled property must be
    // defined to properly work.
    disabled: boolean;

    constructor(public _elementRef: ElementRef) {}
}

export const _McRadioButtonMixinBase:
    CanColorCtor &
    HasTabIndexCtor &
    typeof McRadioButtonBase =
        mixinColor(mixinTabIndex(McRadioButtonBase));


@Component({
    selector: 'mc-radio-button',
    templateUrl: 'radio.component.html',
    styleUrls: ['radio.css'],
    inputs: ['color', 'tabIndex'],
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush,
    exportAs: 'mcRadioButton',
    host: {
        class: 'mc-radio-button',
        '[attr.id]': 'id',
        '[class.mc-checked]': 'checked',
        '[class.mc-disabled]': 'disabled',
        '(focus)': '_inputElement.nativeElement.focus()'
github positive-js / mosaic / packages / mosaic / list / list-selection.component.ts View on Github external
export const MC_SELECTION_LIST_VALUE_ACCESSOR: any = {
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => McListSelection),
    multi: true
};

export class McListSelectionChange {
    constructor(public source: McListSelection, public option: McListOption) {}
}


export class McListSelectionBase {}

// tslint:disable-next-line:naming-convention
export const McListSelectionMixinBase: CanDisableCtor & HasTabIndexCtor & typeof McListSelectionBase
    = mixinTabIndex(mixinDisabled(McListSelectionBase));

@Component({
    exportAs: 'mcListSelection',
    selector: 'mc-list-selection',
    template: '',
    styleUrls: ['./list.css'],
    changeDetection: ChangeDetectionStrategy.OnPush,
    encapsulation: ViewEncapsulation.None,
    inputs: ['disabled'],
    host: {
        '[attr.tabindex]': 'tabIndex',

        class: 'mc-list-selection',

        '(focus)': 'focus()',
        '(blur)': 'blur()',
github positive-js / mosaic / src / lib / link / link.component.ts View on Github external
import {
    CanDisable, CanDisableCtor,
    HasTabIndex, HasTabIndexCtor,
    mixinDisabled,
    mixinTabIndex,
    toBoolean
} from '@ptsecurity/mosaic/core';


export class McLinkBase {
    constructor(public _elementRef: ElementRef) {
    }
}

export const _McLinkBase: HasTabIndexCtor & CanDisableCtor & typeof McLinkBase
    = mixinTabIndex(mixinDisabled(McLinkBase));

@Component({
    selector: 'a.mc-link',
    template: ``,
    changeDetection: ChangeDetectionStrategy.OnPush,
    encapsulation: ViewEncapsulation.None,
    exportAs: 'mcLink',
    styleUrls: ['./link.css'],
    inputs: ['disabled'],
    host: {
        '[attr.disabled]': 'disabled || null',
        '[attr.tabindex]': 'tabIndex'
    }
})

export class McLink extends _McLinkBase implements OnDestroy, HasTabIndex, CanDisable {