@acorex/core 5.6.0 → 5.7.0

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.
@@ -1,8 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe, NgModule, Injectable, Inject } from '@angular/core';
3
3
  import tinycolor from 'tinycolor2';
4
+ import tinygradient from 'tinygradient';
4
5
  import * as i1 from '@angular/platform-browser';
5
- import _ from 'lodash';
6
+ import * as _ from 'lodash';
6
7
  import { Subject, fromEvent } from 'rxjs';
7
8
  import { DOCUMENT } from '@angular/common';
8
9
  import { Observable } from 'rxjs/internal/Observable';
@@ -95,14 +96,11 @@ class AXStringUtil {
95
96
  }
96
97
 
97
98
  class AXColorUtil {
98
- static testa(color) {
99
- var _color = tinycolor(color);
100
- console.log(_color);
101
- }
102
99
  static to(color, mode) {
103
100
  const _color = tinycolor(color);
104
101
  switch (mode) {
105
102
  case 'rgba':
103
+ ;
106
104
  return _color.toRgb();
107
105
  case 'hsla':
108
106
  return _color.toHsl();
@@ -128,13 +126,15 @@ class AXColorUtil {
128
126
  }
129
127
  ;
130
128
  static mix(baseColor, hex, percentage) {
131
- return tinycolor.mix(baseColor, hex, percentage);
129
+ return tinycolor.mix(baseColor, hex, percentage).toString('rgb');
132
130
  }
133
- static multiply(rgb1, rgb2) {
131
+ static multiply(color1, color2) {
132
+ let rgb1 = tinycolor(color1).toRgb();
133
+ let rgb2 = tinycolor(color2).toRgb();
134
134
  rgb1.b = Math.floor(rgb1.b * rgb2.b / 255);
135
135
  rgb1.g = Math.floor(rgb1.g * rgb2.g / 255);
136
136
  rgb1.r = Math.floor(rgb1.r * rgb2.r / 255);
137
- return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b);
137
+ return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');
138
138
  }
139
139
  static toHexSting(color) {
140
140
  const _color = tinycolor(color);
@@ -146,24 +146,7 @@ class AXColorUtil {
146
146
  return _color.toRgbString();
147
147
  }
148
148
  ;
149
- static illuminance(hexColor) {
150
- let rgbColor = AXColorUtil.toRGBString(hexColor);
151
- if (!rgbColor)
152
- return -1;
153
- let r = rgbColor.r, g = rgbColor.g, b = rgbColor.b;
154
- let a = [r, g, b].map(v => {
155
- v /= 255;
156
- return (v <= 0.03928) ?
157
- v / 12.92 :
158
- Math.pow(((v + 0.055) / 1.055), 2.4);
159
- });
160
- return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
161
- }
162
- ;
163
149
  static contrastToWhite(color) {
164
- // let whiteIlluminance = 1;
165
- // let illuminance = AXColorUtil.illuminance(hexColor);
166
- // return whiteIlluminance / illuminance;
167
150
  return tinycolor.readability("#fff", color);
168
151
  }
169
152
  ;
@@ -173,6 +156,12 @@ class AXColorUtil {
173
156
  static darken(hex, percentage) {
174
157
  return tinycolor(hex).darken(percentage);
175
158
  }
159
+ static equal(color1, color2) {
160
+ return tinycolor.equals(color1, color2);
161
+ }
162
+ static gradient(values) {
163
+ return tinygradient([...values]);
164
+ }
176
165
  }
177
166
 
178
167
  class AXSafePipe {
@@ -192,9 +181,9 @@ class AXSafePipe {
192
181
  }
193
182
  }
194
183
  }
195
- AXSafePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSafePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
196
- AXSafePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSafePipe, name: "safe" });
197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSafePipe, decorators: [{
184
+ AXSafePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXSafePipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
185
+ AXSafePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.0", ngImport: i0, type: AXSafePipe, name: "safe" });
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXSafePipe, decorators: [{
198
187
  type: Pipe,
199
188
  args: [{
200
189
  name: 'safe',
@@ -204,10 +193,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
204
193
 
205
194
  class AXCoreModule {
206
195
  }
207
- AXCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
208
- AXCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXCoreModule, declarations: [AXSafePipe], exports: [AXSafePipe] });
209
- AXCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXCoreModule, providers: [], imports: [[]] });
210
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXCoreModule, decorators: [{
196
+ AXCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
197
+ AXCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0", ngImport: i0, type: AXCoreModule, declarations: [AXSafePipe], exports: [AXSafePipe] });
198
+ AXCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXCoreModule, providers: [] });
199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXCoreModule, decorators: [{
211
200
  type: NgModule,
212
201
  args: [{
213
202
  imports: [],
@@ -552,9 +541,9 @@ class AXDateTimePipe {
552
541
  }
553
542
  }
554
543
  }
555
- AXDateTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
556
- AXDateTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimePipe, name: "axDate" });
557
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimePipe, decorators: [{
544
+ AXDateTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
545
+ AXDateTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimePipe, name: "axDate" });
546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimePipe, decorators: [{
558
547
  type: Pipe,
559
548
  args: [{ name: 'axDate' }]
560
549
  }], ctorParameters: function () { return []; } });
@@ -1119,10 +1108,10 @@ class AXDateTimeModule {
1119
1108
  });
