@magic-xpa/angular 4.1100.0-dev4110.106 → 4.1100.0-dev4110.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/index.mjs +59 -2
- package/esm2020/src/controls.metadata.model.mjs +180 -0
- package/esm2020/src/interfaces/sub-form-definition.iterface.mjs +2 -0
- package/esm2020/src/magic.core.module.mjs +160 -0
- package/esm2020/src/services/ISubformMagicService.mjs +2 -0
- package/esm2020/src/services/OverlayWindowService.mjs +236 -0
- package/esm2020/src/services/StylesMapManager.mjs +28 -0
- package/esm2020/src/services/accessor.magic.service.mjs +356 -0
- package/esm2020/src/services/commands-collector.magic.service.mjs +46 -0
- package/esm2020/src/services/component-list.magic.service.mjs +46 -0
- package/esm2020/src/services/confirmation.components.magic.provider.mjs +21 -0
- package/esm2020/src/services/engine.magic.service.mjs +82 -0
- package/esm2020/src/services/exit.magic.service.mjs +13 -0
- package/esm2020/src/services/magic-color.service.mjs +99 -0
- package/esm2020/src/services/magic.lazy.loader.service.mjs +16 -0
- package/esm2020/src/services/magic.providers.mjs +25 -0
- package/esm2020/src/services/magic.services.mjs +31 -0
- package/esm2020/src/services/mg-date-adapter.mjs +109 -0
- package/esm2020/src/services/overlay.conainer.magic.provider.mjs +14 -0
- package/esm2020/src/services/router-commands.magic.service.mjs +28 -0
- package/esm2020/src/services/subform.magic.service.mjs +184 -0
- package/esm2020/src/services/table.magic.service.mjs +77 -0
- package/esm2020/src/services/task.magics.service.mjs +624 -0
- package/esm2020/src/services/title.magic.service.mjs +18 -0
- package/esm2020/src/ui/GuiInteractiveExecutor.mjs +105 -0
- package/esm2020/src/ui/components/base-magic-alert.component.mjs +23 -0
- package/esm2020/src/ui/components/base-magic-confirm.component.mjs +23 -0
- package/esm2020/src/ui/components/magic-alert.component.mjs +35 -0
- package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +41 -0
- package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +49 -0
- package/esm2020/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +28 -0
- package/esm2020/src/ui/directives/magic/checkbox.magic.directive.mjs +28 -0
- package/esm2020/src/ui/directives/magic/combobox.magic.directive.mjs +36 -0
- package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +27 -0
- package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +52 -0
- package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +32 -0
- package/esm2020/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +27 -0
- package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +193 -0
- package/esm2020/src/ui/directives/magic/row.magic.directive.mjs +58 -0
- package/esm2020/src/ui/directives/magic-focus.directive.mjs +19 -0
- package/esm2020/src/ui/directives/magic.directive.mjs +215 -0
- package/esm2020/src/ui/directives/magicViewContainerRef.directive.mjs +19 -0
- package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +408 -0
- package/esm2020/src/ui/directives/range-validator.magic.directive.mjs +58 -0
- package/esm2020/src/ui/magic-confirmationBox.mjs +42 -0
- package/esm2020/src/ui/magic-modal/base-magic-overlay-container.mjs +22 -0
- package/esm2020/src/ui/magic-modal/magic-modal-form.mjs +8 -0
- package/esm2020/src/ui/magic-modal/magic-modal-interface.mjs +2 -0
- package/esm2020/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +121 -0
- package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +159 -0
- package/esm2020/src/ui/magic-root.component.mjs +203 -0
- package/esm2020/src/ui/mgerror.magic.component.mjs +119 -0
- package/esm2020/src/ui/pipes/date.magic.pipe.mjs +105 -0
- package/esm2020/src/ui/pipes/time.magic.pipe.mjs +51 -0
- package/esm2020/src/ui/pipes/time24.magic.pipe.mjs +34 -0
- package/esm2020/src/ui/router-container.magic.component.mjs +108 -0
- package/esm2020/src/ui/subform.magic.component.mjs +52 -0
- package/esm2020/src/ui/task-base.magic.component.mjs +86 -0
- package/esm2020/src/ui/utils.mjs +54 -0
- package/fesm2015/magic-xpa-angular.mjs +4863 -0
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +4681 -0
- package/fesm2020/magic-xpa-angular.mjs.map +1 -1
- package/index.d.ts +58 -1
- package/package.json +3 -3
- package/src/controls.metadata.model.d.ts +62 -0
- package/src/interfaces/sub-form-definition.iterface.d.ts +12 -0
- package/src/magic.core.module.d.ts +41 -0
- package/src/services/ISubformMagicService.d.ts +4 -0
- package/src/services/OverlayWindowService.d.ts +31 -0
- package/src/services/StylesMapManager.d.ts +5 -0
- package/src/services/accessor.magic.service.d.ts +69 -0
- package/src/services/commands-collector.magic.service.d.ts +15 -0
- package/src/services/component-list.magic.service.d.ts +23 -0
- package/src/services/confirmation.components.magic.provider.d.ts +8 -0
- package/src/services/engine.magic.service.d.ts +27 -0
- package/src/services/exit.magic.service.d.ts +6 -0
- package/src/services/magic-color.service.d.ts +19 -0
- package/src/services/magic.lazy.loader.service.d.ts +6 -0
- package/src/services/magic.providers.d.ts +107 -0
- package/src/services/magic.services.d.ts +16 -0
- package/src/services/mg-date-adapter.d.ts +40 -0
- package/src/services/overlay.conainer.magic.provider.d.ts +7 -0
- package/src/services/router-commands.magic.service.d.ts +17 -0
- package/src/services/subform.magic.service.d.ts +43 -0
- package/src/services/table.magic.service.d.ts +30 -0
- package/src/services/task.magics.service.d.ts +100 -0
- package/src/services/title.magic.service.d.ts +9 -0
- package/src/ui/GuiInteractiveExecutor.d.ts +22 -0
- package/src/ui/components/base-magic-alert.component.d.ts +10 -0
- package/src/ui/components/base-magic-confirm.component.d.ts +10 -0
- package/src/ui/components/magic-alert.component.d.ts +6 -0
- package/src/ui/components/magic-confirmation-box.component.d.ts +6 -0
- package/src/ui/directives/NonMagicControlDirective.d.ts +26 -0
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +9 -0
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +9 -0
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +10 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +7 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +17 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +7 -0
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +9 -0
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +18 -0
- package/src/ui/directives/magic/row.magic.directive.d.ts +17 -0
- package/src/ui/directives/magic-focus.directive.d.ts +9 -0
- package/src/ui/directives/magic.directive.d.ts +44 -0
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +8 -0
- package/src/ui/directives/mgformat.magic.directive.d.ts +31 -0
- package/src/ui/directives/range-validator.magic.directive.d.ts +17 -0
- package/src/ui/magic-confirmationBox.d.ts +6 -0
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +5 -0
- package/src/ui/magic-modal/magic-modal-form.d.ts +5 -0
- package/src/ui/magic-modal/magic-modal-interface.d.ts +10 -0
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +31 -0
- package/src/ui/magic-modal/magic-overlay-container.d.ts +25 -0
- package/src/ui/magic-root.component.d.ts +40 -0
- package/src/ui/mgerror.magic.component.d.ts +20 -0
- package/src/ui/pipes/date.magic.pipe.d.ts +17 -0
- package/src/ui/pipes/time.magic.pipe.d.ts +11 -0
- package/src/ui/pipes/time24.magic.pipe.d.ts +10 -0
- package/src/ui/router-container.magic.component.d.ts +30 -0
- package/src/ui/subform.magic.component.d.ts +16 -0
- package/src/ui/task-base.magic.component.d.ts +34 -0
- package/src/ui/utils.d.ts +9 -0
@@ -0,0 +1,203 @@
|
|
1
|
+
import { ChangeDetectorRef, Component, ElementRef, HostListener, Input, Optional, TemplateRef, ViewChild } from '@angular/core';
|
2
|
+
import { CommandType } from '@magic-xpa/gui';
|
3
|
+
import { Title } from '@angular/platform-browser';
|
4
|
+
import { EngineMagicService } from '../services/engine.magic.service';
|
5
|
+
import { ComponentListMagicService } from '../services/component-list.magic.service';
|
6
|
+
import { GuiInteractiveExecutor } from './GuiInteractiveExecutor';
|
7
|
+
import { filter } from 'rxjs/operators';
|
8
|
+
import { ExitMagicService } from '../services/exit.magic.service';
|
9
|
+
import { OverlayWindowService } from '../services/OverlayWindowService';
|
10
|
+
import { CommandsCollectorMagicService } from '../services/commands-collector.magic.service';
|
11
|
+
import { HttpClient } from '@angular/common/http';
|
12
|
+
import * as i0 from "@angular/core";
|
13
|
+
import * as i1 from "../services/engine.magic.service";
|
14
|
+
import * as i2 from "../services/component-list.magic.service";
|
15
|
+
import * as i3 from "@angular/platform-browser";
|
16
|
+
import * as i4 from "../services/OverlayWindowService";
|
17
|
+
import * as i5 from "@angular/common/http";
|
18
|
+
import * as i6 from "../services/commands-collector.magic.service";
|
19
|
+
import * as i7 from "../services/exit.magic.service";
|
20
|
+
import * as i8 from "@angular/common";
|
21
|
+
import * as i9 from "ng-dynamic-component";
|
22
|
+
import * as i10 from "./directives/magicViewContainerRef.directive";
|
23
|
+
const _c0 = ["magicRoot"];
|
24
|
+
function MagicShellComponent_ndc_dynamic_2_Template(rf, ctx) { if (rf & 1) {
|
25
|
+
i0.ɵɵelement(0, "ndc-dynamic", 6);
|
26
|
+
} if (rf & 2) {
|
27
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
28
|
+
i0.ɵɵproperty("ndcDynamicComponent", ctx_r1.RootComponent)("ndcDynamicInputs", ctx_r1.RootComponentParameters);
|
29
|
+
} }
|
30
|
+
function MagicShellComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
31
|
+
i0.ɵɵelementStart(0, "div", 7);
|
32
|
+
i0.ɵɵelementContainer(1, 8);
|
33
|
+
i0.ɵɵelementEnd();
|
34
|
+
} if (rf & 2) {
|
35
|
+
const ctx_r3 = i0.ɵɵnextContext();
|
36
|
+
const _r4 = i0.ɵɵreference(7);
|
37
|
+
i0.ɵɵadvance(1);
|
38
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.SpinnerTemplate ? ctx_r3.SpinnerTemplate : _r4);
|
39
|
+
} }
|
40
|
+
function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
41
|
+
i0.ɵɵelement(0, "div", 9);
|
42
|
+
} }
|
43
|
+
export class MagicShellComponent {
|
44
|
+
constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
|
45
|
+
this.engineMagicService = engineMagicService;
|
46
|
+
this.componentList = componentList;
|
47
|
+
this.changeDetectorRef = changeDetectorRef;
|
48
|
+
this.titleService = titleService;
|
49
|
+
this.overlayWindowService = overlayWindowService;
|
50
|
+
this.httpClient = httpClient;
|
51
|
+
this.pendingCommandsCollector = pendingCommandsCollector;
|
52
|
+
this.exitMagicService = exitMagicService;
|
53
|
+
this.RootComponent = null;
|
54
|
+
this.magicEngineTerminated = false;
|
55
|
+
this.initialize();
|
56
|
+
this.setTitle();
|
57
|
+
}
|
58
|
+
onBeforeUnload(event) {
|
59
|
+
if (this.engineMagicService.TransCacheExists()) {
|
60
|
+
event.returnValue = 'Are you sure?';
|
61
|
+
return 'Are you sure?';
|
62
|
+
}
|
63
|
+
else {
|
64
|
+
this.engineMagicService.TerminateContextUsingFetchAPI();
|
65
|
+
this.magicEngineTerminated = true;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
onUnload(event) {
|
69
|
+
if (!this.magicEngineTerminated)
|
70
|
+
this.engineMagicService.TerminateContextUsingFetchAPI();
|
71
|
+
}
|
72
|
+
ngAfterViewInit() {
|
73
|
+
this.overlayWindowService.init(this.overlayWindowsContainerViewRef, this.rootMagicElementRef.nativeElement, this.changeDetectorRef);
|
74
|
+
this.engineMagicService.startMagicEngine(this.httpClient);
|
75
|
+
}
|
76
|
+
setViewContainerRef(vcRef) {
|
77
|
+
this.overlayWindowsContainerViewRef = vcRef;
|
78
|
+
}
|
79
|
+
initialize() {
|
80
|
+
this.registerUICommands();
|
81
|
+
}
|
82
|
+
setTitle() {
|
83
|
+
const newTitle = this.componentList.title;
|
84
|
+
this.titleService.setTitle(newTitle);
|
85
|
+
}
|
86
|
+
setComponent(formName, taskId, taskDescription, isModal) {
|
87
|
+
this.pendingCommandsCollector.startCollecting();
|
88
|
+
if (isModal) {
|
89
|
+
this.overlayWindowService.open(formName, taskId, taskDescription);
|
90
|
+
}
|
91
|
+
else {
|
92
|
+
this.RootComponent = this.componentList.getComponent(formName);
|
93
|
+
this.RootComponentParameters = { taskIdParam: taskId, taskDescription: taskDescription };
|
94
|
+
}
|
95
|
+
this.changeDetectorRef.detectChanges();
|
96
|
+
}
|
97
|
+
registerUICommands() {
|
98
|
+
this.engineMagicService.refreshDom.pipe(filter(command => command.TaskTag === '0'))
|
99
|
+
.subscribe(command => {
|
100
|
+
this.executeCommand(command);
|
101
|
+
});
|
102
|
+
this.engineMagicService
|
103
|
+
.interactiveCommands.pipe(filter(command => command.TaskTag === '0'))
|
104
|
+
.subscribe(command => {
|
105
|
+
GuiInteractiveExecutor.executeInteractiveCommand(null, command, this.overlayWindowService);
|
106
|
+
});
|
107
|
+
}
|
108
|
+
executeCommand(command) {
|
109
|
+
switch (command.CommandType) {
|
110
|
+
case CommandType.OPEN_FORM:
|
111
|
+
this.setComponent(command.str, command.stringList[0], command.stringList[1], command.Bool1);
|
112
|
+
break;
|
113
|
+
case CommandType.SET_IS_LOGGED_IN:
|
114
|
+
this.engineMagicService.setIsLoggedIn(command.Bool1);
|
115
|
+
break;
|
116
|
+
case CommandType.CLOSE_FORM:
|
117
|
+
if (this.RootComponent != null && command.str === this.RootComponentParameters.taskIdParam) {
|
118
|
+
this.RootComponent = null;
|
119
|
+
this.RootComponentParameters = {};
|
120
|
+
this.changeDetectorRef.detectChanges();
|
121
|
+
}
|
122
|
+
else {
|
123
|
+
this.overlayWindowService.close(command.str);
|
124
|
+
this.changeDetectorRef.detectChanges();
|
125
|
+
}
|
126
|
+
break;
|
127
|
+
case CommandType.RELOAD_PAGE:
|
128
|
+
window.location.reload();
|
129
|
+
break;
|
130
|
+
case CommandType.SHOW_SPINNER:
|
131
|
+
if (this.showSpinner != command.Bool1) {
|
132
|
+
this.showSpinner = command.Bool1;
|
133
|
+
this.changeDetectorRef.detectChanges();
|
134
|
+
}
|
135
|
+
break;
|
136
|
+
case CommandType.EXIT_MAGIC:
|
137
|
+
if (this.exitMagicService)
|
138
|
+
this.exitMagicService.exitMagic();
|
139
|
+
break;
|
140
|
+
case CommandType.SHOW_HTML_ERROR:
|
141
|
+
window.document.write(command.str);
|
142
|
+
break;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(i0.ɵɵdirectiveInject(i1.EngineMagicService), i0.ɵɵdirectiveInject(i2.ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i3.Title), i0.ɵɵdirectiveInject(i4.OverlayWindowService), i0.ɵɵdirectiveInject(i5.HttpClient), i0.ɵɵdirectiveInject(i6.CommandsCollectorMagicService), i0.ɵɵdirectiveInject(i7.ExitMagicService, 8)); };
|
147
|
+
MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
148
|
+
i0.ɵɵviewQuery(_c0, 7);
|
149
|
+
} if (rf & 2) {
|
150
|
+
let _t;
|
151
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
|
152
|
+
} }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
153
|
+
i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, false, i0.ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, false, i0.ɵɵresolveWindow);
|
154
|
+
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵProvidersFeature([])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
|
155
|
+
i0.ɵɵelementStart(0, "div", null, 0);
|
156
|
+
i0.ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
|
157
|
+
i0.ɵɵelement(3, "div", 2, 3);
|
158
|
+
i0.ɵɵelementEnd();
|
159
|
+
i0.ɵɵtemplate(5, MagicShellComponent_div_5_Template, 2, 1, "div", 4);
|
160
|
+
i0.ɵɵtemplate(6, MagicShellComponent_ng_template_6_Template, 1, 0, "ng-template", null, 5, i0.ɵɵtemplateRefExtractor);
|
161
|
+
} if (rf & 2) {
|
162
|
+
i0.ɵɵadvance(2);
|
163
|
+
i0.ɵɵproperty("ngIf", ctx.RootComponent !== null);
|
164
|
+
i0.ɵɵadvance(3);
|
165
|
+
i0.ɵɵproperty("ngIf", ctx.showSpinner);
|
166
|
+
} }, dependencies: [i8.NgIf, i8.NgTemplateOutlet, i9.DynamicComponent, i9.DynamicIoDirective, i10.MagicViewContainerRef], styles: [".mgSpinnerClass[_ngcontent-%COMP%]{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:_ngcontent-%COMP%_spin 2s linear infinite}.spinner-background[_ngcontent-%COMP%]{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"] });
|
167
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
|
168
|
+
type: Component,
|
169
|
+
args: [{ selector: 'magic-root', providers: [], template: `
|
170
|
+
<div #magicRoot>
|
171
|
+
<ndc-dynamic
|
172
|
+
*ngIf = "RootComponent !== null"
|
173
|
+
[ndcDynamicComponent]="RootComponent"
|
174
|
+
[ndcDynamicInputs] ="RootComponentParameters">
|
175
|
+
</ndc-dynamic>
|
176
|
+
|
177
|
+
<div #overlayWindowsContainer magicViewContainerRef>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="spinner-background" *ngIf="showSpinner">
|
182
|
+
<ng-container [ngTemplateOutlet]="SpinnerTemplate ? SpinnerTemplate:defaultSpinner"></ng-container>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<ng-template #defaultSpinner>
|
186
|
+
<div class="mgSpinnerClass"></div>
|
187
|
+
</ng-template>
|
188
|
+
`, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
189
|
+
}], function () { return [{ type: i1.EngineMagicService }, { type: i2.ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i3.Title }, { type: i4.OverlayWindowService }, { type: i5.HttpClient }, { type: i6.CommandsCollectorMagicService }, { type: i7.ExitMagicService, decorators: [{
|
190
|
+
type: Optional
|
191
|
+
}] }]; }, { rootMagicElementRef: [{
|
192
|
+
type: ViewChild,
|
193
|
+
args: ['magicRoot', { static: true }]
|
194
|
+
}], SpinnerTemplate: [{
|
195
|
+
type: Input
|
196
|
+
}], onBeforeUnload: [{
|
197
|
+
type: HostListener,
|
198
|
+
args: ['window:beforeunload', ['$event']]
|
199
|
+
}], onUnload: [{
|
200
|
+
type: HostListener,
|
201
|
+
args: ['window:unload', ['$event']]
|
202
|
+
}] }); })();
|
203
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFnaWMtcm9vdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91aS9tYWdpYy1yb290LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBRUwsaUJBQWlCLEVBQ2pCLFNBQVMsRUFDVCxVQUFVLEVBQ1YsWUFBWSxFQUNaLEtBQUssRUFDTCxRQUFRLEVBQ1IsV0FBVyxFQUNYLFNBQVMsRUFFVixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsV0FBVyxFQUFjLE1BQU0sZ0JBQWdCLENBQUM7QUFDekQsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ2xELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBQ3RFLE9BQU8sRUFBRSx5QkFBeUIsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBQ3JGLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ2xFLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNsRSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQUV4RSxPQUFPLEVBQUUsNkJBQTZCLEVBQUUsTUFBTSw4Q0FBOEMsQ0FBQztBQUM3RixP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xKSB7XHJcbiAgICAgICAgICB0aGlzLnNob3dTcGlubmVyID0gY29tbWFuZC5Cb29sMTtcclxuICAgICAgICAgIHRoaXMuY2hhbmdlRGV0ZWN0b3JSZWYuZGV0ZWN0Q2hhbmdlcygpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBicmVhaztcclxuXHJcbiAgICAgIGNhc2UgQ29tbWFuZFR5cGUuRVhJVF9NQUdJQzpcclxuICAgICAgICBpZiAodGhpcy5leGl0TWFnaWNTZXJ2aWNlKVxyXG4gICAgICAgICAgdGhpcy5leGl0TWFnaWNTZXJ2aWNlLmV4aXRNYWdpYygpO1xyXG4gICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgY2FzZSBDb21tYW5kVHlwZS5TSE9XX0hUTUxfRVJST1I6XHJcbiAgICAgICAgd2luZG93LmRvY3VtZW50LndyaXRlKGNvbW1hbmQuc3RyKTtcclxuICAgICAgICBicmVhaztcclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import { ChangeDetectorRef, Component, ElementRef, Input, ViewChild } from "@angular/core";
|
2
|
+
import { AccessorMagicService } from "../services/accessor.magic.service";
|
3
|
+
import { TaskMagicService } from "../services/task.magics.service";
|
4
|
+
import { isUndefined } from "@magic-xpa/mscorelib";
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
import * as i1 from "../services/task.magics.service";
|
7
|
+
import * as i2 from "../services/accessor.magic.service";
|
8
|
+
import * as i3 from "@angular/common";
|
9
|
+
const _c0 = ["customContent"];
|
10
|
+
function ErrorMagicComponent_div_0_span_4_Template(rf, ctx) { if (rf & 1) {
|
11
|
+
i0.ɵɵelementStart(0, "span");
|
12
|
+
i0.ɵɵtext(1);
|
13
|
+
i0.ɵɵelementEnd();
|
14
|
+
} if (rf & 2) {
|
15
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
16
|
+
i0.ɵɵadvance(1);
|
17
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r2.mgService.getErrMsg(ctx_r2.id, ctx_r2.rowId), " ");
|
18
|
+
} }
|
19
|
+
function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
20
|
+
i0.ɵɵelementStart(0, "div")(1, "div", null, 1);
|
21
|
+
i0.ɵɵprojection(3);
|
22
|
+
i0.ɵɵelementEnd();
|
23
|
+
i0.ɵɵtemplate(4, ErrorMagicComponent_div_0_span_4_Template, 2, 1, "span", 0);
|
24
|
+
i0.ɵɵelementEnd();
|
25
|
+
} if (rf & 2) {
|
26
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
27
|
+
i0.ɵɵadvance(4);
|
28
|
+
i0.ɵɵproperty("ngIf", ctx_r0.defaultDisplay);
|
29
|
+
} }
|
30
|
+
const _c1 = ["*"];
|
31
|
+
export class ErrorMagicComponent {
|
32
|
+
set magic(val) {
|
33
|
+
this.id = val;
|
34
|
+
}
|
35
|
+
;
|
36
|
+
set rowId1(val) {
|
37
|
+
this.rowId = val;
|
38
|
+
}
|
39
|
+
;
|
40
|
+
set CustomContent(innerComponent) {
|
41
|
+
this.defaultDisplay = innerComponent == undefined || this.isEmpty(innerComponent.nativeElement);
|
42
|
+
this.changeDetectorRef.detectChanges();
|
43
|
+
}
|
44
|
+
;
|
45
|
+
constructor(_task, mgService, changeDetectorRef) {
|
46
|
+
this._task = _task;
|
47
|
+
this.mgService = mgService;
|
48
|
+
this.changeDetectorRef = changeDetectorRef;
|
49
|
+
this.defaultDisplay = true;
|
50
|
+
this.rowId = "0";
|
51
|
+
}
|
52
|
+
isEmpty(element) {
|
53
|
+
const nodes = element.childNodes;
|
54
|
+
for (let i = 0; i < nodes.length; i++) {
|
55
|
+
const node = nodes.item(i);
|
56
|
+
if (node.nodeType !== 8 && nodes.item(i).textContent.trim().length !== 0) {
|
57
|
+
return false;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return true;
|
61
|
+
}
|
62
|
+
HasErrors(id) {
|
63
|
+
if (!isUndefined(id)) {
|
64
|
+
let control = this._task.getFormControl(this.rowId, id);
|
65
|
+
if (control !== null) {
|
66
|
+
if (control.dirty && (control.hasError('pattern') || control.hasError('required') ||
|
67
|
+
control.hasError('rangevalidator') || control.hasError('maxlength') || control.hasError('max')))
|
68
|
+
return true;
|
69
|
+
if (control.touched && control.hasError('required'))
|
70
|
+
return true;
|
71
|
+
if (this._task.Records.list[this.rowId] && this._task.Records.list[this.rowId].getControlMetadata(id)) {
|
72
|
+
let controlMetadata = this._task.Records.list[this.rowId].getControlMetadata(id);
|
73
|
+
for (let customValidator of controlMetadata.customValidators.keys()) {
|
74
|
+
if (control.hasError(customValidator))
|
75
|
+
return true;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
return false;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(i0.ɵɵdirectiveInject(i1.TaskMagicService), i0.ɵɵdirectiveInject(i2.AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
84
|
+
ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
85
|
+
i0.ɵɵviewQuery(_c0, 5);
|
86
|
+
} if (rf & 2) {
|
87
|
+
let _t;
|
88
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CustomContent = _t.first);
|
89
|
+
} }, inputs: { magic: "magic", rowId1: ["rowId", "rowId1"] }, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [[4, "ngIf"], ["customContent", ""]], template: function ErrorMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
90
|
+
i0.ɵɵprojectionDef();
|
91
|
+
i0.ɵɵtemplate(0, ErrorMagicComponent_div_0_Template, 5, 1, "div", 0);
|
92
|
+
} if (rf & 2) {
|
93
|
+
i0.ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
|
94
|
+
} }, dependencies: [i3.NgIf], encapsulation: 2 });
|
95
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorMagicComponent, [{
|
96
|
+
type: Component,
|
97
|
+
args: [{
|
98
|
+
selector: 'mgError',
|
99
|
+
template: `<div *ngIf="HasErrors(id)">
|
100
|
+
<div #customContent>
|
101
|
+
<ng-content></ng-content>
|
102
|
+
</div>
|
103
|
+
<span *ngIf="defaultDisplay">
|
104
|
+
{{mgService.getErrMsg(id, rowId)}}
|
105
|
+
</span>
|
106
|
+
</div>
|
107
|
+
`
|
108
|
+
}]
|
109
|
+
}], function () { return [{ type: i1.TaskMagicService }, { type: i2.AccessorMagicService }, { type: i0.ChangeDetectorRef }]; }, { magic: [{
|
110
|
+
type: Input,
|
111
|
+
args: ['magic']
|
112
|
+
}], rowId1: [{
|
113
|
+
type: Input,
|
114
|
+
args: ['rowId']
|
115
|
+
}], CustomContent: [{
|
116
|
+
type: ViewChild,
|
117
|
+
args: ['customContent', { static: false }]
|
118
|
+
}] }); })();
|
119
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWdlcnJvci5tYWdpYy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91aS9tZ2Vycm9yLm1hZ2ljLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNGLE9BQU8sRUFBQyxvQkFBb0IsRUFBQyxNQUFNLG9DQUFvQyxDQUFDO0FBQ3hFLE9BQU8sRUFBQyxnQ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cm9sLmhhc0Vycm9yKCdtYXhsZW5ndGgnKSB8fCBjb250cm9sLmhhc0Vycm9yKCdtYXgnKSkpXHJcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICBpZiAoY29udHJvbC50b3VjaGVkICYmIGNvbnRyb2wuaGFzRXJyb3IoJ3JlcXVpcmVkJykpXHJcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuXHJcbiAgICAgICAgaWYodGhpcy5fdGFzay5SZWNvcmRzLmxpc3RbdGhpcy5yb3dJZF0gJiYgdGhpcy5fdGFzay5SZWNvcmRzLmxpc3RbdGhpcy5yb3dJZF0uZ2V0Q29udHJvbE1ldGFkYXRhKGlkKSl7XHJcbiAgICAgICAgICBsZXQgY29udHJvbE1ldGFkYXRhID0gdGhpcy5fdGFzay5SZWNvcmRzLmxpc3RbdGhpcy5yb3dJZF0uZ2V0Q29udHJvbE1ldGFkYXRhKGlkKTtcclxuICAgICAgICAgIGZvciAobGV0IGN1c3RvbVZhbGlkYXRvciBvZiBjb250cm9sTWV0YWRhdGEuY3VzdG9tVmFsaWRhdG9ycy5rZXlzKCkpIHtcclxuICAgICAgICAgICAgaWYgKGNvbnRyb2wuaGFzRXJyb3IoY3VzdG9tVmFsaWRhdG9yKSlcclxuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiBmYWxzZTtcclxuICB9XHJcbn1cclxuXHJcbiJdfQ==
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import { Pipe } from '@angular/core';
|
2
|
+
import { DatePipe } from '@angular/common';
|
3
|
+
import { TaskMagicService } from '../../services/task.magics.service';
|
4
|
+
import { StringBuilder, isNullOrUndefined } from "@magic-xpa/mscorelib";
|
5
|
+
import { PICInterface } from "@magic-xpa/utils";
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
import * as i1 from "../../services/task.magics.service";
|
8
|
+
export class Constants {
|
9
|
+
}
|
10
|
+
Constants.DATE_FMT = 'dd/MMM/yyyy';
|
11
|
+
export class DateMagicPipe extends DatePipe {
|
12
|
+
constructor(_task) {
|
13
|
+
super('en-US');
|
14
|
+
this._task = _task;
|
15
|
+
}
|
16
|
+
transform(value, controlId) {
|
17
|
+
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
18
|
+
let formatStr = null;
|
19
|
+
let mgDateFormatter = new MgDateFormatter();
|
20
|
+
if (!isNullOrUndefined(value) && mask !== null) {
|
21
|
+
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
22
|
+
if (formatStr != null && this._task.isTableControl(controlId)) {
|
23
|
+
if (this._task.mgInputDateFormat == null)
|
24
|
+
this._task.mgInputDateFormat = formatStr;
|
25
|
+
else
|
26
|
+
formatStr = this._task.mgInputDateFormat;
|
27
|
+
}
|
28
|
+
return super.transform(value, formatStr);
|
29
|
+
}
|
30
|
+
else
|
31
|
+
value = "";
|
32
|
+
return value;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(i0.ɵɵdirectiveInject(i1.TaskMagicService, 16)); };
|
36
|
+
DateMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
37
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateMagicPipe, [{
|
38
|
+
type: Pipe,
|
39
|
+
args: [{
|
40
|
+
name: 'magicDate'
|
41
|
+
}]
|
42
|
+
}], function () { return [{ type: i1.TaskMagicService }]; }, null); })();
|
43
|
+
export class MgDateFormatter {
|
44
|
+
ConvertMgDateFormatToAngular(mgDateMask) {
|
45
|
+
let formatStr = new StringBuilder();
|
46
|
+
if (mgDateMask !== null) {
|
47
|
+
for (let i = 0; i < mgDateMask.length;) {
|
48
|
+
switch (mgDateMask.charCodeAt(i)) {
|
49
|
+
case PICInterface.PIC_YYYY:
|
50
|
+
formatStr.Append('yyyy');
|
51
|
+
i += 4;
|
52
|
+
break;
|
53
|
+
case PICInterface.PIC_MMD:
|
54
|
+
formatStr.Append('MM');
|
55
|
+
i += 2;
|
56
|
+
break;
|
57
|
+
case PICInterface.PIC_YY:
|
58
|
+
formatStr.Append('yy');
|
59
|
+
i += 2;
|
60
|
+
break;
|
61
|
+
case PICInterface.PIC_MMM:
|
62
|
+
{
|
63
|
+
let cnt = 0;
|
64
|
+
for (; i < mgDateMask.length; i++)
|
65
|
+
if (mgDateMask.charCodeAt(i) == PICInterface.PIC_MMM)
|
66
|
+
cnt++;
|
67
|
+
else
|
68
|
+
break;
|
69
|
+
if (cnt == 3)
|
70
|
+
formatStr.Append('MMM');
|
71
|
+
if (cnt > 3)
|
72
|
+
formatStr.Append('MMMM');
|
73
|
+
}
|
74
|
+
break;
|
75
|
+
case PICInterface.PIC_DD:
|
76
|
+
formatStr.Append('dd');
|
77
|
+
i += 2;
|
78
|
+
break;
|
79
|
+
case PICInterface.PIC_WWW:
|
80
|
+
{
|
81
|
+
let cnt = 0;
|
82
|
+
for (; i < mgDateMask.length; i++)
|
83
|
+
if (mgDateMask.charCodeAt(i) == PICInterface.PIC_WWW)
|
84
|
+
cnt++;
|
85
|
+
else
|
86
|
+
break;
|
87
|
+
if (cnt == 3)
|
88
|
+
formatStr.Append('EEE');
|
89
|
+
if (cnt > 3)
|
90
|
+
formatStr.Append('EEEE');
|
91
|
+
}
|
92
|
+
break;
|
93
|
+
default:
|
94
|
+
formatStr.Append(mgDateMask.charAt(i));
|
95
|
+
i++;
|
96
|
+
break;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
return formatStr.ToString();
|
100
|
+
}
|
101
|
+
else
|
102
|
+
return "dd-mm-yyyy";
|
103
|
+
}
|
104
|
+
}
|
105
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS5tYWdpYy5waXBlLmpzIiw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Kz0gNDtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICBjYXNlIFBJQ0ludGVyZmFjZS5QSUNfTU1EOlxyXG4gICAgICAgICAgICBmb3JtYXRTdHIuQXBwZW5kKCdNTScpO1xyXG4gICAgICAgICAgICBpICs9IDI7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBQSUNJbnRlcmZhY2UuUElDX1lZOlxyXG4gICAgICAgICAgICBmb3JtYXRTdHIuQXBwZW5kKCd5eScpO1xyXG4gICAgICAgICAgICBpICs9IDI7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBQSUNJbnRlcmZhY2UuUElDX01NTTpcclxuICAgICAgICAgIHtcclxuICAgICAgICAgICAgbGV0IGNudCA9IDA7XHJcbiAgICAgICAgICAgIGZvciAgKDtpIDwgbWdEYXRlTWFzay5sZW5ndGg7IGkrKylcclxuICAgICAgICAgICAgICBpZiAobWdEYXRlTWFzay5jaGFyQ29kZUF0KGkpID09IFBJQ0ludGVyZmFjZS5QSUNfTU1NKVxyXG4gICAgICAgICAgICAgICAgY250Kys7XHJcbiAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgICBpZiAoY250ID09IDMpXHJcbiAgICAgICAgICAgICAgZm9ybWF0U3RyLkFwcGVuZCgnTU1NJyk7XHJcbiAgICAgICAgICAgIGlmIChjbnQgPiAzKVxyXG4gICAgICAgICAgICAgIGZvcm1hdFN0ci5BcHBlbmQoJ01NTU0nKTtcclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBQSUNJbnRlcmZhY2UuUElDX0REOlxyXG4gICAgICAgICAgICBmb3JtYXRTdHIuQXBwZW5kKCdkZCcpO1xyXG4gICAgICAgICAgICBpICs9IDI7XHJcblxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIFBJQ0ludGVyZmFjZS5QSUNfV1dXOiB7XHJcbiAgICAgICAgICAgIGxldCBjbnQgPSAwO1xyXG4gICAgICAgICAgICBmb3IgICg7aSA8IG1nRGF0ZU1hc2subGVuZ3RoOyBpKyspXHJcbiAgICAgICAgICAgICAgaWYgKG1nRGF0ZU1hc2suY2hhckNvZGVBdChpKSA9PSBQSUNJbnRlcmZhY2UuUElDX1dXVylcclxuICAgICAgICAgICAgICAgIGNudCsrO1xyXG4gICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgICAgaWYgKGNudCA9PSAzKVxyXG4gICAgICAgICAgICAgIGZvcm1hdFN0ci5BcHBlbmQoJ0VFRScpO1xyXG4gICAgICAgICAgICBpZiAoY250ID4gMylcclxuICAgICAgICAgICAgICBmb3JtYXRTdHIuQXBwZW5kKCdFRUVFJyk7XHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgIGZvcm1hdFN0ci5BcHBlbmQobWdEYXRlTWFzay5jaGFyQXQoaSkpO1xyXG4gICAgICAgICAgICBpKys7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG4gICAgICByZXR1cm4gZm9ybWF0U3RyLlRvU3RyaW5nKCk7XHJcbiAgICB9XHJcbiAgICBlbHNlXHJcbiAgICAgIHJldHVybiBcImRkLW1tLXl5eXlcIjsgLy8gcmV0dXJuIGRlZmF1bHQgZm9ybWF0LlxyXG5cclxuICB9XHJcbn1cclxuIl19
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { Pipe } from '@angular/core';
|
2
|
+
import { DatePipe } from '@angular/common';
|
3
|
+
import { TaskMagicService } from '../../services/task.magics.service';
|
4
|
+
import { StringBuilder } from "@magic-xpa/mscorelib";
|
5
|
+
import { PICInterface } from "@magic-xpa/utils";
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
import * as i1 from "../../services/task.magics.service";
|
8
|
+
export class TimeMagicPipe extends DatePipe {
|
9
|
+
constructor(_task) {
|
10
|
+
super('en-US');
|
11
|
+
this._task = _task;
|
12
|
+
}
|
13
|
+
transform(value, controlId) {
|
14
|
+
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
15
|
+
let formatStr = new StringBuilder();
|
16
|
+
if (typeof value !== "undefined" && mask !== null) {
|
17
|
+
for (let i = 0; i < mask.length;) {
|
18
|
+
switch (mask.charCodeAt(i)) {
|
19
|
+
case PICInterface.PIC_HH:
|
20
|
+
formatStr.Append('hh');
|
21
|
+
i += 2;
|
22
|
+
break;
|
23
|
+
case PICInterface.PIC_MMT:
|
24
|
+
formatStr.Append('mm');
|
25
|
+
i += 2;
|
26
|
+
break;
|
27
|
+
case PICInterface.PIC_SS:
|
28
|
+
formatStr.Append('ss');
|
29
|
+
i += 2;
|
30
|
+
break;
|
31
|
+
default:
|
32
|
+
formatStr.Append(mask.charAt(i));
|
33
|
+
i++;
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
formatStr.Append(' a');
|
38
|
+
return super.transform(value, formatStr.ToString());
|
39
|
+
}
|
40
|
+
return value;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(i0.ɵɵdirectiveInject(i1.TaskMagicService, 16)); };
|
44
|
+
TimeMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
45
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimeMagicPipe, [{
|
46
|
+
type: Pipe,
|
47
|
+
args: [{
|
48
|
+
name: 'magicTime'
|
49
|
+
}]
|
50
|
+
}], function () { return [{ type: i1.TaskMagicService }]; }, null); })();
|
51
|
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BdChpKSkge1xyXG4gICAgICAgICAgY2FzZSBQSUNJbnRlcmZhY2UuUElDX0hIOlxyXG4gICAgICAgICAgICBmb3JtYXRTdHIuQXBwZW5kKCdoaCcpO1xyXG4gICAgICAgICAgICBpICs9IDI7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgY2FzZSBQSUNJbnRlcmZhY2UuUElDX01NVDpcclxuICAgICAgICAgICAgZm9ybWF0U3RyLkFwcGVuZCgnbW0nKTtcclxuICAgICAgICAgICAgaSArPSAyO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIGNhc2UgUElDSW50ZXJmYWNlLlBJQ19TUzpcclxuICAgICAgICAgICAgZm9ybWF0U3RyLkFwcGVuZCgnc3MnKTtcclxuICAgICAgICAgICAgaSArPSAyO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgIGZvcm1hdFN0ci5BcHBlbmQobWFzay5jaGFyQXQoaSkpO1xyXG4gICAgICAgICAgICBpKys7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgfVxyXG5cclxuICAgICAgZm9ybWF0U3RyLkFwcGVuZCgnIGEnKTtcclxuICAgICAgcmV0dXJuIHN1cGVyLnRyYW5zZm9ybSh2YWx1ZSwgZm9ybWF0U3RyLlRvU3RyaW5nKCkpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIHZhbHVlO1xyXG4gIH1cclxufVxyXG4iXX0=
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Pipe } from '@angular/core';
|
2
|
+
import { TaskMagicService } from "../../services/task.magics.service";
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "../../services/task.magics.service";
|
5
|
+
export class Time24MagicPipe {
|
6
|
+
constructor(_task) {
|
7
|
+
this._task = _task;
|
8
|
+
}
|
9
|
+
transform(value, controlId) {
|
10
|
+
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
11
|
+
if (typeof value !== "undefined" && mask !== null) {
|
12
|
+
const date = new Date(value);
|
13
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
14
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
15
|
+
const seconds = date.getSeconds().toString().padStart(2, '0');
|
16
|
+
if (mask.length == 5) {
|
17
|
+
return `${hours}:${minutes}`;
|
18
|
+
}
|
19
|
+
else if (mask.length > 5) {
|
20
|
+
return `${hours}:${minutes}:${seconds}`;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return value;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
Time24MagicPipe.ɵfac = function Time24MagicPipe_Factory(t) { return new (t || Time24MagicPipe)(i0.ɵɵdirectiveInject(i1.TaskMagicService, 16)); };
|
27
|
+
Time24MagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true });
|
28
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
|
29
|
+
type: Pipe,
|
30
|
+
args: [{
|
31
|
+
name: 'magicTime24'
|
32
|
+
}]
|
33
|
+
}], function () { return [{ type: i1.TaskMagicService }]; }, null); })();
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZTI0Lm1hZ2ljLnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91aS9waXBlcy90aW1lMjQubWFnaWMucGlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsSUFBSSxFQUFpQixNQUFNLGVBQWUsQ0FBQztBQUNwRCxPQUFPLEVBQUMsZ0JBQWdCLEVBQUMsTUFBTSxvQ0FBb0MsQ0FBQzs7O0FBS3BFLE1BQU0sT0FBTyxlQUF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