@yoyoboot/l-52abp-ng
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.13.
3,438 lines • 160 kB
JavaScript
import * as i0 from '@angular/core';
import { InjectionToken, Injectable, Directive, Input, ElementRef, EventEmitter, ChangeDetectorRef, Output, Component, ChangeDetectionStrategy, Optional, Inject, NgModule, forwardRef, Pipe } from '@angular/core';
import * as i1$1 from 'abp-ng2-module';
import { FeatureCheckerService, NotifyService, SettingService, MessageService, AbpMultiTenancyService, AbpSessionService, AbpModule } from 'abp-ng2-module';
import * as i3$1 from '@delon/theme';
import { ALAIN_I18N_TOKEN, ModalHelper, TitleService } from '@delon/theme';
import * as i1 from '@delon/acl';
import { DelonACLModule } from '@delon/acl';
import * as _ from 'lodash';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { trigger, state, style, transition, animate } from '@angular/animations';
import * as i3 from '@angular/common';
import { CommonModule } from '@angular/common';
import { __decorate } from 'tslib';
import { InputBoolean, toBoolean } from '@delon/util';
import * as i4 from '@delon/abc/reuse-tab';
import { ReuseTabService } from '@delon/abc/reuse-tab';
import * as i11 from 'ng-zorro-antd/spin';
import { NzSpinModule } from 'ng-zorro-antd/spin';
import * as i2 from 'ng-zorro-antd/dropdown';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import * as i4$1 from 'ng-zorro-antd/menu';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import * as i1$2 from 'ng-zorro-antd/alert';
import { NzAlertModule } from 'ng-zorro-antd/alert';
import * as i2$1 from 'ng-zorro-antd/divider';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import * as i9 from 'ng-zorro-antd/select';
import { NzSelectModule } from 'ng-zorro-antd/select';
import PerfectScrollbar from 'perfect-scrollbar';
import { Subject, fromEvent, BehaviorSubject } from 'rxjs';
import { debounceTime, takeUntil, finalize, filter } from 'rxjs/operators';
import * as i2$2 from '@angular/forms';
import { NG_VALIDATORS, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
import * as i1$3 from '@angular/cdk/overlay';
import { OverlayConfig } from '@angular/cdk/overlay';
import { ComponentPortal } from '@angular/cdk/portal';
import { HttpHeaders, HttpRequest, HTTP_INTERCEPTORS } from '@angular/common/http';
import * as i1$4 from '@delon/form';
import { ControlWidget, ControlUIWidget, toBool, DelonFormModule } from '@delon/form';
import { format } from 'date-fns';
import { toDate } from '@delon/util/date-time';
import * as moment from 'moment';
import * as i1$5 from 'ng-zorro-antd/date-picker';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import * as i2$3 from 'ngx-simplemde';
import { SimplemdeModule } from 'ngx-simplemde';
import * as i5 from 'ng-zorro-antd/button';
import { NzButtonModule } from 'ng-zorro-antd/button';
import * as i6 from 'ng-zorro-antd/time-picker';
import { NzTimePickerModule } from 'ng-zorro-antd/time-picker';
import * as i1$6 from '@delon/abc/st';
import { STModule } from '@delon/abc/st';
import * as i8 from 'ng-zorro-antd/form';
import { NzFormModule } from 'ng-zorro-antd/form';
import * as i13 from 'ng-zorro-antd/icon';
import { NzIconModule } from 'ng-zorro-antd/icon';
import * as i4$2 from 'ng-zorro-antd/input';
import { NzInputModule } from 'ng-zorro-antd/input';
const YOYO_CONFIG = new InjectionToken('yoyo-config', {
providedIn: 'root',
factory: YOYO_CONFIG_FACTORY
});
function YOYO_CONFIG_FACTORY() {
return new YoyoConfig();
}
class YoyoConfig {
constructor() {
this.grid = new YoyoConfigGrid();
this.lang = new YoyoLang();
this.standartErrors = [
{ error: 'required', localizationKey: 'validation.required' },
{ error: 'minlength', localizationKey: 'validation.minlength', errorProperty: 'requiredLength' },
{ error: 'maxlength', localizationKey: 'validation.maxlength', errorProperty: 'requiredLength' },
{ error: 'email', localizationKey: 'validation.email' },
{ error: 'pattern', localizationKey: 'validation.pattern' },
{ error: 'duplicate', localizationKey: 'DuplicateData' },
{ error: 'min', localizationKey: 'Validation.Common.ValueMustGreaterThan', errorProperty: 'min' },
{ error: 'max', localizationKey: 'Validation.Common.ValueMustLessThan', errorProperty: 'max' },
{ error: 'notGreaterThan', localizationKey: 'Validation.Common.ValueMustGreaterThan', errorProperty: 'value' },
{ error: 'expression', localizationKey: 'ExpressionCheckFailed' },
{ error: 'exist', localizationKey: 'validation.exist' },
{ error: 'confirm', localizationKey: 'validation.confirm' },
];
}
}
class YoyoConfigGrid {
constructor() {
this.defaultPageSize = 20;
this.defaultPageSizes = [20, 50, 80, 100];
}
}
class YoyoLang {
constructor() {
this.defaultSource = 'YoyoCmsTemplate';
this.defaultLang = 'zh-Hans';
}
}
// https://angular.io/guide/styleguide#style-04-12
function throwIfAlreadyLoaded(parentModule, moduleName) {
if (parentModule) {
throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`);
}
}
/**
* 分页请求必须参数
*/
class PagedResultDto {
}
/**
* 分页结果dto
*/
class PagedRequestDto {
}
/** 排序类型 */
var SortType;
(function (SortType) {
SortType[SortType["None"] = 'None'] = "None";
SortType[SortType["Asc"] = 'Asc'] = "Asc";
SortType[SortType["Desc"] = 'Desc'] = "Desc";
})(SortType || (SortType = {}));
class PermissionService {
constructor(aclService) {
this.aclService = aclService;
}
/**
* 判断是否拥有某权限
* @param permissionName (单个/多个) 权限名称
*/
isGranted(permissionName) {
if (!permissionName || permissionName.length === 0) {
return true;
}
if (Array.isArray(permissionName)) {
return this.aclService.can({
role: permissionName,
mode: 'allOf'
});
}
else {
return this.aclService.can(permissionName);
}
}
/**
* 添加权限名称
* @param permissionName 添加(单个/多个)权限名称
*/
addPermission(permissionName) {
if (!permissionName || permissionName.length === 0) {
return;
}
if (Array.isArray(permissionName)) {
for (const tmppermissionName of permissionName) {
if (this.aclService.data.abilities.find(item => item === tmppermissionName)) {
continue;
}
this.aclService.attachRole([tmppermissionName]);
}
}
else {
if (this.aclService.data.abilities.find(item => item === permissionName)) {
return;
}
this.aclService.attachRole([permissionName]);
}
}
/**
* 移除单个/多个权限
* @param permissionName (单个/多个)权限名称
*/
removePermission(permissionName) {
if (!permissionName || permissionName.length === 0) {
return;
}
if (Array.isArray(permissionName)) {
this.aclService.removeRole(permissionName);
}
else {
this.aclService.removeRole([permissionName]);
}
}
/**
* 清空所有权限
*/
clear() {
const tmppermissionNames = this.aclService.data.abilities;
this.removePermission(tmppermissionNames);
}
/**
* 填充数据
* @param auth abp.auth 数据
*/
extend(auth) {
const permissions = [];
// tslint:disable-next-line:forin
for (const key in auth.grantedPermissions) {
permissions.push(key);
}
this.addPermission(permissions);
}
}
PermissionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionService, deps: [{ token: i1.ACLService }], target: i0.ɵɵFactoryTarget.Injectable });
PermissionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionService, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: i1.ACLService }]; } });
class SampleComponentBaseDirective {
constructor(injector) {
this.injector = injector;
this.localization = injector.get(ALAIN_I18N_TOKEN);
this.permission = injector.get(PermissionService);
}
/**
* 本地化
* @param key 本地化key
* @param args 本地化参数
* @returns 本地化结果
*/
l(key, ...args) {
return this.localization.l(key, null, ...args);
}
/**
* 权限列表验证
* @param permissions 权限名称列表
* @returns 是否拥有此权限
*/
isGranted(permissions) {
if (!permissions) {
return true;
}
return this.permission.isGranted(permissions);
}
/**
* 权限列表验证
* @param permissions 权限名称列表
* @returns 是否拥有此权限
*/
isGrantedAny(...permissions) {
if (!permissions) {
return false;
}
for (const permission of permissions) {
if (this.isGranted(permission)) {
return true;
}
}
return false;
}
}
SampleComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SampleComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
SampleComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: SampleComponentBaseDirective, inputs: { loading: "loading" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SampleComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { loading: [{
type: Input
}] } });
class FakeAppSessionService {
init() {
throw new Error('Method not implemented.');
}
getShownLoginName() {
throw new Error('Method not implemented.');
}
changeTenantIfNeeded(tenantId) {
throw new Error('Method not implemented.');
}
}
FakeAppSessionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FakeAppSessionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
FakeAppSessionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FakeAppSessionService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FakeAppSessionService, decorators: [{
type: Injectable
}] });
const YOYO_APP_SESSION_SERVICE = new InjectionToken('yoyo-app-session-service', {
providedIn: 'root',
factory: YOYO_APP_SESSION_SERVICE_FACTORY
});
function YOYO_APP_SESSION_SERVICE_FACTORY() {
return new FakeAppSessionService();
}
class TreeDataHelperService {
findNode(data, selector) {
const nodes = _.filter(data, selector);
if (nodes && nodes.length === 1) {
return nodes[0];
}
let foundNode = null;
_.forEach(data, d => {
if (!foundNode) {
foundNode = this.findNode(d.children, selector);
}
});
return foundNode;
}
}
TreeDataHelperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TreeDataHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
TreeDataHelperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TreeDataHelperService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TreeDataHelperService, decorators: [{
type: Injectable
}] });
class ArrayToTreeConverterService {
createTree(array, parentIdProperty, idProperty, parentIdValue, childrenProperty, fieldMappings) {
const tree = [];
const nodes = _.filter(array, [parentIdProperty, parentIdValue]);
_.forEach(nodes, node => {
const newNode = {
data: node,
};
this.mapFields(node, newNode, fieldMappings);
newNode[childrenProperty] = this.createTree(array, parentIdProperty, idProperty, node[idProperty], childrenProperty, fieldMappings);
tree.push(newNode);
});
return tree;
}
mapFields(node, newNode, fieldMappings) {
_.forEach(fieldMappings, fieldMapping => {
if (!fieldMapping.target) {
return;
}
if (fieldMapping.hasOwnProperty('value')) {
newNode[fieldMapping.target] = fieldMapping.value;
}
else if (fieldMapping.source) {
newNode[fieldMapping.target] = node[fieldMapping.source];
}
else if (fieldMapping.targetFunction) {
newNode[fieldMapping.target] = fieldMapping.targetFunction(node);
}
});
}
}
ArrayToTreeConverterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ArrayToTreeConverterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
ArrayToTreeConverterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ArrayToTreeConverterService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ArrayToTreeConverterService, decorators: [{
type: Injectable
}] });
// 加载第三方脚本的service
class ScriptLoaderService {
constructor() {
this.scripts = {};
}
load(...scripts) {
this.scripts = scripts;
const promises = [];
scripts.forEach((script) => promises.push(this.loadScript(script)));
return Promise.all(promises);
}
loadScript(name) {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = name;
if (script.readyState) { // IE
script.onreadystatechange = () => {
if (script.readyState === 'loaded' || script.readyState === 'complete') {
script.onreadystatechange = null;
resolve({ script: name, loaded: true, status: 'Loaded' });
}
};
}
else { // Others
script.onload = () => {
resolve({ script: name, loaded: true, status: 'Loaded' });
};
}
script.onerror = (error) => resolve({ script: name, loaded: false, status: 'Loaded' });
document.getElementsByTagName('head')[0].appendChild(script);
});
}
}
ScriptLoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ScriptLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
ScriptLoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ScriptLoaderService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ScriptLoaderService, decorators: [{
type: Injectable
}] });
class EnumService {
constructor() { }
getData(type) {
// tslint:disable-next-line:no-string-literal
return abp['custom']['EnumMaps'][type];
}
}
EnumService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: EnumService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
EnumService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: EnumService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: EnumService, decorators: [{
type: Injectable
}], ctorParameters: function () { return []; } });
const YOYO_ENUM_SERVICE = new InjectionToken('yoyo-enum-service', {
providedIn: 'root',
factory: YOYO_ENUM_SERVICE_FACTORY
});
function YOYO_ENUM_SERVICE_FACTORY() {
return new EnumService();
}
class AppComponentBaseDirective extends SampleComponentBaseDirective {
constructor(injector) {
super(injector);
/** 保存状态 */
this.saving = false;
this.appConfig = injector.get(YOYO_CONFIG);
this.elementRef = injector.get(ElementRef);
this.modalHelper = injector.get(ModalHelper);
this.feature = injector.get(FeatureCheckerService);
this.notify = injector.get(NotifyService);
this.setting = injector.get(SettingService);
this.message = injector.get(MessageService);
this.multiTenancy = injector.get(AbpMultiTenancyService);
this.titleSrvice = injector.get(TitleService);
this.abpSession = injector.get(AbpSessionService);
this.appSession = injector.get(YOYO_APP_SESSION_SERVICE);
this.enumService = injector.get(YOYO_ENUM_SERVICE);
}
/** 将枚举转换SFS的枚举数组 */
convertToSFSchemaEnumType(listEnumType) {
const temp = [];
listEnumType.map(item => {
temp.push({
label: item.key,
value: item.value,
});
});
return temp;
}
/** 检查实体历史变更记录是否启用 */
checkEntityHistoryEnabled(entityTypeName) {
const customSettings = abp.custom;
const entityTypeHistoryEnabled = customSettings.EntityHistory.enabledEntities.filter((entityType) => entityType === entityTypeName).length === 1;
return (customSettings.EntityHistory &&
customSettings.EntityHistory.isEnabled &&
entityTypeHistoryEnabled);
}
/** 获取枚举显示名称 */
getEnumDisplayName(enumName, key) {
let result = '';
if (enumName === undefined ||
enumName == null ||
key == null ||
key === undefined) {
return result;
}
if (typeof (key) === 'number') {
return this.l(this.enumService.getData(enumName)[key].displayName);
}
if (typeof (key) === 'string') {
const enums = this.enumService.getData(enumName);
if (enums.length > 0) {
enums.forEach(element => {
if (element.value === key) {
result = this.l(element.displayName);
}
});
}
}
return result;
}
}
AppComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AppComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
AppComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: AppComponentBaseDirective, usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AppComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
/** 基于模态框弹出 Form表单提交的基类信息 */
class ModalComponentBaseDirective extends AppComponentBaseDirective {
/**
* 构造函数
* @param injector 注入器
* @param _nzModalRef nzModal 模态框关闭、销毁等处理帮助,只能在modal中打开的组件中注入,非modal打开的组件注入null即可,否则报错。因为nzModalRef是建立在nzModalComponent之上的。
*/
constructor(injector) {
super(injector);
this.title = '';
this.nzModalRef = injector.get(NzModalRef);
}
/**
* 带参数回传关闭
* @param result 回传参数
*/
success(result = true) {
if (result) {
this.nzModalRef.close(result);
}
else {
this.close();
}
}
close($event) {
this.nzModalRef.close();
}
}
ModalComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ModalComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
ModalComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ModalComponentBaseDirective, usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ModalComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
/**
* 分页列表基类,包含一些分页通用方法。注意 派生类中的 `ngOnInit` 会覆盖此类中的此方法。
*/
class PagedListingComponentBaseDirective extends AppComponentBaseDirective {
/**
* 构造函数
* @param injector 注入器
* @param nzModalRef (optional) nzModal 模态框关闭、销毁等处理帮助,只能在modal中打开的组件中注入,非modal打开的组件注入null即可,否则报错。因为nzModalRef是建立在nzModalComponent之上的。
*/
constructor(injector) {
super(injector);
/** 分页大小 */
this.pageSize = this.appConfig.grid.defaultPageSize;
/** 当前页 */
this.pageSizeOptions = this.appConfig.grid.defaultPageSizes;
/** 当前页 */
this.pageNumber = 1;
/** 总页数 */
this.totalPages = 1;
/** 数据是否处于加载状态 */
this.isTableLoading = true;
/** 是否全部选中 */
this.allChecked = false;
/** 全选框是否禁用 */
this.allCheckboxDisabled = false;
/** 选择框非全选状态,控制全选框的样式:☒ */
this.checkboxIndeterminate = false;
/** 已选中数据项列表 */
this.selectedDataItems = [];
/** 排序条件 - 表达式 */
this.sortConditions = [];
/** 排序 */
this.sorting = undefined;
/** 模糊搜索的文本 */
this.filterText = '';
/** 数据表的数据源 */
this.dataList = [];
/** 布尔类型表格列头过滤列表 */
this.booleanFilterList = [
{ text: this.l('All'), value: 'All' },
{ text: this.l('Yes'), value: true },
{ text: this.l('No'), value: false }
];
}
ngOnInit() {
this.refresh();
}
/** 刷新表格数据 */
refresh() {
this.restCheckStatus(this.dataList);
this.getDataPage(this.pageNumber);
}
/** 刷新表格数据并跳转到第一页(`pageNumber = 1`) */
refreshGoFirstPage() {
this.pageNumber = 1;
this.restCheckStatus(this.dataList);
this.getDataPage(this.pageNumber);
}
/** 获取数据页 */
getDataPage(page) {
const req = new PagedRequestDto();
req.maxResultCount = this.pageSize;
req.skipCount = (page - 1) * this.pageSize;
req.sorting = this.sorting;
this.isTableLoading = true;
this.fetchDataList(req, page, () => {
this.isTableLoading = false;
// 更新全选框禁用状态
this.refreshAllCheckBoxDisabled();
});
}
/** 刷新全选框是否禁用 */
refreshAllCheckBoxDisabled() {
this.allCheckboxDisabled = this.dataList.length <= 0;
}
/** 当页码发生改变 */
pageNumberChange() {
if (this.pageNumber > 0) {
this.refresh();
}
}
/**
* 选中全部记录
* @param value 是否选中
*/
checkAll(value) {
this.dataList.forEach(data => data.checked = this.allChecked);
this.refreshCheckStatus(this.dataList);
}
/**
* 刷新选中状态
* @param entityList 数据集合
*/
refreshCheckStatus(entityList) {
// 是否全部选中
const allChecked = entityList.every(value => value.checked === true);
// 是否全部未选中
const allUnChecked = entityList.every(value => !value.checked);
// 是否全选
this.allChecked = allChecked;
// 全选框样式控制
this.checkboxIndeterminate = !allChecked && !allUnChecked;
// 已选中数据
this.selectedDataItems = entityList.filter(value => value.checked);
}
/**
* 重置选中状态
* @param entityList 数据集合
*/
restCheckStatus(entityList) {
if (!Array.isArray(entityList)) {
entityList = this.dataList;
}
this.allChecked = false;
this.checkboxIndeterminate = false;
// 已选中数据
this.selectedDataItems = [];
// 设置数据为未选中状态
entityList.forEach(value => (value.checked = false));
}
/**
* 计算分页
* @param result 分页结果Dto
* @param pageNumber 当前页码
*/
showPaging(result) {
this.totalItems = result.totalCount;
this.totalPages = Math.ceil(this.totalItems / this.pageSize);
}
/** 排序条件发生改变 */
onSortChange(sortConditions, sorting) {
this.sortConditions = sortConditions !== null && sortConditions !== void 0 ? sortConditions : [];
this.sorting = sorting;
this.refresh();
}
/** 数据表格排序 */
gridSort(sort) {
this.sorting = undefined;
this.sortConditions = [];
let ascOrDesc = sort.value; // 'ascend' or 'descend' or null
const filedName = sort.key; // 字段名
if (ascOrDesc) {
ascOrDesc = abp.utils.replaceAll(ascOrDesc, 'end', '');
const args = ['{0} {1}', filedName, ascOrDesc];
const sortingStr = abp.utils.formatString.apply(this, args);
this.sorting = sortingStr;
this.sortConditions.push({
field: filedName,
order: 0,
type: ascOrDesc === 'asc' ? SortType.Asc : SortType.Desc
});
}
this.refresh();
}
/**
* 权限列表验证
* @param permissions 权限名称列表
*/
isGrantedAny(...permissions) {
if (!permissions) {
return false;
}
for (const permission of permissions) {
if (this.isGranted(permission)) {
return true;
}
}
return false;
}
/** st change事件 */
stChange(e) {
switch (e.type) {
case 'checkbox': // 多选
const checked = e.checkbox;
this.refreshCheckStatus(checked);
break;
case 'radio': // 单选
this.refreshCheckStatus([e.radio]);
break;
case 'sort': // 排序
const sortMap = this.processSorting(e);
this.onSortChange(this.toSortConditions(sortMap), this.toSortingString(sortMap));
break;
case 'pi': // page index 修改
this.pageNumber = e.pi;
this.pageNumberChange();
break;
case 'ps': // page size 修改
this.pageSize = e.ps;
this.refresh();
break;
}
}
/** STChange 转 sort cond */
toSortConditions(sortMap) {
if (!sortMap) {
return [];
}
let index = 0;
const sortConditions = [];
// tslint:disable-next-line:forin
for (const key in sortMap) {
sortConditions.push({
field: key,
order: index++,
type: sortMap[key]
});
}
return sortConditions;
}
/** STChange 转 sorting */
toSortingString(sortMap) {
if (!sortMap) {
return '';
}
// 处理数据
let sorting = '';
// tslint:disable-next-line:forin
for (const key in sortMap) {
sorting += `${key} ${sortMap[key]},`;
}
// 截取最后的字符串
if (sorting.endsWith(',')) {
sorting = sorting.substr(0, sorting.length - 1);
}
return sorting;
}
/** 预处理sorting数据 */
processSorting(input) {
// 结果集
const sortMap = {};
if (input.type !== 'sort') {
return sortMap;
}
let sortType = SortType.None;
// tslint:disable-next-line:no-string-literal
const inputSortStringArr = input.sort.map['sort'].split('-');
inputSortStringArr.forEach(o => {
const lastIndex = o.lastIndexOf('.');
const field = o.substring(0, lastIndex);
const fieldSortType = o.substring(lastIndex + 1, o.length);
sortType = SortType.None;
switch (fieldSortType) {
case 'descend':
sortType = SortType.Desc;
break;
case 'ascend':
sortType = SortType.Asc;
break;
}
if (sortType !== SortType.None) {
sortMap[field] = sortType;
}
});
return sortMap;
}
}
PagedListingComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PagedListingComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
PagedListingComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: PagedListingComponentBaseDirective, usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PagedListingComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
class ModalPagedListingComponentBaseDirective extends PagedListingComponentBaseDirective {
/**
* 构造函数
* @param injector 注入器
* @param _nzModalRef nzModal 模态框关闭、销毁等处理帮助,只能在modal中打开的组件中注入,非modal打开的组件注入null即可,否则报错。因为nzModalRef是建立在nzModalComponent之上的。
*/
constructor(injector) {
super(injector);
this.title = '';
this.nzModalRef = injector.get(NzModalRef);
}
/**
* 带参数回传关闭
* @param result 回传参数
*/
success(result = true) {
if (result) {
this.nzModalRef.close(result);
}
else {
this.close();
}
}
close($event) {
this.nzModalRef.close();
}
}
ModalPagedListingComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ModalPagedListingComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
ModalPagedListingComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ModalPagedListingComponentBaseDirective, usesInheritance: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ModalPagedListingComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
/***
* 简单控件基类
*/
class SampleControlComponentBaseDirective extends SampleComponentBaseDirective {
constructor(injector) {
super(injector);
/** 占位符 */
this.placeholder = '';
/** 值发生更改事件 */
this.valueChange = new EventEmitter();
this.cdr = injector.get(ChangeDetectorRef);
}
ngOnInit() {
this.onInit();
}
ngAfterViewInit() {
this.onAfterViewInit();
}
ngOnChanges(changes) {
this.onInputChange(changes);
}
ngOnDestroy() {
this.onDestroy();
}
emitValueChange(val) {
this.value = val;
this.valueChange.emit(val);
}
}
SampleControlComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SampleControlComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
SampleControlComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: SampleControlComponentBaseDirective, inputs: { placeholder: "placeholder", enabledClear: "enabledClear", enabledFileter: "enabledFileter", disabled: "disabled", value: "value" }, outputs: { valueChange: "valueChange" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SampleControlComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { placeholder: [{
type: Input
}], enabledClear: [{
type: Input
}], enabledFileter: [{
type: Input
}], disabled: [{
type: Input
}], value: [{
type: Input
}], valueChange: [{
type: Output
}] } });
/***
* 表单控件基类
*/
class ControlComponentBaseDirective extends SampleControlComponentBaseDirective {
constructor(injector) {
super(injector);
this.cdr = injector.get(ChangeDetectorRef);
}
ngOnChanges(changes) {
if (changes.value) {
this.writeValue(changes.value.currentValue);
}
this.onInputChange(changes);
}
registerOnChange(fn) {
this.valueChange.emit = fn;
}
registerOnTouched(fn) {
}
setDisabledState(isDisabled) {
this.disabled = isDisabled;
}
writeValue(obj) {
this.value = obj;
this.cdr.detectChanges();
}
}
ControlComponentBaseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ControlComponentBaseDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
ControlComponentBaseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ControlComponentBaseDirective, inputs: { name: "name" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ControlComponentBaseDirective, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { name: [{
type: Input
}] } });
function appModuleAnimation() {
return slideFromBottom();
}
function accountModuleAnimation() {
return slideFromUp();
}
function slideFromBottom() {
return trigger('routerTransition', [
state('void', style({ 'padding-top': '20px', opacity: '0' })),
state('*', style({ 'padding-top': '0px', opacity: '1' })),
transition(':enter', [
animate('0.33s ease-out', style({ opacity: '1', 'padding-top': '0px' }))
])
]);
}
function slideFromUp() {
return trigger('routerTransition', [
state('void', style({ 'margin-top': '10px', opacity: '0' })),
state('*', style({ 'margin-top': '0px', opacity: '1' })),
transition(':enter', [
animate('0.3s ease-out', style({ opacity: '1', 'margin-top': '0px' }))
])
]);
}
class ImgShowComponent extends ModalComponentBaseDirective {
constructor(injector) {
super(injector);
this.imgUrl = '';
}
}
ImgShowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ImgShowComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
ImgShowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ImgShowComponent, selector: "l-img-show", usesInheritance: true, ngImport: i0, template: "<img [src]=\"imgUrl\" style=\"width:100%;height:100%;margin-top: 20px;\" />\n" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ImgShowComponent, decorators: [{
type: Component,
args: [{
selector: 'l-img-show',
templateUrl: './img-show.component.html',
styles: []
}]
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
class NoDataComponent extends SampleComponentBaseDirective {
// endregion
constructor(injector) {
super(injector);
/**
* 图标
*/
this.icon = 'iconfont icon-frown-o';
}
ngOnInit() {
if (!this.text) {
this.text = this.l('NoData');
}
}
}
NoDataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: NoDataComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
NoDataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: NoDataComponent, selector: "l-no-data", inputs: { text: "text", icon: "icon" }, usesInheritance: true, ngImport: i0, template: `
<span class="no-result-data">
<i *ngIf="icon" [class]="icon"></i>
<span>{{ text }}</span>
</span>
`, isInline: true, styles: ["\n .no-result-data {\n color: rgba(0, 0, 0, 0.25);\n text-align: center;\n line-height: 64px;\n font-size: 16px;\n margin: 0 auto;\n }\n\n .no-result-data i {\n font-size: 24px;\n margin-right: 16px;\n position: relative;\n top: 3px;\n }\n "], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: NoDataComponent, decorators: [{
type: Component,
args: [{
selector: 'l-no-data',
template: `
<span class="no-result-data">
<i *ngIf="icon" [class]="icon"></i>
<span>{{ text }}</span>
</span>
`,
styles: [
`
.no-result-data {
color: rgba(0, 0, 0, 0.25);
text-align: center;
line-height: 64px;
font-size: 16px;
margin: 0 auto;
}
.no-result-data i {
font-size: 24px;
margin-right: 16px;
position: relative;
top: 3px;
}
`,
],
preserveWhitespaces: false,
}]
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { text: [{
type: Input
}], icon: [{
type: Input
}] } });
class PageGridComponent {
constructor(el, rend, titleSrv, reuseSrv) {
this.el = el;
this.rend = rend;
this.titleSrv = titleSrv;
this.reuseSrv = reuseSrv;
this.loading = false;
this.noSpacing = false;
}
set title(value) {
if (value) {
if (this.titleSrv) {
this.titleSrv.setTitle(value);
}
if (this.reuseSrv) {
this.reuseSrv.title = value;
}
}
}
ngAfterViewInit() {
if (this.style) {
Object.keys(this.style).forEach((key) => {
this.rend.setStyle(this.el.nativeElement, key, this.style[key]);
});
}
}
}
PageGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PageGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: TitleService, optional: true }, { token: ReuseTabService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
PageGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: PageGridComponent, selector: "l-page-grid", inputs: { loading: "loading", noSpacing: "noSpacing", style: "style", title: "title" }, host: { properties: { "class.alain-pro__page-grid": "true", "class.alain-pro__page-grid-no-spacing": "noSpacing", "class.alain-pro__page-grid-wide": "false" } }, ngImport: i0, template: "<nz-spin [nzSpinning]=\"loading\">\n <div *ngIf=\"loading\" class=\"brand-page-loading\"></div>\n <ng-template nzDrawerContent></ng-template>\n</nz-spin>\n", components: [{ type: i11.NzSpinComponent, selector: "nz-spin", inputs: ["nzIndicator", "nzSize", "nzTip", "nzDelay", "nzSimple", "nzSpinning"], exportAs: ["nzSpin"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
__decorate([
InputBoolean()
], PageGridComponent.prototype, "loading", void 0);
__decorate([
InputBoolean()
], PageGridComponent.prototype, "noSpacing", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PageGridComponent, decorators: [{
type: Component,
args: [{
selector: 'l-page-grid',
templateUrl: './page-grid.component.html',
host: {
'[class.alain-pro__page-grid]': 'true',
'[class.alain-pro__page-grid-no-spacing]': 'noSpacing',
'[class.alain-pro__page-grid-wide]': 'false',
},
changeDetection: ChangeDetectionStrategy.OnPush,
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i3$1.TitleService, decorators: [{
type: Optional
}, {
type: Inject,
args: [TitleService]
}] }, { type: i4.ReuseTabService, decorators: [{
type: Optional
}, {
type: Inject,
args: [ReuseTabService]
}] }]; }, propDecorators: { loading: [{
type: Input
}], noSpacing: [{
type: Input
}], style: [{
type: Input
}], title: [{
type: Input
}] } });
class ProLangsComponent extends SampleComponentBaseDirective {
constructor(injector, utilsService) {
super(injector);
this.utilsService = utilsService;
this.placement = 'bottomRight';
this.btnClass = 'alain-pro__header-item';
this.btnIconClass = 'alain-pro__header-item-icon';
}
ngOnInit() {
this.languages = this.localization.languages.filter(l => !l.isDisabled);
// _.filter(this.localization.languages, l => !l.isDisabled);
this.currentLanguage = this.localization.currentLanguage;
}
changeLanguage(languageName) {
this.utilsService.setCookieValue('Abp.Localization.CultureName', languageName, new Date(new Date().getTime() + 5 * 365 * 86400000), // 5 year
abp.appPath);
location.reload();
}
}
ProLangsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProLangsComponent, deps: [{ token: i0.Injector }, { token: i1$1.UtilsService }], target: i0.ɵɵFactoryTarget.Component });
ProLangsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ProLangsComponent, selector: "l-pro-langs", inputs: { placement: "placement", btnClass: "btnClass", btnIconClass: "btnIconClass" }, usesInheritance: true, ngImport: i0, template: "<div nz-dropdown [nzDropdownMenu]=\"langMenu\" [nzPlacement]=\"placement\" [ngClass]=\"btnClass\">\n <i nz-icon nzType=\"global\" [ngClass]=\"btnIconClass\"></i>\n</div>\n<nz-dropdown-menu #langMenu=\"nzDropdownMenu\">\n <div nz-menu class=\"width-sm\" *ngIf=\"languages && currentLanguage\">\n <li nz-menu-item *ngFor=\"let item of languages\" [nzSelected]=\"item.name == currentLanguage.name\" (click)=\"changeLanguage(item.name)\">\n <i class=\"anticon {{ item.icon }}\"></i>\n <span>{{ item.displayName }}</span>\n </li>\n </div>\n</nz-dropdown-menu>\n", components: [{ type: i2.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }], directives: [{ type: i2.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzHasBackdrop", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4$1.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter", "nzPaddingLeft"], exportAs: ["nzMenuItem"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProLangsComponent, decorators: [{
type: Component,
args: [{
selector: 'l-pro-langs',
templateUrl: './pro-langs.component.html',
styles: [],
}]
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$1.UtilsService }]; }, propDecorators: { placement: [{
type: Input
}], btnClass: [{
type: Input
}], btnIconClass: [{
type: Input
}] } });
class TableCheckboxPanelComponent extends SampleComponentBaseDirective {
constructor(injector) {
super(injector);
this.onClear = new EventEmitter();
this.onRefresh = new EventEmitter();
this.selectLength = 0;
}
ngOnInit() {
}
onClearClick() {
this.onClear.emit();
}
// 触发刷新方法,调用绑定的onRefresh事件
onRefreshClick() {
this.onRefresh.emit();
}
}
TableCheckboxPanelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TableCheckboxPanelComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
TableCheckboxPanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: TableCheckboxPanelComponent, selector: "l-table-checkbox-panel", inputs: { selectLength: "selectLength" }, outputs: { onClear: "onClear", onRefresh: "onRefresh" }, usesInheritance: true, ngImport: i0, template: "<!-- \u590D\u9009\u6846\u63D0\u793A\u7684\u5185\u5BB9\u6570\u636E\u90E8\u5206 -->\n<div class=\"my-md\">\n <nz-alert [nzType]=\"'info'\" [nzShowIcon]=\"true\" [nzMessage]=\"message\">\n <ng-template #message>\n <span [innerHTML]=\"l('GridSelectedXItemsTips', selectLength)\"></span>\n <a (click)=\"onClearClick()\" class=\"ml-md\">\n {{ l('ClearEmpty') }}\n </a>\n <nz-divider nzType=\"vertical\"></nz-divider>\n <a (click)=\"onRefreshClick()\"> {{ l('Refresh') }} </a>\n </ng-template>\n </nz-alert>\n</div>\n", components: [{ type: i1$2.NzAlertComponent, selector: "nz-alert", inputs: ["nzCloseText", "nzIconType", "nzMessage", "nzDescription", "nzType", "nzCloseable", "nzShowIcon", "nzBanner", "nzNoAnimation"], outputs: ["nzOnClose"], exportAs: ["nzAlert"] }, { type: i2$1.NzDividerComponent, selector: "nz-divider", inputs: ["nzType", "nzOrientation", "nzDashed", "nzPlain", "nzText"], exportAs: ["nzDivider"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TableCheckboxPanelComponent, decorators: [{
type: Component,
args: [{
selector: 'l-table-checkbox-panel',
templateUrl: './table-checkbox-panel.component.html',
styles: [],
}]
}], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { onClear: [{
type: Output
}], onRefresh: [{
type: Output
}], selectLength: [{
type: Input
}] } });
const NG_ZORRO_MODULES = [
NzSelectModule,
NzDropDownModule,
NzSpinModule,
NzAlertModule,
NzDividerModule,
];
const ENTRY_COMPONENTS$1 = [
ImgShowComponent,
];
const ALL_COMPONENTS = [
NoDataComponent,
PageGridComponent,
ProLangsComponent,
TableCheckboxPanelComponent,
...ENTRY_COMPONENTS$1
];
/** 自定义组件模块 */
class LComponentsModule {
}
LComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LComponentsModule, declarations: [NoDataComponent,
PageGridComponent,
ProLangsComponent,
TableCheckboxPanelComponent, ImgShowComponent], imports: [CommonModule, NzSelectModule,
NzDropDownModule,
NzSpinModule,
NzAlertModule,
NzDividerModule], exports: [NoDataComponent,
PageGridComponent,
ProLangsComponent,
TableCheckboxPanelComponent, ImgShowComponent] });
LComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LComponentsModule, imports: [[
CommonModule,
...NG_ZORRO_MODULES
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LComponentsModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule,
...NG_ZORRO_MODULES
],
declarations: [
...ALL_COMPONENTS
],
exports: [
...ALL_COMPONENTS
],
entryComponents: [
...ENTRY_COMPONENTS$1
]
}]
}] });
class AutoFocusDirective {
constructor(element) {
this.element = element;
}
ngAfterViewInit() {
const ele = this.element.nativeElement;
if (ele) {
ele.focus();
}
}
}
AutoFocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AutoFocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
AutoFocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: AutoFocusDirective, selector: "[autoFocus]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AutoFocusDirective, decorators: [{
type: Directive,
args: [{
selector: '[autoFocus]',
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
const PerfectScrollbarEvents = [
'psScrollY',
'psScrollX',
'psScrollUp',
'psScrollDown',
'psScrollLeft',
'psScrollRight',
'psYReachEnd',
'psYReachStart',
'psXReachEnd',
'psXReachStart',
];
class ScrollbarDirective {
constructor(elRef, zone) {
this.elRef = elRef;
this.zone = zone;
this.instance = null;
this.ngDestroy = new Subject();
this._disabled = false;
this.options = {};
this.psScrollX = new EventEmitter();
this.psScrollY = new EventEmitter();
this.psScrollUp = new EventEmitter();
this.psScrollDown = new EventEmitter();
this.psScrollLeft = new EventEmitter();
this.psScrollRight = new EventEmitter();
this.psXReachStart = new EventEmitter();
this.psXReachEnd = new EventEmitter();
this.psYReachStart = new EventEmitter();
this.psYReachEnd = new EventEmitter();
}
set disabled(value) {
this._disabled = toBoolean(value);
if (this._disabled) {
this.ngOnDestroy();
}
else {
this.init();
}
}
get el() {
return this.elRef.nativeElement;
}
scrollToBottom() {
this.el.scrollTop = this.el.scrollHeight - this.el.clientHeight;
}
scrollToTop() {
this.el.scrollTop = 0;
}
scrollToLeft() {
this.el.scrollLeft = 0;
}
scrollToRight() {
this.el.scrollLeft = this.el.scrollWidth - this.el.clientWidth;
}
init() {
this.zone.runOutsideAngular(() => {
const options = Object.assign({ wheelSpeed: 0.5, swipeEasing: true, wheelPropagation: false, minScrollbarLength: 40, maxScrollbarLength: 300 }, this.options);
setTimeout(() => {
if (this._disabled) {
return;
}
this.instance = new PerfectScrollbar(this.el, options);
PerfectScrollbarEvents.forEach((eventName) => {
const eventType = eventName.replace(/([A-Z])/g, c => `-${c.toLowerCase()}`);
fromEvent(this.el, eventType)
.pipe(debounceTime(20), takeUntil(this.ngDestroy))
.subscribe((event) => {
this[eventName].emit(event);
});
});
}, this.options.delay || 0);
});
}
ngOnDestroy() {
this.ngDestroy.next();
this.ngDestroy.complete();
this.zone.runOutsideAngular(() => {
if (this.instance) {
this.instance.destroy();
}
this.instance = null;
});
}
ngAfterViewInit() {
this.init();
}
}
ScrollbarDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ScrollbarDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
ScrollbarDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ScrollbarDirective, selector: "[Scrollbar]", inputs: { options: ["scrollbar", "options"], disabled: "disabled" }, outputs: { psScrollX: "psScrollX", psScrollY: "psScrollY", psScrollUp: "psScrollUp", psScrollDown: "psScrollDown", psScrollLeft: "psScrollLeft", psScrollRight: "psScrollRight", psXReachStart: "psXReachStart", psXReachEnd: "psXReachEnd", psYReachStart: "psYReachStart", psYReachEnd: "psYReachEnd" }, exportAs: ["scrollbarComp"], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ScrollbarDirective, decorators: [{
type: Directive,
args: [{
selector: '[Scrollbar]',
exportAs: 'scrollbarComp',
}]
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { options: [{
type: Input,
args: ['scrollbar']
}], disabled: [{
type: Input
}], psScrollX: [{
type: Output
}], psScrollY: [{
type: Output
}], psScrollUp: [{
type: Output
}], psScrollDown: [{
type: Output
}], psScrollLeft: [{
type: Output
}], psScrollRight: [{
type: Output
}], psXReachStart: [{
type: Output
}], psXReachEnd: [{
type: Output
}], psYReachStart: [{
type: Output
}], psYReachEnd: [{
type: Output
}] } });
// Got from: https://scotch.io/tutorials/how-to-implement-a-custom-validator-directive-confirm-password-in-angular-2
class EqualValidator {
constructor() {
this._default = {};
this._enabled = false;
}
set confirm(value) {
this._confirmValue = value;
this._enabled = typeof (value) === 'string';
if (this._onChange) {
this._onChange();
}
}
set validateEqual(value) {
this.confirm = value;
}
validate(control) {
if (!this._enabled) {
return this._default;
}
if (!control.value || control.value.trim() === '') {
return this._default;
}
if (control.value !== this._confirmValue) {
return { validateEqual: true, confirm: true, error: true };
}
return this._default;
}
registerOnValidatorChange(fn) {
this._onChange = fn;
}
}
EqualValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: EqualValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
EqualValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: EqualValidator, selector: "[validateEqual][formControlName],[validateEqual][formControl],[validateEqual][ngModel],:not([type=checkbox])[confirm][formControlName],:not([type=checkbox])[confirm][formControl],:not([type=checkbox])[confirm][ngModel]", inputs: { confirm: "confirm", validateEqual: "validateEqual" }, providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => EqualValidator),
multi: true,
},
], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: EqualValidator, decorators: [{
type: Directive,
args: [{
selector: '[validateEqual][formControlName],[validateEqual][formControl],[validateEqual][ngModel],:not([type=checkbox])[confirm][formControlName],:not([type=checkbox])[confirm][formControl],:not([type=checkbox])[confirm][ngModel]',
providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => EqualValidator),
multi: true,
},
],
}]
}], ctorParameters: function () { return []; }, propDecorators: { confirm: [{
type: Input
}], validateEqual: [{
type: Input
}] } });
class ExpressionValidator {
validate(control) {
let validationResult = null;
if (!this.expression) {
return validationResult;
}
if (!control.value || control.value.length < 0) {
return validationResult;
}
const currentValue = control.value;
let error = false;
let regexp;
if (Array.isArray(this.expression)) {
for (const item of this.expression) {
regexp = new RegExp(item);
if (!regexp.test(currentValue)) {
error = true;
break;
}
}
}
else {
regexp = new RegExp(this.expression);
error = !regexp.test(currentValue);
}
if (error) {
validationResult = {};
validationResult.expression = true;
}
else {
validationResult = null;
}
return validationResult;
}
}
ExpressionValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExpressionValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
ExpressionValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ExpressionValidator, selector: "[expression]", inputs: { expression: "expression" }, providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => ExpressionValidator),
multi: true,
},
], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ExpressionValidator, decorators: [{
type: Directive,
args: [{
selector: '[expression]',
providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => ExpressionValidator),
multi: true,
},
],
}]
}], propDecorators: { expression: [{
type: Input
}] } });
class MaxValueValidator {
validate(control) {
const currentValue = control.value;
let validationResult = null;
if (!currentValue) {
return validationResult;
}
const maxValue = this.maxValue;
if (maxValue && currentValue > maxValue) {
validationResult = validationResult || {};
validationResult.maxValue = true;
}
return validationResult;
}
}
MaxValueValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MaxValueValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
MaxValueValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: MaxValueValidator, selector: "[maxValue]", inputs: { maxValue: "maxValue" }, providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MaxValueValidator),
multi: true,
},
], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MaxValueValidator, decorators: [{
type: Directive,
args: [{
selector: '[maxValue]',
providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MaxValueValidator),
multi: true,
},
],
}]
}], propDecorators: { maxValue: [{
type: Input
}] } });
class MinValueValidator {
validate(control) {
const currentValue = control.value;
let validationResult = null;
if (!currentValue) {
return validationResult;
}
const minValue = this.minValue;
if (minValue && currentValue < minValue) {
validationResult = validationResult || {};
validationResult.minValue = true;
}
return validationResult;
}
}
MinValueValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MinValueValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
MinValueValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: MinValueValidator, selector: "[minValue]", inputs: { minValue: "minValue" }, providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MinValueValidator),
multi: true,
},
], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MinValueValidator, decorators: [{
type: Directive,
args: [{
selector: '[minValue]',
providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => MinValueValidator),
multi: true,
},
],
}]
}], propDecorators: { minValue: [{
type: Input
}] } });
class PasswordComplexityValidator {
validate(control) {
const givenPassword = control.value;
let validationResult = null;
const requireDigit = this.requireDigit;
if (requireDigit && givenPassword && !/[0-9]/.test(givenPassword)) {
validationResult = validationResult || {};
validationResult.requireDigit = true;
}
const requireUppercase = this.requireUppercase;
if (requireUppercase && givenPassword && !/[A-Z]/.test(givenPassword)) {
validationResult = validationResult || {};
validationResult.requireUppercase = true;
}
const requireLowercase = this.requireLowercase;
if (requireLowercase && givenPassword && !/[a-z]/.test(givenPassword)) {
validationResult = validationResult || {};
validationResult.requireLowercase = true;
}
const requiredLength = this.requiredLength;
if (requiredLength &&
givenPassword &&
givenPassword.length < requiredLength) {
validationResult = validationResult || {};
validationResult.requiredLength = true;
}
// use upperCaseLetters
const requireNonAlphanumeric = this.requireNonAlphanumeric;
if (requireNonAlphanumeric &&
givenPassword &&
/^[0-9a-zA-Z]+$/.test(givenPassword)) {
validationResult = validationResult || {};
validationResult.requireNonAlphanumeric = true;
}
return validationResult;
}
}
PasswordComplexityValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PasswordComplexityValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
PasswordComplexityValidator.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: PasswordComplexityValidator, selector: "[requireDigit],[requireLowercase],[requireNonAlphanumeric],[requireUppercase],[requiredLength]", inputs: { requireDigit: "requireDigit", requireUppercase: "requireUppercase", requireLowercase: "requireLowercase", requireNonAlphanumeric: "requireNonAlphanumeric", requiredLength: "requiredLength" }, providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => PasswordComplexityValidator),
multi: true,
},
], ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PasswordComplexityValidator, decorators: [{
type: Directive,
args: [{
selector: '[requireDigit],[requireLowercase],[requireNonAlphanumeric],[requireUppercase],[requiredLength]',
providers: [
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => PasswordComplexityValidator),
multi: true,
},
],
}]
}], propDecorators: { requireDigit: [{
type: Input
}], requireUppercase: [{
type: Input
}], requireLowercase: [{
type: Input
}], requireNonAlphanumeric: [{
type: Input
}], requiredLength: [{
type: Input
}] } });
const VALIDATION_DIRECTIVES = [
EqualValidator,
MinValueValidator,
PasswordComplexityValidator,
ExpressionValidator,
MaxValueValidator,
];
const ALL_DIRECTIVES = [
AutoFocusDirective,
ScrollbarDirective,
...VALIDATION_DIRECTIVES
];
/** 自定义指令模块 */
class LDirectivesModule {
static forRoot() {
return { ngModule: LDirectivesModule };
}
}
LDirectivesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LDirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LDirectivesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LDirectivesModule, declarations: [AutoFocusDirective,
ScrollbarDirective, EqualValidator,
MinValueValidator,
PasswordComplexityValidator,
ExpressionValidator,
MaxValueValidator], imports: [CommonModule], exports: [AutoFocusDirective,
ScrollbarDirective, EqualValidator,
MinValueValidator,
PasswordComplexityValidator,
ExpressionValidator,
MaxValueValidator] });
LDirectivesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LDirectivesModule, imports: [[CommonModule]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LDirectivesModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule],
declarations: [
...ALL_DIRECTIVES
],
exports: [
...ALL_DIRECTIVES
],
}]
}] });
class OverlayComponent {
constructor(injector) {
this.injector = injector;
this.i18nSer = injector.get(ALAIN_I18N_TOKEN);
}
ngOnInit() {
this.loadingThreeDot = this.i18nSer.fanyi('LoadingThreeDot');
}
}
OverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: OverlayComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
OverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: OverlayComponent, selector: "l-overlay", ngImport: i0, template: "<!-- <nz-spin [nzTip]=\"loadingThreeDot\" nzSimple [nzSize]=\"'large'\"></nz-spin> -->\n", styles: [":host ::ng-deep nz-spin{display:inline-block;margin-right:16px}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: OverlayComponent, decorators: [{
type: Component,
args: [{
selector: 'l-overlay',
templateUrl: './overlay.component.html',
styleUrls: ['./overlay.component.less']
}]
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
const ENTRY_COMPONENTS = [
OverlayComponent
];
class LGlobalLoadingModule {
}
LGlobalLoadingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LGlobalLoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LGlobalLoadingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LGlobalLoadingModule, declarations: [OverlayComponent], imports: [CommonModule] });
LGlobalLoadingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LGlobalLoadingModule, imports: [[
CommonModule
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LGlobalLoadingModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule
],
declarations: [
...ENTRY_COMPONENTS
],
entryComponents: [
...ENTRY_COMPONENTS
]
}]
}] });
class LoadingService {
constructor(overlay) {
this.overlay = overlay;
this.showLoading = false;
}
/** 显示加载效果 */
show(message = '', target) {
if (!this.showLoading) {
const config = new OverlayConfig();
if (target) {
config.positionStrategy = this.overlay
.position()
.flexibleConnectedTo(target.element)
.withPositions([
{
originY: 'center',
originX: 'center',
overlayX: 'start',
overlayY: 'top'
}
]);
}
else {
config.positionStrategy = this.overlay
.position()
.global()
.centerHorizontally() // 水平居中
.centerVertically();
}
config.hasBackdrop = true;
this.overlayRef = this.overlay.create(config); // OverlayRef, overlay层
this.overlayRef.attach(new ComponentPortal(OverlayComponent, target));
this.showLoading = true;
}
}
/** 隐藏 */
hide() {
if (this.showLoading) {
this.overlayRef.dispose();
this.showLoading = false;
}
}
static include(componentType) {
if (!LoadingService.appliedComponents.includes(componentType)) {
LoadingService.appliedComponents.push(componentType);
}
}
}
LoadingService.appliedComponents = [];
LoadingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoadingService, deps: [{ token: i1$3.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
LoadingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoadingService, providedIn: 'root' });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoadingService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: function () { return [{ type: i1$3.Overlay }]; } });
class LoadingInterceptor {
constructor(loadingOverlayService) {
this.loadingOverlayService = loadingOverlayService;
}
intercept(req, next) {
this.loadingOverlayService.show();
return next.handle(req).pipe(finalize(() => {
setTimeout(() => {
this.loadingOverlayService.hide();
}, 500);
}));
}
}
LoadingInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
LoadingInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoadingInterceptor });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LoadingInterceptor, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: LoadingService }]; } });
/** 请求帮助器 */
class RequestHelper {
/**
* 创建请求头
*/
static createHttpHeaders() {
let modifiedHeaders = new HttpHeaders();
modifiedHeaders.append('Pragma', 'no-cache');
modifiedHeaders.append('Cache-Control', 'no-cache');
modifiedHeaders.append('Expires', 'Sat, 01 Jan 2000 00:00:00 GMT');
modifiedHeaders = this.addXRequestedWithHeader(modifiedHeaders);
modifiedHeaders = this.addAuthorizationHeaders(modifiedHeaders);
modifiedHeaders = this.addAspNetCoreCultureHeader(modifiedHeaders);
modifiedHeaders = this.addAcceptLanguageHeader(modifiedHeaders);
modifiedHeaders = this.addTenantIdHeader(modifiedHeaders);
return modifiedHeaders;
}
/**
* 创建请求
* @param httpClient http客户端
* @param url 地址
* @param methad 请求方式, GET\POST\PUT\DELETE,默认值get
* @param formDate formDate
* @param headers 请求头
*/
static createRequest(httpClient, url, methad, formDate, headers) {
if (!headers) {
headers = RequestHelper.createHttpHeaders();
}
if (!methad) {
methad = 'GET';
}
const request = new HttpRequest(methad, url, formDate, {
headers
});
return httpClient.request(request);
}
static addXRequestedWithHeader(headers) {
if (headers) {
headers = headers.set('X-Requested-With', 'XMLHttpRequest');
}
return headers;
}
static addAspNetCoreCultureHeader(headers) {
const cookieLangValue = abp.utils.getCookieValue('Abp.Localization.CultureName');
if (cookieLangValue && headers && !headers.has('.AspNetCore.Culture')) {
headers = headers.set('.AspNetCore.Culture', cookieLangValue);
}
return headers;
}
static addAcceptLanguageHeader(headers) {
const cookieLangValue = abp.utils.getCookieValue('Abp.Localization.CultureName');
if (cookieLangValue && headers && !headers.has('Accept-Language')) {
headers = headers.set('Accept-Language', cookieLangValue);
}
return headers;
}
static addTenantIdHeader(headers) {
const cookieTenantIdValue = abp.utils.getCookieValue('Abp.TenantId');
if (cookieTenantIdValue && headers && !headers.has('Abp.TenantId')) {
headers = headers.set('Abp.TenantId', cookieTenantIdValue);
}
return headers;
}
static addAuthorizationHeaders(headers) {
let authorizationHeaders = headers ? headers.getAll('Authorization') : null;
if (!authorizationHeaders) {
authorizationHeaders = [];
}
if (!this.itemExists(authorizationHeaders, (item) => item.indexOf('Bearer ') === 0)) {
const token = abp.auth.getToken();
if (headers && token) {
headers = headers.set('Authorization', 'Bearer ' + token);
}
}
return headers;
}
static itemExists(items, predicate) {
for (const item of items) {
if (predicate(item)) {
return true;
}
}
return false;
}
}
class MessageExtension {
/**
* 覆盖abp.message替换为ng-zorro的全局message
* @param _nzMessageService 消息服务
* @param _nzModalService 模态框服务
*/
static overrideAbpMessageByMini(_nzMessageService, _nzModalService) {
if (_nzModalService) {
if (abp.nzModal) {
return;
}
abp.nzModal = _nzModalService;
}
if (abp.nzMessage) {
return;
}
abp.nzMessage = _nzMessageService;
abp.message.info = (message, title) => {
// const timingCounts = parseInt(title, 0);
// (<any>abp).nzMessage.info(message, { nzDuration: timingCounts });
abp.nzMessage.info(message);
};
abp.message.warn = (message, title) => {
abp.nzMessage.warning(message);
};
abp.message.error = (message, title) => {
abp.nzMessage.error(message);
};
abp.message.success = (message, title) => {
abp.nzMessage.success(message);
};
abp.message.confirm = this.confirm;
}
/**
* 覆盖abp.message替换为ng-zorro的模态框
* @param _nzModalService 模态框服务
*/
static overrideAbpMessageByNgModal(_nzModalService) {
if (abp.nzModal) {
return;
}
abp.nzModal = _nzModalService;
abp.message.info = (message, title) => {
abp.nzModal.info({
nzTitle: title,
nzContent: message,
nzMask: true,
});
};
abp.message.warn = (message, title) => {
abp.nzModal.warning({
nzTitle: title,
nzContent: message,
nzMask: true,
});
};
abp.message.error = (message, title) => {
abp.nzModal.error({
nzTitle: title,
nzContent: message,
nzMask: true,
});
};
abp.message.success = (message, title) => {
abp.nzModal.success({
nzTitle: title,
nzContent: message,
nzMask: true,
});
};
abp.message.confirm = this.confirm;
}
// 覆盖abp.message替换为ng-zorro的notify
static overrideAbpNotify(_nzNotificationService) {
if (abp.nzNotify) {
return;
}
abp.nzNotify = _nzNotificationService;
abp.notify.info = (message, title, options) => {
abp.nzNotify.info(message, title, options);
};
abp.notify.warn = (message, title, options) => {
abp.nzNotify.warning(message, title, options);
};
abp.notify.error = (message, title, options) => {
abp.nzNotify.error(message, title, options);
};
abp.notify.success = (message, title, options) => {
abp.nzNotify.success(message, title, options);
};
}
static confirm(message, titleOrCallBack, callback) {
if (typeof titleOrCallBack === 'string' || typeof titleOrCallBack === 'undefined') {
abp.nzModal.confirm({
nzTitle: titleOrCallBack,
nzContent: message,
nzOnOk() {
if (callback) {
callback(true);
}
},
nzOnCancel() {
if (callback) {
callback(false);
}
},
});
}
else {
abp.nzModal.confirm({
nzTitle: abp.localization.localize('MessageConfirmOperation', abp.localization.defaultSourceName),
nzContent: message,
nzOnOk() {
if (titleOrCallBack) {
titleOrCallBack(true);
}
},
nzOnCancel() {
if (titleOrCallBack) {
titleOrCallBack(false);
}
},
});
}
}
}
// @Injectable()
class LocalizationService {
constructor(injector) {
this.injector = injector;
this.change$ = new BehaviorSubject(null);
this.defaultLang = 'zh-Hans';
const appConfig = injector.get(YOYO_CONFIG);
this.defaultSource = appConfig.lang.defaultSource;
}
use(lang, data) {
}
getLangs() {
return this.languages;
}
get change() {
return this.change$.asObservable().pipe(filter(w => w != null));
}
fanyi(key, params, isSafe) {
return this.l(key, null);
}
/**
* ABP的本地化翻译
* @param key 国际化键值
* @param sourceName 语言源
* @param args 参数
*/
l(key, sourceName, ...args) {
sourceName = sourceName || abp.localization.defaultSourceName || this.defaultSource;
const localizedText = abp.localization.localize(key, sourceName);
// 无参数
if (!args || !args.length) {
return localizedText;
}
// 有参数
return abp.utils.formatString(localizedText, ...args);
}
/**
* 填充数据
* @param localization 本地化信息
* @param defaultSourceName 默认数据源
*/
extend(localization, defaultSourceName) {
abp.localization.defaultSourceName = defaultSourceName || this.defaultSource;
this.languages = localization.languages;
this.currentLang = abp.localization.currentLanguage.name;
this.currentLanguage = localization.currentLanguage;
}
}
LocalizationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LocalizationService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
LocalizationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LocalizationService, providedIn: 'root' });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LocalizationService, decorators: [{
type: Injectable,
args: [{ providedIn: 'root' }]
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
// tslint:disable-next-line: component-class-suffix
class AddressWidget extends ControlWidget {
_change(value) {
this.setValue(value);
}
}
AddressWidget.KEY = 'address';
AddressWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AddressWidget, deps: null, target: i0.ɵɵFactoryTarget.Component });
AddressWidget.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: AddressWidget, selector: "sf-address", usesInheritance: true, ngImport: i0, template: `
<sf-item-wrap
[id]="id"
[schema]="schema"
[ui]="ui"
[showError]="showError"
[error]="error"
[showTitle]="schema.title"
>
<address [ngModel]="value" name="sf.address" (ngModelChange)="_change($event)"></address>
</sf-item-wrap>
`, isInline: true, components: [{ type: i1$4.SFItemWrapComponent, selector: "sf-item-wrap", inputs: ["title", "showTitle", "id", "schema", "ui", "showError", "error"] }], directives: [{ type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AddressWidget, decorators: [{
type: Component,
args: [{
selector: 'sf-address',
template: `
<sf-item-wrap
[id]="id"
[schema]="schema"
[ui]="ui"
[showError]="showError"
[error]="error"
[showTitle]="schema.title"
>
<address [ngModel]="value" name="sf.address" (ngModelChange)="_change($event)"></address>
</sf-item-wrap>
`,
preserveWhitespaces: false,
}]
}] });
// tslint:disable-next-line: component-class-suffix
class MarkdownWidget extends ControlWidget {
constructor() {
super(...arguments);
this.schema = {
properties: {
remark: {
type: 'string',
ui: {
widget: 'md',
},
},
},
};
}
_change(value) {
this.setValue(value);
}
}
MarkdownWidget.KEY = 'markdown';
MarkdownWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MarkdownWidget, deps: null, target: i0.ɵɵFactoryTarget.Component });
MarkdownWidget.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: MarkdownWidget, selector: "sf-markdown", usesInheritance: true, ngImport: i0, template: `
<sf-item-wrap
[id]="id"
[schema]="schema"
[ui]="ui"
[showError]="showError"
[error]="error"
[showTitle]="schema.title"
>
<sf name="markdown" [schema]="schema" (formSubmit)="_change($event)"></sf>
</sf-item-wrap>
`, isInline: true, components: [{ type: i1$4.SFItemWrapComponent, selector: "sf-item-wrap", inputs: ["title", "showTitle", "id", "schema", "ui", "showError", "error"] }, { type: i1$4.SFComponent, selector: "sf, [sf]", inputs: ["layout", "button", "liveValidate", "firstVisual", "onlyVisual", "compact", "loading", "disabled", "noColon", "cleanValue", "autocomplete", "mode", "ui", "schema", "formData"], outputs: ["formValueChange", "formChange", "formSubmit", "formReset", "formError"], exportAs: ["sf"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MarkdownWidget, decorators: [{
type: Component,
args: [{
selector: 'sf-markdown',
template: `
<sf-item-wrap
[id]="id"
[schema]="schema"
[ui]="ui"
[showError]="showError"
[error]="error"
[showTitle]="schema.title"
>
<sf name="markdown" [schema]="schema" (formSubmit)="_change($event)"></sf>
</sf-item-wrap>
`,
preserveWhitespaces: false,
}]
}] });
// tslint:disable-next-line:component-class-suffix
class MomentWidget extends ControlUIWidget {
constructor() {
super(...arguments);
this.flatRange = false;
this.displayValue = null;
}
ngOnInit() {
const { mode, end, displayFormat, allowClear, showToday } = this.ui;
this.mode = mode || 'date';
this.flatRange = end != null;
// 构建属性对象时会对默认值进行校验,因此可以直接使用 format 作为格式化属性
this.startFormat = this.ui._format;
if (this.flatRange) {
this.mode = 'range';
const endUi = this.endProperty.ui;
this.endFormat = endUi.format ? endUi._format : this.startFormat;
}
if (!displayFormat) {
switch (this.mode) {
case 'year':
this.displayFormat = `yyyy`;
break;
case 'month':
this.displayFormat = `yyyy-MM`;
break;
case 'week':
this.displayFormat = `yyyy-ww`;
break;
}
}
else {
this.displayFormat = displayFormat;
}
this.i = {
allowClear: toBool(allowClear, true),
// nz-date-picker
showToday: toBool(showToday, true),
};
if (!this.startFormat) {
this.startFormat = 'yyyy-MM-dd';
}
if (!this.endFormat) {
this.endFormat = 'yyyy-MM-dd';
}
}
reset(value) {
const toDateOptions = { formatString: this.startFormat, defaultValue: null };
if (Array.isArray(value)) {
value = value.map(o => {
if (moment.isMoment(o)) {
return o.toDate();
}
else if (moment.isDate(o)) {
return o;
}
return o;
}).map(v => toDate(v, toDateOptions));
}
else {
let tmpVal;
if (moment.isMoment(value)) {
tmpVal = value.toDate();
}
else if (moment.isDate(value)) {
tmpVal = value;
}
value = toDate(tmpVal, toDateOptions);
}
if (this.flatRange) {
const endValue = toDate(this.endProperty.formData, {
formatString: this.endFormat || this.startFormat,
defaultValue: null,
});
this.displayValue = value == null || endValue == null ? [] : [value, endValue];
}
else {
this.displayValue = value;
}
this.detectChanges();
// TODO: Need to wait for the rendering to complete, otherwise it will be overwritten of end widget
if (this.displayValue) {
setTimeout(() => this._change(this.displayValue, false));
}
}
_change(value, emitModelChange = true) {
if (emitModelChange && this.ui.change) {
if (Array.isArray(value)) {
this.ui.change(value.map(o => moment(o)));
}
else {
this.ui.change(!!value ? moment(value) : null);
}
}
if (value == null || (Array.isArray(value) && value.length < 2)) {
this.setValue(null);
this.setEnd(null);
return;
}
const res = Array.isArray(value)
? [format(value[0], this.startFormat), format(value[1], this.endFormat || this.startFormat)]
: format(value, this.startFormat);
if (this.flatRange) {
this.setValue(moment(res[0]));
this.setEnd(res[1]);
}
else {
this.setValue(moment(res));
}
}
_openChange(status) {
if (this.ui.onOpenChange) {
this.ui.onOpenChange(status);
}
}
_ok(value) {
if (this.ui.onOk) {
if (!value) {
this.ui.onOk(null);
return;
}
if (!Array.isArray(value)) {
this.ui.onOk(moment(value));
return;
}
this.ui.onOk(value.map(o => moment(o)));
}
}
get endProperty() {
return this.formProperty.parent.properties[this.ui.end];
}
setEnd(value) {
if (!this.flatRange) {
return;
}
this.endProperty.setValue(value, true);
this.endProperty.updateValueAndValidity();
}
}
/* 用于注册小部件 KEY 值 */
MomentWidget.KEY = 'moment';
MomentWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentWidget, deps: null, target: i0.ɵɵFactoryTarget.Component });
MomentWidget.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: MomentWidget, selector: "sf-moment", usesInheritance: true, ngImport: i0, template: "<sf-item-wrap [id]=\"id\" [schema]=\"schema\" [ui]=\"ui\" [showError]=\"showError\" [error]=\"error\" [showTitle]=\"schema.title\">\n <ng-container [ngSwitch]=\"mode\">\n <nz-year-picker\n *ngSwitchCase=\"'year'\"\n [nzId]=\"id\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"ui.size!\"\n [nzFormat]=\"displayFormat\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"_change($event)\"\n [nzAllowClear]=\"i.allowClear\"\n [ngClass]=\"ui.className!\"\n [nzDisabledDate]=\"ui.disabledDate\"\n [nzLocale]=\"ui.locale!\"\n [nzPlaceHolder]=\"ui.placeholder!\"\n [nzPopupStyle]=\"ui.popupStyle!\"\n [nzDropdownClassName]=\"ui.dropdownClassName\"\n (nzOnOpenChange)=\"_openChange($event)\"\n [nzRenderExtraFooter]=\"ui.renderExtraFooter\"\n [nzInputReadOnly]=\"ui.inputReadOnly\"\n [nzInline]=\"ui.inline!\"\n ></nz-year-picker>\n\n <nz-month-picker\n *ngSwitchCase=\"'month'\"\n [nzId]=\"id\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"ui.size!\"\n [nzFormat]=\"displayFormat\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"_change($event)\"\n [nzAllowClear]=\"i.allowClear\"\n [ngClass]=\"ui.className!\"\n [nzDisabledDate]=\"ui.disabledDate\"\n [nzLocale]=\"ui.locale!\"\n [nzPlaceHolder]=\"ui.placeholder!\"\n [nzPopupStyle]=\"ui.popupStyle!\"\n [nzDropdownClassName]=\"ui.dropdownClassName\"\n (nzOnOpenChange)=\"_openChange($event)\"\n [nzRenderExtraFooter]=\"ui.renderExtraFooter\"\n [nzInputReadOnly]=\"ui.inputReadOnly\"\n [nzInline]=\"ui.inline!\"\n ></nz-month-picker>\n\n <nz-week-picker\n *ngSwitchCase=\"'week'\"\n [nzId]=\"id\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"ui.size!\"\n [nzFormat]=\"displayFormat\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"_change($event)\"\n [nzAllowClear]=\"i.allowClear\"\n [ngClass]=\"ui.className!\"\n [nzDisabledDate]=\"ui.disabledDate\"\n [nzLocale]=\"ui.locale!\"\n [nzPlaceHolder]=\"ui.placeholder!\"\n [nzPopupStyle]=\"ui.popupStyle!\"\n [nzDropdownClassName]=\"ui.dropdownClassName\"\n [nzInputReadOnly]=\"ui.inputReadOnly\"\n [nzInline]=\"ui.inline!\"\n (nzOnOpenChange)=\"_openChange($event)\"\n ></nz-week-picker>\n\n <nz-range-picker\n *ngSwitchCase=\"'range'\"\n [nzId]=\"id\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"ui.size!\"\n [nzFormat]=\"displayFormat\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"_change($event)\"\n [nzAllowClear]=\"i.allowClear\"\n [ngClass]=\"ui.className!\"\n [nzDisabledDate]=\"ui.disabledDate\"\n [nzLocale]=\"ui.locale!\"\n [nzPlaceHolder]=\"ui.placeholder!\"\n [nzPopupStyle]=\"ui.popupStyle!\"\n [nzDropdownClassName]=\"ui.dropdownClassName\"\n (nzOnOpenChange)=\"_openChange($event)\"\n [nzDisabledTime]=\"ui.disabledTime\"\n [nzRenderExtraFooter]=\"ui.renderExtraFooter\"\n [nzRanges]=\"ui.ranges\"\n [nzShowTime]=\"ui.showTime\"\n [nzMode]=\"ui.rangeMode\"\n [nzInputReadOnly]=\"ui.inputReadOnly\"\n [nzInline]=\"ui.inline!\"\n (nzOnOk)=\"_ok($event)\"\n ></nz-range-picker>\n\n <nz-date-picker\n *ngSwitchDefault\n [nzId]=\"id\"\n [nzDisabled]=\"disabled\"\n [nzSize]=\"ui.size!\"\n [nzFormat]=\"displayFormat\"\n [(ngModel)]=\"displayValue\"\n (ngModelChange)=\"_change($event)\"\n [nzAllowClear]=\"i.allowClear\"\n [ngClass]=\"ui.className!\"\n [nzDisabledDate]=\"ui.disabledDate\"\n [nzLocale]=\"ui.locale!\"\n [nzPlaceHolder]=\"ui.placeholder!\"\n [nzPopupStyle]=\"ui.popupStyle!\"\n [nzDropdownClassName]=\"ui.dropdownClassName\"\n (nzOnOpenChange)=\"_openChange($event)\"\n [nzDisabledTime]=\"ui.disabledTime\"\n [nzRenderExtraFooter]=\"ui.renderExtraFooter\"\n [nzShowTime]=\"ui.showTime\"\n [nzShowToday]=\"i.showToday\"\n [nzInputReadOnly]=\"ui.inputReadOnly\"\n [nzInline]=\"ui.inline!\"\n (nzOnOk)=\"_ok($event)\"\n ></nz-date-picker>\n </ng-container>\n</sf-item-wrap>\n", components: [{ type: i1$4.SFItemWrapComponent, selector: "sf-item-wrap", inputs: ["title", "showTitle", "id", "schema", "ui", "showError", "error"] }, { type: i1$5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzPlaceHolder", "nzPopupStyle", "nzSize", "nzShowToday", "nzMode", "nzShowNow", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzShowTime", "nzFormat", "nzLocale", "nzOpen", "nzDisabledDate", "nzDropdownClassName", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzRanges"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }], directives: [{ type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$5.NzYearPickerComponent, selector: "nz-year-picker", exportAs: ["nzYearPicker"] }, { type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$5.NzMonthPickerComponent, selector: "nz-month-picker", exportAs: ["nzMonthPicker"] }, { type: i1$5.NzWeekPickerComponent, selector: "nz-week-picker", exportAs: ["nzWeekPicker"] }, { type: i1$5.NzRangePickerComponent, selector: "nz-range-picker", exportAs: ["nzRangePicker"] }, { type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentWidget, decorators: [{
type: Component,
args: [{
selector: 'sf-moment',
templateUrl: './moment.widget.html',
}]
}] });
// tslint:disable-next-line: component-class-suffix
class SimplemdeWidget extends ControlWidget {
_change(value) {
this.setValue(value);
if (this.ui.contentChanged) {
this.ui.contentChanged(value);
}
}
}
SimplemdeWidget.KEY = 'md';
SimplemdeWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SimplemdeWidget, deps: null, target: i0.ɵɵFactoryTarget.Component });
SimplemdeWidget.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SimplemdeWidget, selector: "sf-editor", usesInheritance: true, ngImport: i0, template: `
<sf-item-wrap
[id]="id"
[schema]="schema"
[ui]="ui"
[showError]="showError"
[error]="error"
[showTitle]="schema.title"
>
<simplemde
[ngModel]="value"
(ngModelChange)="_change($event)"
[options]="ui.options"
[delay]="ui.delay || 300"
></simplemde>
</sf-item-wrap>
`, isInline: true, components: [{ type: i1$4.SFItemWrapComponent, selector: "sf-item-wrap", inputs: ["title", "showTitle", "id", "schema", "ui", "showError", "error"] }, { type: i2$3.SimplemdeComponent, selector: "simplemde", inputs: ["style", "delay", "disabled", "options"] }], directives: [{ type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SimplemdeWidget, decorators: [{
type: Component,
args: [{
selector: 'sf-editor',
template: `
<sf-item-wrap
[id]="id"
[schema]="schema"
[ui]="ui"
[showError]="showError"
[error]="error"
[showTitle]="schema.title"
>
<simplemde
[ngModel]="value"
(ngModelChange)="_change($event)"
[options]="ui.options"
[delay]="ui.delay || 300"
></simplemde>
</sf-item-wrap>
`,
preserveWhitespaces: false,
}]
}] });
class MomentFormatPipe {
transform(value, format) {
if (!value) {
return '';
}
if (!format) {
format = 'YYYY-MM-DD HH:mm:ss';
}
return moment(value).format(format);
}
}
MomentFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
MomentFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentFormatPipe, name: "_moment" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentFormatPipe, decorators: [{
type: Pipe,
args: [{ name: '_moment' }]
}] });
class MomentFromNowPipe {
transform(value) {
if (!value) {
return '';
}
return moment(value).fromNow();
}
}
MomentFromNowPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentFromNowPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
MomentFromNowPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentFromNowPipe, name: "momentFromNow" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MomentFromNowPipe, decorators: [{
type: Pipe,
args: [{ name: 'momentFromNow' }]
}] });
const MOMENT_PIPES = [
MomentFormatPipe,
MomentFromNowPipe
];
class LPipesModule {
}
LPipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LPipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LPipesModule, declarations: [MomentFormatPipe,
MomentFromNowPipe], imports: [CommonModule], exports: [MomentFormatPipe,
MomentFromNowPipe] });
LPipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LPipesModule, imports: [[
CommonModule
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LPipesModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule
],
declarations: [
...MOMENT_PIPES
],
exports: [
...MOMENT_PIPES
]
}]
}] });
const JSON_SCHEMA_NG_MODULES = [
CommonModule,
FormsModule,
ReactiveFormsModule,
];
const JSON_SCHEMA_NG_ZORRO_MODULES = [
NzInputModule,
NzButtonModule,
NzTimePickerModule,
NzDatePickerModule,
NzFormModule,
NzSelectModule,
NzDropDownModule,
NzSpinModule,
NzMenuModule,
NzIconModule,
];
const JSON_SCHEMA_NG_ALAIN_MODULES = [
DelonACLModule,
DelonFormModule,
STModule,
];
const JSON_SCHEMA_MODULES = [
...JSON_SCHEMA_NG_MODULES,
...JSON_SCHEMA_NG_ZORRO_MODULES,
...JSON_SCHEMA_NG_ALAIN_MODULES,
LPipesModule,
];
const SCHEMA_THIRDS_COMPONENTS = [
AddressWidget,
SimplemdeWidget,
MarkdownWidget,
MomentWidget,
];
class SfWidgetsModule {
constructor(widgetRegistry) {
widgetRegistry.register(AddressWidget.KEY, AddressWidget);
widgetRegistry.register(SimplemdeWidget.KEY, SimplemdeWidget);
widgetRegistry.register(MarkdownWidget.KEY, MarkdownWidget);
widgetRegistry.register(MomentWidget.KEY, MomentWidget);
}
}
SfWidgetsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SfWidgetsModule, deps: [{ token: i1$4.WidgetRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
SfWidgetsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SfWidgetsModule, declarations: [AddressWidget,
SimplemdeWidget,
MarkdownWidget,
MomentWidget], imports: [i3.CommonModule, i2$2.FormsModule, i2$2.ReactiveFormsModule, i4$2.NzInputModule, i5.NzButtonModule, i6.NzTimePickerModule, i1$5.NzDatePickerModule, i8.NzFormModule, i9.NzSelectModule, i2.NzDropDownModule, i11.NzSpinModule, i4$1.NzMenuModule, i13.NzIconModule, i1.DelonACLModule, i1$4.DelonFormModule, i1$6.STModule, LPipesModule, SimplemdeModule], exports: [AddressWidget,
SimplemdeWidget,
MarkdownWidget,
MomentWidget] });
SfWidgetsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SfWidgetsModule, imports: [[
...JSON_SCHEMA_MODULES,
SimplemdeModule
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SfWidgetsModule, decorators: [{
type: NgModule,
args: [{
declarations: SCHEMA_THIRDS_COMPONENTS,
entryComponents: SCHEMA_THIRDS_COMPONENTS,
imports: [
...JSON_SCHEMA_MODULES,
SimplemdeModule
],
exports: [...SCHEMA_THIRDS_COMPONENTS],
}]
}], ctorParameters: function () { return [{ type: i1$4.WidgetRegistry }]; } });
// tslint:disable-next-line:component-class-suffix
class StMomentWidget {
constructor() { }
ngOnInit() {
/* 优先级:
1. 自定义的format
2. mode
*/
if (this.format) {
return;
}
switch (this.mode) {
case 'year':
this.format = `yyyy`;
break;
case 'month':
this.format = `yyyy-MM`;
break;
case 'week':
this.format = `yyyy-ww`;
break;
case 'day':
this.format = `YYYY-MM-DD`;
break;
case 'date':
this.format = `YYYY-MM-DD HH:mm`;
break;
default:
this.format = `YYYY-MM-DD HH:mm:ss`;
break;
}
}
}
StMomentWidget.KEY = 'moment';
StMomentWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: StMomentWidget, deps: [], target: i0.ɵɵFactoryTarget.Component });
StMomentWidget.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: StMomentWidget, selector: "st-widget-moment", ngImport: i0, template: "<ng-container>\n <ng-container> {{date|_moment:format}} </ng-container>\n</ng-container>\n", pipes: { "_moment": MomentFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: StMomentWidget, decorators: [{
type: Component,
args: [{
selector: 'st-widget-moment',
templateUrl: './st-moment.widget.html',
changeDetection: ChangeDetectionStrategy.OnPush,
}]
}], ctorParameters: function () { return []; } });
const STWIDGET_COMPONENTS = [
StMomentWidget
];
class StWidgetsModule {
constructor(widgetRegistry) {
widgetRegistry.register(StMomentWidget.KEY, StMomentWidget);
}
}
StWidgetsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: StWidgetsModule, deps: [{ token: i1$6.STWidgetRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
StWidgetsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: StWidgetsModule, declarations: [StMomentWidget], imports: [i3.CommonModule, i2$2.FormsModule, i2$2.ReactiveFormsModule, i4$2.NzInputModule, i5.NzButtonModule, i6.NzTimePickerModule, i1$5.NzDatePickerModule, i8.NzFormModule, i9.NzSelectModule, i2.NzDropDownModule, i11.NzSpinModule, i4$1.NzMenuModule, i13.NzIconModule, i1.DelonACLModule, i1$4.DelonFormModule, i1$6.STModule, LPipesModule], exports: [StMomentWidget] });
StWidgetsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: StWidgetsModule, imports: [[
...JSON_SCHEMA_MODULES
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: StWidgetsModule, decorators: [{
type: NgModule,
args: [{
declarations: STWIDGET_COMPONENTS,
imports: [
...JSON_SCHEMA_MODULES
],
exports: [...STWIDGET_COMPONENTS],
}]
}], ctorParameters: function () { return [{ type: i1$6.STWidgetRegistry }]; } });
class LJsonSchemaModule {
constructor() {
}
}
LJsonSchemaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LJsonSchemaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LJsonSchemaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LJsonSchemaModule, exports: [SfWidgetsModule, StWidgetsModule] });
LJsonSchemaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LJsonSchemaModule, imports: [[], SfWidgetsModule, StWidgetsModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LJsonSchemaModule, decorators: [{
type: NgModule,
args: [{
imports: [],
exports: [SfWidgetsModule, StWidgetsModule],
}]
}], ctorParameters: function () { return []; } });
class DatePickerBase {
constructor() {
/**
* 是否显示清除按钮
*/
this.nzAllowClear = true;
/**
* 自动获取焦点
*/
this.nzAutoFocus = false;
/**
* 选择器
*/
this.nzClassName = '';
/**
* 禁用
*/
this.nzDisabled = false;
/**
* 额外的弹出日历样式
*/
this.nzPopupStyle = {};
/**
* 输入框大小
*/
this.nzSize = 'default';
/**
* 自定义输入框样式
*/
this.nzStyle = {};
/**
* 弹出日历和关闭日历的回调
*/
this.nzOnOpenChange = new EventEmitter();
}
/**
* 控制弹层展开状态发生改变
* @param event 是否展开
*/
onNzOnOpenChange(event) {
this.nzOpen = event;
this.nzOnOpenChange.emit(event);
}
}
DatePickerBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DatePickerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
DatePickerBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: DatePickerBase, inputs: { name: "name", nzAllowClear: "nzAllowClear", nzAutoFocus: "nzAutoFocus", nzClassName: "nzClassName", nzDateRender: "nzDateRender", nzDisabled: "nzDisabled", nzDisabledDate: "nzDisabledDate", nzLocale: "nzLocale", nzOpen: "nzOpen", nzPopupStyle: "nzPopupStyle", nzDropdownClassName: "nzDropdownClassName", nzSize: "nzSize", nzStyle: "nzStyle" }, outputs: { nzOnOpenChange: "nzOnOpenChange" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DatePickerBase, decorators: [{
type: Directive
}], ctorParameters: function () { return []; }, propDecorators: { name: [{
type: Input
}], nzAllowClear: [{
type: Input
}], nzAutoFocus: [{
type: Input
}], nzClassName: [{
type: Input
}], nzDateRender: [{
type: Input
}], nzDisabled: [{
type: Input
}], nzDisabledDate: [{
type: Input
}], nzLocale: [{
type: Input
}], nzOpen: [{
type: Input
}], nzPopupStyle: [{
type: Input
}], nzDropdownClassName: [{
type: Input
}], nzSize: [{
type: Input
}], nzStyle: [{
type: Input
}], nzOnOpenChange: [{
type: Output
}] } });
class DatePickerComponent extends DatePickerBase {
constructor() {
super();
/**
* 展示的日期格式,见nzFormat特别说明
*/
this.nzFormat = 'yyyy-MM-dd';
/**
* nzShowToday
*/
this.nzShowToday = true;
/**
* 点击确定按钮的回调
*/
this.nzOnOk = new EventEmitter();
/**
* 时间发生变化的回调
*/
this.ngModelChange = new EventEmitter();
}
onNzOk(event) {
if (event && moment.isDate(event)) {
this.nzOnOk.emit(moment(event));
}
else {
this.nzOnOk.emit(undefined);
}
}
onNgModelChangeChange(event) {
if (event && moment.isDate(event)) {
this.ngModelChange.emit(moment(event));
}
else {
this.ngModelChange.emit(undefined);
}
}
registerOnChange(fn) {
this.ngModelChange.emit = fn;
}
registerOnTouched(fn) {
}
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
writeValue(obj) {
if (obj && moment.isMoment(obj)) {
this.value = obj.toDate();
}
else {
this.value = obj;
}
}
}
DatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
DatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: DatePickerComponent, selector: "l-date-picker", inputs: { ngModel: "ngModel", nzDisabledTime: "nzDisabledTime", nzFormat: "nzFormat", nzRenderExtraFooter: "nzRenderExtraFooter", nzShowTime: "nzShowTime", nzShowToday: "nzShowToday", nzPlaceHolder: "nzPlaceHolder" }, outputs: { nzOnOk: "nzOnOk", ngModelChange: "ngModelChange" }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true,
}], usesInheritance: true, ngImport: i0, template: "<nz-date-picker\n [nzAllowClear]=\"nzAllowClear\"\n [nzAutoFocus]=\"nzAutoFocus\"\n [nzDateRender]=\"nzDateRender\"\n [nzDisabled]=\"nzDisabled\"\n [nzDisabledDate]=\"nzDisabledDate\"\n [nzLocale]=\"nzLocale\"\n [nzPopupStyle]=\"nzPopupStyle\"\n [nzDropdownClassName]=\"nzDropdownClassName\"\n [nzSize]=\"nzSize\"\n\n\n [nzDisabledTime]=\"nzDisabledTime\"\n [nzFormat]=\"nzFormat\"\n [nzRenderExtraFooter]=\"nzRenderExtraFooter\"\n [nzShowTime]=\"nzShowTime\"\n [nzShowToday]=\"nzShowToday\"\n [nzPlaceHolder]=\"nzPlaceHolder\"\n\n [(ngModel)]=\"value\"\n (nzOnOk)=\"onNzOk($event)\"\n (ngModelChange)=\"onNgModelChangeChange($event)\"\n (nzOnOpenChange)=\"onNzOnOpenChange($event)\">\n\n</nz-date-picker>\n", styles: [":host ::ng-deep{width:100%}\n"], components: [{ type: i1$5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzPlaceHolder", "nzPopupStyle", "nzSize", "nzShowToday", "nzMode", "nzShowNow", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzShowTime", "nzFormat", "nzLocale", "nzOpen", "nzDisabledDate", "nzDropdownClassName", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzRanges"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }], directives: [{ type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: DatePickerComponent, decorators: [{
type: Component,
args: [{
selector: 'l-date-picker',
templateUrl: './date-picker.component.html',
styleUrls: ['./date-picker.component.less'],
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DatePickerComponent),
multi: true,
}],
}]
}], ctorParameters: function () { return []; }, propDecorators: { ngModel: [{
type: Input
}], nzDisabledTime: [{
type: Input
}], nzFormat: [{
type: Input
}], nzRenderExtraFooter: [{
type: Input
}], nzShowTime: [{
type: Input
}], nzShowToday: [{
type: Input
}], nzPlaceHolder: [{
type: Input
}], nzOnOk: [{
type: Output
}], ngModelChange: [{
type: Output
}] } });
class YearPickerComponent extends DatePickerBase {
constructor() {
super();
/**
* 展示的日期格式,见nzFormat特别说明
*/
this.nzFormat = 'yyyy';
/**
* 时间发生变化的回调
*/
this.ngModelChange = new EventEmitter();
}
onNgModelChangeChange(event) {
if (event && moment.isDate(event)) {
this.ngModelChange.emit(moment(event));
}
else {
this.ngModelChange.emit(undefined);
}
}
registerOnChange(fn) {
this.ngModelChange.emit = fn;
}
registerOnTouched(fn) {
}
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
writeValue(obj) {
if (obj && moment.isMoment(obj)) {
this.value = obj.toDate();
}
else {
this.value = obj;
}
}
}
YearPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: YearPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
YearPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: YearPickerComponent, selector: "l-year-picker", inputs: { ngModel: "ngModel", nzFormat: "nzFormat", nzRenderExtraFooter: "nzRenderExtraFooter", nzPlaceHolder: "nzPlaceHolder" }, outputs: { ngModelChange: "ngModelChange" }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => YearPickerComponent),
multi: true
}], usesInheritance: true, ngImport: i0, template: "<nz-year-picker\n [nzAllowClear]=\"nzAllowClear\"\n [nzAutoFocus]=\"nzAutoFocus\"\n [nzDisabled]=\"nzDisabled\"\n [nzDisabledDate]=\"nzDisabledDate\"\n [nzLocale]=\"nzLocale\"\n [nzPopupStyle]=\"nzPopupStyle\"\n [nzDropdownClassName]=\"nzDropdownClassName\"\n [nzSize]=\"nzSize\"\n\n\n [nzFormat]=\"nzFormat\"\n [nzRenderExtraFooter]=\"nzRenderExtraFooter\"\n [nzPlaceHolder]=\"nzPlaceHolder\"\n\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onNgModelChangeChange($event)\"\n (nzOnOpenChange)=\"onNzOnOpenChange($event)\">\n\n</nz-year-picker>\n", components: [{ type: i1$5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzPlaceHolder", "nzPopupStyle", "nzSize", "nzShowToday", "nzMode", "nzShowNow", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzShowTime", "nzFormat", "nzLocale", "nzOpen", "nzDisabledDate", "nzDropdownClassName", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzRanges"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }], directives: [{ type: i1$5.NzYearPickerComponent, selector: "nz-year-picker", exportAs: ["nzYearPicker"] }, { type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: YearPickerComponent, decorators: [{
type: Component,
args: [{
selector: 'l-year-picker',
templateUrl: './year-picker.component.html',
styles: [],
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => YearPickerComponent),
multi: true
}]
}]
}], ctorParameters: function () { return []; }, propDecorators: { ngModel: [{
type: Input
}], nzFormat: [{
type: Input
}], nzRenderExtraFooter: [{
type: Input
}], nzPlaceHolder: [{
type: Input
}], ngModelChange: [{
type: Output
}] } });
class MonthPickerComponent extends DatePickerBase {
constructor() {
super();
/**
* 展示的日期格式,见nzFormat特别说明
*/
this.nzFormat = 'yyyy-MM';
/**
* 时间发生变化的回调
*/
this.ngModelChange = new EventEmitter();
}
onNgModelChangeChange(event) {
if (event && moment.isDate(event)) {
this.ngModelChange.emit(moment(event));
}
else {
this.ngModelChange.emit(undefined);
}
}
registerOnChange(fn) {
this.ngModelChange.emit = fn;
}
registerOnTouched(fn) {
}
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
writeValue(obj) {
if (obj && moment.isMoment(obj)) {
this.value = obj.toDate();
}
else {
this.value = obj;
}
}
}
MonthPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MonthPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
MonthPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: MonthPickerComponent, selector: "l-month-picker", inputs: { ngModel: "ngModel", nzDisabledTime: "nzDisabledTime", nzFormat: "nzFormat", nzRenderExtraFooter: "nzRenderExtraFooter", nzPlaceHolder: "nzPlaceHolder" }, outputs: { ngModelChange: "ngModelChange" }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MonthPickerComponent),
multi: true
}], usesInheritance: true, ngImport: i0, template: "<nz-month-picker\n [nzAllowClear]=\"nzAllowClear\"\n [nzAutoFocus]=\"nzAutoFocus\"\n [nzDisabled]=\"nzDisabled\"\n [nzDisabledDate]=\"nzDisabledDate\"\n [nzLocale]=\"nzLocale\"\n [nzPopupStyle]=\"nzPopupStyle\"\n [nzDropdownClassName]=\"nzDropdownClassName\"\n [nzSize]=\"nzSize\"\n\n [nzFormat]=\"nzFormat\"\n [nzRenderExtraFooter]=\"nzRenderExtraFooter\"\n [nzPlaceHolder]=\"nzPlaceHolder\"\n\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onNgModelChangeChange($event)\"\n (nzOnOpenChange)=\"onNzOnOpenChange($event)\">\n\n</nz-month-picker>\n", components: [{ type: i1$5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzPlaceHolder", "nzPopupStyle", "nzSize", "nzShowToday", "nzMode", "nzShowNow", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzShowTime", "nzFormat", "nzLocale", "nzOpen", "nzDisabledDate", "nzDropdownClassName", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzRanges"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }], directives: [{ type: i1$5.NzMonthPickerComponent, selector: "nz-month-picker", exportAs: ["nzMonthPicker"] }, { type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: MonthPickerComponent, decorators: [{
type: Component,
args: [{
selector: 'l-month-picker',
templateUrl: './month-picker.component.html',
styles: [],
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MonthPickerComponent),
multi: true
}]
}]
}], ctorParameters: function () { return []; }, propDecorators: { ngModel: [{
type: Input
}], nzDisabledTime: [{
type: Input
}], nzFormat: [{
type: Input
}], nzRenderExtraFooter: [{
type: Input
}], nzPlaceHolder: [{
type: Input
}], ngModelChange: [{
type: Output
}] } });
class WeekPickerComponent extends DatePickerBase {
constructor() {
super();
/**
* 展示的日期格式,见nzFormat特别说明
*/
this.nzFormat = 'yyyy-ww';
/**
* 时间发生变化的回调
*/
this.ngModelChange = new EventEmitter();
}
onNgModelChangeChange(event) {
if (event && moment.isDate(event)) {
this.ngModelChange.emit(moment(event));
}
else {
this.ngModelChange.emit(undefined);
}
}
registerOnChange(fn) {
this.ngModelChange.emit = fn;
}
registerOnTouched(fn) {
}
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
writeValue(obj) {
if (obj && moment.isMoment(obj)) {
this.value = obj.toDate();
}
else {
this.value = obj;
}
}
}
WeekPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: WeekPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
WeekPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: WeekPickerComponent, selector: "l-week-picker", inputs: { ngModel: "ngModel", nzFormat: "nzFormat", nzPlaceHolder: "nzPlaceHolder" }, outputs: { ngModelChange: "ngModelChange" }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => WeekPickerComponent),
multi: true
}], usesInheritance: true, ngImport: i0, template: "<nz-week-picker\n [nzAllowClear]=\"nzAllowClear\"\n [nzAutoFocus]=\"nzAutoFocus\"\n [nzDisabled]=\"nzDisabled\"\n [nzDisabledDate]=\"nzDisabledDate\"\n [nzLocale]=\"nzLocale\"\n [nzPopupStyle]=\"nzPopupStyle\"\n [nzDropdownClassName]=\"nzDropdownClassName\"\n [nzSize]=\"nzSize\"\n\n\n [nzFormat]=\"nzFormat\"\n [nzPlaceHolder]=\"nzPlaceHolder\"\n\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onNgModelChangeChange($event)\"\n (nzOnOpenChange)=\"onNzOnOpenChange($event)\"\n>\n\n</nz-week-picker>\n", components: [{ type: i1$5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzPlaceHolder", "nzPopupStyle", "nzSize", "nzShowToday", "nzMode", "nzShowNow", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzShowTime", "nzFormat", "nzLocale", "nzOpen", "nzDisabledDate", "nzDropdownClassName", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzRanges"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }], directives: [{ type: i1$5.NzWeekPickerComponent, selector: "nz-week-picker", exportAs: ["nzWeekPicker"] }, { type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: WeekPickerComponent, decorators: [{
type: Component,
args: [{
selector: 'l-week-picker',
templateUrl: './week-picker.component.html',
styles: [],
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => WeekPickerComponent),
multi: true
}]
}]
}], ctorParameters: function () { return []; }, propDecorators: { ngModel: [{
type: Input
}], nzFormat: [{
type: Input
}], nzPlaceHolder: [{
type: Input
}], ngModelChange: [{
type: Output
}] } });
class RangePickerComponent extends DatePickerBase {
constructor() {
super();
/**
* 展示的日期格式,见nzFormat特别说明
*/
this.nzFormat = 'yyyy-MM-dd';
/**
* 点击确定按钮的回调
*/
this.nzOnOk = new EventEmitter();
/**
* 时间发生变化的回调
*/
this.ngModelChange = new EventEmitter();
/**
* 待选日期发生变化的回调
*/
this.nzOnCalendarChange = new EventEmitter();
}
/**
* 点击确定按钮的回调
* @param event 数据
*/
onNzOk(event) {
if (Array.isArray(event) && moment.isDate(event[0] && moment.isDate(event[1]))) {
this.nzOnOk.emit(event.map(o => {
return moment(o);
}));
}
else {
this.nzOnOk.emit(undefined);
}
}
/**
* 时间发生变化的回调
* @param event 数据
*/
onNgModelChangeChange(event) {
if (Array.isArray(event) && event.length === 2) {
this.ngModelChange.emit(event.map(o => {
return moment(o);
}));
}
else {
this.ngModelChange.emit(undefined);
}
}
/**
* 待选日期发生变化的回调
* @param event 数据
*/
onNzOnCalendarChange(event) {
if (Array.isArray(event) && event.length === 2) {
this.nzOnCalendarChange.emit(event.map(o => {
return moment(o);
}));
}
else {
this.nzOnCalendarChange.emit(undefined);
}
}
registerOnChange(fn) {
this.ngModelChange.emit = fn;
}
registerOnTouched(fn) {
}
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
writeValue(obj) {
if (obj && Array.isArray(obj) && obj.length === 2 && moment.isMoment(obj[0]) && moment.isMoment(obj[1])) {
this.value = [obj[0].toDate(), obj[1].toDate()];
}
else {
this.value = obj;
}
}
}
RangePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: RangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
RangePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: RangePickerComponent, selector: "l-range-picker", inputs: { ngModel: "ngModel", nzDisabledTime: "nzDisabledTime", nzFormat: "nzFormat", nzRanges: "nzRanges", nzRenderExtraFooter: "nzRenderExtraFooter", nzShowTime: "nzShowTime", nzPlaceHolder: "nzPlaceHolder" }, outputs: { nzOnOk: "nzOnOk", ngModelChange: "ngModelChange", nzOnCalendarChange: "nzOnCalendarChange" }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => RangePickerComponent),
multi: true,
}], usesInheritance: true, ngImport: i0, template: "<nz-range-picker\n [nzAllowClear]='nzAllowClear'\n [nzAutoFocus]='nzAutoFocus'\n [nzDateRender]='nzDateRender'\n [nzDisabled]='nzDisabled'\n [nzDisabledDate]='nzDisabledDate'\n [nzLocale]='nzLocale'\n [nzPopupStyle]='nzPopupStyle'\n [nzDropdownClassName]='nzDropdownClassName'\n [nzSize]='nzSize'\n [nzDisabledTime]='nzDisabledTime'\n [nzFormat]='nzFormat'\n [nzRenderExtraFooter]='nzRenderExtraFooter'\n [nzShowTime]='nzShowTime'\n [nzPlaceHolder]='nzPlaceHolder'\n [nzRanges]='nzRanges'\n [(ngModel)]='value'\n (nzOnOk)='onNzOk($event)'\n (ngModelChange)='onNgModelChangeChange($event)'\n (nzOnCalendarChange)='onNzOnCalendarChange($event)'\n (nzOnOpenChange)='onNzOnOpenChange($event)'\n>\n</nz-range-picker>\n", components: [{ type: i1$5.NzDatePickerComponent, selector: "nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker", inputs: ["nzAllowClear", "nzAutoFocus", "nzDisabled", "nzBorderless", "nzInputReadOnly", "nzInline", "nzPlaceHolder", "nzPopupStyle", "nzSize", "nzShowToday", "nzMode", "nzShowNow", "nzDefaultPickerValue", "nzSeparator", "nzSuffixIcon", "nzBackdrop", "nzId", "nzShowTime", "nzFormat", "nzLocale", "nzOpen", "nzDisabledDate", "nzDropdownClassName", "nzDateRender", "nzDisabledTime", "nzRenderExtraFooter", "nzRanges"], outputs: ["nzOnPanelChange", "nzOnCalendarChange", "nzOnOk", "nzOnOpenChange"], exportAs: ["nzDatePicker"] }], directives: [{ type: i1$5.NzRangePickerComponent, selector: "nz-range-picker", exportAs: ["nzRangePicker"] }, { type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: RangePickerComponent, decorators: [{
type: Component,
args: [{
selector: 'l-range-picker',
templateUrl: './range-picker.component.html',
styles: [],
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => RangePickerComponent),
multi: true,
}],
}]
}], ctorParameters: function () { return []; }, propDecorators: { ngModel: [{
type: Input
}], nzDisabledTime: [{
type: Input
}], nzFormat: [{
type: Input
}], nzRanges: [{
type: Input
}], nzRenderExtraFooter: [{
type: Input
}], nzShowTime: [{
type: Input
}], nzPlaceHolder: [{
type: Input
}], nzOnOk: [{
type: Output
}], ngModelChange: [{
type: Output
}], nzOnCalendarChange: [{
type: Output
}] } });
class TimePickerComponent extends DatePickerBase {
constructor() {
super();
/**
* 展示的日期格式,见nzFormat特别说明
*/
this.nzFormat = 'HH:mm:ss';
/**
* 自动获取焦点
*/
this.nzAutoFocus = false;
/**
* 隐藏禁止选择的选项
*/
this.nzHideDisabledOptions = false;
/**
* 小时选项间隔
*/
this.nzHourStep = 1;
/**
* 分钟选项间隔
*/
this.nzMinuteStep = 1;
/**
* 秒选项间隔
*/
this.nzSecondStep = 1;
/**
* 面板是否打开,可双向绑定
*/
this.nzOpen = false;
/**
* 弹出层类名
*/
this.nzPopupClassName = '';
/**
* 当 [ngModel] 不存在时,可以设置面板打开时默认选中的值
*/
this.nzDefaultOpenValue = new Date();
/**
* 使用12小时制,为true时format默认为h:mm:ss a
*/
this.nzUse12Hours = false;
/**
* 点击确定按钮的回调
*/
this.nzOnOk = new EventEmitter();
/**
* 时间发生变化的回调
*/
this.ngModelChange = new EventEmitter();
/**
* 待选日期发生变化的回调
*/
this.nzOnCalendarChange = new EventEmitter();
}
/**
* 点击确定按钮的回调
* @param event 数据
*/
onNzOk(event) {
if (event && moment.isDate(event[0] && moment.isDate(event[1]))) {
this.nzOnOk.emit(event.map(o => {
return moment(o);
}));
}
else {
this.nzOnOk.emit(undefined);
}
}
/**
* 时间发生变化的回调
* @param event 数据
*/
onNgModelChangeChange(event) {
if (event && moment.isDate(event[0] && moment.isDate(event[1]))) {
this.ngModelChange.emit(event.map(o => {
return moment(o);
}));
}
else {
this.ngModelChange.emit(undefined);
}
}
/**
* 待选日期发生变化的回调
* @param event 数据
*/
onNzOnCalendarChange(event) {
if (event && moment.isDate(event[0] && moment.isDate(event[1]))) {
this.nzOnCalendarChange.emit(event.map(o => {
return moment(o);
}));
}
else {
this.nzOnCalendarChange.emit(undefined);
}
}
registerOnChange(fn) {
this.ngModelChange.emit = fn;
}
registerOnTouched(fn) { }
setDisabledState(isDisabled) {
this.nzDisabled = isDisabled;
}
writeValue(obj) {
if (obj && moment.isMoment(obj)) {
this.value = obj.toDate();
}
else {
this.value = obj;
}
}
}
TimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
TimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: TimePickerComponent, selector: "l-time-picker", inputs: { ngModel: "ngModel", nzDisabledTime: "nzDisabledTime", nzFormat: "nzFormat", nzRanges: "nzRanges", nzRenderExtraFooter: "nzRenderExtraFooter", nzShowTime: "nzShowTime", nzPlaceHolder: "nzPlaceHolder", nzAddOn: "nzAddOn", nzAutoFocus: "nzAutoFocus", nzDisabledHours: "nzDisabledHours", nzDisabledMinutes: "nzDisabledMinutes", nzDisabledSeconds: "nzDisabledSeconds", nzHideDisabledOptions: "nzHideDisabledOptions", nzHourStep: "nzHourStep", nzMinuteStep: "nzMinuteStep", nzSecondStep: "nzSecondStep", nzOpen: "nzOpen", nzPopupClassName: "nzPopupClassName", nzDefaultOpenValue: "nzDefaultOpenValue", nzUse12Hours: "nzUse12Hours" }, outputs: { nzOnOk: "nzOnOk", ngModelChange: "ngModelChange", nzOnCalendarChange: "nzOnCalendarChange" }, providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => TimePickerComponent),
multi: true,
},
], usesInheritance: true, ngImport: i0, template: "<nz-time-picker [nzAutoFocus]='nzAutoFocus' [nzDisabled]='nzDisabled' [nzSize]='nzSize' [nzFormat]='nzFormat'\n [nzAddOn]='nzAddOn' [nzDisabledHours]='nzDisabledHours' [nzDisabledMinutes]='nzDisabledMinutes'\n [nzDefaultOpenValue]='nzDefaultOpenValue' [nzDisabledSeconds]='nzDisabledSeconds'\n [nzHideDisabledOptions]='nzHideDisabledOptions' [nzHourStep]='nzHourStep' [nzMinuteStep]='nzMinuteStep'\n [nzSecondStep]='nzSecondStep' [nzOpen]='nzOpen' [nzPopupClassName]='nzPopupClassName'\n [nzUse12Hours]='nzUse12Hours'\n [nzPlaceHolder]='nzPlaceHolder' [(ngModel)]='value'\n (ngModelChange)='onNgModelChangeChange($event)'\n (nzOpenChange)='onNzOnOpenChange($event)'>\n</nz-time-picker>\n", components: [{ type: i6.NzTimePickerComponent, selector: "nz-time-picker", inputs: ["nzId", "nzSize", "nzHourStep", "nzMinuteStep", "nzSecondStep", "nzClearText", "nzNowText", "nzOkText", "nzPopupClassName", "nzPlaceHolder", "nzFormat", "nzOpen", "nzUse12Hours", "nzSuffixIcon", "nzHideDisabledOptions", "nzAllowEmpty", "nzDisabled", "nzAutoFocus", "nzBackdrop", "nzAddOn", "nzDefaultOpenValue", "nzDisabledHours", "nzDisabledMinutes", "nzDisabledSeconds"], outputs: ["nzOpenChange"], exportAs: ["nzTimePicker"] }], directives: [{ type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TimePickerComponent, decorators: [{
type: Component,
args: [{
selector: 'l-time-picker',
templateUrl: './time-picker.component.html',
styles: [],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => TimePickerComponent),
multi: true,
},
],
}]
}], ctorParameters: function () { return []; }, propDecorators: { ngModel: [{
type: Input
}], nzDisabledTime: [{
type: Input
}], nzFormat: [{
type: Input
}], nzRanges: [{
type: Input
}], nzRenderExtraFooter: [{
type: Input
}], nzShowTime: [{
type: Input
}], nzPlaceHolder: [{
type: Input
}], nzAddOn: [{
type: Input
}], nzAutoFocus: [{
type: Input
}], nzDisabledHours: [{
type: Input
}], nzDisabledMinutes: [{
type: Input
}], nzDisabledSeconds: [{
type: Input
}], nzHideDisabledOptions: [{
type: Input
}], nzHourStep: [{
type: Input
}], nzMinuteStep: [{
type: Input
}], nzSecondStep: [{
type: Input
}], nzOpen: [{
type: Input
}], nzPopupClassName: [{
type: Input
}], nzDefaultOpenValue: [{
type: Input
}], nzUse12Hours: [{
type: Input
}], nzOnOk: [{
type: Output
}], ngModelChange: [{
type: Output
}], nzOnCalendarChange: [{
type: Output
}] } });
const COMPONENTS$1 = [
DatePickerComponent,
RangePickerComponent,
YearPickerComponent,
MonthPickerComponent,
WeekPickerComponent,
TimePickerComponent
];
/** 自定义组件模块 */
class LNgZorroModule {
static forRoot() {
return { ngModule: LNgZorroModule };
}
}
LNgZorroModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LNgZorroModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LNgZorroModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LNgZorroModule, declarations: [DatePickerComponent,
RangePickerComponent,
YearPickerComponent,
MonthPickerComponent,
WeekPickerComponent,
TimePickerComponent], imports: [CommonModule,
FormsModule,
NzDatePickerModule,
NzTimePickerModule], exports: [DatePickerComponent,
RangePickerComponent,
YearPickerComponent,
MonthPickerComponent,
WeekPickerComponent,
TimePickerComponent] });
LNgZorroModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LNgZorroModule, imports: [[
CommonModule,
FormsModule,
NzDatePickerModule,
NzTimePickerModule,
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LNgZorroModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule,
FormsModule,
NzDatePickerModule,
NzTimePickerModule,
],
declarations: [
...COMPONENTS$1,
],
exports: [
...COMPONENTS$1,
],
}]
}] });
class ValidationMessagesComponent extends SampleComponentBaseDirective {
constructor(injector, cdr, appConfig) {
super(injector);
this.cdr = cdr;
this.appConfig = appConfig;
this._formCtrlInited = false;
/** 所有异常 */
this.errorSource = {};
/** 页面异常信息 */
this.viewErrors = [];
this.updateErrorSource();
}
ngOnChanges(changes) {
if (changes.customErrors) {
this.updateErrorSource();
}
if (changes.formCtrl && changes.formCtrl.currentValue && !this._formCtrlInited) {
this._formCtrlInited = true;
const self = this;
self.updateViewError();
changes.formCtrl.currentValue.valueChanges.subscribe((res) => {
self.updateViewError();
});
}
}
/** 更新所有定义的错误 */
updateErrorSource() {
if (!this.customErrors || this.customErrors.length === 0) {
this.appConfig.standartErrors.forEach((item) => {
this.errorSource[item.error] = item;
});
return;
}
const standarts = this.appConfig.standartErrors.filter(stdErr => !this.customErrors.every(customErr => customErr.error === stdErr.error));
standarts.concat(this.customErrors)
.forEach((item) => {
this.errorSource[item.error] = item;
});
}
/** 更新视图错误 */
updateViewError() {
if (this.formCtrl.invalid && (this.formCtrl.dirty || this.formCtrl.touched)) {
const tmpViewErrors = [];
// tslint:disable-next-line: forin
for (const key in this.formCtrl.errors) {
const formError = this.formCtrl.errors[key];
if (!formError) {
continue;
}
const error = this.errorSource[key];
if (!error) {
continue;
}
const errorRequirement = formError[error.errorProperty];
tmpViewErrors.push(!!errorRequirement ? this.l(error.localizationKey) + ' ' + errorRequirement : this.l(error.localizationKey));
}
const newError = tmpViewErrors.join(',');
const oldError = this.viewErrors.join(',');
if (newError !== oldError) {
this.viewErrors = tmpViewErrors;
this.cdr.detectChanges();
}
}
}
}
ValidationMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValidationMessagesComponent, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }, { token: YOYO_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
ValidationMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ValidationMessagesComponent, selector: "validation-messages", inputs: { formCtrl: "formCtrl", customErrors: "customErrors" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<!--<span *ngIf=\"formCtrl&&formCtrl.invalid && (formCtrl.dirty || formCtrl.touched)\">-->\n<!-- <ng-container *ngFor=\"let errorDef of errorDefsInternal\">-->\n<!-- <span *ngIf=\"getErrorDefinitionIsInValid(errorDef)\">-->\n<!-- {{getErrorDefinitionMessage(errorDef)}}-->\n<!-- </span>-->\n<!-- </ng-container>-->\n<!--</span>-->\n\n<ng-container *ngFor=\"let error of viewErrors\">\n <div>\n {{error}}\n </div>\n</ng-container>\n", styles: [""], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ValidationMessagesComponent, decorators: [{
type: Component,
args: [{
selector: 'validation-messages',
templateUrl: './validation-messages.component.html',
styleUrls: ['./validation-messages.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush,
}]
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
type: Inject,
args: [YOYO_CONFIG]
}] }]; }, propDecorators: { formCtrl: [{
type: Input
}], customErrors: [{
type: Input
}] } });
const COMPONENTS = [
ValidationMessagesComponent,
];
class LValidationMessagesModule {
}
LValidationMessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LValidationMessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LValidationMessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LValidationMessagesModule, declarations: [ValidationMessagesComponent], imports: [CommonModule], exports: [ValidationMessagesComponent] });
LValidationMessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LValidationMessagesModule, imports: [[
CommonModule,
]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: LValidationMessagesModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule,
],
declarations: [
...COMPONENTS,
],
exports: [
...COMPONENTS,
]
}]
}] });
/** L52ABP-NG 的服务 */
const L52ABP_SERVICES = [
TreeDataHelperService,
ArrayToTreeConverterService,
PermissionService,
];
/** http 拦截器,loading效果 */
const L52ABP_HTTP_LOADING_PROVIDER = [
{
provide: HTTP_INTERCEPTORS,
useClass: LoadingInterceptor,
multi: true,
},
];
//
const ALL_MODULES = [
AbpModule,
LComponentsModule,
LDirectivesModule,
LGlobalLoadingModule,
LNgZorroModule,
LPipesModule,
LValidationMessagesModule,
];
class L52AbpModule {
}
L52AbpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: L52AbpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
L52AbpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: L52AbpModule, imports: [AbpModule,
LComponentsModule,
LDirectivesModule,
LGlobalLoadingModule,
LNgZorroModule,
LPipesModule,
LValidationMessagesModule], exports: [AbpModule,
LComponentsModule,
LDirectivesModule,
LGlobalLoadingModule,
LNgZorroModule,
LPipesModule,
LValidationMessagesModule] });
L52AbpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: L52AbpModule, providers: [], imports: [[
...ALL_MODULES,
], AbpModule,
LComponentsModule,
LDirectivesModule,
LGlobalLoadingModule,
LNgZorroModule,
LPipesModule,
LValidationMessagesModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: L52AbpModule, decorators: [{
type: NgModule,
args: [{
imports: [
...ALL_MODULES,
],
declarations: [],
entryComponents: [],
exports: [
...ALL_MODULES,
],
providers: [],
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { AddressWidget, AppComponentBaseDirective, ArrayToTreeConverterService, AutoFocusDirective, ControlComponentBaseDirective, DatePickerBase, DatePickerComponent, EnumService, EqualValidator, ExpressionValidator, FakeAppSessionService, ImgShowComponent, L52ABP_HTTP_LOADING_PROVIDER, L52ABP_SERVICES, L52AbpModule, LComponentsModule, LDirectivesModule, LGlobalLoadingModule, LJsonSchemaModule, LNgZorroModule, LPipesModule, LValidationMessagesModule, LoadingInterceptor, LoadingService, LocalizationService, MarkdownWidget, MaxValueValidator, MessageExtension, MinValueValidator, ModalComponentBaseDirective, ModalPagedListingComponentBaseDirective, MomentFormatPipe, MomentFromNowPipe, MomentWidget, MonthPickerComponent, NoDataComponent, OverlayComponent, PageGridComponent, PagedListingComponentBaseDirective, PagedRequestDto, PagedResultDto, PasswordComplexityValidator, PerfectScrollbarEvents, PermissionService, ProLangsComponent, RangePickerComponent, RequestHelper, SCHEMA_THIRDS_COMPONENTS, STWIDGET_COMPONENTS, SampleComponentBaseDirective, SampleControlComponentBaseDirective, ScriptLoaderService, ScrollbarDirective, SfWidgetsModule, SimplemdeWidget, SortType, StMomentWidget, StWidgetsModule, TableCheckboxPanelComponent, TimePickerComponent, TreeDataHelperService, ValidationMessagesComponent, WeekPickerComponent, YOYO_APP_SESSION_SERVICE, YOYO_APP_SESSION_SERVICE_FACTORY, YOYO_CONFIG, YOYO_CONFIG_FACTORY, YOYO_ENUM_SERVICE, YOYO_ENUM_SERVICE_FACTORY, YearPickerComponent, YoyoConfig, YoyoConfigGrid, YoyoLang, accountModuleAnimation, appModuleAnimation, slideFromBottom, slideFromUp, throwIfAlreadyLoaded };
//# sourceMappingURL=yoyoboot-l-52abp-ng.js.map