本文整理汇总了TypeScript中aurelia-framework.FrameworkConfiguration类的典型用法代码示例。如果您正苦于以下问题:TypeScript FrameworkConfiguration类的具体用法?TypeScript FrameworkConfiguration怎么用?TypeScript FrameworkConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FrameworkConfiguration类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: configure
export function configure(frameworkConfig: FrameworkConfiguration, config: CoreConfig): Promise<void> {
frameworkConfig.singleton(RouteMapper);
frameworkConfig.globalResources([
PLATFORM.moduleName("./routing/route-active/route-active.attribute"),
PLATFORM.moduleName("./routing/route-href/route-href.attribute")
]);
Object.assign(routeActiveConfig, config.routeActive);
return Promise.resolve();
}
示例2: configure
export function configure(frameworkConfig: FrameworkConfiguration, callback?: (config: PluginOptions) => void) {
const logger = getLogger('aurelia-json-schema-form');
logger.info('initializing aurelia-json-schema-form');
// create defaults/apply user defined configuration
const options = new PluginOptions();
if (callback instanceof Function) {
callback(options);
}
registerLogger(logger, options, frameworkConfig);
registerConfiguration(logger, options, frameworkConfig);
(frameworkConfig.container.get(RulesFactory) as RulesFactory).register();
frameworkConfig.globalResources([
PLATFORM.moduleName('./form/au-json-schema-form'),
PLATFORM.moduleName('./value-converters/sf-number-value-converter'),
PLATFORM.moduleName('./value-converters/sf-array-can-remove-value-converter'),
PLATFORM.moduleName('./value-converters/sf-boolean-is-read-only-value-converter'),
PLATFORM.moduleName('./form/array/sf-array'),
PLATFORM.moduleName('./form/object/sf-object'),
PLATFORM.moduleName('./form/number/sf-number'),
PLATFORM.moduleName('./form/text/sf-string'),
PLATFORM.moduleName('./form/boolean/sf-boolean'),
PLATFORM.moduleName('./templates/bootstrap4/bootstrap-tooltip')
]);
}
示例3: configure
export function configure(aurelia: FrameworkConfiguration) {
aurelia.globalResources([
PLATFORM.moduleName('./tree-view/tree-node'),
PLATFORM.moduleName('./tree-view/tree-node-template'),
PLATFORM.moduleName('./tree-view/tree-view')
]);
}
示例4: configure
export function configure(config: FrameworkConfiguration) {
config.globalResources([
PLATFORM.moduleName('./elements/bootstrap-tooltip'),
PLATFORM.moduleName('./elements/loading-indicator'),
PLATFORM.moduleName('./value-converters/date-format')
]);
}
示例5: configure
export function configure(config: FrameworkConfiguration) {
config.globalResources([
"./elements/loading-indicator",
"./elements/date-picker",
"./dialogs/message-box",
"./value-converters/dateFormat"
]);
}
示例6: configure
export function configure(config: FrameworkConfiguration) {
config.globalResources([
'./number-value',
'./registration-form',
'./trigger-form',
'./validation-errors-form-one',
'./nullable-object-form'
]);
}
示例7: configure
export function configure(config: FrameworkConfiguration) {
config.globalResources([
'./components/nav-bar',
'./components/pagination.html',
'./components/list-search.html',
'./value-converters/upper'
]);
}
示例8: configure
export function configure(fc: FrameworkConfiguration){
fc.globalResources([
'./ui/elements/title-bar.html',
'./ui/elements/nav-bar',
'./ui/elements/post-summary',
'./ui/elements/post-object',
'./ui/elements/post-editor',
'./ui/command/command-ext',
'./ui/converters/common'
]);
}
示例9: configure
export function configure(config: FrameworkConfiguration) {
config.globalResources([
// elements
// './elements/nav-bar',
// './elements/pagination.html',
// attributes
// './attributes/authOnly',
// './attributes/themeable'
// binding behaviors
// './throttleOnNetwork'
// value converters
// './value-converters/upperCase'
]);
}
示例10: configure
export function configure(config: FrameworkConfiguration, configCallback) {
config.container.registerHandler('ui-validator', container => container.get(UIValidationRenderer));
config.globalResources([
'./elements/core/ui-viewport',
'./elements/core/ui-page',
'./elements/core/ui-grid'
]);
config.globalResources([
'./elements/components/ui-tab',
'./elements/components/ui-menu',
'./elements/components/ui-panel',
'./elements/components/ui-drawer',
'./elements/components/ui-tree',
'./elements/components/ui-datagrid'
]);
config.globalResources([
'./elements/inputs/ui-button',
'./elements/inputs/ui-input',
'./elements/inputs/ui-option',
'./elements/inputs/ui-markdown',
'./elements/inputs/ui-list',
'./elements/inputs/ui-date'
]);
config.globalResources([
'./attributes/ui-marked',
'./attributes/ui-badge'
]);
config.globalResources([
'./value-converters/ui-text',
'./value-converters/ui-lodash'
]);
var Configure = {
title: (t) => {
UIConstants.App.Title = t;
return Configure;
},
version: (t) => {
UIConstants.App.Version = t;
return Configure;
},
appKey: (t) => {
UIConstants.App.Key = t;
return Configure;
},
apiUrl: (t) => {
UIConstants.Http.BaseUrl = t;
return Configure;
},
apiHeaders: (t) => {
UIConstants.Http.Headers = t;
return Configure;
},
sendAuthHeader: (t) => {
UIConstants.Http.AuthorizationHeader = t;
return Configure;
},
languages: (l) => {
UIConstants.Languages = l;
return Configure;
}
};
if (configCallback !== undefined && typeof configCallback === 'function') {
configCallback(Configure);
}
// Validation Rules
ValidationRules
.customRule('phone', (value, obj) => value === null || value === undefined || value === '' || PhoneLib.isValid(value), '\${$displayName } is not a valid phone number.');
ValidationRules
.customRule('integer', (value, obj, min, max) => value === null || value === undefined || value === '' || (Number.isInteger(value) && value >= (isEmpty(min) ? Number.MIN_VALUE : min) && value <= (isEmpty(max) ? Number.MAX_VALUE : max)),
'\${$displayName} must be an integer value between \${$config.min} and \${$config.max}.', (min, max) => ({ min, max }));
ValidationRules
.customRule('decimal', (value, obj, min, max) => value === null || value === undefined || value === '' || (isNumber(value) && Math.floor(value % 1) === 0 && value >= (isEmpty(min) ? Number.MIN_VALUE : min) && value <= (isEmpty(max) ? Number.MAX_VALUE : max)),
'\${$displayName} must be a decimal value between \${$config.min} and \${$config.max}.', (min, max) => ({ min, max }));
ValidationRules
.customRule('language', (map, obj, controller, langInput) => {
if (!(langInput && langInput.addError && langInput.removeError)) throw new Error('Language validation must have reference to ui-language');
let promises = [];
_.forEach(map, (model, key) => {
promises.push(controller.validator.validateObject(model)
.then(e => {
if (langInput.errors.indexOf(key) > -1) langInput.removeError(key);
if (e.length > 0) langInput.addError(key);
return e.length > 0 ? true : false;
}));
});
return Promise.all(promises).then(e => _.filter(e).length == 0);
}, 'Some language entries contain invalid values');
// Setup kramed
let rend = new kramed.Renderer();
rend.code = (code, lang) => {
if (window.hljs) {
window.hljs.configure({
useBR: true,
tabReplace: ' '
});
//.........这里部分代码省略.........