1120
1109
  }
1121
1110
  }
1122
- AXDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1123
- AXDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimeModule, declarations: [AXDateTimePipe], exports: [AXDateTimePipe] });
1124
- AXDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimeModule, providers: [], imports: [[]] });
1125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXDateTimeModule, decorators: [{
1111
+ AXDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1112
+ AXDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimeModule, declarations: [AXDateTimePipe], exports: [AXDateTimePipe] });
1113
+ AXDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimeModule, providers: [] });
1114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXDateTimeModule, decorators: [{
1126
1115
  type: NgModule,
1127
1116
  args: [{
1128
1117
  imports: [],
@@ -1159,9 +1148,9 @@ class AXEventService {
1159
1148
  }
1160
1149
  }
1161
1150
  }
1162
- AXEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1163
- AXEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXEventService, providedIn: 'root' });
1164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXEventService, decorators: [{
1151
+ AXEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1152
+ AXEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXEventService, providedIn: 'root' });
1153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXEventService, decorators: [{
1165
1154
  type: Injectable,
1166
1155
  args: [{ providedIn: 'root' }]
1167
1156
  }] });
@@ -1189,10 +1178,11 @@ class AXHotkeysService {
1189
1178
  });
1190
1179
  }
1191
1180
  }
1192
- AXHotkeysService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXHotkeysService, deps: [{ token: i1.EventManager }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1193
- AXHotkeysService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXHotkeysService });
1194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXHotkeysService, decorators: [{
1195
- type: Injectable
1181
+ AXHotkeysService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXHotkeysService, deps: [{ token: i1.EventManager }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1182
+ AXHotkeysService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXHotkeysService, providedIn: 'root' });
1183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXHotkeysService, decorators: [{
1184
+ type: Injectable,
1185
+ args: [{ providedIn: 'root' }]
1196
1186
  }], ctorParameters: function () {
1197
1187
  return [{ type: i1.EventManager }, { type: Document, decorators: [{
1198
1188
  type: Inject,
@@ -1246,19 +1236,19 @@ class AXTranslatorPipe {
1246
1236
  return AXTranslator.get(value, arg1, arg2);
1247
1237
  }
1248
1238
  }
1249
- AXTranslatorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1250
- AXTranslatorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslatorPipe, name: "trans" });
1251
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslatorPipe, decorators: [{
1239
+ AXTranslatorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXTranslatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1240
+ AXTranslatorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.0", ngImport: i0, type: AXTranslatorPipe, name: "trans" });
1241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXTranslatorPipe, decorators: [{
1252
1242
  type: Pipe,
1253
1243
  args: [{ name: 'trans', pure: true }]
1254
1244
  }] });
1255
1245
 
1256
1246
  class AXTranslationModule {
1257
1247
  }
1258
- AXTranslationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1259
- AXTranslationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] });
1260
- AXTranslationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslationModule, providers: [], imports: [[]] });
1261
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXTranslationModule, decorators: [{
1248
+ AXTranslationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXTranslationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1249
+ AXTranslationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] });
1250
+ AXTranslationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXTranslationModule, providers: [] });
1251
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXTranslationModule, decorators: [{
1262
1252
  type: NgModule,
1263
1253
  args: [{
1264
1254
  imports: [],
@@ -1393,9 +1383,9 @@ class AXPlatform {
1393
1383
  document.querySelector(':root').style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
1394
1384
  }
1395
1385
  }
1396
- AXPlatform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXPlatform, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1397
- AXPlatform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXPlatform, providedIn: 'platform' });
1398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXPlatform, decorators: [{
1386
+ AXPlatform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXPlatform, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1387
+ AXPlatform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXPlatform, providedIn: 'platform' });
1388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: AXPlatform, decorators: [{
1399
1389
  type: Injectable,
1400
1390
  args: [{
1401
1391
  providedIn: 'platform',