How to use the @ptsecurity/mosaic/core.mixinErrorState 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 / src / lib / tree-select / tree-select.component.ts View on Github external
export class McTreeSelectTrigger {}


class McTreeSelectBase {
    constructor(
        public elementRef: ElementRef,
        public defaultErrorStateMatcher: ErrorStateMatcher,
        public parentForm: NgForm,
        public parentFormGroup: FormGroupDirective,
        public ngControl: NgControl
    ) {}
}

// tslint:disable-next-line:naming-convention
const McTreeSelectMixinBase: CanDisableCtor & HasTabIndexCtor & CanUpdateErrorStateCtor &
    typeof McTreeSelectBase = mixinTabIndex(mixinDisabled(mixinErrorState(McTreeSelectBase)));


@Component({
    selector: 'mc-tree-select',
    exportAs: 'mcTreeSelect',
    templateUrl: 'tree-select.html',
    styleUrls: ['./tree-select.css'],
    inputs: ['disabled', 'tabIndex'],
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush,
    host: {
        '[attr.id]': 'id',
        '[attr.tabindex]': 'tabIndex',

        class: 'mc-tree-select',
        '[class.mc-disabled]': 'disabled',
github positive-js / mosaic / packages / mosaic / select / select.component.ts View on Github external
constructor(public source: McSelect, public value: any) {}
}

export class McSelectBase {
    constructor(
        public elementRef: ElementRef,
        public defaultErrorStateMatcher: ErrorStateMatcher,
        public parentForm: NgForm,
        public parentFormGroup: FormGroupDirective,
        public ngControl: NgControl
    ) {}
}

// tslint:disable-next-line:naming-convention
const McSelectMixinBase: CanDisableCtor & HasTabIndexCtor & CanUpdateErrorStateCtor &
    typeof McSelectBase = mixinTabIndex(mixinDisabled(mixinErrorState(McSelectBase)));


@Directive({
    selector: '[mcSelectSearch]',
    exportAs: 'mcSelectSearch',
    host: {
        '(keydown)': 'handleKeydown($event)'
    }
})
export class McSelectSearch implements AfterContentInit, OnDestroy {
    @ContentChild(McInput, { static: false }) input: McInput;

    searchChangesSubscription: Subscription = new Subscription();

    isSearchChanged: boolean = false;
github positive-js / mosaic / packages / mosaic / tree-select / tree-select.component.ts View on Github external
export class McTreeSelectTrigger {}


class McTreeSelectBase {
    constructor(
        public elementRef: ElementRef,
        public defaultErrorStateMatcher: ErrorStateMatcher,
        public parentForm: NgForm,
        public parentFormGroup: FormGroupDirective,
        public ngControl: NgControl
    ) {}
}

// tslint:disable-next-line:naming-convention
const McTreeSelectMixinBase: CanDisableCtor & HasTabIndexCtor & CanUpdateErrorStateCtor &
    typeof McTreeSelectBase = mixinTabIndex(mixinDisabled(mixinErrorState(McTreeSelectBase)));


@Component({
    selector: 'mc-tree-select',
    exportAs: 'mcTreeSelect',
    templateUrl: 'tree-select.html',
    styleUrls: ['./tree-select.css'],
    inputs: ['disabled'],
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush,
    host: {
        '[attr.id]': 'id',
        '[attr.tabindex]': 'tabIndex',

        class: 'mc-tree-select',
        '[class.mc-disabled]': 'disabled',
github positive-js / mosaic / src / lib / textarea / textarea.component.ts View on Github external
new InjectionToken<{ value: any }>('MC_TEXTAREA_VALUE_ACCESSOR');

let nextUniqueId = 0;

const ROW_SEPARATOR = '\n';

export class McTextareaBase {
    constructor(public defaultErrorStateMatcher: ErrorStateMatcher,
                public parentForm: NgForm,
                public parentFormGroup: FormGroupDirective,
                public ngControl: NgControl) {
    }
}

// tslint:disable-next-line:naming-convention
export const McTextareaMixinBase: CanUpdateErrorStateCtor & typeof McTextareaBase = mixinErrorState(McTextareaBase);

@Directive({
    selector: 'textarea[mcTextarea]',
    exportAs: 'mcTextarea',
    host: {
        class: 'mc-textarea',
        '[class.mc-textarea-resizable]': '!canGrow',
        '[attr.id]': 'id',
        '[attr.placeholder]': 'placeholder',
        '[attr.aria-invalid]': 'errorState',
        '[disabled]': 'disabled',
        '[required]': 'required',
        '(blur)': 'focusChanged(false)',
        '(focus)': 'focusChanged(true)'
    },
    providers: [{ provide: McFormFieldControl, useExisting: McTextarea }]
github positive-js / mosaic / packages / mosaic / textarea / textarea.component.ts View on Github external
new InjectionToken<{ value: any }>('MC_TEXTAREA_VALUE_ACCESSOR');

let nextUniqueId = 0;

const ROW_SEPARATOR = '\n';

export class McTextareaBase {
    constructor(public defaultErrorStateMatcher: ErrorStateMatcher,
                public parentForm: NgForm,
                public parentFormGroup: FormGroupDirective,
                public ngControl: NgControl) {
    }
}

// tslint:disable-next-line:naming-convention
export const McTextareaMixinBase: CanUpdateErrorStateCtor & typeof McTextareaBase = mixinErrorState(McTextareaBase);

@Directive({
    selector: 'textarea[mcTextarea]',
    exportAs: 'mcTextarea',
    host: {
        class: 'mc-textarea',
        '[class.mc-textarea-resizable]': '!canGrow',
        '[attr.id]': 'id',
        '[attr.placeholder]': 'placeholder',
        '[attr.aria-invalid]': 'errorState',
        '[disabled]': 'disabled',
        '[required]': 'required',
        '(blur)': 'focusChanged(false)',
        '(focus)': 'focusChanged(true)'
    },
    providers: [{ provide: McFormFieldControl, useExisting: McTextarea }]
github positive-js / mosaic / packages / mosaic / input / input.ts View on Github external
export const BIG_STEP = 10;
export const SMALL_STEP = 1;

let nextUniqueId = 0;

export class McInputBase {
    constructor(public defaultErrorStateMatcher: ErrorStateMatcher,
                public parentForm: NgForm,
                public parentFormGroup: FormGroupDirective,
                public ngControl: NgControl) {
    }
}

// tslint:disable-next-line:naming-convention
export const McInputMixinBase: CanUpdateErrorStateCtor & typeof McInputBase = mixinErrorState(McInputBase);


@Directive({
    selector: `input[mcInput][type="number"]`,
    exportAs: 'mcNumericalInput',
    providers: [NgModel, { provide: McFormFieldNumberControl, useExisting: McNumberInput }],
    host: {
        '(blur)': 'focusChanged(false)',
        '(focus)': 'focusChanged(true)',
        '(paste)': 'onPaste($event)',
        '(keydown)': 'onKeyDown($event)'
    }
})
export class McNumberInput implements McFormFieldNumberControl {

    /**
github positive-js / mosaic / packages / mosaic / tags / tag-list.component.ts View on Github external
import { McTagTextControl } from './tag-text-control';
import { McTag, McTagEvent, McTagSelectionChange } from './tag.component';


export class McTagListBase {
    constructor(
        public defaultErrorStateMatcher: ErrorStateMatcher,
        public parentForm: NgForm,
        public parentFormGroup: FormGroupDirective,
        public ngControl: NgControl
    ) {
    }
}

// tslint:disable-next-line:naming-convention
export const McTagListMixinBase: CanUpdateErrorStateCtor & typeof McTagListBase = mixinErrorState(McTagListBase);


// Increasing integer for generating unique ids for tag-list components.
let nextUniqueId = 0;

/** Change event object that is emitted when the tag list value has changed. */
export class McTagListChange {
    constructor(public source: McTagList, public value: any) {}
}


@Component({
    selector: 'mc-tag-list',
    exportAs: 'mcTagList',
    templateUrl: 'tag-list.partial.html',
    host: {
github positive-js / mosaic / src / lib / select / select.component.ts View on Github external
export class McSelectChange {
    constructor(public source: McSelect, public value: any) {}
}

export class McSelectBase {
    constructor(
        public elementRef: ElementRef,
        public defaultErrorStateMatcher: ErrorStateMatcher,
        public parentForm: NgForm,
        public parentFormGroup: FormGroupDirective,
        public ngControl: NgControl
    ) {}
}

const McSelectMixinBase: CanDisableCtor & HasTabIndexCtor & CanUpdateErrorStateCtor &
    typeof McSelectBase = mixinTabIndex(mixinDisabled(mixinErrorState(McSelectBase)));


@Directive({ selector: 'mc-select-trigger' })
export class McSelectTrigger {}


@Component({
    selector: 'mc-select',
    exportAs: 'mcSelect',
    templateUrl: 'select.html',
    styleUrls: ['./select.css'],
    inputs: ['disabled', 'tabIndex'],
    encapsulation: ViewEncapsulation.None,
    changeDetection: ChangeDetectionStrategy.OnPush,
    host: {
        '[attr.id]': 'id',
github positive-js / mosaic / src / lib / input / input.ts View on Github external
];

export const BIG_STEP = 10;
export const SMALL_STEP = 1;

let nextUniqueId = 0;

export class McInputBase {
    constructor(public defaultErrorStateMatcher: ErrorStateMatcher,
                public parentForm: NgForm,
                public parentFormGroup: FormGroupDirective,
                public ngControl: NgControl) {
    }
}

export const _McInputMixinBase: CanUpdateErrorStateCtor & typeof McInputBase = mixinErrorState(McInputBase);


@Directive({
    selector: `input[mcInput][type="number"]`,
    exportAs: 'mcNumericalInput',
    providers: [NgModel, { provide: McFormFieldNumberControl, useExisting: McNumberInput }],
    host: {
        '(blur)': '_focusChanged(false)',
        '(focus)': '_focusChanged(true)',
        '(paste)': 'onPaste($event)',
        '(keydown)': 'onKeyDown($event)'
    }
})
export class McNumberInput implements McFormFieldNumberControl {

    /**