@acorex/core 5.1.1 → 5.1.5
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/README.md +2 -23
- package/esm2020/lib/classes/base-page.class.mjs +28 -0
- package/esm2020/lib/classes/color.class.mjs +49 -0
- package/esm2020/lib/classes/datetime.class.mjs +314 -0
- package/esm2020/lib/classes/menu.class.mjs +27 -0
- package/esm2020/lib/classes/navigator.class.mjs +2 -0
- package/esm2020/lib/classes/popup.class.mjs +2 -0
- package/esm2020/lib/classes/promise.class.mjs +19 -0
- package/esm2020/lib/classes/sectionlist.class.mjs +2 -0
- package/esm2020/lib/classes/select.class.mjs +3 -0
- package/esm2020/lib/core.module.mjs +20 -11
- package/esm2020/lib/error/error.class.mjs +2 -0
- package/esm2020/lib/error/error.module.mjs +19 -0
- package/esm2020/lib/error/error.service.mjs +21 -0
- package/esm2020/lib/events/keyboard.mjs +2 -0
- package/esm2020/lib/http/http-error.class.mjs +2 -0
- package/esm2020/lib/http/http-events.interceptor.mjs +3 -0
- package/esm2020/lib/http/http-request.class.mjs +2 -0
- package/esm2020/lib/http/http-result.class.mjs +21 -0
- package/esm2020/lib/http/http.module.mjs +37 -0
- package/esm2020/lib/http/http.service.mjs +145 -0
- package/esm2020/lib/locale/en.json +255 -0
- package/esm2020/lib/locale/fa.json +244 -0
- package/esm2020/lib/pipe/datetime.pipe.mjs +25 -0
- package/esm2020/lib/pipe/htmlToText.pipe.mjs +25 -0
- package/esm2020/lib/platform/platform.service.mjs +10 -6
- package/esm2020/lib/services/config.mjs +29 -0
- package/esm2020/lib/services/event.service.mjs +36 -0
- package/esm2020/lib/services/navigator.service.mjs +10 -0
- package/esm2020/lib/services/storage.service.mjs +16 -0
- package/esm2020/lib/translator/translator.mjs +26 -0
- package/esm2020/lib/translator/translator.module.mjs +25 -0
- package/esm2020/lib/translator/translator.pipe.mjs +24 -0
- package/esm2020/lib/translator/translator.service.mjs +21 -0
- package/esm2020/lib/utils/array/array-util.mjs +133 -0
- package/esm2020/lib/utils/html/html-util.mjs +192 -0
- package/esm2020/lib/utils/html/html.module.mjs +19 -0
- package/esm2020/lib/utils/math/math-util.mjs +6 -0
- package/esm2020/lib/utils/object/object-util.mjs +83 -0
- package/esm2020/lib/utils/render/on-demand-preload-strategy.service.mjs +20 -0
- package/esm2020/lib/utils/render/render.service.mjs +103 -0
- package/esm2020/lib/utils/render/rendering.module.mjs +35 -0
- package/esm2020/lib/utils/scroll/scroll.directive.mjs +54 -0
- package/esm2020/lib/utils/scroll/scroll.module.mjs +19 -0
- package/esm2020/lib/utils/separator/separator.module.mjs +19 -0
- package/esm2020/lib/utils/separator/separator.pipe.mjs +33 -0
- package/esm2020/public-api.mjs +43 -12
- package/fesm2015/acorex-core.mjs +1939 -1006
- package/fesm2015/acorex-core.mjs.map +1 -1
- package/fesm2020/acorex-core.mjs +1939 -1007
- package/fesm2020/acorex-core.mjs.map +1 -1
- package/lib/classes/base-page.class.d.ts +13 -0
- package/lib/classes/color.class.d.ts +17 -0
- package/lib/classes/datetime.class.d.ts +63 -0
- package/lib/classes/menu.class.d.ts +34 -0
- package/lib/classes/navigator.class.d.ts +5 -0
- package/lib/classes/popup.class.d.ts +12 -0
- package/lib/classes/promise.class.d.ts +7 -0
- package/lib/classes/sectionlist.class.d.ts +8 -0
- package/lib/classes/select.class.d.ts +7 -0
- package/lib/core.module.d.ts +4 -2
- package/lib/error/error.class.d.ts +4 -0
- package/lib/error/error.module.d.ts +7 -0
- package/lib/error/error.service.d.ts +13 -0
- package/lib/events/keyboard.d.ts +2 -0
- package/lib/http/http-error.class.d.ts +7 -0
- package/lib/http/http-events.interceptor.d.ts +10 -0
- package/lib/http/http-request.class.d.ts +14 -0
- package/lib/http/http-result.class.d.ts +11 -0
- package/lib/http/http.module.d.ts +10 -0
- package/lib/http/http.service.d.ts +23 -0
- package/lib/{dateTime → pipe}/datetime.pipe.d.ts +2 -2
- package/lib/pipe/htmlToText.pipe.d.ts +7 -0
- package/lib/{config/configs.d.ts → services/config.d.ts} +1 -1
- package/lib/{events → services}/event.service.d.ts +0 -0
- package/lib/services/navigator.service.d.ts +8 -0
- package/lib/services/storage.service.d.ts +7 -0
- package/lib/{translation → translator}/translator.d.ts +1 -3
- package/lib/translator/translator.module.d.ts +8 -0
- package/lib/{translation → translator}/translator.pipe.d.ts +1 -0
- package/lib/translator/translator.service.d.ts +8 -0
- package/lib/utils/array/array-util.d.ts +6 -0
- package/lib/utils/html/html-util.d.ts +62 -0
- package/lib/utils/html/html.module.d.ts +8 -0
- package/lib/utils/math/math-util.d.ts +3 -0
- package/lib/utils/object/object-util.d.ts +7 -0
- package/lib/utils/render/on-demand-preload-strategy.service.d.ts +10 -0
- package/lib/utils/render/render.service.d.ts +18 -0
- package/lib/utils/render/rendering.module.d.ts +8 -0
- package/lib/utils/scroll/scroll.directive.d.ts +18 -0
- package/lib/utils/scroll/scroll.module.d.ts +8 -0
- package/lib/utils/separator/separator.module.d.ts +8 -0
- package/lib/utils/separator/separator.pipe.d.ts +8 -0
- package/package.json +6 -11
- package/public-api.d.ts +42 -11
- package/config/ax-preset.js +0 -182
- package/esm2020/lib/config/configs.mjs +0 -29
- package/esm2020/lib/dateTime/datetime.class.mjs +0 -295
- package/esm2020/lib/dateTime/datetime.module.mjs +0 -33
- package/esm2020/lib/dateTime/datetime.pipe.mjs +0 -26
- package/esm2020/lib/dateTime/georgian.calendar.mjs +0 -189
- package/esm2020/lib/dateTime/index.mjs +0 -6
- package/esm2020/lib/dateTime/jalali.calendar.mjs +0 -359
- package/esm2020/lib/events/event.service.mjs +0 -36
- package/esm2020/lib/events/index.mjs +0 -2
- package/esm2020/lib/hotkeys/hotkeys.service.mjs +0 -37
- package/esm2020/lib/hotkeys/index.mjs +0 -2
- package/esm2020/lib/translation/index.mjs +0 -4
- package/esm2020/lib/translation/translation.module.mjs +0 -18
- package/esm2020/lib/translation/translator.mjs +0 -42
- package/esm2020/lib/translation/translator.pipe.mjs +0 -15
- package/esm2020/lib/utils/drawing-util.mjs +0 -27
- package/esm2020/lib/utils/index.mjs +0 -5
- package/esm2020/lib/utils/object-util.mjs +0 -39
- package/esm2020/lib/utils/safe.pipe.mjs +0 -30
- package/esm2020/lib/utils/string-util.mjs +0 -19
- package/lib/dateTime/datetime.class.d.ts +0 -100
- package/lib/dateTime/datetime.module.d.ts +0 -8
- package/lib/dateTime/georgian.calendar.d.ts +0 -20
- package/lib/dateTime/index.d.ts +0 -5
- package/lib/dateTime/jalali.calendar.d.ts +0 -35
- package/lib/events/index.d.ts +0 -1
- package/lib/hotkeys/hotkeys.service.d.ts +0 -17
- package/lib/hotkeys/index.d.ts +0 -1
- package/lib/translation/index.d.ts +0 -3
- package/lib/translation/translation.module.d.ts +0 -7
- package/lib/utils/drawing-util.d.ts +0 -17
- package/lib/utils/index.d.ts +0 -4
- package/lib/utils/object-util.d.ts +0 -4
- package/lib/utils/safe.pipe.d.ts +0 -10
- package/lib/utils/string-util.d.ts +0 -6
package/fesm2020/acorex-core.mjs
CHANGED
|
@@ -1,11 +1,62 @@
|
|
|
1
|
+
import moment from 'jalali-moment';
|
|
2
|
+
import { Subject, fromEvent } from 'rxjs';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Observable } from 'rxjs/internal/Observable';
|
|
4
|
+
import { EventEmitter, Injectable, InjectionToken, NgModule, Pipe, Directive, Input, HostListener } from '@angular/core';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import * as i1 from '@angular/common/http';
|
|
7
|
+
import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
8
|
+
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
8
9
|
import merge from 'lodash-es/merge';
|
|
10
|
+
import * as i1$1 from '@angular/router';
|
|
11
|
+
|
|
12
|
+
class AXColorUtil {
|
|
13
|
+
static hex2Rgb(hexColor) {
|
|
14
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hexColor);
|
|
15
|
+
return result ? {
|
|
16
|
+
r: parseInt(result[1], 16),
|
|
17
|
+
g: parseInt(result[2], 16),
|
|
18
|
+
b: parseInt(result[3], 16)
|
|
19
|
+
} : null;
|
|
20
|
+
}
|
|
21
|
+
static rgb2Hex(r, g, b, a = 255) {
|
|
22
|
+
let alpha;
|
|
23
|
+
let hex = (r | 1 << 8).toString(16).slice(1) +
|
|
24
|
+
(g | 1 << 8).toString(16).slice(1) +
|
|
25
|
+
(b | 1 << 8).toString(16).slice(1);
|
|
26
|
+
if (a !== 255) {
|
|
27
|
+
alpha = a;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
alpha = 1;
|
|
31
|
+
}
|
|
32
|
+
alpha = Math.round(alpha * 100) / 100;
|
|
33
|
+
alpha = Math.round(alpha * 255);
|
|
34
|
+
const hexAlpha = (alpha + 0x10000).toString(16).substr(-2).toUpperCase();
|
|
35
|
+
return '#' + hex + (alpha == 255 ? '' : hexAlpha);
|
|
36
|
+
}
|
|
37
|
+
;
|
|
38
|
+
static illuminance(hexColor) {
|
|
39
|
+
const rgbColor = AXColorUtil.hex2Rgb(hexColor);
|
|
40
|
+
if (!rgbColor) {
|
|
41
|
+
return -1;
|
|
42
|
+
}
|
|
43
|
+
const r = rgbColor.r;
|
|
44
|
+
const g = rgbColor.g;
|
|
45
|
+
const b = rgbColor.b;
|
|
46
|
+
const a = [r, g, b].map(v => {
|
|
47
|
+
v /= 255;
|
|
48
|
+
return (v <= 0.03928) ?
|
|
49
|
+
v / 12.92 :
|
|
50
|
+
Math.pow(((v + 0.055) / 1.055), 2.4);
|
|
51
|
+
});
|
|
52
|
+
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
|
|
53
|
+
}
|
|
54
|
+
static contrastToWhite(hexColor) {
|
|
55
|
+
const whiteIlluminance = 1;
|
|
56
|
+
const illuminance = AXColorUtil.illuminance(hexColor);
|
|
57
|
+
return whiteIlluminance / illuminance;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
9
60
|
|
|
10
61
|
// @dynamic
|
|
11
62
|
class AXObjectUtil {
|
|
@@ -44,95 +95,51 @@ class AXObjectUtil {
|
|
|
44
95
|
}
|
|
45
96
|
throw new Error('Unable to copy obj! Its type isn\'t supported.');
|
|
46
97
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
static collision(a, b) {
|
|
52
|
-
const ac = a.getBoundingClientRect();
|
|
53
|
-
const bc = b.getBoundingClientRect();
|
|
54
|
-
if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left &&
|
|
55
|
-
ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
static isInElementBound(pos, element) {
|
|
63
|
-
const elBound = element.getBoundingClientRect();
|
|
64
|
-
return AXDrawingUtil.isInRecPoint(pos, {
|
|
65
|
-
left: elBound.x,
|
|
66
|
-
width: elBound.width,
|
|
67
|
-
top: elBound.y,
|
|
68
|
-
height: elBound.height
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
static isInRecPoint(pos, rec) {
|
|
72
|
-
return pos.x >= rec.left && pos.x <= (rec.left + rec.width) && pos.y >= rec.top && (pos.y <= (rec.top + rec.height));
|
|
98
|
+
}
|
|
99
|
+
function AXFetchProp(obj, prop) {
|
|
100
|
+
if (typeof obj === 'undefined') {
|
|
101
|
+
return false;
|
|
73
102
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class AXStringUtil {
|
|
78
|
-
static getWordBoundsAtPosition(str, position) {
|
|
79
|
-
const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);
|
|
80
|
-
let start = position - 1;
|
|
81
|
-
while (start >= 0 && !isSpace(str[start])) {
|
|
82
|
-
start -= 1;
|
|
83
|
-
}
|
|
84
|
-
start = Math.max(0, start + 1);
|
|
85
|
-
const leftSideString = str.slice(start).match(/[a-zA-Z0-9]+/i);
|
|
86
|
-
start += leftSideString.index;
|
|
87
|
-
let end = start + leftSideString[0].length;
|
|
88
|
-
return {
|
|
89
|
-
start,
|
|
90
|
-
end
|
|
91
|
-
};
|
|
103
|
+
const index = prop.indexOf('.');
|
|
104
|
+
if (index > -1) {
|
|
105
|
+
return AXFetchProp(obj[prop.substring(0, index)], prop.substr(index + 1));
|
|
92
106
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
case 'html': return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
104
|
-
case 'style': return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
105
|
-
case 'script': return this.sanitizer.bypassSecurityTrustScript(value);
|
|
106
|
-
case 'url': return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
107
|
-
case 'resourceUrl': return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
108
|
-
default: throw new Error(`Invalid safe type specified: ${type}`);
|
|
107
|
+
return obj[prop];
|
|
108
|
+
}
|
|
109
|
+
function getPropByPath(obj, path, defaultVal) {
|
|
110
|
+
path = path
|
|
111
|
+
.replace(/\[/g, '.')
|
|
112
|
+
.replace(/]/g, '')
|
|
113
|
+
.split('.');
|
|
114
|
+
path.forEach((level) => {
|
|
115
|
+
if (obj) {
|
|
116
|
+
obj = obj[level];
|
|
109
117
|
}
|
|
118
|
+
});
|
|
119
|
+
if (obj === undefined) {
|
|
120
|
+
return defaultVal;
|
|
110
121
|
}
|
|
122
|
+
return obj;
|
|
111
123
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
exports: [AXSafePipe],
|
|
132
|
-
declarations: [AXSafePipe],
|
|
133
|
-
providers: [],
|
|
134
|
-
}]
|
|
135
|
-
}] });
|
|
124
|
+
function setPropByPath(obj, path, value) {
|
|
125
|
+
if (Object(obj) !== obj) {
|
|
126
|
+
return obj;
|
|
127
|
+
} // When obj is not an object
|
|
128
|
+
// If not yet an array, get the keys from the string-path
|
|
129
|
+
if (!Array.isArray(path)) {
|
|
130
|
+
path = path.toString().match(/[^.[\]]+/g) || [];
|
|
131
|
+
}
|
|
132
|
+
path.slice(0, -1).reduce((a, c, i) => // Iterate all of them except the last one
|
|
133
|
+
Object(a[c]) === a[c] // Does the key exist and is its value an object?
|
|
134
|
+
// Yes: then follow that path
|
|
135
|
+
? a[c]
|
|
136
|
+
// No: create the key. Is the next key a potential array-index?
|
|
137
|
+
: a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1]
|
|
138
|
+
? [] // Yes: assign a new array object
|
|
139
|
+
: {}, // No: assign a new plain object
|
|
140
|
+
obj)[path[path.length - 1]] = value; // Finally assign the value to the last key
|
|
141
|
+
return obj[path[0]]; // Return the top-level object to allow chaining
|
|
142
|
+
}
|
|
136
143
|
|
|
137
144
|
// @dynamic
|
|
138
145
|
class AXConfig {
|
|
@@ -141,12 +148,12 @@ class AXConfig {
|
|
|
141
148
|
}
|
|
142
149
|
static set(arg1, arg2) {
|
|
143
150
|
if (arg1 && typeof arg1 == 'string') {
|
|
144
|
-
|
|
151
|
+
setPropByPath(AXConfig.dataModel, arg1, arg2);
|
|
145
152
|
AXConfig.dataChangeSubject.next(AXConfig.dataModel);
|
|
146
153
|
return;
|
|
147
154
|
}
|
|
148
155
|
if (arg1 && typeof arg1 == 'object') {
|
|
149
|
-
|
|
156
|
+
Object.assign(AXConfig.dataModel, arg1);
|
|
150
157
|
AXConfig.dataChangeSubject.next(AXConfig.dataModel);
|
|
151
158
|
return;
|
|
152
159
|
}
|
|
@@ -154,213 +161,285 @@ class AXConfig {
|
|
|
154
161
|
return AXConfig.dataChangeSubject.asObservable();
|
|
155
162
|
}
|
|
156
163
|
}
|
|
157
|
-
static get(path
|
|
158
|
-
return
|
|
164
|
+
static get(path) {
|
|
165
|
+
return getPropByPath(AXConfig.dataModel, path);
|
|
159
166
|
}
|
|
160
167
|
}
|
|
161
168
|
AXConfig.dataModel = {};
|
|
162
169
|
AXConfig.dataChangeSubject = new Subject();
|
|
163
170
|
|
|
164
|
-
// @dynamic
|
|
165
171
|
class AXDateTime {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
m: () => this.date.getMinutes().toString(),
|
|
176
|
-
//
|
|
177
|
-
MMMM: () => this.calendar.monthNames[this.calendar.monthOfYear(this.date) - 1],
|
|
178
|
-
MMM: () => this.calendar.monthShortNames[this.calendar.monthOfYear(this.date) - 1],
|
|
179
|
-
MM: () => this.pad(this.calendar.monthOfYear(this.date), 2),
|
|
180
|
-
//
|
|
181
|
-
DDDD: () => this.calendar.dayNames[this.calendar.dayOfWeek(this.date) - 1],
|
|
182
|
-
DDD: () => this.calendar.dayShortNames[this.calendar.dayOfWeek(this.date) - 1],
|
|
183
|
-
//
|
|
184
|
-
yyyy: () => this.calendar.year(this.date).toString(),
|
|
185
|
-
YYYY: () => this.calendar.year(this.date).toString(),
|
|
186
|
-
yy: () => this.calendar.year(this.date).toString().substring(2),
|
|
187
|
-
YY: () => this.calendar.year(this.date).toString().substring(2),
|
|
188
|
-
//
|
|
189
|
-
HH: () => this.pad(this.date.getHours(), 2),
|
|
190
|
-
H: () => this.date.getHours().toString(),
|
|
191
|
-
//
|
|
192
|
-
hh: () => this.pad((this.date.getHours() % 12 || 12), 2),
|
|
193
|
-
h: () => (this.date.getHours() % 12 || 12).toString(),
|
|
194
|
-
//
|
|
195
|
-
A: () => (this.date.getHours() < 12) ? 'am' : 'pm',
|
|
196
|
-
a: () => (this.date.getHours() < 12) ? 'am' : 'pm',
|
|
197
|
-
};
|
|
198
|
-
this._calendar = AXDateTime.resolveCalendar(calendar);
|
|
172
|
+
// private get _moment(): moment_.Moment {
|
|
173
|
+
// const m = moment(this.date);
|
|
174
|
+
// if (this.type === 'jalali') {
|
|
175
|
+
// m.locale('fa');
|
|
176
|
+
// }
|
|
177
|
+
// return m;
|
|
178
|
+
// }
|
|
179
|
+
constructor(value = new Date(), type = AXConfig.get('dateTime.type') || 'gregorian') {
|
|
180
|
+
this.type = type;
|
|
199
181
|
if (value instanceof Date) {
|
|
200
182
|
this._date = value;
|
|
201
183
|
}
|
|
202
184
|
else {
|
|
203
|
-
//TODO: parse jalali
|
|
204
185
|
this._date = new Date(value);
|
|
205
186
|
}
|
|
187
|
+
this._moment = moment(this.date);
|
|
188
|
+
if (this.type === 'jalali') {
|
|
189
|
+
this._moment.locale('fa');
|
|
190
|
+
}
|
|
206
191
|
}
|
|
207
|
-
static convert(value,
|
|
192
|
+
static convert(value, type = AXConfig.get('dateTime.type') || 'gregorian') {
|
|
208
193
|
let date;
|
|
209
194
|
if (typeof value === 'string' || value instanceof String) {
|
|
210
|
-
date = new AXDateTime(value,
|
|
195
|
+
date = new AXDateTime(value, type);
|
|
211
196
|
}
|
|
212
197
|
else if (value instanceof Date) {
|
|
213
|
-
date = new AXDateTime(value,
|
|
198
|
+
date = new AXDateTime(value, type);
|
|
214
199
|
}
|
|
215
200
|
else if (value instanceof AXDateTime) {
|
|
216
|
-
date =
|
|
201
|
+
date = value;
|
|
217
202
|
}
|
|
218
203
|
return date;
|
|
219
204
|
}
|
|
220
|
-
static from(value = {
|
|
221
|
-
calendar: AXConfig.get('dateTime.calendar'),
|
|
222
|
-
year: 1,
|
|
223
|
-
month: 1,
|
|
224
|
-
date: 1,
|
|
225
|
-
hours: 0,
|
|
226
|
-
minutes: 0,
|
|
227
|
-
seconds: 0,
|
|
228
|
-
ms: 0
|
|
229
|
-
}) {
|
|
230
|
-
// let date: AXDateTime = new AXDateTime(new Date(), value.calendar);
|
|
231
|
-
// date.set('year', value.year);
|
|
232
|
-
// date.set('month', value.month);
|
|
233
|
-
// date.set('day', value.date);
|
|
234
|
-
// date.set('hour', value.hours);
|
|
235
|
-
// date.set('minute', value.minutes);
|
|
236
|
-
// date.set('second', value.seconds);
|
|
237
|
-
// date.set('ms', value.ms);
|
|
238
|
-
return AXDateTime.resolveCalendar(value.calendar).create(value);
|
|
239
|
-
}
|
|
240
|
-
static resolveCalendar(calendar) {
|
|
241
|
-
return typeof calendar == 'string'
|
|
242
|
-
? AXConfig.get(`dateTime.calendars.${calendar}`)
|
|
243
|
-
: calendar;
|
|
244
|
-
}
|
|
245
205
|
get date() {
|
|
246
206
|
return this._date;
|
|
247
207
|
}
|
|
248
|
-
|
|
249
|
-
return this.
|
|
208
|
+
resolveUnit(unit) {
|
|
209
|
+
return this.type === 'jalali' ? 'j' + unit : unit;
|
|
250
210
|
}
|
|
251
211
|
clone() {
|
|
252
|
-
return new AXDateTime(this.date, this.
|
|
212
|
+
return new AXDateTime(this.date, this.type);
|
|
253
213
|
}
|
|
254
|
-
get
|
|
255
|
-
return this.
|
|
214
|
+
get dayInMonth() {
|
|
215
|
+
return this._moment.date();
|
|
256
216
|
}
|
|
257
217
|
get dayOfYear() {
|
|
258
|
-
return this.
|
|
218
|
+
return this._moment.dayOfYear();
|
|
259
219
|
}
|
|
260
|
-
get
|
|
261
|
-
return this.
|
|
220
|
+
get dayInWeek() {
|
|
221
|
+
return this._moment.day();
|
|
262
222
|
}
|
|
263
223
|
get hour() {
|
|
264
|
-
return this.
|
|
224
|
+
return this._moment.hour();
|
|
265
225
|
}
|
|
266
226
|
get minute() {
|
|
267
|
-
return this.
|
|
227
|
+
return this._moment.minute();
|
|
268
228
|
}
|
|
269
229
|
get second() {
|
|
270
|
-
return this.
|
|
230
|
+
return this._moment.second();
|
|
271
231
|
}
|
|
272
232
|
get year() {
|
|
273
|
-
return this.
|
|
233
|
+
return this._moment.year();
|
|
274
234
|
}
|
|
275
235
|
get monthOfYear() {
|
|
276
|
-
return this.
|
|
277
|
-
}
|
|
278
|
-
get weekOfYear() {
|
|
279
|
-
return this._calendar.weekOfYear(this.date);
|
|
236
|
+
return this._moment.month();
|
|
280
237
|
}
|
|
281
238
|
get month() {
|
|
282
239
|
return new AXCalendarMonth(this);
|
|
283
240
|
}
|
|
284
|
-
|
|
285
|
-
|
|
241
|
+
get firstDayOfWeek() {
|
|
242
|
+
const a = moment(this.date);
|
|
243
|
+
if (this.type === 'jalali') {
|
|
244
|
+
this._moment.locale('fa');
|
|
245
|
+
}
|
|
246
|
+
return new AXDateTime(a.startOf('w').toDate(), this.type);
|
|
247
|
+
}
|
|
248
|
+
get endDayOfWeek() {
|
|
249
|
+
const a = moment(this.date);
|
|
250
|
+
if (this.type === 'jalali') {
|
|
251
|
+
this._moment.locale('fa');
|
|
252
|
+
}
|
|
253
|
+
return new AXDateTime(moment(this.date).endOf('w').toDate(), this.type);
|
|
254
|
+
}
|
|
255
|
+
convertStringToJalali(date, format) {
|
|
256
|
+
return moment(date).locale('fa').format('YYYY/M/D');
|
|
257
|
+
}
|
|
258
|
+
convertStringToGregorian(date, format) {
|
|
259
|
+
return new Date(moment.from(date, 'fa', 'YYYY/MM/DD').format('YYYY/MM/DD'));
|
|
260
|
+
}
|
|
261
|
+
add(unit = 'day', amount) {
|
|
262
|
+
return new AXDateTime(moment(this.date).add(amount, this.resolveUnit(unit)).toDate(), this.type);
|
|
263
|
+
}
|
|
264
|
+
addDay(amount) {
|
|
265
|
+
return new AXDateTime(moment(this.date).add(amount, 'd').toDate(), this.type);
|
|
266
|
+
}
|
|
267
|
+
addMonth(amount) {
|
|
268
|
+
return new AXDateTime(moment(this.date).add(amount, 'months').toDate(), this.type);
|
|
269
|
+
}
|
|
270
|
+
addHour(amount) {
|
|
271
|
+
return new AXDateTime(moment(this.date).add(amount, 'hours').toDate(), this.type);
|
|
286
272
|
}
|
|
287
273
|
set(unit = 'day', value) {
|
|
288
|
-
return this.
|
|
274
|
+
return new AXDateTime(this._moment.set(unit, value).toDate(), this.type);
|
|
289
275
|
}
|
|
290
|
-
duration(end, unit = '
|
|
291
|
-
const
|
|
292
|
-
return
|
|
276
|
+
duration(end, unit = 'days') {
|
|
277
|
+
const duration = moment.duration(this._moment.diff(end._moment));
|
|
278
|
+
return Math.round(duration.as(unit));
|
|
293
279
|
}
|
|
294
280
|
startOf(unit = 'day') {
|
|
295
|
-
return this.
|
|
281
|
+
return new AXDateTime(moment(this.date).startOf(this.resolveUnit(unit)).toDate(), this.type);
|
|
296
282
|
}
|
|
297
283
|
endOf(unit = 'day') {
|
|
298
|
-
return this.
|
|
284
|
+
return new AXDateTime(moment(this.date).endOf(this.resolveUnit(unit)).toDate(), this.type);
|
|
299
285
|
}
|
|
300
|
-
format(format = AXConfig.get('dateTime.shortDateFormat')) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
pad(n, width, z = '0') {
|
|
307
|
-
n = n + '';
|
|
308
|
-
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
|
286
|
+
format(format = AXConfig.get('dateTime.shortDateFormat') || (this.type === 'gregorian' ? 'DD-MM-YYYY' : 'YYYY-MM-DD')) {
|
|
287
|
+
if (format === 'P') {
|
|
288
|
+
return this._moment.fromNow();
|
|
289
|
+
}
|
|
290
|
+
return this._moment.format(format);
|
|
309
291
|
}
|
|
310
|
-
toString(
|
|
311
|
-
return this.format(
|
|
292
|
+
toString() {
|
|
293
|
+
return this.format();
|
|
312
294
|
}
|
|
313
295
|
equal(value, unit = 'day') {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
296
|
+
if (!value) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
return this._moment.isSame(moment(value.date), this.resolveUnit(unit));
|
|
300
|
+
}
|
|
301
|
+
convertToJalaliDate(value) {
|
|
302
|
+
const options = {
|
|
303
|
+
numberingSystem: 'latn',
|
|
304
|
+
year: 'numeric',
|
|
305
|
+
month: '2-digit',
|
|
306
|
+
day: '2-digit',
|
|
307
|
+
hour: '2-digit',
|
|
308
|
+
minute: '2-digit',
|
|
309
|
+
second: '2-digit'
|
|
328
310
|
};
|
|
329
|
-
|
|
311
|
+
const jDate = new Date(value).toLocaleDateString('fa-IR', options);
|
|
312
|
+
const item = {};
|
|
313
|
+
item.year = jDate.slice(0, 4);
|
|
314
|
+
item.month = jDate.slice(5, 7);
|
|
315
|
+
item.day = jDate.slice(8, 10);
|
|
316
|
+
item.hour = jDate.slice(13, 15);
|
|
317
|
+
item.minutes = jDate.slice(16, 18);
|
|
318
|
+
item.seconds = jDate.slice(19, 21);
|
|
319
|
+
return item;
|
|
320
|
+
}
|
|
321
|
+
toJalaliString(value) {
|
|
322
|
+
const date = this.convertToJalaliDate(value);
|
|
323
|
+
let str = '';
|
|
324
|
+
str = date.year + '-' + date.month + '-' + date.day + 'T' + date.hour + ':' + date.minutes + ':' + date.seconds;
|
|
325
|
+
return str;
|
|
326
|
+
}
|
|
327
|
+
convertToGregorianDate(value) {
|
|
328
|
+
// TODO: check this fucking type
|
|
329
|
+
const options = {
|
|
330
|
+
numberingSystem: 'latn',
|
|
331
|
+
year: 'numeric',
|
|
332
|
+
month: '2-digit',
|
|
333
|
+
day: '2-digit',
|
|
334
|
+
hour: '2-digit',
|
|
335
|
+
minute: '2-digit',
|
|
336
|
+
second: '2-digit'
|
|
337
|
+
};
|
|
338
|
+
const date = new Date(value).toLocaleString('en-us', options);
|
|
339
|
+
const item = {};
|
|
340
|
+
item.year = date.slice(6, 10);
|
|
341
|
+
item.month = date.slice(0, 2);
|
|
342
|
+
item.day = date.slice(3, 5);
|
|
343
|
+
item.hour = date.slice(12, 14);
|
|
344
|
+
item.minutes = date.slice(15, 17);
|
|
345
|
+
item.seconds = date.slice(18, 20);
|
|
346
|
+
return item;
|
|
347
|
+
}
|
|
348
|
+
toGregorianString(value) {
|
|
349
|
+
const date = this.convertToGregorianDate(value);
|
|
350
|
+
let str = '';
|
|
351
|
+
str = date.year + '-' + date.month + '-' + date.day + 'T' + date.hour + ':' + date.minutes + ':' + date.seconds;
|
|
352
|
+
return str;
|
|
353
|
+
}
|
|
354
|
+
compaireNew(value, unit = 'YMD', type = 'jalali') {
|
|
355
|
+
const range = [0, 0];
|
|
356
|
+
let str1;
|
|
357
|
+
let str2;
|
|
358
|
+
if (type === 'jalali') {
|
|
359
|
+
str1 = this.toJalaliString(this.date);
|
|
360
|
+
str2 = this.toJalaliString(value.date ? value.date : value);
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
str1 = this.toGregorianString(this.date);
|
|
364
|
+
str2 = this.toGregorianString(value.date ? value.date : value);
|
|
365
|
+
}
|
|
330
366
|
switch (unit) {
|
|
331
|
-
case '
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
case '
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
367
|
+
case 'YMDhms':
|
|
368
|
+
range[0] = 0;
|
|
369
|
+
range[1] = 19;
|
|
370
|
+
break;
|
|
371
|
+
case 'YMDhm':
|
|
372
|
+
range[0] = 0;
|
|
373
|
+
range[1] = 16;
|
|
374
|
+
break;
|
|
375
|
+
case 'YMDh':
|
|
376
|
+
range[0] = 0;
|
|
377
|
+
range[1] = 13;
|
|
378
|
+
break;
|
|
379
|
+
case 'YMD':
|
|
380
|
+
range[0] = 0;
|
|
381
|
+
range[1] = 10;
|
|
382
|
+
break;
|
|
383
|
+
case 'YM':
|
|
384
|
+
range[0] = 0;
|
|
385
|
+
range[1] = 7;
|
|
386
|
+
break;
|
|
387
|
+
case 'h':
|
|
388
|
+
range[0] = 11;
|
|
389
|
+
range[1] = 13;
|
|
390
|
+
break;
|
|
391
|
+
case 'm':
|
|
392
|
+
range[0] = 14;
|
|
393
|
+
range[1] = 16;
|
|
394
|
+
break;
|
|
395
|
+
case 's':
|
|
396
|
+
range[0] = 17;
|
|
397
|
+
range[1] = 19;
|
|
398
|
+
break;
|
|
399
|
+
case 'D':
|
|
400
|
+
range[0] = 8;
|
|
401
|
+
range[1] = 10;
|
|
402
|
+
break;
|
|
403
|
+
case 'M':
|
|
404
|
+
range[0] = 5;
|
|
405
|
+
range[1] = 7;
|
|
406
|
+
break;
|
|
407
|
+
case 'Y':
|
|
408
|
+
range[0] = 0;
|
|
409
|
+
range[1] = 4;
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
if (str1.slice(range[0], range[1]) === str2.slice(range[0], range[1])) {
|
|
413
|
+
return 0;
|
|
414
|
+
}
|
|
415
|
+
else if (str1.slice(range[0], range[1]) > str2.slice(range[0], range[1])) {
|
|
416
|
+
return 1;
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
return -1;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
compaire(value, unit = 'day') {
|
|
423
|
+
if (this._moment.isSame(moment(value.date), this.resolveUnit(unit))) {
|
|
424
|
+
return 0;
|
|
425
|
+
}
|
|
426
|
+
else if (this._moment.isAfter(moment(value.date), this.resolveUnit(unit))) {
|
|
427
|
+
return 1;
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
return -1;
|
|
353
431
|
}
|
|
354
432
|
}
|
|
355
|
-
|
|
356
|
-
return
|
|
433
|
+
toISOString() {
|
|
434
|
+
return this._date.toISOString();
|
|
357
435
|
}
|
|
358
436
|
}
|
|
359
437
|
class AXCalendarMonth {
|
|
360
438
|
constructor(date) {
|
|
439
|
+
this._moment = moment(date.date);
|
|
361
440
|
this.index = date.date.getMonth();
|
|
362
|
-
this.name =
|
|
363
|
-
this.range = new AXDateTimeRange(new AXDateTime(
|
|
441
|
+
this.name = this._moment.format('MMMM');
|
|
442
|
+
this.range = new AXDateTimeRange(new AXDateTime(this._moment.startOf('month').toDate(), date.type), new AXDateTime(this._moment.endOf('month').toDate(), date.type));
|
|
364
443
|
}
|
|
365
444
|
get range() {
|
|
366
445
|
return this._range;
|
|
@@ -371,813 +450,336 @@ class AXCalendarMonth {
|
|
|
371
450
|
}
|
|
372
451
|
class AXDateTimeRange {
|
|
373
452
|
constructor(startTime, endTime) {
|
|
374
|
-
this.
|
|
375
|
-
this.
|
|
376
|
-
}
|
|
377
|
-
get startTime() {
|
|
378
|
-
return this._startTime;
|
|
379
|
-
}
|
|
380
|
-
get endTime() {
|
|
381
|
-
return this._endTime;
|
|
382
|
-
}
|
|
383
|
-
duration() {
|
|
384
|
-
const result = {
|
|
385
|
-
miliseconds: 0,
|
|
386
|
-
seconds: 0,
|
|
387
|
-
minutes: 0,
|
|
388
|
-
hours: 0,
|
|
389
|
-
days: 0,
|
|
390
|
-
months: 0,
|
|
391
|
-
years: 0,
|
|
392
|
-
total: {
|
|
393
|
-
miliseconds: 0,
|
|
394
|
-
seconds: 0,
|
|
395
|
-
minutes: 0,
|
|
396
|
-
hours: 0,
|
|
397
|
-
days: 0,
|
|
398
|
-
weeks: 0,
|
|
399
|
-
months: 0,
|
|
400
|
-
years: 0,
|
|
401
|
-
},
|
|
402
|
-
};
|
|
403
|
-
const one_second = 1000;
|
|
404
|
-
const one_min = one_second * 60;
|
|
405
|
-
const one_hour = one_min * 60;
|
|
406
|
-
const one_day = one_hour * 24;
|
|
407
|
-
const one_week = one_day * 7;
|
|
408
|
-
const one_year = 365.25 * one_day;
|
|
409
|
-
const one_month = one_year / 12;
|
|
410
|
-
const startTime = this._startTime.date.getTime();
|
|
411
|
-
const endTime = this._endTime.date.getTime();
|
|
412
|
-
const diff = Math.abs(endTime - startTime);
|
|
413
|
-
//
|
|
414
|
-
result.total.miliseconds = diff;
|
|
415
|
-
result.total.seconds = Number((diff / one_second).toFixed(2));
|
|
416
|
-
result.total.minutes = Number((diff / one_min).toFixed(2));
|
|
417
|
-
result.total.hours = Number((diff / one_hour).toFixed(2));
|
|
418
|
-
result.total.days = Number((diff / one_day).toFixed(2));
|
|
419
|
-
result.total.weeks = Number((diff / one_week).toFixed(2));
|
|
420
|
-
//
|
|
421
|
-
// let months = (this.endTime.year - this.startTime.year) * 12;
|
|
422
|
-
// months += this.endTime.monthOfYear - this.startTime.monthOfYear + 1;
|
|
423
|
-
// if (this.endTime.dayOfYear < this.startTime.dayOfYear) {
|
|
424
|
-
// months--;
|
|
425
|
-
// }
|
|
426
|
-
// result.total.months = Math.abs(months);
|
|
427
|
-
// TODO: review
|
|
428
|
-
result.total.months = Number((diff / one_month).toFixed(2));
|
|
429
|
-
result.total.years = Number((diff / one_year).toFixed(2));
|
|
430
|
-
//
|
|
431
|
-
result.miliseconds = result.total.miliseconds % 1000;
|
|
432
|
-
result.seconds = Number((result.total.seconds % 60).toFixed(0));
|
|
433
|
-
result.minutes = Number((result.total.minutes % 60).toFixed(0));
|
|
434
|
-
result.hours = Number((result.total.hours % 24).toFixed(0));
|
|
435
|
-
// TODO: review
|
|
436
|
-
result.days = Number((result.total.days % 30.4).toFixed(0));
|
|
437
|
-
result.months = Number((result.total.months % 12).toFixed(0));
|
|
438
|
-
result.years = Number(result.total.years.toFixed(0));
|
|
439
|
-
return result;
|
|
453
|
+
this.startTime = startTime;
|
|
454
|
+
this.endTime = endTime;
|
|
440
455
|
}
|
|
441
|
-
|
|
442
|
-
|
|
456
|
+
duration(unit = 'days') {
|
|
457
|
+
const duration = moment.duration(moment(this.startTime.date).diff(moment(this.endTime.date)));
|
|
458
|
+
return duration.as(unit);
|
|
459
|
+
}
|
|
460
|
+
enumurate(unit = 'day', type = AXConfig.get('dateTime.type') || 'jalali') {
|
|
443
461
|
const result = [];
|
|
444
|
-
let
|
|
445
|
-
|
|
446
|
-
result.push(item);
|
|
447
|
-
item = item.add(unit, amount);
|
|
462
|
+
for (let index = 0; this.startTime.add(unit, index).compaireNew(this.endTime, this.getViewCompaire(unit), type) <= 0; index++) {
|
|
463
|
+
result.push(this.startTime.add(unit, index));
|
|
448
464
|
}
|
|
449
465
|
return result;
|
|
450
466
|
}
|
|
451
|
-
includes(value, unit = 'day') {
|
|
452
|
-
|
|
453
|
-
|
|
467
|
+
includes(value, unit = 'day', type = 'jalali') {
|
|
468
|
+
return (value.compaireNew(this.startTime, this.getViewCompaire(unit), type) >= 0 &&
|
|
469
|
+
value.compaireNew(this.endTime, this.getViewCompaire(unit), type) <= 0);
|
|
454
470
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const date = value instanceof AXDateTime ? value.clone() : AXDateTime.convert(value, calendar);
|
|
464
|
-
if (!format) {
|
|
465
|
-
return date.format(AXConfig.get('dateTime.shortDateFormat'));
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
return date.format(format);
|
|
471
|
+
getViewCompaire(view) {
|
|
472
|
+
switch (view) {
|
|
473
|
+
case 'day':
|
|
474
|
+
return 'YMD';
|
|
475
|
+
case 'month':
|
|
476
|
+
return 'YM';
|
|
477
|
+
case 'year':
|
|
478
|
+
return 'Y';
|
|
469
479
|
}
|
|
470
480
|
}
|
|
471
|
-
}
|
|
472
|
-
AXDateTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
473
|
-
AXDateTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimePipe, name: "axDate" });
|
|
474
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimePipe, decorators: [{
|
|
475
|
-
type: Pipe,
|
|
476
|
-
args: [{ name: 'axDate' }]
|
|
477
|
-
}], ctorParameters: function () { return []; } });
|
|
481
|
+
}
|
|
478
482
|
|
|
479
|
-
class
|
|
483
|
+
class AXBaseMenuItem {
|
|
480
484
|
constructor() {
|
|
481
|
-
this.
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
this.monthShortNames = [
|
|
488
|
-
"Jan", "Feb", "Mar",
|
|
489
|
-
"Apr", "May", "Jun", "Jul",
|
|
490
|
-
"Aug", "Sep", "Oct",
|
|
491
|
-
"Nov", "Dec"
|
|
492
|
-
];
|
|
493
|
-
this.dayNames = [
|
|
494
|
-
"Sunday", "Monday", "Tuesday", "Wednesday",
|
|
495
|
-
"Thursday", "Friday", "Saturday"
|
|
496
|
-
];
|
|
497
|
-
this.dayShortNames = [
|
|
498
|
-
"Sun", "Mon", "Tue", "Wed",
|
|
499
|
-
"Thu", "Fri", "Sat"
|
|
500
|
-
];
|
|
501
|
-
}
|
|
502
|
-
create(value) {
|
|
503
|
-
return new AXDateTime(new Date(value.year, value.month - 1, value.date, value.hours || 0, value.minutes || 0, value.seconds || 0, value.ms || 0), this.name());
|
|
504
|
-
}
|
|
505
|
-
name() {
|
|
506
|
-
return 'gregorian';
|
|
507
|
-
}
|
|
508
|
-
dayOfMonth(date) {
|
|
509
|
-
return date.getDate();
|
|
510
|
-
}
|
|
511
|
-
dayOfYear(date) {
|
|
512
|
-
let result = 0;
|
|
513
|
-
let m = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
514
|
-
if (this.isLeap(date)) {
|
|
515
|
-
m[1] = 29;
|
|
516
|
-
}
|
|
517
|
-
for (let i = 0; i < date.getMonth(); i++) {
|
|
518
|
-
result = result + m[i];
|
|
519
|
-
}
|
|
520
|
-
result += date.getDate();
|
|
521
|
-
return result;
|
|
485
|
+
this.uid = new Date().getTime().toString();
|
|
486
|
+
this.visible = true;
|
|
487
|
+
this.disable = false;
|
|
488
|
+
this.selected = false;
|
|
489
|
+
this.style = 'ax light';
|
|
490
|
+
this.orderIndex = 0;
|
|
522
491
|
}
|
|
523
|
-
|
|
524
|
-
|
|
492
|
+
}
|
|
493
|
+
class AXMenuItem extends AXBaseMenuItem {
|
|
494
|
+
constructor() {
|
|
495
|
+
super(...arguments);
|
|
496
|
+
this.divider = false;
|
|
525
497
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
498
|
+
}
|
|
499
|
+
class AXButtonItem extends AXBaseMenuItem {
|
|
500
|
+
constructor() {
|
|
501
|
+
super(...arguments);
|
|
502
|
+
this.dropdown = false;
|
|
503
|
+
this.submitBehavior = false;
|
|
504
|
+
this.cancelBehavior = false;
|
|
529
505
|
}
|
|
530
|
-
|
|
531
|
-
|
|
506
|
+
}
|
|
507
|
+
class AXCheckItem {
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
class AXPromise {
|
|
511
|
+
constructor(executor) {
|
|
512
|
+
this._executor = executor;
|
|
513
|
+
setTimeout(() => {
|
|
514
|
+
this._executor(this.thenAction);
|
|
515
|
+
}, 50);
|
|
516
|
+
}
|
|
517
|
+
static resolve(value) {
|
|
518
|
+
const r = new AXPromise(z => {
|
|
519
|
+
z(value);
|
|
520
|
+
}).then(() => { });
|
|
521
|
+
return r;
|
|
522
|
+
}
|
|
523
|
+
then(action) {
|
|
524
|
+
this.thenAction = action;
|
|
525
|
+
return this;
|
|
532
526
|
}
|
|
533
|
-
|
|
534
|
-
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
class AXSelectItem {
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @deprecated Use AXBasePageComponent from @acorex/components
|
|
534
|
+
*/
|
|
535
|
+
// TODO: Add Angular decorator.
|
|
536
|
+
class AXBasePageComponent {
|
|
537
|
+
constructor() {
|
|
538
|
+
this.onClosed = new EventEmitter();
|
|
535
539
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
break;
|
|
542
|
-
case 'minute':
|
|
543
|
-
value += 60000 * amount;
|
|
544
|
-
break;
|
|
545
|
-
case 'hour':
|
|
546
|
-
value += 3600000 * amount;
|
|
547
|
-
break;
|
|
548
|
-
case 'month':
|
|
549
|
-
const v = new Date(value);
|
|
550
|
-
var mo = date.getMonth();
|
|
551
|
-
var yr = date.getFullYear();
|
|
552
|
-
mo = (mo + amount) % 12;
|
|
553
|
-
if (0 > mo) {
|
|
554
|
-
yr += (date.getMonth() + amount - mo - 12) / 12;
|
|
555
|
-
mo += 12;
|
|
556
|
-
}
|
|
557
|
-
else
|
|
558
|
-
yr += ((date.getMonth() + amount - mo) / 12);
|
|
559
|
-
v.setMonth(mo);
|
|
560
|
-
v.setFullYear(yr);
|
|
561
|
-
value = v.valueOf();
|
|
562
|
-
break;
|
|
563
|
-
case 'week':
|
|
564
|
-
value += 7 * 86400000 * amount;
|
|
565
|
-
break;
|
|
566
|
-
case 'year':
|
|
567
|
-
const yv = new Date(value);
|
|
568
|
-
yv.setFullYear(yv.getFullYear() + amount);
|
|
569
|
-
value = yv.valueOf();
|
|
570
|
-
break;
|
|
571
|
-
case 'day':
|
|
572
|
-
default:
|
|
573
|
-
value += 86400000 * amount;
|
|
574
|
-
}
|
|
575
|
-
return new AXDateTime(new Date(value), this.name());
|
|
540
|
+
close(data) {
|
|
541
|
+
this.onClosed.emit({
|
|
542
|
+
component: this,
|
|
543
|
+
data: data
|
|
544
|
+
});
|
|
576
545
|
}
|
|
577
|
-
|
|
578
|
-
const clone = new Date(date.valueOf());
|
|
579
|
-
switch (unit) {
|
|
580
|
-
case 'second':
|
|
581
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), value, clone.getMilliseconds());
|
|
582
|
-
break;
|
|
583
|
-
case 'minute':
|
|
584
|
-
clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());
|
|
585
|
-
break;
|
|
586
|
-
case 'hour':
|
|
587
|
-
clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());
|
|
588
|
-
break;
|
|
589
|
-
default:
|
|
590
|
-
case 'day':
|
|
591
|
-
clone.setDate(value);
|
|
592
|
-
break;
|
|
593
|
-
case "week":
|
|
594
|
-
break;
|
|
595
|
-
case "month":
|
|
596
|
-
clone.setMonth(Math.max(0, value - 1));
|
|
597
|
-
break;
|
|
598
|
-
case "year":
|
|
599
|
-
clone.setFullYear(value);
|
|
600
|
-
break;
|
|
601
|
-
}
|
|
602
|
-
return new AXDateTime(clone, this.name());
|
|
546
|
+
onClosing(e) {
|
|
603
547
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
switch (unit) {
|
|
607
|
-
case 'second':
|
|
608
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 0);
|
|
609
|
-
return new AXDateTime(clone, this.name());
|
|
610
|
-
case 'minute':
|
|
611
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);
|
|
612
|
-
return new AXDateTime(clone, this.name());
|
|
613
|
-
case 'hour':
|
|
614
|
-
clone.setHours(clone.getHours(), 0, 0, 0);
|
|
615
|
-
return new AXDateTime(clone, this.name());
|
|
616
|
-
default:
|
|
617
|
-
case 'day':
|
|
618
|
-
clone.setHours(0, 0, 0, 0);
|
|
619
|
-
return new AXDateTime(clone, this.name());
|
|
620
|
-
case "week":
|
|
621
|
-
const index = 0;
|
|
622
|
-
const start = index >= 0 ? index : 0;
|
|
623
|
-
const day = clone.getDay();
|
|
624
|
-
const diff = clone.getDate() - day + (start > day ? start - 7 : start);
|
|
625
|
-
clone.setDate(diff);
|
|
626
|
-
return new AXDateTime(clone, this.name()).startOf('day');
|
|
627
|
-
case "month":
|
|
628
|
-
clone.setDate(1);
|
|
629
|
-
return new AXDateTime(clone, this.name()).startOf('day');
|
|
630
|
-
case "year":
|
|
631
|
-
clone.setMonth(0);
|
|
632
|
-
clone.setDate(1);
|
|
633
|
-
return new AXDateTime(clone, this.name()).startOf('day');
|
|
634
|
-
}
|
|
548
|
+
ngOnDestroy() {
|
|
549
|
+
this.onClosed.unsubscribe();
|
|
635
550
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
case 'week':
|
|
653
|
-
return this.startOf(date, 'week').add('day', 6).endOf('day');
|
|
654
|
-
case 'month':
|
|
655
|
-
return new AXDateTime(new Date(date.getFullYear(), date.getMonth() + 1, 0), this.name()).endOf('day');
|
|
656
|
-
case "year":
|
|
657
|
-
clone.setMonth(11);
|
|
658
|
-
return new AXDateTime(clone, this.name()).endOf('month');
|
|
551
|
+
}
|
|
552
|
+
AXBasePageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXBasePageComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
553
|
+
AXBasePageComponent.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXBasePageComponent });
|
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXBasePageComponent, decorators: [{
|
|
555
|
+
type: Injectable
|
|
556
|
+
}] });
|
|
557
|
+
|
|
558
|
+
const AX_ERROR_DISPLAY_INTERCEPTOR = new InjectionToken('ax.error');
|
|
559
|
+
class AXErrorService {
|
|
560
|
+
constructor(injector) {
|
|
561
|
+
this.injector = injector;
|
|
562
|
+
}
|
|
563
|
+
handle(message) {
|
|
564
|
+
const instance = this.injector.get(AX_ERROR_DISPLAY_INTERCEPTOR);
|
|
565
|
+
if (instance) {
|
|
566
|
+
instance.show(message);
|
|
659
567
|
}
|
|
660
568
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
569
|
+
}
|
|
570
|
+
AXErrorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
571
|
+
AXErrorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorService, providedIn: 'root' });
|
|
572
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorService, decorators: [{
|
|
573
|
+
type: Injectable,
|
|
574
|
+
args: [{ providedIn: 'root' }]
|
|
575
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
666
576
|
|
|
667
|
-
class
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
577
|
+
class AXErrorModule {
|
|
578
|
+
}
|
|
579
|
+
AXErrorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
580
|
+
AXErrorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorModule, imports: [CommonModule] });
|
|
581
|
+
AXErrorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorModule, providers: [AXErrorService], imports: [[CommonModule]] });
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXErrorModule, decorators: [{
|
|
583
|
+
type: NgModule,
|
|
584
|
+
args: [{
|
|
585
|
+
declarations: [],
|
|
586
|
+
imports: [CommonModule],
|
|
587
|
+
exports: [],
|
|
588
|
+
providers: [AXErrorService],
|
|
589
|
+
}]
|
|
590
|
+
}] });
|
|
591
|
+
|
|
592
|
+
const AX_HTTP_EVENT_INTERCEPTOR = new InjectionToken('ax.http.events');
|
|
593
|
+
|
|
594
|
+
class HttpResult {
|
|
595
|
+
constructor(executor) {
|
|
596
|
+
this._executor = executor;
|
|
597
|
+
setTimeout(() => {
|
|
598
|
+
this._executor(this.resultAction, this.errorAction, this.completeAction);
|
|
599
|
+
}, 50);
|
|
680
600
|
}
|
|
681
|
-
|
|
682
|
-
|
|
601
|
+
result(action) {
|
|
602
|
+
this.resultAction = action;
|
|
603
|
+
return this;
|
|
683
604
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
return
|
|
605
|
+
error(action) {
|
|
606
|
+
this.errorAction = action;
|
|
607
|
+
return this;
|
|
687
608
|
}
|
|
688
|
-
|
|
689
|
-
|
|
609
|
+
complete(action) {
|
|
610
|
+
this.completeAction = action;
|
|
611
|
+
return this;
|
|
690
612
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// import { catchError, retry, retryWhen, mergeMap, delay, switchMap, scan, takeWhile, flatMap } from 'rxjs/operators';
|
|
616
|
+
// import { of, concat, throwError } from 'rxjs';
|
|
617
|
+
class AXHttpService {
|
|
618
|
+
constructor(http, injector) {
|
|
619
|
+
this.http = http;
|
|
620
|
+
this.injector = injector;
|
|
621
|
+
this.interceptor = this.injector.get(AX_HTTP_EVENT_INTERCEPTOR);
|
|
622
|
+
}
|
|
623
|
+
get(url, config = {}) {
|
|
624
|
+
config.url = url;
|
|
625
|
+
config.method = "get";
|
|
626
|
+
return this.request(config);
|
|
627
|
+
}
|
|
628
|
+
post(url, config = {}) {
|
|
629
|
+
config.url = url;
|
|
630
|
+
config.method = "post";
|
|
631
|
+
return this.request(config);
|
|
632
|
+
}
|
|
633
|
+
delete(url, config = {}) {
|
|
634
|
+
config.url = url;
|
|
635
|
+
config.method = "delete";
|
|
636
|
+
return this.request(config);
|
|
637
|
+
}
|
|
638
|
+
put(url, config = {}) {
|
|
639
|
+
config.url = url;
|
|
640
|
+
config.method = "put";
|
|
641
|
+
return this.request(config);
|
|
642
|
+
}
|
|
643
|
+
request(config) {
|
|
644
|
+
return new HttpResult((result, error, complete) => {
|
|
645
|
+
this.handleBegin(config).then(c => {
|
|
646
|
+
this.http
|
|
647
|
+
.request(config.method, config.url, this.mapOptions(config))
|
|
648
|
+
//.pipe(this.retry)
|
|
649
|
+
.subscribe(data => {
|
|
650
|
+
this.handleResult(data, result, complete, config);
|
|
651
|
+
}, c => {
|
|
652
|
+
this.handleError(c, error, complete, config);
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
});
|
|
695
656
|
}
|
|
696
|
-
|
|
697
|
-
|
|
657
|
+
handleResult(data, result, complete, config) {
|
|
658
|
+
if (this.interceptor) {
|
|
659
|
+
this.interceptor.success(config, data).then(c => {
|
|
660
|
+
if (result)
|
|
661
|
+
result(c);
|
|
662
|
+
this.handleComplete(complete, config);
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
//
|
|
667
|
+
if (result)
|
|
668
|
+
result(data);
|
|
669
|
+
this.handleComplete(complete, config);
|
|
670
|
+
}
|
|
698
671
|
}
|
|
699
|
-
|
|
700
|
-
return
|
|
672
|
+
handleBegin(config) {
|
|
673
|
+
return new Promise((resolve) => {
|
|
674
|
+
if (!config.headers)
|
|
675
|
+
config.headers = {};
|
|
676
|
+
if (!config.params)
|
|
677
|
+
config.params = {};
|
|
678
|
+
//
|
|
679
|
+
if (this.interceptor) {
|
|
680
|
+
this.interceptor.begin(config).then(c => {
|
|
681
|
+
resolve(c);
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
else {
|
|
685
|
+
resolve(config);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
701
688
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
let jm = this.monthOfYear(date);
|
|
719
|
-
let jy = this.year(date);
|
|
720
|
-
const nm = (jm + amount);
|
|
721
|
-
const ny = (nm % 12) ? Math.floor(nm / 12) : 0;
|
|
722
|
-
jy += ny;
|
|
723
|
-
jm = nm - (ny * 12);
|
|
724
|
-
const vv = this.toGregorian(jy, jm, jd);
|
|
725
|
-
v.setFullYear(vv.getFullYear());
|
|
726
|
-
v.setMonth(vv.getMonth());
|
|
727
|
-
v.setDate(vv.getDate());
|
|
728
|
-
value = v.valueOf();
|
|
729
|
-
break;
|
|
730
|
-
}
|
|
731
|
-
case 'week':
|
|
732
|
-
value += 7 * 86400000 * amount;
|
|
733
|
-
break;
|
|
734
|
-
case 'year':
|
|
735
|
-
{
|
|
736
|
-
// const v = new Date(value);
|
|
737
|
-
// v.setFullYear(v.getFullYear() + amount);
|
|
738
|
-
// value = v.valueOf();
|
|
739
|
-
// break
|
|
740
|
-
const v = new Date(value);
|
|
741
|
-
let jd = this.dayOfMonth(date);
|
|
742
|
-
let jm = this.monthOfYear(date);
|
|
743
|
-
let jy = this.year(date);
|
|
744
|
-
const vv = this.toGregorian(jy + amount, jm, jd);
|
|
745
|
-
v.setFullYear(vv.getFullYear());
|
|
746
|
-
v.setMonth(vv.getMonth());
|
|
747
|
-
v.setDate(vv.getDate());
|
|
748
|
-
value = v.valueOf();
|
|
749
|
-
break;
|
|
750
|
-
}
|
|
751
|
-
case 'day':
|
|
752
|
-
default:
|
|
753
|
-
value += 86400000 * amount;
|
|
689
|
+
handleComplete(complete, config) {
|
|
690
|
+
if (complete)
|
|
691
|
+
complete();
|
|
692
|
+
if (this.interceptor)
|
|
693
|
+
this.interceptor.complete(config);
|
|
694
|
+
}
|
|
695
|
+
handleError(c, error, complete, config) {
|
|
696
|
+
let r = {
|
|
697
|
+
message: c.message,
|
|
698
|
+
status: c.status,
|
|
699
|
+
code: c.status?.toString(),
|
|
700
|
+
handled: false,
|
|
701
|
+
error: c.error
|
|
702
|
+
};
|
|
703
|
+
if (error) {
|
|
704
|
+
error(r);
|
|
754
705
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
const clone = new Date(date.valueOf());
|
|
759
|
-
const jDate = this.toJalali(clone);
|
|
760
|
-
switch (unit) {
|
|
761
|
-
case 'second':
|
|
762
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), value, clone.getMilliseconds());
|
|
763
|
-
break;
|
|
764
|
-
case 'minute':
|
|
765
|
-
clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());
|
|
766
|
-
break;
|
|
767
|
-
case 'hour':
|
|
768
|
-
clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());
|
|
769
|
-
break;
|
|
770
|
-
default:
|
|
771
|
-
case 'day':
|
|
772
|
-
const gDate = this.toGregorian(jDate.year, jDate.month, value);
|
|
773
|
-
clone.setDate(gDate.getDate());
|
|
774
|
-
break;
|
|
775
|
-
case "week":
|
|
776
|
-
break;
|
|
777
|
-
case "month":
|
|
778
|
-
const gDate2 = this.toGregorian(jDate.year, value, jDate.day);
|
|
779
|
-
clone.setMonth(gDate2.getMonth());
|
|
780
|
-
break;
|
|
781
|
-
case "year":
|
|
782
|
-
const gDate3 = this.toGregorian(value, jDate.month, jDate.day);
|
|
783
|
-
clone.setFullYear(gDate3.getFullYear());
|
|
784
|
-
break;
|
|
706
|
+
if (!r.handled) {
|
|
707
|
+
if (this.interceptor)
|
|
708
|
+
this.interceptor.error(config, r);
|
|
785
709
|
}
|
|
786
|
-
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);
|
|
796
|
-
return new AXDateTime(clone, this.name());
|
|
797
|
-
case 'hour':
|
|
798
|
-
clone.setHours(clone.getHours(), 0, 0, 0);
|
|
799
|
-
return new AXDateTime(clone, this.name());
|
|
800
|
-
default:
|
|
801
|
-
case 'day':
|
|
802
|
-
clone.setHours(0, 0, 0, 0);
|
|
803
|
-
return new AXDateTime(clone, this.name());
|
|
804
|
-
case "week":
|
|
805
|
-
return new AXDateTime(clone, this.name()).add('day', -this.dayOfWeek(clone) + 1).startOf('day');
|
|
806
|
-
case "month":
|
|
807
|
-
{
|
|
808
|
-
const jy = this.year(date);
|
|
809
|
-
const jm = this.monthOfYear(date);
|
|
810
|
-
const gDate = this.toGregorian(jy, jm, 1);
|
|
811
|
-
return new AXDateTime(gDate, this.name()).startOf('day');
|
|
812
|
-
}
|
|
813
|
-
case "year":
|
|
814
|
-
{
|
|
815
|
-
const jy = this.year(date);
|
|
816
|
-
const gDate = this.toGregorian(jy, 1, 1);
|
|
817
|
-
return new AXDateTime(gDate, this.name()).startOf('day');
|
|
818
|
-
}
|
|
710
|
+
this.handleComplete(complete, config);
|
|
711
|
+
}
|
|
712
|
+
mapOptions(options) {
|
|
713
|
+
let headers = new HttpHeaders();
|
|
714
|
+
for (const key in options.headers) {
|
|
715
|
+
if (options.headers.hasOwnProperty(key)) {
|
|
716
|
+
const value = options.headers[key];
|
|
717
|
+
headers = headers.set(key, value);
|
|
718
|
+
}
|
|
819
719
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 999);
|
|
826
|
-
return new AXDateTime(clone, this.name());
|
|
827
|
-
case 'minute':
|
|
828
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), 59, 999);
|
|
829
|
-
return new AXDateTime(clone, this.name());
|
|
830
|
-
case 'hour':
|
|
831
|
-
clone.setHours(clone.getHours(), 59, 59, 999);
|
|
832
|
-
return new AXDateTime(clone, this.name());
|
|
833
|
-
default:
|
|
834
|
-
case 'day':
|
|
835
|
-
clone.setHours(23, 59, 59, 999);
|
|
836
|
-
return new AXDateTime(clone, this.name());
|
|
837
|
-
case 'week':
|
|
838
|
-
{
|
|
839
|
-
return this.startOf(date, 'week').add('day', 6).endOf('day');
|
|
840
|
-
}
|
|
841
|
-
case 'month':
|
|
842
|
-
{
|
|
843
|
-
const jy = this.year(date);
|
|
844
|
-
const jm = this.monthOfYear(date);
|
|
845
|
-
const jd = this.monthLength(jy, jm);
|
|
846
|
-
const gDate = this.toGregorian(jy, jm, jd);
|
|
847
|
-
return new AXDateTime(gDate, this.name()).endOf('day');
|
|
848
|
-
}
|
|
849
|
-
case "year":
|
|
850
|
-
let jy = this.year(date);
|
|
851
|
-
const gDate = this.toGregorian(jy, 12, this.monthLength(jy, 12));
|
|
852
|
-
return new AXDateTime(gDate, this.name()).endOf('day');
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
toJalali(date) {
|
|
856
|
-
const gy = date.getFullYear();
|
|
857
|
-
const gm = date.getMonth() + 1;
|
|
858
|
-
const gd = date.getDate();
|
|
859
|
-
const r = this.d2j(this.g2d(gy, gm, gd));
|
|
860
|
-
return {
|
|
861
|
-
year: r.jy,
|
|
862
|
-
month: r.jm,
|
|
863
|
-
day: r.jd,
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
/*
|
|
867
|
-
Converts a Jalaali date to Gregorian.
|
|
868
|
-
*/
|
|
869
|
-
toGregorian(jy, jm, jd) {
|
|
870
|
-
const g = this.d2g(this.j2d(jy, jm, jd));
|
|
871
|
-
return new Date(g.gy, g.gm - 1, g.gd);
|
|
872
|
-
}
|
|
873
|
-
/*
|
|
874
|
-
Checks whether a Jalaali date is valid or not.
|
|
875
|
-
*/
|
|
876
|
-
isValid(jy, jm, jd) {
|
|
877
|
-
return jy >= -61 && jy <= 3177 &&
|
|
878
|
-
jm >= 1 && jm <= 12 &&
|
|
879
|
-
jd >= 1 && jd <= this.monthLength(jy, jm);
|
|
880
|
-
}
|
|
881
|
-
/*
|
|
882
|
-
Is this a leap year or not?
|
|
883
|
-
*/
|
|
884
|
-
isLeapYear(jy) {
|
|
885
|
-
return this.jalCal(jy).leap === 0;
|
|
886
|
-
}
|
|
887
|
-
/*
|
|
888
|
-
Number of days in a given month in a Jalaali year.
|
|
889
|
-
*/
|
|
890
|
-
monthLength(jy, jm) {
|
|
891
|
-
if (jm <= 6)
|
|
892
|
-
return 31;
|
|
893
|
-
if (jm <= 11)
|
|
894
|
-
return 30;
|
|
895
|
-
if (this.isLeapYear(jy))
|
|
896
|
-
return 30;
|
|
897
|
-
return 29;
|
|
898
|
-
}
|
|
899
|
-
jalCal(jy) {
|
|
900
|
-
// Jalaali years starting the 33-year rule.
|
|
901
|
-
let breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210,
|
|
902
|
-
1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178
|
|
903
|
-
], bl = breaks.length, gy = jy + 621, leapJ = -14, jp = breaks[0], jm, jump, leap, leapG, march, n, i;
|
|
904
|
-
if (jy < jp || jy >= breaks[bl - 1])
|
|
905
|
-
throw new Error('Invalid Jalaali year ' + jy);
|
|
906
|
-
// Find the limiting years for the Jalaali year jy.
|
|
907
|
-
for (i = 1; i < bl; i += 1) {
|
|
908
|
-
jm = breaks[i];
|
|
909
|
-
jump = jm - jp;
|
|
910
|
-
if (jy < jm)
|
|
911
|
-
break;
|
|
912
|
-
leapJ = leapJ + this.div(jump, 33) * 8 + this.div(this.mod(jump, 33), 4);
|
|
913
|
-
jp = jm;
|
|
914
|
-
}
|
|
915
|
-
n = jy - jp;
|
|
916
|
-
// Find the number of leap years from AD 621 to the beginning
|
|
917
|
-
// of the current Jalaali year in the Persian calendar.
|
|
918
|
-
leapJ = leapJ + this.div(n, 33) * 8 + this.div(this.mod(n, 33) + 3, 4);
|
|
919
|
-
if (this.mod(jump, 33) === 4 && jump - n === 4)
|
|
920
|
-
leapJ += 1;
|
|
921
|
-
// And the same in the Gregorian calendar (until the year gy).
|
|
922
|
-
leapG = this.div(gy, 4) - this.div((this.div(gy, 100) + 1) * 3, 4) - 150;
|
|
923
|
-
// Determine the Gregorian date of Farvardin the 1st.
|
|
924
|
-
march = 20 + leapJ - leapG;
|
|
925
|
-
// Find how many years have passed since the last leap year.
|
|
926
|
-
if (jump - n < 6)
|
|
927
|
-
n = n - jump + this.div(jump + 4, 33) * 33;
|
|
928
|
-
leap = this.mod(this.mod(n + 1, 33) - 1, 4);
|
|
929
|
-
if (leap === -1) {
|
|
930
|
-
leap = 4;
|
|
931
|
-
}
|
|
932
|
-
return {
|
|
933
|
-
leap: leap,
|
|
934
|
-
gy: gy,
|
|
935
|
-
march: march
|
|
936
|
-
};
|
|
937
|
-
}
|
|
938
|
-
/*
|
|
939
|
-
Converts a date of the Jalaali calendar to the Julian Day number.
|
|
940
|
-
@param jy Jalaali year (1 to 3100)
|
|
941
|
-
@param jm Jalaali month (1 to 12)
|
|
942
|
-
@param jd Jalaali day (1 to 29/31)
|
|
943
|
-
@return Julian Day number
|
|
944
|
-
*/
|
|
945
|
-
j2d(jy, jm, jd) {
|
|
946
|
-
let r = this.jalCal(jy);
|
|
947
|
-
return this.g2d(r.gy, 3, r.march) + (jm - 1) * 31 - this.div(jm, 7) * (jm - 7) + jd - 1;
|
|
948
|
-
}
|
|
949
|
-
/*
|
|
950
|
-
Converts the Julian Day number to a date in the Jalaali calendar.
|
|
951
|
-
@param jdn Julian Day number
|
|
952
|
-
@return
|
|
953
|
-
jy: Jalaali year (1 to 3100)
|
|
954
|
-
jm: Jalaali month (1 to 12)
|
|
955
|
-
jd: Jalaali day (1 to 29/31)
|
|
956
|
-
*/
|
|
957
|
-
d2j(jdn) {
|
|
958
|
-
let gy = this.d2g(jdn).gy // Calculate Gregorian year (gy).
|
|
959
|
-
, jy = gy - 621, r = this.jalCal(jy), jdn1f = this.g2d(gy, 3, r.march), jd, jm, k;
|
|
960
|
-
// Find number of days that passed since 1 Farvardin.
|
|
961
|
-
k = jdn - jdn1f;
|
|
962
|
-
if (k >= 0) {
|
|
963
|
-
if (k <= 185) {
|
|
964
|
-
// The first 6 months.
|
|
965
|
-
jm = 1 + this.div(k, 31);
|
|
966
|
-
jd = this.mod(k, 31) + 1;
|
|
967
|
-
return {
|
|
968
|
-
jy: jy,
|
|
969
|
-
jm: jm,
|
|
970
|
-
jd: jd
|
|
971
|
-
};
|
|
720
|
+
let params = new HttpParams();
|
|
721
|
+
for (const key in options.params) {
|
|
722
|
+
if (options.params.hasOwnProperty(key)) {
|
|
723
|
+
const value = options.params[key];
|
|
724
|
+
params = params.set(key, value);
|
|
972
725
|
}
|
|
973
|
-
else {
|
|
974
|
-
// The remaining months.
|
|
975
|
-
k -= 186;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
else {
|
|
979
|
-
// Previous Jalaali year.
|
|
980
|
-
jy -= 1;
|
|
981
|
-
k += 179;
|
|
982
|
-
if (r.leap === 1)
|
|
983
|
-
k += 1;
|
|
984
726
|
}
|
|
985
|
-
jm = 7 + this.div(k, 30);
|
|
986
|
-
jd = this.mod(k, 30) + 1;
|
|
987
|
-
return {
|
|
988
|
-
jy: jy,
|
|
989
|
-
jm: jm,
|
|
990
|
-
jd: jd
|
|
991
|
-
};
|
|
992
|
-
}
|
|
993
|
-
g2d(gy, gm, gd) {
|
|
994
|
-
let d = this.div((gy + this.div(gm - 8, 6) + 100100) * 1461, 4)
|
|
995
|
-
+ this.div(153 * this.mod(gm + 9, 12) + 2, 5)
|
|
996
|
-
+ gd - 34840408;
|
|
997
|
-
d = d - this.div(this.div(gy + 100100 + this.div(gm - 8, 6), 100) * 3, 4) + 752;
|
|
998
|
-
return d;
|
|
999
|
-
}
|
|
1000
|
-
d2g(jdn) {
|
|
1001
|
-
let j, i, gd, gm, gy;
|
|
1002
|
-
j = 4 * jdn + 139361631;
|
|
1003
|
-
j = j + this.div(this.div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;
|
|
1004
|
-
i = this.div(this.mod(j, 1461), 4) * 5 + 308;
|
|
1005
|
-
gd = this.div(this.mod(i, 153), 5) + 1;
|
|
1006
|
-
gm = this.mod(this.div(i, 153), 12) + 1;
|
|
1007
|
-
gy = this.div(j, 1461) - 100100 + this.div(8 - gm, 6);
|
|
1008
727
|
return {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
728
|
+
headers: headers,
|
|
729
|
+
params: params,
|
|
730
|
+
body: options.body,
|
|
731
|
+
responseType: options.responseType || 'json'
|
|
1012
732
|
};
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
constructor() {
|
|
1027
|
-
AXConfig.set({
|
|
1028
|
-
dateTime: {
|
|
1029
|
-
calendars: {
|
|
1030
|
-
jalali: new JalaliCalendar(),
|
|
1031
|
-
gregorian: new GeorgianCalendar()
|
|
1032
|
-
},
|
|
1033
|
-
calendar: 'gregorian',
|
|
1034
|
-
shortDateFormat: 'DDDD, d MMM yyyy'
|
|
1035
|
-
}
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
AXDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1040
|
-
AXDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimeModule, declarations: [AXDateTimePipe], exports: [AXDateTimePipe] });
|
|
1041
|
-
AXDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimeModule, providers: [], imports: [[]] });
|
|
1042
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXDateTimeModule, decorators: [{
|
|
1043
|
-
type: NgModule,
|
|
1044
|
-
args: [{
|
|
1045
|
-
imports: [],
|
|
1046
|
-
exports: [AXDateTimePipe],
|
|
1047
|
-
declarations: [AXDateTimePipe],
|
|
1048
|
-
providers: [],
|
|
1049
|
-
}]
|
|
1050
|
-
}], ctorParameters: function () { return []; } });
|
|
1051
|
-
|
|
1052
|
-
class AXEventService {
|
|
1053
|
-
constructor() {
|
|
1054
|
-
this.list = [];
|
|
1055
|
-
}
|
|
1056
|
-
broadcast(key, options) {
|
|
1057
|
-
const d = this.list.find(c => c.key === key);
|
|
1058
|
-
if (d) {
|
|
1059
|
-
d.events.forEach(c => {
|
|
1060
|
-
c(options);
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
on(key, callback) {
|
|
1065
|
-
let d = this.list.find(c => c.key === key);
|
|
1066
|
-
if (!d) {
|
|
1067
|
-
d = { key, events: [] };
|
|
1068
|
-
this.list.push(d);
|
|
1069
|
-
}
|
|
1070
|
-
d.events.push(callback);
|
|
1071
|
-
}
|
|
1072
|
-
destroy(key, callback) {
|
|
1073
|
-
const d = this.list.find(c => c.key === key);
|
|
1074
|
-
if (d) {
|
|
1075
|
-
d.events = [];
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
AXEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1080
|
-
AXEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXEventService, providedIn: 'root' });
|
|
1081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXEventService, decorators: [{
|
|
1082
|
-
type: Injectable,
|
|
1083
|
-
args: [{ providedIn: 'root' }]
|
|
1084
|
-
}] });
|
|
1085
|
-
|
|
1086
|
-
class AXHotkeysService {
|
|
1087
|
-
constructor(eventManager, document) {
|
|
1088
|
-
this.eventManager = eventManager;
|
|
1089
|
-
this.document = document;
|
|
1090
|
-
this.defaults = {
|
|
1091
|
-
element: this.document
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
addShortcut(options) {
|
|
1095
|
-
const merged = { ...this.defaults, ...options };
|
|
1096
|
-
const event = `keydown.${merged.keys}`;
|
|
1097
|
-
return new Observable(observer => {
|
|
1098
|
-
const handler = (e) => {
|
|
1099
|
-
e.preventDefault();
|
|
1100
|
-
observer.next(e);
|
|
1101
|
-
};
|
|
1102
|
-
const dispose = this.eventManager.addEventListener(merged.element, event, handler);
|
|
1103
|
-
return () => {
|
|
1104
|
-
dispose();
|
|
1105
|
-
};
|
|
1106
|
-
});
|
|
733
|
+
// if (options.method == "get") {
|
|
734
|
+
// return {
|
|
735
|
+
// headers: headers,
|
|
736
|
+
// params: params
|
|
737
|
+
// };
|
|
738
|
+
// }
|
|
739
|
+
// else {
|
|
740
|
+
// return {
|
|
741
|
+
// headers: headers,
|
|
742
|
+
// params: params,
|
|
743
|
+
// body: options.body
|
|
744
|
+
// };
|
|
745
|
+
// }
|
|
1107
746
|
}
|
|
1108
747
|
}
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
748
|
+
AXHttpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpService, deps: [{ token: i1.HttpClient }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
749
|
+
AXHttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpService });
|
|
750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpService, decorators: [{
|
|
1112
751
|
type: Injectable
|
|
1113
|
-
}], ctorParameters: function () { return [{ type: i1.
|
|
1114
|
-
type: Inject,
|
|
1115
|
-
args: [DOCUMENT]
|
|
1116
|
-
}] }]; } });
|
|
1117
|
-
|
|
1118
|
-
// @dynamic
|
|
1119
|
-
class AXTranslator {
|
|
1120
|
-
static get onChange() {
|
|
1121
|
-
return AXTranslator.dataChangeSubject.asObservable();
|
|
1122
|
-
}
|
|
1123
|
-
static load(lang, value) {
|
|
1124
|
-
if (typeof value === 'object') {
|
|
1125
|
-
if (!AXTranslator[`__data__${lang}`]) {
|
|
1126
|
-
AXTranslator[`__data__${lang}`] = {};
|
|
1127
|
-
}
|
|
1128
|
-
AXTranslator[`__data__${lang}`] = merge(AXTranslator[`__data__${lang}`], value);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
static use(lang) {
|
|
1132
|
-
AXTranslator.lang = lang;
|
|
1133
|
-
}
|
|
1134
|
-
static get(key, lang, params) {
|
|
1135
|
-
lang = lang || AXTranslator.lang;
|
|
1136
|
-
let result = _.get(AXTranslator[`__data__${lang}`], key, key);
|
|
1137
|
-
const vars = typeof (result) == 'string' ? result?.match(this._varsRegx) : [];
|
|
1138
|
-
if (vars?.length) {
|
|
1139
|
-
vars.forEach(v => {
|
|
1140
|
-
const varKey = v.match(this._varNameRegx)?.length ? v.match(this._varNameRegx)[0] : null;
|
|
1141
|
-
if (varKey) {
|
|
1142
|
-
const p = _.get(params, varKey) || this.get(varKey, lang);
|
|
1143
|
-
if (p) {
|
|
1144
|
-
result = result.replace(v, p);
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
return typeof (result) == 'string' ? result : JSON.stringify(result);
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
AXTranslator.lang = 'en';
|
|
1153
|
-
AXTranslator.dataChangeSubject = new Subject();
|
|
1154
|
-
AXTranslator._varsRegx = /((\$\{[a-zA-Z_0-9\.]+\})+)/gm;
|
|
1155
|
-
AXTranslator._varNameRegx = /[a-zA-Z_0-9\.]+/gm;
|
|
752
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }]; } });
|
|
1156
753
|
|
|
1157
|
-
class
|
|
1158
|
-
|
|
1159
|
-
return
|
|
754
|
+
class AXHttpModule {
|
|
755
|
+
static forRoot() {
|
|
756
|
+
return {
|
|
757
|
+
ngModule: AXHttpModule,
|
|
758
|
+
providers: [AXHttpService]
|
|
759
|
+
};
|
|
1160
760
|
}
|
|
1161
761
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
AXTranslationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] });
|
|
1173
|
-
AXTranslationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXTranslationModule, providers: [], imports: [[]] });
|
|
1174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXTranslationModule, decorators: [{
|
|
762
|
+
AXHttpModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
763
|
+
AXHttpModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpModule, imports: [CommonModule,
|
|
764
|
+
HttpClientModule], exports: [HttpClientModule] });
|
|
765
|
+
AXHttpModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpModule, providers: [
|
|
766
|
+
AXHttpService
|
|
767
|
+
], imports: [[
|
|
768
|
+
CommonModule,
|
|
769
|
+
HttpClientModule
|
|
770
|
+
], HttpClientModule] });
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHttpModule, decorators: [{
|
|
1175
772
|
type: NgModule,
|
|
1176
773
|
args: [{
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
774
|
+
declarations: [],
|
|
775
|
+
imports: [
|
|
776
|
+
CommonModule,
|
|
777
|
+
HttpClientModule
|
|
778
|
+
],
|
|
779
|
+
exports: [HttpClientModule],
|
|
780
|
+
providers: [
|
|
781
|
+
AXHttpService
|
|
782
|
+
]
|
|
1181
783
|
}]
|
|
1182
784
|
}] });
|
|
1183
785
|
|
|
@@ -1256,7 +858,10 @@ class AXPlatform {
|
|
|
1256
858
|
this.resize = new Subject();
|
|
1257
859
|
this.click = new Subject();
|
|
1258
860
|
this.scroll = new Subject();
|
|
1259
|
-
window
|
|
861
|
+
fromEvent(window, 'resize')
|
|
862
|
+
.pipe(debounceTime(100))
|
|
863
|
+
.pipe(distinctUntilChanged())
|
|
864
|
+
.subscribe((e) => {
|
|
1260
865
|
this.resize.next({
|
|
1261
866
|
nativeEvent: e,
|
|
1262
867
|
source: this
|
|
@@ -1303,23 +908,1350 @@ class AXPlatform {
|
|
|
1303
908
|
document.querySelector(':root').style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
|
|
1304
909
|
}
|
|
1305
910
|
}
|
|
1306
|
-
AXPlatform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1307
|
-
AXPlatform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
1308
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
911
|
+
AXPlatform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXPlatform, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
912
|
+
AXPlatform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXPlatform, providedIn: 'platform' });
|
|
913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXPlatform, decorators: [{
|
|
1309
914
|
type: Injectable,
|
|
1310
915
|
args: [{
|
|
1311
916
|
providedIn: 'platform',
|
|
1312
917
|
}]
|
|
1313
918
|
}], ctorParameters: function () { return []; } });
|
|
1314
919
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
920
|
+
class AXDateTimePipe {
|
|
921
|
+
constructor() { }
|
|
922
|
+
transform(value, format) {
|
|
923
|
+
const date = AXDateTime.convert(value);
|
|
924
|
+
if (value == null) {
|
|
925
|
+
return '';
|
|
926
|
+
}
|
|
927
|
+
if (!format) {
|
|
928
|
+
return date.toString();
|
|
929
|
+
}
|
|
930
|
+
else {
|
|
931
|
+
return date.format(format);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
AXDateTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
936
|
+
AXDateTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXDateTimePipe, name: "dt" });
|
|
937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXDateTimePipe, decorators: [{
|
|
938
|
+
type: Pipe,
|
|
939
|
+
args: [{ name: 'dt' }]
|
|
940
|
+
}], ctorParameters: function () { return []; } });
|
|
941
|
+
|
|
942
|
+
class AXHtmlToTextPipe {
|
|
943
|
+
transform(value) {
|
|
944
|
+
if (value) {
|
|
945
|
+
const regexHtml = /<\/?[^>]+>/gi;
|
|
946
|
+
const regexNbsp = / /gi;
|
|
947
|
+
const regexAmp = /&/gi;
|
|
948
|
+
return value
|
|
949
|
+
.replace(regexHtml, '')
|
|
950
|
+
.replace(regexNbsp, '')
|
|
951
|
+
.replace(regexAmp, '');
|
|
952
|
+
}
|
|
953
|
+
else {
|
|
954
|
+
return '';
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
AXHtmlToTextPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlToTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
959
|
+
AXHtmlToTextPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlToTextPipe, name: "html2text" });
|
|
960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlToTextPipe, decorators: [{
|
|
961
|
+
type: Pipe,
|
|
962
|
+
args: [{ name: 'html2text' }]
|
|
963
|
+
}] });
|
|
964
|
+
|
|
965
|
+
class AXEventService {
|
|
966
|
+
constructor() {
|
|
967
|
+
this.list = [];
|
|
968
|
+
}
|
|
969
|
+
broadcast(key, options) {
|
|
970
|
+
const d = this.list.find(c => c.key === key);
|
|
971
|
+
if (d) {
|
|
972
|
+
d.events.forEach(c => {
|
|
973
|
+
c(options);
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
on(key, callback) {
|
|
978
|
+
let d = this.list.find(c => c.key === key);
|
|
979
|
+
if (!d) {
|
|
980
|
+
d = { key, events: [] };
|
|
981
|
+
this.list.push(d);
|
|
982
|
+
}
|
|
983
|
+
d.events.push(callback);
|
|
984
|
+
}
|
|
985
|
+
destroy(key, callback) {
|
|
986
|
+
const d = this.list.find(c => c.key === key);
|
|
987
|
+
if (d) {
|
|
988
|
+
d.events = [];
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
AXEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
993
|
+
AXEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXEventService, providedIn: 'root' });
|
|
994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXEventService, decorators: [{
|
|
995
|
+
type: Injectable,
|
|
996
|
+
args: [{ providedIn: 'root' }]
|
|
997
|
+
}] });
|
|
998
|
+
|
|
999
|
+
class AXNavigator {
|
|
1000
|
+
}
|
|
1001
|
+
AXNavigator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXNavigator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1002
|
+
AXNavigator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXNavigator });
|
|
1003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXNavigator, decorators: [{
|
|
1004
|
+
type: Injectable
|
|
1005
|
+
}] });
|
|
1006
|
+
|
|
1007
|
+
class AXStorageService {
|
|
1008
|
+
get(key) {
|
|
1009
|
+
return localStorage.getItem(key);
|
|
1010
|
+
}
|
|
1011
|
+
set(key, value) {
|
|
1012
|
+
localStorage.setItem(key, value);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
AXStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1016
|
+
AXStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXStorageService });
|
|
1017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXStorageService, decorators: [{
|
|
1018
|
+
type: Injectable
|
|
1019
|
+
}] });
|
|
1020
|
+
|
|
1021
|
+
// @dynamic
|
|
1022
|
+
class AXTranslator {
|
|
1023
|
+
static get onChange() {
|
|
1024
|
+
return AXTranslator.dataChangeSubject.asObservable();
|
|
1025
|
+
}
|
|
1026
|
+
static load(lang, value) {
|
|
1027
|
+
if (typeof value === 'object') {
|
|
1028
|
+
if (!AXTranslator[`__data__${lang}`]) {
|
|
1029
|
+
AXTranslator[`__data__${lang}`] = {};
|
|
1030
|
+
}
|
|
1031
|
+
AXTranslator[`__data__${lang}`] = merge(AXTranslator[`__data__${lang}`], value);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
static use(lang) {
|
|
1035
|
+
AXTranslator.lang = lang;
|
|
1036
|
+
}
|
|
1037
|
+
static get(key, lang) {
|
|
1038
|
+
return getPropByPath(AXTranslator[`__data__${lang || AXTranslator.lang}`], key) || key;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
AXTranslator.lang = 'en';
|
|
1042
|
+
AXTranslator.dataChangeSubject = new Subject();
|
|
1043
|
+
|
|
1044
|
+
class AXTranslatorService {
|
|
1045
|
+
load(lang, value) {
|
|
1046
|
+
AXTranslator.load(lang, value);
|
|
1047
|
+
}
|
|
1048
|
+
use(lang) {
|
|
1049
|
+
AXTranslator.use(lang);
|
|
1050
|
+
}
|
|
1051
|
+
get(key, lang) {
|
|
1052
|
+
return AXTranslator.get(lang, lang);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
AXTranslatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1056
|
+
AXTranslatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorService, providedIn: 'platform' });
|
|
1057
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorService, decorators: [{
|
|
1058
|
+
type: Injectable,
|
|
1059
|
+
args: [{ providedIn: 'platform' }]
|
|
1060
|
+
}] });
|
|
1061
|
+
|
|
1062
|
+
class AXTranslatorPipe {
|
|
1063
|
+
constructor() { }
|
|
1064
|
+
// transform(value: string, lang?: string): Promise<string> {
|
|
1065
|
+
// return new Promise<string>((resolve, reject) => {
|
|
1066
|
+
// if (!value) {
|
|
1067
|
+
// resolve(value);
|
|
1068
|
+
// }
|
|
1069
|
+
// resolve(this.translate.get(value, lang));
|
|
1070
|
+
// });
|
|
1071
|
+
// }
|
|
1072
|
+
transform(value, lang) {
|
|
1073
|
+
return AXTranslator.get(value, lang);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
AXTranslatorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1077
|
+
AXTranslatorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorPipe, name: "trans" });
|
|
1078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorPipe, decorators: [{
|
|
1079
|
+
type: Pipe,
|
|
1080
|
+
args: [{ name: 'trans', pure: true }]
|
|
1081
|
+
}], ctorParameters: function () { return []; } });
|
|
1082
|
+
|
|
1083
|
+
var common$1 = {
|
|
1084
|
+
search: "Search",
|
|
1085
|
+
yes: "yes",
|
|
1086
|
+
no: "No",
|
|
1087
|
+
confirm: "Confirm",
|
|
1088
|
+
okay: "Okay",
|
|
1089
|
+
cancel: "Cancel",
|
|
1090
|
+
remove: "Remove",
|
|
1091
|
+
edit: "Edit",
|
|
1092
|
+
configs: "Configs",
|
|
1093
|
+
noDataFound: "No data found!",
|
|
1094
|
+
searching: "searching ...",
|
|
1095
|
+
save: "Save",
|
|
1096
|
+
"save-as": "Save As...",
|
|
1097
|
+
title: "Title",
|
|
1098
|
+
description: "Description",
|
|
1099
|
+
name: "Name",
|
|
1100
|
+
uniquename: "Unique Name",
|
|
1101
|
+
size: "Size",
|
|
1102
|
+
"add-item": "Add Item",
|
|
1103
|
+
color: "Color",
|
|
1104
|
+
display: "Display",
|
|
1105
|
+
"min-value": "Min Value",
|
|
1106
|
+
value: "Value",
|
|
1107
|
+
"max-value": "Max Value",
|
|
1108
|
+
"refresh-rate": "Refresh Rate",
|
|
1109
|
+
refresh: "Refresh",
|
|
1110
|
+
reload: "Reload",
|
|
1111
|
+
condition: "Condition",
|
|
1112
|
+
next: "Next",
|
|
1113
|
+
prev: "Prev"
|
|
1114
|
+
};
|
|
1115
|
+
var dateTime$1 = {
|
|
1116
|
+
weekdaysShort: {
|
|
1117
|
+
sun: "Sun",
|
|
1118
|
+
mon: "Mon",
|
|
1119
|
+
tue: "Tue",
|
|
1120
|
+
wed: "Wed",
|
|
1121
|
+
thu: "Thu",
|
|
1122
|
+
fri: "Fri",
|
|
1123
|
+
sat: "Sat"
|
|
1124
|
+
},
|
|
1125
|
+
dayTime: {
|
|
1126
|
+
am: "am",
|
|
1127
|
+
pm: "pm",
|
|
1128
|
+
m: "m",
|
|
1129
|
+
a: "a",
|
|
1130
|
+
p: "p"
|
|
1131
|
+
},
|
|
1132
|
+
today: "today",
|
|
1133
|
+
duration: {
|
|
1134
|
+
format_second: "{0} second(s)",
|
|
1135
|
+
format_minute: "{0} minute(s)"
|
|
1136
|
+
}
|
|
1137
|
+
};
|
|
1138
|
+
var queryBuilder$1 = {
|
|
1139
|
+
contains: "contains",
|
|
1140
|
+
"not-contains": "not-contains",
|
|
1141
|
+
"contains-all": "contains-all",
|
|
1142
|
+
"start-with": "start-with",
|
|
1143
|
+
"end-with": "end-with",
|
|
1144
|
+
equal: "equal",
|
|
1145
|
+
"not-equal": "not-equal",
|
|
1146
|
+
"null": "null",
|
|
1147
|
+
"not-null": "not-null",
|
|
1148
|
+
"greater-than": "greater-than",
|
|
1149
|
+
gt: "greater-than",
|
|
1150
|
+
"greater-than-equal": "greater-than-equal",
|
|
1151
|
+
gte: "greater-than-equal",
|
|
1152
|
+
"less-than": "less-than",
|
|
1153
|
+
lt: "less-than",
|
|
1154
|
+
"less-than-equal": "less-than-equal",
|
|
1155
|
+
lte: "less-than-equal",
|
|
1156
|
+
"true": "true",
|
|
1157
|
+
"false": "false",
|
|
1158
|
+
empty: "empty"
|
|
1159
|
+
};
|
|
1160
|
+
var validation$1 = {
|
|
1161
|
+
messages: {
|
|
1162
|
+
required: "This field is required!",
|
|
1163
|
+
email: "Please enter a valid email address!",
|
|
1164
|
+
phone: "Please enter a valid phone number!"
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
var dataGrid$1 = {
|
|
1168
|
+
page: "page",
|
|
1169
|
+
more: "more",
|
|
1170
|
+
to: "To",
|
|
1171
|
+
of: "Of",
|
|
1172
|
+
next: "next",
|
|
1173
|
+
last: "last",
|
|
1174
|
+
first: "first",
|
|
1175
|
+
previous: "previous",
|
|
1176
|
+
loadingOoo: "Loading...",
|
|
1177
|
+
selectAll: "selectAll",
|
|
1178
|
+
searchOoo: "Search...",
|
|
1179
|
+
blanks: "blanks",
|
|
1180
|
+
filterOoo: "Filter...",
|
|
1181
|
+
equals: "Equals",
|
|
1182
|
+
notEqual: "NotEqual",
|
|
1183
|
+
lessThan: "LessThan",
|
|
1184
|
+
greaterThan: "GreaterThan",
|
|
1185
|
+
lessThanOrEqual: "LessThanOrEqual",
|
|
1186
|
+
greaterThanOrEqual: "GreaterThanOrEqual",
|
|
1187
|
+
inRange: "InRange",
|
|
1188
|
+
inRangeStart: "To",
|
|
1189
|
+
inRangeEnd: "From",
|
|
1190
|
+
contains: "Contains",
|
|
1191
|
+
notContains: "NotContains",
|
|
1192
|
+
startsWith: "Starts with",
|
|
1193
|
+
endsWith: "Ends with",
|
|
1194
|
+
andCondition: "AND",
|
|
1195
|
+
orCondition: "OR",
|
|
1196
|
+
applyFilter: "Apply",
|
|
1197
|
+
resetFilter: "Reset",
|
|
1198
|
+
clearFilter: "Clear",
|
|
1199
|
+
group: "Group",
|
|
1200
|
+
columns: "Columns",
|
|
1201
|
+
filters: "Filters",
|
|
1202
|
+
groups: "Groups",
|
|
1203
|
+
values: "Values",
|
|
1204
|
+
enabled: "Enabled",
|
|
1205
|
+
pinColumn: "Pin Column",
|
|
1206
|
+
groupBy: "Group by",
|
|
1207
|
+
ungroupBy: "UnGroup by",
|
|
1208
|
+
resetColumns: "ResetColumns",
|
|
1209
|
+
expandAll: "ExpandAll",
|
|
1210
|
+
collapseAll: "CollapseAll",
|
|
1211
|
+
toolPanel: "ToolPanel",
|
|
1212
|
+
"export": "Exporto",
|
|
1213
|
+
csvExport: "csv Export",
|
|
1214
|
+
excelExport: "Excel Export (.xlsx)",
|
|
1215
|
+
excelXmlExport: "Excel Exporto (.xml)",
|
|
1216
|
+
chartRange: "Chart Range",
|
|
1217
|
+
columnChart: "Column",
|
|
1218
|
+
groupedColumn: "Grouped",
|
|
1219
|
+
stackedColumn: "Stacked",
|
|
1220
|
+
normalizedColumn: "normalized Column",
|
|
1221
|
+
barChart: "bar Chart",
|
|
1222
|
+
groupedBar: "Grouped",
|
|
1223
|
+
stackedBar: "Stacked",
|
|
1224
|
+
normalizedBar: "normalized Bar",
|
|
1225
|
+
pie: "Pie",
|
|
1226
|
+
doughnut: "Doughnut",
|
|
1227
|
+
line: "Line",
|
|
1228
|
+
xyChart: "X Y (Scatter)",
|
|
1229
|
+
scatter: "Scatter",
|
|
1230
|
+
bubble: "Bubble",
|
|
1231
|
+
areaChart: "Area",
|
|
1232
|
+
area: "Area",
|
|
1233
|
+
stackedArea: "Stacked",
|
|
1234
|
+
normalizedArea: "100% Stacked",
|
|
1235
|
+
histogramChart: "Histogram",
|
|
1236
|
+
pinLeft: "Pin Left",
|
|
1237
|
+
pinRight: "Pin Right",
|
|
1238
|
+
noPin: "Dont Pin",
|
|
1239
|
+
sum: "Sum",
|
|
1240
|
+
min: "Min",
|
|
1241
|
+
max: "Max",
|
|
1242
|
+
none: "None",
|
|
1243
|
+
count: "Count",
|
|
1244
|
+
avg: "Average",
|
|
1245
|
+
filteredRows: "Filtered",
|
|
1246
|
+
selectedRows: "Selected",
|
|
1247
|
+
totalRows: "Total Rows",
|
|
1248
|
+
totalAndFilteredRows: "Rows",
|
|
1249
|
+
copy: "Copy",
|
|
1250
|
+
copyWithHeaders: "Copy With Headers",
|
|
1251
|
+
ctrlC: "Ctrl C",
|
|
1252
|
+
paste: "Paste",
|
|
1253
|
+
ctrlV: "Ctrl V",
|
|
1254
|
+
pivotChartTitle: "Pivot Chart",
|
|
1255
|
+
rangeChartTitle: "Range Chart",
|
|
1256
|
+
settings: "Settings",
|
|
1257
|
+
data: "Data",
|
|
1258
|
+
format: "Format",
|
|
1259
|
+
categories: "Categories",
|
|
1260
|
+
series: "Series",
|
|
1261
|
+
xyValues: "X Y Values",
|
|
1262
|
+
paired: "Paired Mode",
|
|
1263
|
+
axis: "Axis",
|
|
1264
|
+
color: "Color",
|
|
1265
|
+
thickness: "Thickness",
|
|
1266
|
+
xType: "X Type",
|
|
1267
|
+
automatic: "Automatic",
|
|
1268
|
+
category: "Category",
|
|
1269
|
+
number: "Number",
|
|
1270
|
+
time: "Time",
|
|
1271
|
+
xRotation: "X Rotation",
|
|
1272
|
+
yRotation: "Y Rotation",
|
|
1273
|
+
ticks: "Ticks",
|
|
1274
|
+
width: "Width",
|
|
1275
|
+
length: "Length",
|
|
1276
|
+
padding: "Padding",
|
|
1277
|
+
chart: "Chart",
|
|
1278
|
+
title: "Title",
|
|
1279
|
+
background: "Background",
|
|
1280
|
+
font: "Font",
|
|
1281
|
+
top: "Top",
|
|
1282
|
+
right: "Right",
|
|
1283
|
+
bottom: "Bottom",
|
|
1284
|
+
left: "Left",
|
|
1285
|
+
labels: "Labels",
|
|
1286
|
+
size: "Size",
|
|
1287
|
+
minSize: "Minimum Size",
|
|
1288
|
+
maxSize: "Maximum Size",
|
|
1289
|
+
legend: "Legend",
|
|
1290
|
+
position: "Position",
|
|
1291
|
+
markerSize: "Marker Size",
|
|
1292
|
+
markerStroke: "Marker Stroke",
|
|
1293
|
+
markerPadding: "Marker Padding",
|
|
1294
|
+
itemPaddingX: "Item Padding X",
|
|
1295
|
+
itemPaddingY: "Item Padding Y",
|
|
1296
|
+
strokeWidth: "Stroke Width",
|
|
1297
|
+
offset: "Offset",
|
|
1298
|
+
offsets: "Offsets",
|
|
1299
|
+
tooltips: "Tooltips",
|
|
1300
|
+
callout: "Callout",
|
|
1301
|
+
markers: "Markers",
|
|
1302
|
+
shadow: "Shadow",
|
|
1303
|
+
blur: "Blur",
|
|
1304
|
+
xOffset: "X Offset",
|
|
1305
|
+
yOffset: "Y Offset",
|
|
1306
|
+
lineWidth: "Line Width",
|
|
1307
|
+
normal: "Normal",
|
|
1308
|
+
bold: "Bold",
|
|
1309
|
+
italic: "Italic",
|
|
1310
|
+
boldItalic: "Bold Italic",
|
|
1311
|
+
predefined: "Predefined",
|
|
1312
|
+
fillOpacity: "Fill Opacity",
|
|
1313
|
+
strokeOpacity: "Line Opacity",
|
|
1314
|
+
histogramBinCount: "Bin Count",
|
|
1315
|
+
columnGroup: "Column",
|
|
1316
|
+
barGroup: "Bar",
|
|
1317
|
+
pieGroup: "Pie",
|
|
1318
|
+
lineGroup: "Line",
|
|
1319
|
+
scatterGroup: "Scatter",
|
|
1320
|
+
areaGroup: "Area",
|
|
1321
|
+
histogramGroup: "Histogram",
|
|
1322
|
+
groupedColumnTooltip: "Grouped",
|
|
1323
|
+
stackedColumnTooltip: "Stacked",
|
|
1324
|
+
normalizedColumnTooltip: "100% Stacked",
|
|
1325
|
+
groupedBarTooltip: "Grouped",
|
|
1326
|
+
stackedBarTooltip: "Stacked",
|
|
1327
|
+
pieTooltip: "Pie",
|
|
1328
|
+
doughnutTooltip: "Doughnut",
|
|
1329
|
+
lineTooltip: "Line",
|
|
1330
|
+
groupedAreaTooltip: "Grouped",
|
|
1331
|
+
stackedAreaTooltip: "Stacked",
|
|
1332
|
+
scatterTooltip: "Scatter",
|
|
1333
|
+
bubbleTooltip: "Bubble",
|
|
1334
|
+
histogramTooltip: "Histogram"
|
|
1335
|
+
};
|
|
1336
|
+
var en = {
|
|
1337
|
+
common: common$1,
|
|
1338
|
+
dateTime: dateTime$1,
|
|
1339
|
+
queryBuilder: queryBuilder$1,
|
|
1340
|
+
validation: validation$1,
|
|
1341
|
+
dataGrid: dataGrid$1
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
var en$1 = /*#__PURE__*/Object.freeze({
|
|
1345
|
+
__proto__: null,
|
|
1346
|
+
common: common$1,
|
|
1347
|
+
dateTime: dateTime$1,
|
|
1348
|
+
queryBuilder: queryBuilder$1,
|
|
1349
|
+
validation: validation$1,
|
|
1350
|
+
dataGrid: dataGrid$1,
|
|
1351
|
+
'default': en
|
|
1352
|
+
});
|
|
1353
|
+
|
|
1354
|
+
var common = {
|
|
1355
|
+
search: "جستجو",
|
|
1356
|
+
yes: "بله",
|
|
1357
|
+
no: "خیر",
|
|
1358
|
+
confirm: "تایید",
|
|
1359
|
+
okay: "تایید",
|
|
1360
|
+
cancel: "انصراف",
|
|
1361
|
+
remove: "حذف",
|
|
1362
|
+
edit: "ویرایش",
|
|
1363
|
+
configs: "پیکربندی",
|
|
1364
|
+
noDataFound: "موردی یافت نشد!",
|
|
1365
|
+
searching: "درحال جستجو ...",
|
|
1366
|
+
"save-as": "ذخیره به عنوان ...",
|
|
1367
|
+
title: "عنوان",
|
|
1368
|
+
description: "توضیحات",
|
|
1369
|
+
name: "نام",
|
|
1370
|
+
uniquename: "نام شناسه یکتا",
|
|
1371
|
+
size: "اندازه",
|
|
1372
|
+
"add-item": "افزودن",
|
|
1373
|
+
color: "رنگ",
|
|
1374
|
+
display: "نمایش",
|
|
1375
|
+
value: "مقدار",
|
|
1376
|
+
"min-value": "مقدار کمینه",
|
|
1377
|
+
"max-value": "مقدار بیشینه",
|
|
1378
|
+
"refresh-rate": "نرخ بروز رسانی",
|
|
1379
|
+
refresh: "بروز رسانی",
|
|
1380
|
+
reload: "بارگزاری مجدد",
|
|
1381
|
+
condition: "شرط",
|
|
1382
|
+
next: "بعدی",
|
|
1383
|
+
prev: "قبلی"
|
|
1384
|
+
};
|
|
1385
|
+
var dateTime = {
|
|
1386
|
+
weekdaysShort: {
|
|
1387
|
+
sun: "ی",
|
|
1388
|
+
mon: "د",
|
|
1389
|
+
tue: "س",
|
|
1390
|
+
wed: "چ",
|
|
1391
|
+
thu: "پ",
|
|
1392
|
+
fri: "ج",
|
|
1393
|
+
sat: "ش"
|
|
1394
|
+
},
|
|
1395
|
+
dayTime: {
|
|
1396
|
+
am: "ق ظ",
|
|
1397
|
+
pm: "ب ظُ",
|
|
1398
|
+
m: ".ظ",
|
|
1399
|
+
a: "ق",
|
|
1400
|
+
p: "ب"
|
|
1401
|
+
},
|
|
1402
|
+
today: "امروز",
|
|
1403
|
+
duration: {
|
|
1404
|
+
format_second: "{0} ثانیه",
|
|
1405
|
+
format_minute: "{0} دقیقه"
|
|
1406
|
+
}
|
|
1407
|
+
};
|
|
1408
|
+
var queryBuilder = {
|
|
1409
|
+
contains: "شامل",
|
|
1410
|
+
"not-contains": "به غیر از",
|
|
1411
|
+
"contains-all": "شامل همه",
|
|
1412
|
+
"start-with": "شروع شود با",
|
|
1413
|
+
"end-with": "پایان با",
|
|
1414
|
+
equal: "برابر با",
|
|
1415
|
+
"not-equal": "نا برابر با",
|
|
1416
|
+
"null": " خالی باشد",
|
|
1417
|
+
"not-null": "خالی نباشد",
|
|
1418
|
+
"greater-than": "بزرگ تر",
|
|
1419
|
+
gt: "بزرگ تر",
|
|
1420
|
+
"greater-than-equal": "بزرگتر مساوی",
|
|
1421
|
+
gte: "بزرگتر مساوی",
|
|
1422
|
+
"less-than": "کوچکتر",
|
|
1423
|
+
lt: "کوچکتر",
|
|
1424
|
+
"less-than-equal": "کوچکتر مساوی",
|
|
1425
|
+
lte: "کوچکتر مساوی",
|
|
1426
|
+
"true": "true",
|
|
1427
|
+
"false": "false"
|
|
1428
|
+
};
|
|
1429
|
+
var validation = {
|
|
1430
|
+
messages: {
|
|
1431
|
+
required: "مقدار این فیلد الزامی می باشد!",
|
|
1432
|
+
email: "این آدرس ایمیل معتبر نمی باشد!",
|
|
1433
|
+
phone: "این شماره تلفن معتبر نمی باشد!"
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
var dataGrid = {
|
|
1437
|
+
page: "صفحه",
|
|
1438
|
+
more: "بیشتر",
|
|
1439
|
+
to: "تا",
|
|
1440
|
+
of: "از",
|
|
1441
|
+
next: "بعدی",
|
|
1442
|
+
last: "آخرین",
|
|
1443
|
+
first: "اولین",
|
|
1444
|
+
previous: "قبلی",
|
|
1445
|
+
loadingOoo: "... لطفا منتظر بمانید",
|
|
1446
|
+
selectAll: "انتخاب همه",
|
|
1447
|
+
searchOoo: "جستجو ...",
|
|
1448
|
+
blanks: "جای خالی",
|
|
1449
|
+
filterOoo: "فیلتر ...",
|
|
1450
|
+
equals: "برابر",
|
|
1451
|
+
notEqual: "نابرابر",
|
|
1452
|
+
lessThan: "کوچکتر از",
|
|
1453
|
+
greaterThan: "بزرگتر از",
|
|
1454
|
+
lessThanOrEqual: "کوچکتر مساوی",
|
|
1455
|
+
greaterThanOrEqual: "بزرکتر مساوی",
|
|
1456
|
+
inRange: "در محدوده",
|
|
1457
|
+
inRangeStart: "تا",
|
|
1458
|
+
inRangeEnd: "از",
|
|
1459
|
+
contains: "شامل",
|
|
1460
|
+
notContains: "شامل نمی شود",
|
|
1461
|
+
startsWith: "شروع شود با",
|
|
1462
|
+
endsWith: "پایان با",
|
|
1463
|
+
andCondition: "و",
|
|
1464
|
+
orCondition: "یا",
|
|
1465
|
+
applyFilter: "اعمال",
|
|
1466
|
+
resetFilter: "تنظیم مجدد فیلتر",
|
|
1467
|
+
clearFilter: "پاک کردن فیلتر",
|
|
1468
|
+
group: "گروه",
|
|
1469
|
+
columns: "ستون ها",
|
|
1470
|
+
filters: "فیاتر ها",
|
|
1471
|
+
groups: "گروه ها ",
|
|
1472
|
+
values: "مقدار ها",
|
|
1473
|
+
enabled: "فعال شده",
|
|
1474
|
+
pinColumn: "سنجاق",
|
|
1475
|
+
groupBy: "دسته بندی بر اساس",
|
|
1476
|
+
ungroupBy: "حذف دسته بندی",
|
|
1477
|
+
resetColumns: "تنظیم مجدد ستون ها",
|
|
1478
|
+
expandAll: "باز کردن همه",
|
|
1479
|
+
collapseAll: "بستن همه",
|
|
1480
|
+
toolPanel: "پنل ابزار",
|
|
1481
|
+
"export": "خروجی",
|
|
1482
|
+
csvExport: "csv خروجی",
|
|
1483
|
+
excelExport: "خروجی اکسل (.xlsx)",
|
|
1484
|
+
excelXmlExport: "خروجی اکسل (.xml)",
|
|
1485
|
+
chartRange: "محدوده نمودار",
|
|
1486
|
+
columnChart: "ستون",
|
|
1487
|
+
groupedColumn: "دسته بندی شده",
|
|
1488
|
+
stackedColumn: "انباشته",
|
|
1489
|
+
normalizedColumn: "ستون نرمال",
|
|
1490
|
+
barChart: "نمودار میله ای",
|
|
1491
|
+
groupedBar: "دسته بندی شده",
|
|
1492
|
+
stackedBar: "انباشته",
|
|
1493
|
+
normalizedBar: "نوار ",
|
|
1494
|
+
pie: "پای",
|
|
1495
|
+
doughnut: "Doughnut",
|
|
1496
|
+
line: "خط",
|
|
1497
|
+
xyChart: "X Y (پراکندگی)",
|
|
1498
|
+
scatter: "پراکندگی",
|
|
1499
|
+
bubble: "حباب",
|
|
1500
|
+
areaChart: "حوزه",
|
|
1501
|
+
area: "حوزه",
|
|
1502
|
+
stackedArea: "انباشته ",
|
|
1503
|
+
normalizedArea: "100% انباشته",
|
|
1504
|
+
histogramChart: "هیستوگرام",
|
|
1505
|
+
pinLeft: "سنجاق چپ",
|
|
1506
|
+
pinRight: "سنجاق راست",
|
|
1507
|
+
noPin: "حذف سنجاق",
|
|
1508
|
+
sum: "مجموع",
|
|
1509
|
+
min: "مینیمم",
|
|
1510
|
+
max: "ماکزیمم",
|
|
1511
|
+
none: "هیچ",
|
|
1512
|
+
count: "شمردن",
|
|
1513
|
+
avg: "میانگین",
|
|
1514
|
+
filteredRows: "فیلتر شده",
|
|
1515
|
+
selectedRows: "انتخاب شده",
|
|
1516
|
+
totalRows: "مجموع ردیف ها",
|
|
1517
|
+
totalAndFilteredRows: "سطر ها",
|
|
1518
|
+
copy: "کپی",
|
|
1519
|
+
copyWithHeaders: "کپی با هدر ها",
|
|
1520
|
+
ctrlC: "Ctrl C",
|
|
1521
|
+
paste: "جایگزینی",
|
|
1522
|
+
ctrlV: "Ctrl V",
|
|
1523
|
+
pivotChartTitle: "نمودار محوری",
|
|
1524
|
+
rangeChartTitle: "نمودار محدوده",
|
|
1525
|
+
settings: "تنظیمات",
|
|
1526
|
+
data: "تاریخ",
|
|
1527
|
+
format: "قالب",
|
|
1528
|
+
categories: "دسته بندی ها",
|
|
1529
|
+
series: "Series",
|
|
1530
|
+
xyValues: "X Y مقادیر",
|
|
1531
|
+
paired: "حالت زوج",
|
|
1532
|
+
axis: "محور",
|
|
1533
|
+
color: "رنگ",
|
|
1534
|
+
thickness: "ضخامت",
|
|
1535
|
+
xType: "X Type",
|
|
1536
|
+
automatic: "خودکار",
|
|
1537
|
+
category: "دسته بندی",
|
|
1538
|
+
number: "عدد",
|
|
1539
|
+
time: "زمان",
|
|
1540
|
+
xRotation: "X چرخش",
|
|
1541
|
+
yRotation: "Y چرخش",
|
|
1542
|
+
ticks: "نمادها",
|
|
1543
|
+
width: "عرض",
|
|
1544
|
+
length: "طول",
|
|
1545
|
+
padding: "لایه گزاری",
|
|
1546
|
+
chart: "جدول",
|
|
1547
|
+
title: "عنوان",
|
|
1548
|
+
background: "زمینه",
|
|
1549
|
+
font: "فونت",
|
|
1550
|
+
top: "بالا",
|
|
1551
|
+
right: "راست",
|
|
1552
|
+
bottom: "پایین",
|
|
1553
|
+
left: "چپ",
|
|
1554
|
+
labels: "برچسب",
|
|
1555
|
+
size: "اندازه",
|
|
1556
|
+
minSize: "حداقل اندازه",
|
|
1557
|
+
maxSize: "بیشترین اندازه",
|
|
1558
|
+
position: "موقعیت",
|
|
1559
|
+
markerSize: "اندازه نشانگر",
|
|
1560
|
+
callout: "فراخوان",
|
|
1561
|
+
markers: "نشانه گرها",
|
|
1562
|
+
shadow: "سایه",
|
|
1563
|
+
blur: "محو شدن",
|
|
1564
|
+
xOffset: "X انحراف",
|
|
1565
|
+
yOffset: "Y انحراف",
|
|
1566
|
+
lineWidth: "عرض خط",
|
|
1567
|
+
normal: "نرمال",
|
|
1568
|
+
italic: "Italic",
|
|
1569
|
+
boldItalic: "Bold Italic",
|
|
1570
|
+
predefined: "Predefined",
|
|
1571
|
+
fillOpacity: "Fill Opacity",
|
|
1572
|
+
strokeOpacity: "Line Opacity",
|
|
1573
|
+
histogramBinCount: "Bin Count",
|
|
1574
|
+
columnGroup: "ستون",
|
|
1575
|
+
barGroup: "Bar",
|
|
1576
|
+
pieGroup: "Pie",
|
|
1577
|
+
lineGroup: "خط",
|
|
1578
|
+
areaGroup: "حوزه",
|
|
1579
|
+
histogramGroup: "هیستوگرام",
|
|
1580
|
+
groupedColumnTooltip: "دسته بندی شده",
|
|
1581
|
+
stackedColumnTooltip: "Stacked",
|
|
1582
|
+
normalizedColumnTooltip: "100% Stacked",
|
|
1583
|
+
groupedBarTooltip: "دسته بندی شده",
|
|
1584
|
+
stackedBarTooltip: "Stacked",
|
|
1585
|
+
pieTooltip: "Pie",
|
|
1586
|
+
doughnutTooltip: "Doughnut",
|
|
1587
|
+
lineTooltip: "خط",
|
|
1588
|
+
groupedAreaTooltip: "گروه بندی شده",
|
|
1589
|
+
stackedAreaTooltip: "Stacked",
|
|
1590
|
+
scatterTooltip: "Scatter",
|
|
1591
|
+
bubbleTooltip: "حباب",
|
|
1592
|
+
histogramTooltip: "هیستوگرام",
|
|
1593
|
+
autosizeThiscolumn: "تنظیم اندازه ستون ",
|
|
1594
|
+
autosizeAllColumns: "تنظیم اندازه همه ستون ها"
|
|
1595
|
+
};
|
|
1596
|
+
var fa = {
|
|
1597
|
+
common: common,
|
|
1598
|
+
dateTime: dateTime,
|
|
1599
|
+
queryBuilder: queryBuilder,
|
|
1600
|
+
validation: validation,
|
|
1601
|
+
dataGrid: dataGrid
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1604
|
+
var fa$1 = /*#__PURE__*/Object.freeze({
|
|
1605
|
+
__proto__: null,
|
|
1606
|
+
common: common,
|
|
1607
|
+
dateTime: dateTime,
|
|
1608
|
+
queryBuilder: queryBuilder,
|
|
1609
|
+
validation: validation,
|
|
1610
|
+
dataGrid: dataGrid,
|
|
1611
|
+
'default': fa
|
|
1612
|
+
});
|
|
1613
|
+
|
|
1614
|
+
class AXTranslatorModule {
|
|
1615
|
+
constructor() {
|
|
1616
|
+
AXTranslator.load('en', en$1);
|
|
1617
|
+
AXTranslator.load('fa', fa$1);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
AXTranslatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1621
|
+
AXTranslatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] });
|
|
1622
|
+
AXTranslatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorModule, providers: [], imports: [[]] });
|
|
1623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXTranslatorModule, decorators: [{
|
|
1624
|
+
type: NgModule,
|
|
1625
|
+
args: [{
|
|
1626
|
+
imports: [],
|
|
1627
|
+
exports: [AXTranslatorPipe],
|
|
1628
|
+
declarations: [AXTranslatorPipe],
|
|
1629
|
+
providers: [],
|
|
1630
|
+
}]
|
|
1631
|
+
}], ctorParameters: function () { return []; } });
|
|
1632
|
+
|
|
1633
|
+
// @dynamic
|
|
1634
|
+
class AXArrayUtil {
|
|
1635
|
+
static pickRandom(array) {
|
|
1636
|
+
return array[Math.floor(Math.random() * array.length)];
|
|
1637
|
+
}
|
|
1638
|
+
static insert(array, index, ...rest) {
|
|
1639
|
+
array.splice.apply(array, [index, 0].concat(Array.prototype.slice.call(rest, 1)));
|
|
1640
|
+
return array;
|
|
1641
|
+
}
|
|
1642
|
+
static range(min, max) {
|
|
1643
|
+
return new Array(max - min).fill(1).map((d, i) => i);
|
|
1644
|
+
}
|
|
1645
|
+
static filter(array, filters) {
|
|
1646
|
+
if (filters == null || filters.length === 0) {
|
|
1647
|
+
return array;
|
|
1648
|
+
}
|
|
1649
|
+
const lamda = (item) => {
|
|
1650
|
+
let result = true;
|
|
1651
|
+
for (const key in filters) {
|
|
1652
|
+
if (filters.hasOwnProperty(key)) {
|
|
1653
|
+
const f = filters[key];
|
|
1654
|
+
if (f !== 'AND') {
|
|
1655
|
+
const vals = [];
|
|
1656
|
+
const mt = f.field.match(/\[\:(.*?)\]/);
|
|
1657
|
+
if (mt && mt.length > 1) {
|
|
1658
|
+
const p1 = f.field.replace(mt[0], '');
|
|
1659
|
+
const p2 = mt[1];
|
|
1660
|
+
const prop = AXFetchProp(item, p1);
|
|
1661
|
+
if (prop instanceof Array && prop.length) {
|
|
1662
|
+
vals.push(...prop.map(m => (AXFetchProp(m, p2))));
|
|
1663
|
+
}
|
|
1664
|
+
else {
|
|
1665
|
+
result = false;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
else {
|
|
1669
|
+
vals.push(AXFetchProp(item, f.field));
|
|
1670
|
+
}
|
|
1671
|
+
for (const j in vals) {
|
|
1672
|
+
if (vals.hasOwnProperty(j)) {
|
|
1673
|
+
let v1 = vals[j];
|
|
1674
|
+
const v2 = f.value;
|
|
1675
|
+
if (f.dataType === 'string') {
|
|
1676
|
+
v1 = v1.toString();
|
|
1677
|
+
switch (f.condition) {
|
|
1678
|
+
case 'equal':
|
|
1679
|
+
result = (v1 && v2) && v1.toLowerCase() === v2.toLowerCase();
|
|
1680
|
+
break;
|
|
1681
|
+
case 'not-equal':
|
|
1682
|
+
result = !((v1 && v2) && v1.toLowerCase() === v2.toLowerCase());
|
|
1683
|
+
break;
|
|
1684
|
+
case 'contains':
|
|
1685
|
+
result = ((v1 && v2) && (v1.toLowerCase().includes(v2.toLowerCase())));
|
|
1686
|
+
break;
|
|
1687
|
+
case 'not-contains':
|
|
1688
|
+
result = !((v1 && v2) && (v1.toLowerCase().includes(v2.toLowerCase())));
|
|
1689
|
+
break;
|
|
1690
|
+
case 'start-with':
|
|
1691
|
+
result = ((v1 && v2) && (v1.toLowerCase().startsWith(v2.toLowerCase())));
|
|
1692
|
+
break;
|
|
1693
|
+
case 'end-with':
|
|
1694
|
+
result = ((v1 && v2) && (v1.toLowerCase().endsWith(v2.toLowerCase())));
|
|
1695
|
+
break;
|
|
1696
|
+
case 'is-empty':
|
|
1697
|
+
result = v1 == null || v1 === undefined;
|
|
1698
|
+
break;
|
|
1699
|
+
case 'is-not-empty':
|
|
1700
|
+
result = !(v1 == null || v1 === undefined);
|
|
1701
|
+
break;
|
|
1702
|
+
default:
|
|
1703
|
+
console.error('The condition is not defined');
|
|
1704
|
+
result = false;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
else if (f.dataType === 'date') {
|
|
1708
|
+
}
|
|
1709
|
+
else if (f.dataType === 'number') {
|
|
1710
|
+
v1 = Number(v1);
|
|
1711
|
+
switch (f.condition) {
|
|
1712
|
+
case 'equal':
|
|
1713
|
+
result = v1 === v2;
|
|
1714
|
+
break;
|
|
1715
|
+
case 'not-equal':
|
|
1716
|
+
result = v1 !== v2;
|
|
1717
|
+
break;
|
|
1718
|
+
case 'contains':
|
|
1719
|
+
result = v2 && v2 instanceof Array && v2.includes(v1);
|
|
1720
|
+
break;
|
|
1721
|
+
case 'less-than':
|
|
1722
|
+
result = v1 < v2;
|
|
1723
|
+
break;
|
|
1724
|
+
case 'less-than-equal':
|
|
1725
|
+
result = v1 <= v2;
|
|
1726
|
+
break;
|
|
1727
|
+
case 'greater-than':
|
|
1728
|
+
result = v1 > v2;
|
|
1729
|
+
break;
|
|
1730
|
+
case 'greater-than-equal':
|
|
1731
|
+
result = v1 >= v2;
|
|
1732
|
+
break;
|
|
1733
|
+
case 'is-empty':
|
|
1734
|
+
result = v1 == null || v1 === undefined;
|
|
1735
|
+
break;
|
|
1736
|
+
case 'is-not-empty':
|
|
1737
|
+
result = !(v1 == null || v1 === undefined);
|
|
1738
|
+
break;
|
|
1739
|
+
default:
|
|
1740
|
+
console.error('The condition is not defined');
|
|
1741
|
+
result = false;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
else {
|
|
1745
|
+
console.error('The datatype is not supported');
|
|
1746
|
+
result = false;
|
|
1747
|
+
}
|
|
1748
|
+
if (result) {
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
if (!result) {
|
|
1755
|
+
return false;
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
return true;
|
|
1760
|
+
};
|
|
1761
|
+
return array.filter(lamda);
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
class AXMathUtil {
|
|
1766
|
+
static randomRange(min, max) {
|
|
1767
|
+
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
class AXPoint {
|
|
1772
|
+
constructor(x, y) {
|
|
1773
|
+
this.x = x;
|
|
1774
|
+
this.y = y;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
class AXClientRec {
|
|
1778
|
+
constructor(rec) {
|
|
1779
|
+
this._left = rec.left;
|
|
1780
|
+
this._top = rec.top;
|
|
1781
|
+
this._width = rec.width;
|
|
1782
|
+
this._height = rec.height;
|
|
1783
|
+
this._right = this._left + this._width;
|
|
1784
|
+
this._bottom = this._top + this._height;
|
|
1785
|
+
}
|
|
1786
|
+
get left() {
|
|
1787
|
+
return this._left;
|
|
1788
|
+
}
|
|
1789
|
+
set left(v) {
|
|
1790
|
+
this._left = v;
|
|
1791
|
+
}
|
|
1792
|
+
get top() {
|
|
1793
|
+
return this._top;
|
|
1794
|
+
}
|
|
1795
|
+
set top(v) {
|
|
1796
|
+
this._top = v;
|
|
1797
|
+
}
|
|
1798
|
+
get right() {
|
|
1799
|
+
return this._right;
|
|
1800
|
+
}
|
|
1801
|
+
set right(v) {
|
|
1802
|
+
this._right = v;
|
|
1803
|
+
}
|
|
1804
|
+
get bottom() {
|
|
1805
|
+
return this._bottom;
|
|
1806
|
+
}
|
|
1807
|
+
set bottom(v) {
|
|
1808
|
+
this._bottom = v;
|
|
1809
|
+
}
|
|
1810
|
+
get width() {
|
|
1811
|
+
return this._width;
|
|
1812
|
+
}
|
|
1813
|
+
set width(v) {
|
|
1814
|
+
this._width = v;
|
|
1815
|
+
}
|
|
1816
|
+
get height() {
|
|
1817
|
+
return this._height;
|
|
1818
|
+
}
|
|
1819
|
+
set height(v) {
|
|
1820
|
+
this._height = v;
|
|
1821
|
+
}
|
|
1822
|
+
intersect(rec) {
|
|
1823
|
+
return (this.left < rec.left + rec.width &&
|
|
1824
|
+
this.left + this.width > rec.left &&
|
|
1825
|
+
this.top < rec.top + rec.height &&
|
|
1826
|
+
this.top + this.height > rec.top);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
// @dynamic
|
|
1830
|
+
class AXHtmlUtil {
|
|
1831
|
+
static getBoundingRectPoint(el, placement) {
|
|
1832
|
+
const rec = el.getBoundingClientRect();
|
|
1833
|
+
const width = el.offsetWidth;
|
|
1834
|
+
const height = el.offsetHeight;
|
|
1835
|
+
switch (placement) {
|
|
1836
|
+
case 'top-start':
|
|
1837
|
+
return new AXPoint(rec.left, rec.top);
|
|
1838
|
+
case 'top-middle':
|
|
1839
|
+
return new AXPoint(rec.left + (width / 2), rec.top);
|
|
1840
|
+
case 'top-end':
|
|
1841
|
+
return new AXPoint(rec.left + (width), rec.top);
|
|
1842
|
+
case 'center-end':
|
|
1843
|
+
return new AXPoint(rec.left + (width), rec.top + (height / 2));
|
|
1844
|
+
case 'bottom-end':
|
|
1845
|
+
return new AXPoint(rec.left + (width), rec.top + (height));
|
|
1846
|
+
case 'bottom-middle':
|
|
1847
|
+
return new AXPoint(rec.left + (width / 2), rec.top + (height));
|
|
1848
|
+
case 'bottom-start':
|
|
1849
|
+
return new AXPoint(rec.left, rec.top + (height));
|
|
1850
|
+
case 'center-start':
|
|
1851
|
+
return new AXPoint(rec.left, rec.top + (height / 2));
|
|
1852
|
+
default:
|
|
1853
|
+
return new AXPoint(rec.left + (width / 2), rec.top + (height));
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
static isInRecPoint(pos, rec) {
|
|
1857
|
+
return pos.x >= rec.left && pos.x <= (rec.left + rec.width) && pos.y >= rec.top && (pos.y <= (rec.top + rec.height));
|
|
1858
|
+
}
|
|
1859
|
+
// static isOverLap(rec1: AXClientRecCtor, rec2: AXClientRecCtor): boolean {
|
|
1860
|
+
// const r1: AXClientRec = new AXClientRec(rec1);
|
|
1861
|
+
// const r2: AXClientRec = new AXClientRec(rec2);
|
|
1862
|
+
// return ;
|
|
1863
|
+
// }
|
|
1864
|
+
static isInElementBound(pos, element) {
|
|
1865
|
+
const elBound = element.getBoundingClientRect();
|
|
1866
|
+
return AXHtmlUtil.isInRecPoint(pos, {
|
|
1867
|
+
left: elBound.left,
|
|
1868
|
+
width: elBound.width,
|
|
1869
|
+
top: elBound.top,
|
|
1870
|
+
height: elBound.height
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
static getDimensions() {
|
|
1874
|
+
let winW = 630;
|
|
1875
|
+
let winH = 460;
|
|
1876
|
+
if (document.body && document.body.offsetWidth) {
|
|
1877
|
+
winW = document.body.offsetWidth;
|
|
1878
|
+
winH = document.body.offsetHeight;
|
|
1879
|
+
}
|
|
1880
|
+
if (document.compatMode === 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) {
|
|
1881
|
+
winW = document.documentElement.offsetWidth;
|
|
1882
|
+
winH = document.documentElement.offsetHeight;
|
|
1883
|
+
}
|
|
1884
|
+
if (window.innerWidth && window.innerHeight) {
|
|
1885
|
+
winW = window.innerWidth;
|
|
1886
|
+
winH = window.innerHeight;
|
|
1887
|
+
}
|
|
1888
|
+
return { width: winW, height: winH };
|
|
1889
|
+
}
|
|
1890
|
+
static getOffsetRight(elem) {
|
|
1891
|
+
let element = elem;
|
|
1892
|
+
const width = element.offsetWidth;
|
|
1893
|
+
let right = 0;
|
|
1894
|
+
while (element.offsetParent) {
|
|
1895
|
+
right += element.offsetLeft;
|
|
1896
|
+
element = element.offsetParent;
|
|
1897
|
+
}
|
|
1898
|
+
right += element.offsetLeft;
|
|
1899
|
+
right = AXHtmlUtil.getDimensions().width - right;
|
|
1900
|
+
right -= width;
|
|
1901
|
+
return right;
|
|
1902
|
+
}
|
|
1903
|
+
static getUID() {
|
|
1904
|
+
return 'el-' + AXMathUtil.randomRange(1000000000, 9999999999).toString();
|
|
1905
|
+
}
|
|
1906
|
+
static getRelatedPosition(source, placement, target, alignment) {
|
|
1907
|
+
const result = { x: 0, y: 0 };
|
|
1908
|
+
const sourcePos = AXHtmlUtil.getBoundingRectPoint(source, placement);
|
|
1909
|
+
let top = 0;
|
|
1910
|
+
let left = 0;
|
|
1911
|
+
switch (alignment) {
|
|
1912
|
+
case 'top-start':
|
|
1913
|
+
top = sourcePos.y;
|
|
1914
|
+
left = sourcePos.x;
|
|
1915
|
+
break;
|
|
1916
|
+
case 'top-middle':
|
|
1917
|
+
top = sourcePos.y;
|
|
1918
|
+
left = sourcePos.x - target.offsetWidth / 2;
|
|
1919
|
+
break;
|
|
1920
|
+
case 'top-end':
|
|
1921
|
+
top = sourcePos.y;
|
|
1922
|
+
left = sourcePos.x - target.offsetWidth;
|
|
1923
|
+
break;
|
|
1924
|
+
case 'center-end':
|
|
1925
|
+
top = sourcePos.y - target.offsetHeight / 2;
|
|
1926
|
+
left = sourcePos.x - target.offsetWidth;
|
|
1927
|
+
break;
|
|
1928
|
+
case 'bottom-end':
|
|
1929
|
+
top = sourcePos.y - target.offsetHeight;
|
|
1930
|
+
left = sourcePos.x - target.offsetWidth;
|
|
1931
|
+
break;
|
|
1932
|
+
case 'bottom-middle':
|
|
1933
|
+
top = sourcePos.y - target.offsetHeight;
|
|
1934
|
+
left = sourcePos.x - target.offsetWidth / 2;
|
|
1935
|
+
break;
|
|
1936
|
+
case 'bottom-start':
|
|
1937
|
+
top = sourcePos.y - target.offsetHeight;
|
|
1938
|
+
left = sourcePos.x;
|
|
1939
|
+
break;
|
|
1940
|
+
case 'center-start':
|
|
1941
|
+
top = sourcePos.y - target.offsetHeight / 2;
|
|
1942
|
+
left = sourcePos.x;
|
|
1943
|
+
break;
|
|
1944
|
+
}
|
|
1945
|
+
result.y = top;
|
|
1946
|
+
result.x = left;
|
|
1947
|
+
return result;
|
|
1948
|
+
}
|
|
1949
|
+
static collision(a, b) {
|
|
1950
|
+
const ac = a.getBoundingClientRect();
|
|
1951
|
+
const bc = b.getBoundingClientRect();
|
|
1952
|
+
if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left &&
|
|
1953
|
+
ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {
|
|
1954
|
+
return true;
|
|
1955
|
+
}
|
|
1956
|
+
else {
|
|
1957
|
+
return false;
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
class AXHtmlModule {
|
|
1963
|
+
}
|
|
1964
|
+
AXHtmlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1965
|
+
AXHtmlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlModule, declarations: [AXHtmlToTextPipe], imports: [CommonModule], exports: [AXHtmlToTextPipe] });
|
|
1966
|
+
AXHtmlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlModule, providers: [], imports: [[CommonModule]] });
|
|
1967
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHtmlModule, decorators: [{
|
|
1968
|
+
type: NgModule,
|
|
1969
|
+
args: [{
|
|
1970
|
+
declarations: [AXHtmlToTextPipe],
|
|
1971
|
+
imports: [CommonModule],
|
|
1972
|
+
exports: [AXHtmlToTextPipe],
|
|
1973
|
+
providers: []
|
|
1974
|
+
}]
|
|
1975
|
+
}] });
|
|
1976
|
+
|
|
1977
|
+
class AXOnDemandPreloadService {
|
|
1978
|
+
constructor() {
|
|
1979
|
+
this.subject = new Subject();
|
|
1980
|
+
this.tmp = AXHtmlUtil.getUID();
|
|
1981
|
+
}
|
|
1982
|
+
startPreload(routePath) {
|
|
1983
|
+
const slices = [];
|
|
1984
|
+
this.subject.next(routePath);
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
AXOnDemandPreloadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXOnDemandPreloadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1988
|
+
AXOnDemandPreloadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXOnDemandPreloadService });
|
|
1989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXOnDemandPreloadService, decorators: [{
|
|
1990
|
+
type: Injectable
|
|
1991
|
+
}], ctorParameters: function () { return []; } });
|
|
1992
|
+
|
|
1993
|
+
class AXRenderService {
|
|
1994
|
+
constructor(appRef, router, componentFactoryResolver, compiler, modulePreloadService, injector) {
|
|
1995
|
+
this.appRef = appRef;
|
|
1996
|
+
this.router = router;
|
|
1997
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1998
|
+
this.compiler = compiler;
|
|
1999
|
+
this.modulePreloadService = modulePreloadService;
|
|
2000
|
+
this.injector = injector;
|
|
2001
|
+
}
|
|
2002
|
+
appendComponent(componentClass, options = {}, location) {
|
|
2003
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentClass);
|
|
2004
|
+
const componentRef = componentFactory.create(this.injector);
|
|
2005
|
+
this.appRef.attachView(componentRef.hostView);
|
|
2006
|
+
Object.assign(componentRef.instance, options);
|
|
2007
|
+
//
|
|
2008
|
+
const domElem = componentRef.hostView.rootNodes[0];
|
|
2009
|
+
componentRef.onDestroy(() => {
|
|
2010
|
+
this.appRef.detachView(componentRef.hostView);
|
|
2011
|
+
});
|
|
2012
|
+
if (location) {
|
|
2013
|
+
location.appendChild(domElem);
|
|
2014
|
+
}
|
|
2015
|
+
else {
|
|
2016
|
+
document.body.appendChild(domElem);
|
|
2017
|
+
}
|
|
2018
|
+
setTimeout(() => {
|
|
2019
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
2020
|
+
}, 0);
|
|
2021
|
+
return componentRef;
|
|
2022
|
+
}
|
|
2023
|
+
findLoadedComponentByRoute(path, timeoutTime = 10) {
|
|
2024
|
+
const delay = 200;
|
|
2025
|
+
const loop = timeoutTime * 1000 / delay;
|
|
2026
|
+
return new Promise((resolve, reject) => {
|
|
2027
|
+
let found = null;
|
|
2028
|
+
let preload = false;
|
|
2029
|
+
const theLoop = (i) => {
|
|
2030
|
+
setTimeout(async () => {
|
|
2031
|
+
found = await this._findLoadedComponentByRoute(path);
|
|
2032
|
+
if (--i && found == null) {
|
|
2033
|
+
if (!preload) {
|
|
2034
|
+
this.modulePreloadService.startPreload(path);
|
|
2035
|
+
preload = true;
|
|
2036
|
+
}
|
|
2037
|
+
theLoop(i);
|
|
2038
|
+
}
|
|
2039
|
+
else if (found) {
|
|
2040
|
+
resolve(found);
|
|
2041
|
+
}
|
|
2042
|
+
else {
|
|
2043
|
+
reject();
|
|
2044
|
+
}
|
|
2045
|
+
}, delay);
|
|
2046
|
+
};
|
|
2047
|
+
theLoop(loop);
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
async _findLoadedComponentByRoute(search) {
|
|
2051
|
+
let found = null;
|
|
2052
|
+
const f = (children, parentPath) => {
|
|
2053
|
+
for (const p in children) {
|
|
2054
|
+
if (children.hasOwnProperty(p)) {
|
|
2055
|
+
const route = children[p];
|
|
2056
|
+
const pp = (route.path != '' && route.path != null) ? parentPath + '/' + route.path : parentPath;
|
|
2057
|
+
if (pp == search && !route._loadedConfig && route.component) {
|
|
2058
|
+
found = route;
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
2061
|
+
else if (route._loadedConfig || route.children) {
|
|
2062
|
+
f(route.children || route._loadedConfig.routes, pp);
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
for (const p in this.router.config) {
|
|
2068
|
+
if (this.router.config.hasOwnProperty(p)) {
|
|
2069
|
+
const route = this.router.config[p];
|
|
2070
|
+
if (route.path === search && route.component) {
|
|
2071
|
+
found = route;
|
|
2072
|
+
}
|
|
2073
|
+
else if (route['_loadedConfig'] || route.children) {
|
|
2074
|
+
f(route.children || route['_loadedConfig'].routes, route.path);
|
|
2075
|
+
}
|
|
2076
|
+
if (found)
|
|
2077
|
+
break;
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
return found;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
AXRenderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderService, deps: [{ token: i0.ApplicationRef }, { token: i1$1.Router }, { token: i0.ComponentFactoryResolver }, { token: i0.Compiler }, { token: AXOnDemandPreloadService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2084
|
+
AXRenderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderService, providedIn: 'root' });
|
|
2085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderService, decorators: [{
|
|
2086
|
+
type: Injectable,
|
|
2087
|
+
args: [{ providedIn: 'root' }]
|
|
2088
|
+
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i1$1.Router }, { type: i0.ComponentFactoryResolver }, { type: i0.Compiler }, { type: AXOnDemandPreloadService }, { type: i0.Injector }]; } });
|
|
2089
|
+
|
|
2090
|
+
// @dynamic
|
|
2091
|
+
function getOnDemandPreloadServiceFactory() {
|
|
2092
|
+
return new AXOnDemandPreloadService();
|
|
2093
|
+
}
|
|
2094
|
+
class AXRenderingModule {
|
|
2095
|
+
}
|
|
2096
|
+
AXRenderingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2097
|
+
AXRenderingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderingModule });
|
|
2098
|
+
AXRenderingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderingModule, providers: [
|
|
2099
|
+
{
|
|
2100
|
+
provide: AXOnDemandPreloadService,
|
|
2101
|
+
useFactory: getOnDemandPreloadServiceFactory
|
|
2102
|
+
},
|
|
2103
|
+
AXRenderService
|
|
2104
|
+
], imports: [[]] });
|
|
2105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXRenderingModule, decorators: [{
|
|
2106
|
+
type: NgModule,
|
|
2107
|
+
args: [{
|
|
2108
|
+
imports: [],
|
|
2109
|
+
exports: [],
|
|
2110
|
+
declarations: [],
|
|
2111
|
+
providers: [
|
|
2112
|
+
{
|
|
2113
|
+
provide: AXOnDemandPreloadService,
|
|
2114
|
+
useFactory: getOnDemandPreloadServiceFactory
|
|
2115
|
+
},
|
|
2116
|
+
AXRenderService
|
|
2117
|
+
],
|
|
2118
|
+
}]
|
|
2119
|
+
}] });
|
|
2120
|
+
|
|
2121
|
+
class AXHorizontalScrollDirective {
|
|
2122
|
+
constructor(el) {
|
|
2123
|
+
this.el = el;
|
|
2124
|
+
this.scrollValue = 40;
|
|
2125
|
+
}
|
|
2126
|
+
onMouseWheel(e) {
|
|
2127
|
+
const delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail));
|
|
2128
|
+
this.el.nativeElement.scrollLeft -= delta * this.scrollValue;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
AXHorizontalScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHorizontalScrollDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2132
|
+
AXHorizontalScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: AXHorizontalScrollDirective, selector: "[horizontalScroll]", inputs: { scrollValue: ["horizontalScroll", "scrollValue"] }, host: { listeners: { "wheel": "onMouseWheel($event)" } }, ngImport: i0 });
|
|
2133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXHorizontalScrollDirective, decorators: [{
|
|
2134
|
+
type: Directive,
|
|
2135
|
+
args: [{
|
|
2136
|
+
// tslint:disable-next-line: directive-selector
|
|
2137
|
+
selector: '[horizontalScroll]'
|
|
2138
|
+
}]
|
|
2139
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { scrollValue: [{
|
|
2140
|
+
type: Input,
|
|
2141
|
+
args: ['horizontalScroll']
|
|
2142
|
+
}], onMouseWheel: [{
|
|
2143
|
+
type: HostListener,
|
|
2144
|
+
args: ['wheel', ['$event']]
|
|
2145
|
+
}] } });
|
|
2146
|
+
class AXVerticalScrollDirective {
|
|
2147
|
+
constructor(el) {
|
|
2148
|
+
this.el = el;
|
|
2149
|
+
this.scrollValue = 40;
|
|
2150
|
+
}
|
|
2151
|
+
onMouseWheel(e) {
|
|
2152
|
+
const delta = Math.max(-1, Math.min(1, e.wheelDelta || -e.detail));
|
|
2153
|
+
this.el.nativeElement.scrollTop -= delta * this.scrollValue;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
AXVerticalScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXVerticalScrollDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2157
|
+
AXVerticalScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: AXVerticalScrollDirective, selector: "[verticalScroll]", inputs: { scrollValue: ["verticalScroll", "scrollValue"] }, host: { listeners: { "wheel": "onMouseWheel($event)" } }, ngImport: i0 });
|
|
2158
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXVerticalScrollDirective, decorators: [{
|
|
2159
|
+
type: Directive,
|
|
2160
|
+
args: [{
|
|
2161
|
+
// tslint:disable-next-line: directive-selector
|
|
2162
|
+
selector: '[verticalScroll]'
|
|
2163
|
+
}]
|
|
2164
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { scrollValue: [{
|
|
2165
|
+
type: Input,
|
|
2166
|
+
args: ['verticalScroll']
|
|
2167
|
+
}], onMouseWheel: [{
|
|
2168
|
+
type: HostListener,
|
|
2169
|
+
args: ['wheel', ['$event']]
|
|
2170
|
+
}] } });
|
|
2171
|
+
|
|
2172
|
+
class AXScrollModule {
|
|
2173
|
+
}
|
|
2174
|
+
AXScrollModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXScrollModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2175
|
+
AXScrollModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXScrollModule, declarations: [AXHorizontalScrollDirective, AXVerticalScrollDirective], imports: [CommonModule], exports: [AXHorizontalScrollDirective, AXVerticalScrollDirective] });
|
|
2176
|
+
AXScrollModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXScrollModule, providers: [], imports: [[CommonModule]] });
|
|
2177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXScrollModule, decorators: [{
|
|
2178
|
+
type: NgModule,
|
|
2179
|
+
args: [{
|
|
2180
|
+
declarations: [AXHorizontalScrollDirective, AXVerticalScrollDirective],
|
|
2181
|
+
imports: [CommonModule],
|
|
2182
|
+
exports: [AXHorizontalScrollDirective, AXVerticalScrollDirective],
|
|
2183
|
+
providers: []
|
|
2184
|
+
}]
|
|
2185
|
+
}] });
|
|
2186
|
+
|
|
2187
|
+
// export class AXSeparatorPipe2 implements PipeTransform {
|
|
2188
|
+
// transform(value: any) {
|
|
2189
|
+
// if (value) {
|
|
2190
|
+
// return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
2191
|
+
// } else {
|
|
2192
|
+
// return '0';
|
|
2193
|
+
// }
|
|
2194
|
+
// }
|
|
2195
|
+
// }
|
|
2196
|
+
class AXSeparatorPipe {
|
|
2197
|
+
transform(value, currency = '', decimal = 0, locale = AXConfig.get('layout.rtl') ? 'fa' : 'en') {
|
|
2198
|
+
return (new Intl.NumberFormat(locale, {
|
|
2199
|
+
minimumFractionDigits: 0,
|
|
2200
|
+
maximumFractionDigits: decimal
|
|
2201
|
+
}).format(Number(value)) + (currency != '' ? ' ' + currency : ''));
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
AXSeparatorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2205
|
+
AXSeparatorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorPipe, name: "separator" });
|
|
2206
|
+
AXSeparatorPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorPipe, providedIn: 'root' });
|
|
2207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorPipe, decorators: [{
|
|
2208
|
+
type: Pipe,
|
|
2209
|
+
args: [{ name: 'separator' }]
|
|
2210
|
+
}, {
|
|
2211
|
+
type: Injectable,
|
|
2212
|
+
args: [{
|
|
2213
|
+
providedIn: 'root'
|
|
2214
|
+
}]
|
|
2215
|
+
}] });
|
|
2216
|
+
|
|
2217
|
+
class AXSeparatorModule {
|
|
2218
|
+
}
|
|
2219
|
+
AXSeparatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2220
|
+
AXSeparatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorModule, declarations: [AXSeparatorPipe], imports: [CommonModule], exports: [AXSeparatorPipe] });
|
|
2221
|
+
AXSeparatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorModule, providers: [], imports: [[CommonModule]] });
|
|
2222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXSeparatorModule, decorators: [{
|
|
2223
|
+
type: NgModule,
|
|
2224
|
+
args: [{
|
|
2225
|
+
declarations: [AXSeparatorPipe],
|
|
2226
|
+
imports: [CommonModule],
|
|
2227
|
+
exports: [AXSeparatorPipe],
|
|
2228
|
+
providers: []
|
|
2229
|
+
}]
|
|
2230
|
+
}] });
|
|
2231
|
+
|
|
2232
|
+
const PIPES = [AXDateTimePipe];
|
|
2233
|
+
const MODULES = [AXScrollModule, AXTranslatorModule];
|
|
2234
|
+
const SERVICES = [AXEventService,
|
|
2235
|
+
AXStorageService
|
|
2236
|
+
];
|
|
2237
|
+
class AXCoreModule {
|
|
2238
|
+
}
|
|
2239
|
+
AXCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2240
|
+
AXCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXCoreModule, declarations: [AXDateTimePipe], imports: [AXScrollModule, AXTranslatorModule], exports: [AXDateTimePipe] });
|
|
2241
|
+
AXCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXCoreModule, providers: [...SERVICES], imports: [[...MODULES]] });
|
|
2242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXCoreModule, decorators: [{
|
|
2243
|
+
type: NgModule,
|
|
2244
|
+
args: [{
|
|
2245
|
+
declarations: [...PIPES],
|
|
2246
|
+
imports: [...MODULES],
|
|
2247
|
+
exports: [...PIPES],
|
|
2248
|
+
providers: [...SERVICES]
|
|
2249
|
+
}]
|
|
2250
|
+
}] });
|
|
1319
2251
|
|
|
1320
2252
|
/**
|
|
1321
2253
|
* Generated bundle index. Do not edit.
|
|
1322
2254
|
*/
|
|
1323
2255
|
|
|
1324
|
-
export { AXCalendarMonth, AXConfig, AXCoreModule, AXDateTime,
|
|
2256
|
+
export { AXArrayUtil, AXBaseMenuItem, AXBasePageComponent, AXButtonItem, AXCalendarMonth, AXCheckItem, AXClientRec, AXColorUtil, AXConfig, AXCoreModule, AXDateTime, AXDateTimePipe, AXDateTimeRange, AXErrorModule, AXErrorService, AXEventService, AXFetchProp, AXHorizontalScrollDirective, AXHtmlModule, AXHtmlToTextPipe, AXHtmlUtil, AXHttpModule, AXHttpService, AXMathUtil, AXMenuItem, AXNavigator, AXObjectUtil, AXOnDemandPreloadService, AXPlatform, AXPlatformEvent, AXPoint, AXPromise, AXRenderService, AXRenderingModule, AXScrollModule, AXSelectItem, AXSeparatorModule, AXSeparatorPipe, AXStorageService, AXTranslator, AXTranslatorModule, AXTranslatorPipe, AXTranslatorService, AXVerticalScrollDirective, AX_ERROR_DISPLAY_INTERCEPTOR, AX_HTTP_EVENT_INTERCEPTOR, HttpResult, getOnDemandPreloadServiceFactory, getPropByPath, setPropByPath, testUserAgent };
|
|
1325
2257
|
//# sourceMappingURL=acorex-core.mjs.map
|