How to use the aurelia-framework.valueConverter function in aurelia-framework

To help you get started, we’ve selected a few aurelia-framework 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 aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / split.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { split } from 'strman';

@valueConverter('split')
export class SplitValueConverter {
    public toView(value: string, separator: string, limit?: number): string[] {
        return split(value, separator, limit);
    }
}
github aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / lefttrim.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { leftTrim } from 'strman';

@valueConverter('lefttrim')
export class LeftTrimValueConverter {
    public toView(value: string, char?: string): string {
        return leftTrim(value, char);
    }
}
github aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / appendArray.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { appendArray } from 'strman';

@valueConverter('appendarray')
export class AppendArrayValueConverter {
    public toView(value: string, append: string[]): string {
        return appendArray(value, append);
    }
}
github aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / removenonwords.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { removeNonWords } from 'strman';

@valueConverter('removenonwords')
export class RemoveNonWordsValueConverter {
    public toView(value: string, replaced?: string): string {
        return removeNonWords(value, replaced);
    }
}
github aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / isuppercase.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { isUpperCase } from 'strman';

@valueConverter('isuppercase')
export class IsUpperCaseValueConverter {
    public toView(value: string): boolean {
        return isUpperCase(value);
    }
}
github aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / slice.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { slice } from 'strman';

@valueConverter('slice')
export class SliceValueConverter {
    public toView(value: string, beginSlice: number, endSlice: number): string {
        return slice(value, beginSlice, endSlice);
    }
}
github aurelia-toolbelt / aurelia-toolbelt / src / value-converters / vanilla / string / strman / surround.ts View on Github external
import { valueConverter } from 'aurelia-framework';

// @ts-ignore
import { surround } from 'strman';

@valueConverter('surround')
export class SurroundValueConverter {
    public toView(value: string, substr: string, substrRight?: string): string {
        return surround(value, substr, substrRight);
    }
}
github adarshpastakia / aurelia-ui-framework / dist / commonjs / value-converters.js View on Github external
var UtcValueConverter = (function () {
    function UtcValueConverter() {
    }
    UtcValueConverter.prototype.toView = function (value) {
        return uiFormat.UIFormat.utcDate(value);
    };
    UtcValueConverter = _tslib.__decorate([
        aureliaFramework.valueConverter("utc")
    ], UtcValueConverter);
    return UtcValueConverter;
}());
var IsoValueConverter = (function () {
github adarshpastakia / aurelia-ui-framework / dist / es2017 / value-converters.js View on Github external
toView(value, country = "") {
        const phoneNumber = getPhone(value, country);
        return `<span class="ui-flag ${phoneNumber.country}"></span>&nbsp;${phoneNumber.formatInternational()}`;
    }
};
PhoneHtmlValueConverter = __decorate([
    valueConverter("phoneHtml")
], PhoneHtmlValueConverter);
let PhoneLocalHtmlValueConverter = class PhoneLocalHtmlValueConverter {
    toView(value, country = "us") {
        const phoneNumber = getPhone(value, country);
        return `<span class="ui-flag ${phoneNumber.country}"></span>&nbsp;${phoneNumber.formatNational()}`;
    }
};
PhoneLocalHtmlValueConverter = __decorate([
    valueConverter("phoneLocalHtml")
], PhoneLocalHtmlValueConverter);
let DateValueConverter = class DateValueConverter {
    toView(value, format) {
        return UIFormat.date(value, format);
    }
};
DateValueConverter = __decorate([
    valueConverter("date")
], DateValueConverter);
let TimeValueConverter = class TimeValueConverter {
    toView(value, format) {
        return UIFormat.time(value, format);
    }
};
TimeValueConverter = __decorate([
    valueConverter("time")
github adarshpastakia / aurelia-ui-framework / dist / commonjs / value-converters.js View on Github external
var TimeValueConverter = (function () {
    function TimeValueConverter() {
    }
    TimeValueConverter.prototype.toView = function (value, format) {
        return uiFormat.UIFormat.time(value, format);
    };
    TimeValueConverter = _tslib.__decorate([
        aureliaFramework.valueConverter("time")
    ], TimeValueConverter);
    return TimeValueConverter;
}());
var DatetimeValueConverter = (function () {