@magic-xpa/angular 4.801.0-dev481.285 → 4.801.0-dev481.290
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 +2 -1
- package/esm2020/src/services/accessor.magic.service.mjs +10 -4
- package/esm2020/src/services/magic-color.service.mjs +59 -0
- package/fesm2015/magic-xpa-angular.mjs +71 -10
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +69 -10
- package/fesm2020/magic-xpa-angular.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +3 -3
- package/src/services/accessor.magic.service.d.ts +4 -1
- package/src/services/magic-color.service.d.ts +14 -0
|
@@ -15,10 +15,10 @@ import { filter, map, debounceTime } from 'rxjs/operators';
|
|
|
15
15
|
import { Subject, fromEvent } from 'rxjs';
|
|
16
16
|
import { __decorate, __metadata } from 'tslib';
|
|
17
17
|
import * as i1$1 from '@angular/platform-browser';
|
|
18
|
-
import * as
|
|
18
|
+
import * as i1$2 from '@angular/common/http';
|
|
19
19
|
import { HttpClientModule } from '@angular/common/http';
|
|
20
20
|
import { NativeDateAdapter, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
21
|
-
import * as i1$
|
|
21
|
+
import * as i1$3 from '@angular/cdk/platform';
|
|
22
22
|
|
|
23
23
|
class ControlMetadata {
|
|
24
24
|
constructor() {
|
|
@@ -2252,9 +2252,65 @@ TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, f
|
|
|
2252
2252
|
type: Injectable
|
|
2253
2253
|
}], function () { return [{ type: i1$1.Title }]; }, null); })();
|
|
2254
2254
|
|
|
2255
|
+
const MAGIC_FG_COLOR = 1;
|
|
2256
|
+
const MAGIC_BG_COLOR = 2;
|
|
2257
|
+
class MagicColorService {
|
|
2258
|
+
constructor(http) {
|
|
2259
|
+
this.http = http;
|
|
2260
|
+
this.colorFilePath = 'assets/clr_rnt.eng';
|
|
2261
|
+
this.http.get(this.colorFilePath, { responseType: 'text' }).subscribe(resp => {
|
|
2262
|
+
this.colorsData = resp.replace(/\n/g, '@').split('@');
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
hexToRgba(hex) {
|
|
2266
|
+
let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
2267
|
+
hex = hex.replace(shorthandRegex, function (m, r, g, b, a) {
|
|
2268
|
+
return a + a + r + r + g + g + b + b;
|
|
2269
|
+
});
|
|
2270
|
+
let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
2271
|
+
let rgb = {
|
|
2272
|
+
'red': parseInt(result[4], 16),
|
|
2273
|
+
'green': parseInt(result[3], 16),
|
|
2274
|
+
'blue': parseInt(result[2], 16),
|
|
2275
|
+
'alpha': (255 - parseInt(result[1], 16)) / 255
|
|
2276
|
+
};
|
|
2277
|
+
return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
|
|
2278
|
+
}
|
|
2279
|
+
getColor(colorIndex, colorType) {
|
|
2280
|
+
if (this.colorsData && this.colorsData[colorIndex]) {
|
|
2281
|
+
let hex = '';
|
|
2282
|
+
const grayHashCode = '00808080';
|
|
2283
|
+
let color = this.colorsData[colorIndex].split(',');
|
|
2284
|
+
if (+color[3] <= 1) {
|
|
2285
|
+
switch (colorType) {
|
|
2286
|
+
case MAGIC_FG_COLOR:
|
|
2287
|
+
hex = ('#' + color[1]);
|
|
2288
|
+
break;
|
|
2289
|
+
case MAGIC_BG_COLOR:
|
|
2290
|
+
hex = ('#' + color[2]);
|
|
2291
|
+
break;
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
else
|
|
2295
|
+
hex = grayHashCode;
|
|
2296
|
+
return this.hexToRgba('#' + hex);
|
|
2297
|
+
}
|
|
2298
|
+
return '';
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
MagicColorService.ɵfac = function MagicColorService_Factory(t) { return new (t || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient)); };
|
|
2302
|
+
MagicColorService.ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
|
2303
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
|
|
2304
|
+
type: Injectable,
|
|
2305
|
+
args: [{
|
|
2306
|
+
providedIn: 'root'
|
|
2307
|
+
}]
|
|
2308
|
+
}], function () { return [{ type: i1$2.HttpClient }]; }, null); })();
|
|
2309
|
+
|
|
2255
2310
|
class AccessorMagicService {
|
|
2256
|
-
constructor(task) {
|
|
2311
|
+
constructor(task, magicColor) {
|
|
2257
2312
|
this.task = task;
|
|
2313
|
+
this.magicColor = magicColor;
|
|
2258
2314
|
this.Logger = null;
|
|
2259
2315
|
this.Logger = Logger.Instance;
|
|
2260
2316
|
}
|
|
@@ -2539,12 +2595,15 @@ class AccessorMagicService {
|
|
|
2539
2595
|
DeleteCookie(name) {
|
|
2540
2596
|
return CookieService.deleteCookie(name);
|
|
2541
2597
|
}
|
|
2598
|
+
getColor(colorNumber, colorType) {
|
|
2599
|
+
return this.magicColor.getColor(colorNumber, colorType);
|
|
2600
|
+
}
|
|
2542
2601
|
}
|
|
2543
|
-
AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(i0.ɵɵinject(TaskMagicService)); };
|
|
2602
|
+
AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MagicColorService)); };
|
|
2544
2603
|
AccessorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
|
2545
2604
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessorMagicService, [{
|
|
2546
2605
|
type: Injectable
|
|
2547
|
-
}], function () { return [{ type: TaskMagicService }]; }, null); })();
|
|
2606
|
+
}], function () { return [{ type: TaskMagicService }, { type: MagicColorService }]; }, null); })();
|
|
2548
2607
|
|
|
2549
2608
|
class MagicServices {
|
|
2550
2609
|
constructor(task, subformService, tableService, titleService, mgAccessorService) {
|
|
@@ -3811,7 +3870,7 @@ class MagicShellComponent {
|
|
|
3811
3870
|
}
|
|
3812
3871
|
}
|
|
3813
3872
|
}
|
|
3814
|
-
MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(
|
|
3873
|
+
MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i1$2.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
|
|
3815
3874
|
MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
|
3816
3875
|
i0.ɵɵviewQuery(_c0, 7);
|
|
3817
3876
|
} if (rf & 2) {
|
|
@@ -3888,7 +3947,7 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
|
|
|
3888
3947
|
}
|
|
3889
3948
|
`]
|
|
3890
3949
|
}]
|
|
3891
|
-
}], function () { return [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type:
|
|
3950
|
+
}], function () { return [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type: i1$2.HttpClient }, { type: CommandsCollectorMagicService }, { type: ExitMagicService, decorators: [{
|
|
3892
3951
|
type: Optional
|
|
3893
3952
|
}] }]; }, { rootMagicElementRef: [{
|
|
3894
3953
|
type: ViewChild,
|
|
@@ -4307,11 +4366,11 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
4307
4366
|
}
|
|
4308
4367
|
}
|
|
4309
4368
|
}
|
|
4310
|
-
MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$
|
|
4369
|
+
MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService)); };
|
|
4311
4370
|
MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
|
4312
4371
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
|
|
4313
4372
|
type: Injectable
|
|
4314
|
-
}], function () { return [{ type: i1$
|
|
4373
|
+
}], function () { return [{ type: i1$3.Platform }, { type: TaskMagicService }]; }, null); })();
|
|
4315
4374
|
|
|
4316
4375
|
const matDateProviders = [
|
|
4317
4376
|
{ provide: DateAdapter, useClass: MgDateAdapter },
|
|
@@ -4400,5 +4459,5 @@ class ModalFormDefinition {
|
|
|
4400
4459
|
}
|
|
4401
4460
|
}
|
|
4402
4461
|
|
|
4403
|
-
export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_DEFAULT_VALUE_ACCESSOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
|
|
4462
|
+
export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
|
|
4404
4463
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|