@acorex/core 5.1.2 → 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 +5 -5
- 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 +1940 -1011
- package/fesm2015/acorex-core.mjs.map +1 -1
- package/fesm2020/acorex-core.mjs +1932 -1004
- 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,12 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Pipe, NgModule, Injectable, Inject } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/platform-browser';
|
|
4
|
-
import _ from 'lodash';
|
|
1
|
+
import moment from 'jalali-moment';
|
|
5
2
|
import { Subject, fromEvent } from 'rxjs';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
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';
|
|
9
8
|
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
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
|
+
}
|
|
10
60
|
|
|
11
61
|
// @dynamic
|
|
12
62
|
class AXObjectUtil {
|
|
@@ -45,95 +95,51 @@ class AXObjectUtil {
|
|
|
45
95
|
}
|
|
46
96
|
throw new Error('Unable to copy obj! Its type isn\'t supported.');
|
|
47
97
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
static collision(a, b) {
|
|
53
|
-
const ac = a.getBoundingClientRect();
|
|
54
|
-
const bc = b.getBoundingClientRect();
|
|
55
|
-
if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left &&
|
|
56
|
-
ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
static isInElementBound(pos, element) {
|
|
64
|
-
const elBound = element.getBoundingClientRect();
|
|
65
|
-
return AXDrawingUtil.isInRecPoint(pos, {
|
|
66
|
-
left: elBound.x,
|
|
67
|
-
width: elBound.width,
|
|
68
|
-
top: elBound.y,
|
|
69
|
-
height: elBound.height
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
static isInRecPoint(pos, rec) {
|
|
73
|
-
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;
|
|
74
102
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class AXStringUtil {
|
|
79
|
-
static getWordBoundsAtPosition(str, position) {
|
|
80
|
-
const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);
|
|
81
|
-
let start = position - 1;
|
|
82
|
-
while (start >= 0 && !isSpace(str[start])) {
|
|
83
|
-
start -= 1;
|
|
84
|
-
}
|
|
85
|
-
start = Math.max(0, start + 1);
|
|
86
|
-
const leftSideString = str.slice(start).match(/[a-zA-Z0-9]+/i);
|
|
87
|
-
start += leftSideString.index;
|
|
88
|
-
let end = start + leftSideString[0].length;
|
|
89
|
-
return {
|
|
90
|
-
start,
|
|
91
|
-
end
|
|
92
|
-
};
|
|
103
|
+
const index = prop.indexOf('.');
|
|
104
|
+
if (index > -1) {
|
|
105
|
+
return AXFetchProp(obj[prop.substring(0, index)], prop.substr(index + 1));
|
|
93
106
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
case 'html': return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
105
|
-
case 'style': return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
106
|
-
case 'script': return this.sanitizer.bypassSecurityTrustScript(value);
|
|
107
|
-
case 'url': return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
108
|
-
case 'resourceUrl': return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
109
|
-
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];
|
|
110
117
|
}
|
|
118
|
+
});
|
|
119
|
+
if (obj === undefined) {
|
|
120
|
+
return defaultVal;
|
|
111
121
|
}
|
|
122
|
+
return obj;
|
|
112
123
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
exports: [AXSafePipe],
|
|
133
|
-
declarations: [AXSafePipe],
|
|
134
|
-
providers: [],
|
|
135
|
-
}]
|
|
136
|
-
}] });
|
|
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
|
+
}
|
|
137
143
|
|
|
138
144
|
// @dynamic
|
|
139
145
|
class AXConfig {
|
|
@@ -142,12 +148,12 @@ class AXConfig {
|
|
|
142
148
|
}
|
|
143
149
|
static set(arg1, arg2) {
|
|
144
150
|
if (arg1 && typeof arg1 == 'string') {
|
|
145
|
-
|
|
151
|
+
setPropByPath(AXConfig.dataModel, arg1, arg2);
|
|
146
152
|
AXConfig.dataChangeSubject.next(AXConfig.dataModel);
|
|
147
153
|
return;
|
|
148
154
|
}
|
|
149
155
|
if (arg1 && typeof arg1 == 'object') {
|
|
150
|
-
|
|
156
|
+
Object.assign(AXConfig.dataModel, arg1);
|
|
151
157
|
AXConfig.dataChangeSubject.next(AXConfig.dataModel);
|
|
152
158
|
return;
|
|
153
159
|
}
|
|
@@ -155,213 +161,285 @@ class AXConfig {
|
|
|
155
161
|
return AXConfig.dataChangeSubject.asObservable();
|
|
156
162
|
}
|
|
157
163
|
}
|
|
158
|
-
static get(path
|
|
159
|
-
return
|
|
164
|
+
static get(path) {
|
|
165
|
+
return getPropByPath(AXConfig.dataModel, path);
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
AXConfig.dataModel = {};
|
|
163
169
|
AXConfig.dataChangeSubject = new Subject();
|
|
164
170
|
|
|
165
|
-
// @dynamic
|
|
166
171
|
class AXDateTime {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
m: () => this.date.getMinutes().toString(),
|
|
177
|
-
//
|
|
178
|
-
MMMM: () => this.calendar.monthNames[this.calendar.monthOfYear(this.date) - 1],
|
|
179
|
-
MMM: () => this.calendar.monthShortNames[this.calendar.monthOfYear(this.date) - 1],
|
|
180
|
-
MM: () => this.pad(this.calendar.monthOfYear(this.date), 2),
|
|
181
|
-
//
|
|
182
|
-
DDDD: () => this.calendar.dayNames[this.calendar.dayOfWeek(this.date) - 1],
|
|
183
|
-
DDD: () => this.calendar.dayShortNames[this.calendar.dayOfWeek(this.date) - 1],
|
|
184
|
-
//
|
|
185
|
-
yyyy: () => this.calendar.year(this.date).toString(),
|
|
186
|
-
YYYY: () => this.calendar.year(this.date).toString(),
|
|
187
|
-
yy: () => this.calendar.year(this.date).toString().substring(2),
|
|
188
|
-
YY: () => this.calendar.year(this.date).toString().substring(2),
|
|
189
|
-
//
|
|
190
|
-
HH: () => this.pad(this.date.getHours(), 2),
|
|
191
|
-
H: () => this.date.getHours().toString(),
|
|
192
|
-
//
|
|
193
|
-
hh: () => this.pad((this.date.getHours() % 12 || 12), 2),
|
|
194
|
-
h: () => (this.date.getHours() % 12 || 12).toString(),
|
|
195
|
-
//
|
|
196
|
-
A: () => (this.date.getHours() < 12) ? 'am' : 'pm',
|
|
197
|
-
a: () => (this.date.getHours() < 12) ? 'am' : 'pm',
|
|
198
|
-
};
|
|
199
|
-
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;
|
|
200
181
|
if (value instanceof Date) {
|
|
201
182
|
this._date = value;
|
|
202
183
|
}
|
|
203
184
|
else {
|
|
204
|
-
//TODO: parse jalali
|
|
205
185
|
this._date = new Date(value);
|
|
206
186
|
}
|
|
187
|
+
this._moment = moment(this.date);
|
|
188
|
+
if (this.type === 'jalali') {
|
|
189
|
+
this._moment.locale('fa');
|
|
190
|
+
}
|
|
207
191
|
}
|
|
208
|
-
static convert(value,
|
|
192
|
+
static convert(value, type = AXConfig.get('dateTime.type') || 'gregorian') {
|
|
209
193
|
let date;
|
|
210
194
|
if (typeof value === 'string' || value instanceof String) {
|
|
211
|
-
date = new AXDateTime(value,
|
|
195
|
+
date = new AXDateTime(value, type);
|
|
212
196
|
}
|
|
213
197
|
else if (value instanceof Date) {
|
|
214
|
-
date = new AXDateTime(value,
|
|
198
|
+
date = new AXDateTime(value, type);
|
|
215
199
|
}
|
|
216
200
|
else if (value instanceof AXDateTime) {
|
|
217
|
-
date =
|
|
201
|
+
date = value;
|
|
218
202
|
}
|
|
219
203
|
return date;
|
|
220
204
|
}
|
|
221
|
-
static from(value = {
|
|
222
|
-
calendar: AXConfig.get('dateTime.calendar'),
|
|
223
|
-
year: 1,
|
|
224
|
-
month: 1,
|
|
225
|
-
date: 1,
|
|
226
|
-
hours: 0,
|
|
227
|
-
minutes: 0,
|
|
228
|
-
seconds: 0,
|
|
229
|
-
ms: 0
|
|
230
|
-
}) {
|
|
231
|
-
// let date: AXDateTime = new AXDateTime(new Date(), value.calendar);
|
|
232
|
-
// date.set('year', value.year);
|
|
233
|
-
// date.set('month', value.month);
|
|
234
|
-
// date.set('day', value.date);
|
|
235
|
-
// date.set('hour', value.hours);
|
|
236
|
-
// date.set('minute', value.minutes);
|
|
237
|
-
// date.set('second', value.seconds);
|
|
238
|
-
// date.set('ms', value.ms);
|
|
239
|
-
return AXDateTime.resolveCalendar(value.calendar).create(value);
|
|
240
|
-
}
|
|
241
|
-
static resolveCalendar(calendar) {
|
|
242
|
-
return typeof calendar == 'string'
|
|
243
|
-
? AXConfig.get(`dateTime.calendars.${calendar}`)
|
|
244
|
-
: calendar;
|
|
245
|
-
}
|
|
246
205
|
get date() {
|
|
247
206
|
return this._date;
|
|
248
207
|
}
|
|
249
|
-
|
|
250
|
-
return this.
|
|
208
|
+
resolveUnit(unit) {
|
|
209
|
+
return this.type === 'jalali' ? 'j' + unit : unit;
|
|
251
210
|
}
|
|
252
211
|
clone() {
|
|
253
|
-
return new AXDateTime(this.date, this.
|
|
212
|
+
return new AXDateTime(this.date, this.type);
|
|
254
213
|
}
|
|
255
|
-
get
|
|
256
|
-
return this.
|
|
214
|
+
get dayInMonth() {
|
|
215
|
+
return this._moment.date();
|
|
257
216
|
}
|
|
258
217
|
get dayOfYear() {
|
|
259
|
-
return this.
|
|
218
|
+
return this._moment.dayOfYear();
|
|
260
219
|
}
|
|
261
|
-
get
|
|
262
|
-
return this.
|
|
220
|
+
get dayInWeek() {
|
|
221
|
+
return this._moment.day();
|
|
263
222
|
}
|
|
264
223
|
get hour() {
|
|
265
|
-
return this.
|
|
224
|
+
return this._moment.hour();
|
|
266
225
|
}
|
|
267
226
|
get minute() {
|
|
268
|
-
return this.
|
|
227
|
+
return this._moment.minute();
|
|
269
228
|
}
|
|
270
229
|
get second() {
|
|
271
|
-
return this.
|
|
230
|
+
return this._moment.second();
|
|
272
231
|
}
|
|
273
232
|
get year() {
|
|
274
|
-
return this.
|
|
233
|
+
return this._moment.year();
|
|
275
234
|
}
|
|
276
235
|
get monthOfYear() {
|
|
277
|
-
return this.
|
|
278
|
-
}
|
|
279
|
-
get weekOfYear() {
|
|
280
|
-
return this._calendar.weekOfYear(this.date);
|
|
236
|
+
return this._moment.month();
|
|
281
237
|
}
|
|
282
238
|
get month() {
|
|
283
239
|
return new AXCalendarMonth(this);
|
|
284
240
|
}
|
|
285
|
-
|
|
286
|
-
|
|
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);
|
|
287
272
|
}
|
|
288
273
|
set(unit = 'day', value) {
|
|
289
|
-
return this.
|
|
274
|
+
return new AXDateTime(this._moment.set(unit, value).toDate(), this.type);
|
|
290
275
|
}
|
|
291
|
-
duration(end, unit = '
|
|
292
|
-
const
|
|
293
|
-
return
|
|
276
|
+
duration(end, unit = 'days') {
|
|
277
|
+
const duration = moment.duration(this._moment.diff(end._moment));
|
|
278
|
+
return Math.round(duration.as(unit));
|
|
294
279
|
}
|
|
295
280
|
startOf(unit = 'day') {
|
|
296
|
-
return this.
|
|
281
|
+
return new AXDateTime(moment(this.date).startOf(this.resolveUnit(unit)).toDate(), this.type);
|
|
297
282
|
}
|
|
298
283
|
endOf(unit = 'day') {
|
|
299
|
-
return this.
|
|
284
|
+
return new AXDateTime(moment(this.date).endOf(this.resolveUnit(unit)).toDate(), this.type);
|
|
300
285
|
}
|
|
301
|
-
format(format = AXConfig.get('dateTime.shortDateFormat')) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
pad(n, width, z = '0') {
|
|
308
|
-
n = n + '';
|
|
309
|
-
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);
|
|
310
291
|
}
|
|
311
|
-
toString(
|
|
312
|
-
return this.format(
|
|
292
|
+
toString() {
|
|
293
|
+
return this.format();
|
|
313
294
|
}
|
|
314
295
|
equal(value, unit = 'day') {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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'
|
|
329
310
|
};
|
|
330
|
-
|
|
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
|
+
}
|
|
331
366
|
switch (unit) {
|
|
332
|
-
case '
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
case '
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
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;
|
|
354
431
|
}
|
|
355
432
|
}
|
|
356
|
-
|
|
357
|
-
return
|
|
433
|
+
toISOString() {
|
|
434
|
+
return this._date.toISOString();
|
|
358
435
|
}
|
|
359
436
|
}
|
|
360
437
|
class AXCalendarMonth {
|
|
361
438
|
constructor(date) {
|
|
439
|
+
this._moment = moment(date.date);
|
|
362
440
|
this.index = date.date.getMonth();
|
|
363
|
-
this.name =
|
|
364
|
-
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));
|
|
365
443
|
}
|
|
366
444
|
get range() {
|
|
367
445
|
return this._range;
|
|
@@ -372,813 +450,336 @@ class AXCalendarMonth {
|
|
|
372
450
|
}
|
|
373
451
|
class AXDateTimeRange {
|
|
374
452
|
constructor(startTime, endTime) {
|
|
375
|
-
this.
|
|
376
|
-
this.
|
|
377
|
-
}
|
|
378
|
-
get startTime() {
|
|
379
|
-
return this._startTime;
|
|
380
|
-
}
|
|
381
|
-
get endTime() {
|
|
382
|
-
return this._endTime;
|
|
383
|
-
}
|
|
384
|
-
duration() {
|
|
385
|
-
const result = {
|
|
386
|
-
miliseconds: 0,
|
|
387
|
-
seconds: 0,
|
|
388
|
-
minutes: 0,
|
|
389
|
-
hours: 0,
|
|
390
|
-
days: 0,
|
|
391
|
-
months: 0,
|
|
392
|
-
years: 0,
|
|
393
|
-
total: {
|
|
394
|
-
miliseconds: 0,
|
|
395
|
-
seconds: 0,
|
|
396
|
-
minutes: 0,
|
|
397
|
-
hours: 0,
|
|
398
|
-
days: 0,
|
|
399
|
-
weeks: 0,
|
|
400
|
-
months: 0,
|
|
401
|
-
years: 0,
|
|
402
|
-
},
|
|
403
|
-
};
|
|
404
|
-
const one_second = 1000;
|
|
405
|
-
const one_min = one_second * 60;
|
|
406
|
-
const one_hour = one_min * 60;
|
|
407
|
-
const one_day = one_hour * 24;
|
|
408
|
-
const one_week = one_day * 7;
|
|
409
|
-
const one_year = 365.25 * one_day;
|
|
410
|
-
const one_month = one_year / 12;
|
|
411
|
-
const startTime = this._startTime.date.getTime();
|
|
412
|
-
const endTime = this._endTime.date.getTime();
|
|
413
|
-
const diff = Math.abs(endTime - startTime);
|
|
414
|
-
//
|
|
415
|
-
result.total.miliseconds = diff;
|
|
416
|
-
result.total.seconds = Number((diff / one_second).toFixed(2));
|
|
417
|
-
result.total.minutes = Number((diff / one_min).toFixed(2));
|
|
418
|
-
result.total.hours = Number((diff / one_hour).toFixed(2));
|
|
419
|
-
result.total.days = Number((diff / one_day).toFixed(2));
|
|
420
|
-
result.total.weeks = Number((diff / one_week).toFixed(2));
|
|
421
|
-
//
|
|
422
|
-
// let months = (this.endTime.year - this.startTime.year) * 12;
|
|
423
|
-
// months += this.endTime.monthOfYear - this.startTime.monthOfYear + 1;
|
|
424
|
-
// if (this.endTime.dayOfYear < this.startTime.dayOfYear) {
|
|
425
|
-
// months--;
|
|
426
|
-
// }
|
|
427
|
-
// result.total.months = Math.abs(months);
|
|
428
|
-
// TODO: review
|
|
429
|
-
result.total.months = Number((diff / one_month).toFixed(2));
|
|
430
|
-
result.total.years = Number((diff / one_year).toFixed(2));
|
|
431
|
-
//
|
|
432
|
-
result.miliseconds = result.total.miliseconds % 1000;
|
|
433
|
-
result.seconds = Number((result.total.seconds % 60).toFixed(0));
|
|
434
|
-
result.minutes = Number((result.total.minutes % 60).toFixed(0));
|
|
435
|
-
result.hours = Number((result.total.hours % 24).toFixed(0));
|
|
436
|
-
// TODO: review
|
|
437
|
-
result.days = Number((result.total.days % 30.4).toFixed(0));
|
|
438
|
-
result.months = Number((result.total.months % 12).toFixed(0));
|
|
439
|
-
result.years = Number(result.total.years.toFixed(0));
|
|
440
|
-
return result;
|
|
441
|
-
}
|
|
442
|
-
enumurate(unit = 'day', amount = 1) {
|
|
443
|
-
// TODO: setptemper savingtime issue
|
|
444
|
-
const result = [];
|
|
445
|
-
let item = this._startTime.clone();
|
|
446
|
-
while (item.compare(this._endTime, unit) < 1) {
|
|
447
|
-
result.push(item);
|
|
448
|
-
item = item.add(unit, amount);
|
|
449
|
-
}
|
|
450
|
-
return result;
|
|
453
|
+
this.startTime = startTime;
|
|
454
|
+
this.endTime = endTime;
|
|
451
455
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
return
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
class AXDateTimePipe {
|
|
459
|
-
constructor() { }
|
|
460
|
-
transform(value, format, calendar) {
|
|
461
|
-
if (value == null) {
|
|
462
|
-
return '';
|
|
463
|
-
}
|
|
464
|
-
const date = value instanceof AXDateTime ? value.clone() : AXDateTime.convert(value, calendar);
|
|
465
|
-
if (!format) {
|
|
466
|
-
return date.format(AXConfig.get('dateTime.shortDateFormat'));
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
return date.format(format);
|
|
470
|
-
}
|
|
456
|
+
duration(unit = 'days') {
|
|
457
|
+
const duration = moment.duration(moment(this.startTime.date).diff(moment(this.endTime.date)));
|
|
458
|
+
return duration.as(unit);
|
|
471
459
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
type: Pipe,
|
|
477
|
-
args: [{ name: 'axDate' }]
|
|
478
|
-
}], ctorParameters: function () { return []; } });
|
|
479
|
-
|
|
480
|
-
class GeorgianCalendar {
|
|
481
|
-
constructor() {
|
|
482
|
-
this.monthNames = [
|
|
483
|
-
"January", "February", "March",
|
|
484
|
-
"April", "May", "June", "July",
|
|
485
|
-
"August", "September", "October",
|
|
486
|
-
"November", "December"
|
|
487
|
-
];
|
|
488
|
-
this.monthShortNames = [
|
|
489
|
-
"Jan", "Feb", "Mar",
|
|
490
|
-
"Apr", "May", "Jun", "Jul",
|
|
491
|
-
"Aug", "Sep", "Oct",
|
|
492
|
-
"Nov", "Dec"
|
|
493
|
-
];
|
|
494
|
-
this.dayNames = [
|
|
495
|
-
"Sunday", "Monday", "Tuesday", "Wednesday",
|
|
496
|
-
"Thursday", "Friday", "Saturday"
|
|
497
|
-
];
|
|
498
|
-
this.dayShortNames = [
|
|
499
|
-
"Sun", "Mon", "Tue", "Wed",
|
|
500
|
-
"Thu", "Fri", "Sat"
|
|
501
|
-
];
|
|
502
|
-
}
|
|
503
|
-
create(value) {
|
|
504
|
-
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());
|
|
505
|
-
}
|
|
506
|
-
name() {
|
|
507
|
-
return 'gregorian';
|
|
508
|
-
}
|
|
509
|
-
dayOfMonth(date) {
|
|
510
|
-
return date.getDate();
|
|
511
|
-
}
|
|
512
|
-
dayOfYear(date) {
|
|
513
|
-
let result = 0;
|
|
514
|
-
let m = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
515
|
-
if (this.isLeap(date)) {
|
|
516
|
-
m[1] = 29;
|
|
517
|
-
}
|
|
518
|
-
for (let i = 0; i < date.getMonth(); i++) {
|
|
519
|
-
result = result + m[i];
|
|
460
|
+
enumurate(unit = 'day', type = AXConfig.get('dateTime.type') || 'jalali') {
|
|
461
|
+
const result = [];
|
|
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));
|
|
520
464
|
}
|
|
521
|
-
result += date.getDate();
|
|
522
465
|
return result;
|
|
523
466
|
}
|
|
524
|
-
|
|
525
|
-
return
|
|
526
|
-
|
|
527
|
-
weekOfYear(date) {
|
|
528
|
-
const firstDay = new AXDateTime(date).startOf('year');
|
|
529
|
-
return Math.ceil((((date.getTime() - firstDay.date.getTime()) / 86400000) + firstDay.date.getDay() + 1) / 7);
|
|
530
|
-
}
|
|
531
|
-
year(date) {
|
|
532
|
-
return date.getFullYear();
|
|
533
|
-
}
|
|
534
|
-
monthOfYear(date) {
|
|
535
|
-
return date.getMonth() + 1;
|
|
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);
|
|
536
470
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
value += 1000 * amount;
|
|
542
|
-
break;
|
|
543
|
-
case 'minute':
|
|
544
|
-
value += 60000 * amount;
|
|
545
|
-
break;
|
|
546
|
-
case 'hour':
|
|
547
|
-
value += 3600000 * amount;
|
|
548
|
-
break;
|
|
471
|
+
getViewCompaire(view) {
|
|
472
|
+
switch (view) {
|
|
473
|
+
case 'day':
|
|
474
|
+
return 'YMD';
|
|
549
475
|
case 'month':
|
|
550
|
-
|
|
551
|
-
var mo = date.getMonth();
|
|
552
|
-
var yr = date.getFullYear();
|
|
553
|
-
mo = (mo + amount) % 12;
|
|
554
|
-
if (0 > mo) {
|
|
555
|
-
yr += (date.getMonth() + amount - mo - 12) / 12;
|
|
556
|
-
mo += 12;
|
|
557
|
-
}
|
|
558
|
-
else
|
|
559
|
-
yr += ((date.getMonth() + amount - mo) / 12);
|
|
560
|
-
v.setMonth(mo);
|
|
561
|
-
v.setFullYear(yr);
|
|
562
|
-
value = v.valueOf();
|
|
563
|
-
break;
|
|
564
|
-
case 'week':
|
|
565
|
-
value += 7 * 86400000 * amount;
|
|
566
|
-
break;
|
|
476
|
+
return 'YM';
|
|
567
477
|
case 'year':
|
|
568
|
-
|
|
569
|
-
yv.setFullYear(yv.getFullYear() + amount);
|
|
570
|
-
value = yv.valueOf();
|
|
571
|
-
break;
|
|
572
|
-
case 'day':
|
|
573
|
-
default:
|
|
574
|
-
value += 86400000 * amount;
|
|
478
|
+
return 'Y';
|
|
575
479
|
}
|
|
576
|
-
return new AXDateTime(new Date(value), this.name());
|
|
577
480
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());
|
|
589
|
-
break;
|
|
590
|
-
default:
|
|
591
|
-
case 'day':
|
|
592
|
-
clone.setDate(value);
|
|
593
|
-
break;
|
|
594
|
-
case "week":
|
|
595
|
-
break;
|
|
596
|
-
case "month":
|
|
597
|
-
clone.setMonth(Math.max(0, value - 1));
|
|
598
|
-
break;
|
|
599
|
-
case "year":
|
|
600
|
-
clone.setFullYear(value);
|
|
601
|
-
break;
|
|
602
|
-
}
|
|
603
|
-
return new AXDateTime(clone, this.name());
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
class AXBaseMenuItem {
|
|
484
|
+
constructor() {
|
|
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;
|
|
604
491
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
return new AXDateTime(clone, this.name());
|
|
611
|
-
case 'minute':
|
|
612
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);
|
|
613
|
-
return new AXDateTime(clone, this.name());
|
|
614
|
-
case 'hour':
|
|
615
|
-
clone.setHours(clone.getHours(), 0, 0, 0);
|
|
616
|
-
return new AXDateTime(clone, this.name());
|
|
617
|
-
default:
|
|
618
|
-
case 'day':
|
|
619
|
-
clone.setHours(0, 0, 0, 0);
|
|
620
|
-
return new AXDateTime(clone, this.name());
|
|
621
|
-
case "week":
|
|
622
|
-
const index = 0;
|
|
623
|
-
const start = index >= 0 ? index : 0;
|
|
624
|
-
const day = clone.getDay();
|
|
625
|
-
const diff = clone.getDate() - day + (start > day ? start - 7 : start);
|
|
626
|
-
clone.setDate(diff);
|
|
627
|
-
return new AXDateTime(clone, this.name()).startOf('day');
|
|
628
|
-
case "month":
|
|
629
|
-
clone.setDate(1);
|
|
630
|
-
return new AXDateTime(clone, this.name()).startOf('day');
|
|
631
|
-
case "year":
|
|
632
|
-
clone.setMonth(0);
|
|
633
|
-
clone.setDate(1);
|
|
634
|
-
return new AXDateTime(clone, this.name()).startOf('day');
|
|
635
|
-
}
|
|
492
|
+
}
|
|
493
|
+
class AXMenuItem extends AXBaseMenuItem {
|
|
494
|
+
constructor() {
|
|
495
|
+
super(...arguments);
|
|
496
|
+
this.divider = false;
|
|
636
497
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), 59, 999);
|
|
645
|
-
return new AXDateTime(clone, this.name());
|
|
646
|
-
case 'hour':
|
|
647
|
-
clone.setHours(clone.getHours(), 59, 59, 999);
|
|
648
|
-
return new AXDateTime(clone, this.name());
|
|
649
|
-
default:
|
|
650
|
-
case 'day':
|
|
651
|
-
clone.setHours(23, 59, 59, 999);
|
|
652
|
-
return new AXDateTime(clone, this.name());
|
|
653
|
-
case 'week':
|
|
654
|
-
return this.startOf(date, 'week').add('day', 6).endOf('day');
|
|
655
|
-
case 'month':
|
|
656
|
-
return new AXDateTime(new Date(date.getFullYear(), date.getMonth() + 1, 0), this.name()).endOf('day');
|
|
657
|
-
case "year":
|
|
658
|
-
clone.setMonth(11);
|
|
659
|
-
return new AXDateTime(clone, this.name()).endOf('month');
|
|
660
|
-
}
|
|
498
|
+
}
|
|
499
|
+
class AXButtonItem extends AXBaseMenuItem {
|
|
500
|
+
constructor() {
|
|
501
|
+
super(...arguments);
|
|
502
|
+
this.dropdown = false;
|
|
503
|
+
this.submitBehavior = false;
|
|
504
|
+
this.cancelBehavior = false;
|
|
661
505
|
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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;
|
|
665
526
|
}
|
|
666
527
|
}
|
|
667
528
|
|
|
668
|
-
class
|
|
529
|
+
class AXSelectItem {
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @deprecated Use AXBasePageComponent from @acorex/components
|
|
534
|
+
*/
|
|
535
|
+
// TODO: Add Angular decorator.
|
|
536
|
+
class AXBasePageComponent {
|
|
669
537
|
constructor() {
|
|
670
|
-
this.
|
|
671
|
-
this.monthShortNames = ("فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند").split("_");
|
|
672
|
-
this.dayNames = ("شنبه_یکشنبه_دوشنبه_سه شنبه_چهارشنبه_پنج شنبه_جمعه").split("_");
|
|
673
|
-
this.dayShortNames = "ش_ی_د_س_چ_پ_ج".split("_");
|
|
538
|
+
this.onClosed = new EventEmitter();
|
|
674
539
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
540
|
+
close(data) {
|
|
541
|
+
this.onClosed.emit({
|
|
542
|
+
component: this,
|
|
543
|
+
data: data
|
|
544
|
+
});
|
|
678
545
|
}
|
|
679
|
-
|
|
680
|
-
return 'jalali';
|
|
546
|
+
onClosing(e) {
|
|
681
547
|
}
|
|
682
|
-
|
|
683
|
-
|
|
548
|
+
ngOnDestroy() {
|
|
549
|
+
this.onClosed.unsubscribe();
|
|
684
550
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
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);
|
|
567
|
+
}
|
|
688
568
|
}
|
|
689
|
-
|
|
690
|
-
|
|
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 }]; } });
|
|
576
|
+
|
|
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);
|
|
691
600
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
return Math.ceil((((date.getTime() - firstDay.date.getTime()) / 86400000) + firstDay.date.getDay() + 1) / 7);
|
|
601
|
+
result(action) {
|
|
602
|
+
this.resultAction = action;
|
|
603
|
+
return this;
|
|
696
604
|
}
|
|
697
|
-
|
|
698
|
-
|
|
605
|
+
error(action) {
|
|
606
|
+
this.errorAction = action;
|
|
607
|
+
return this;
|
|
699
608
|
}
|
|
700
|
-
|
|
701
|
-
|
|
609
|
+
complete(action) {
|
|
610
|
+
this.completeAction = action;
|
|
611
|
+
return this;
|
|
702
612
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
v.setFullYear(vv.getFullYear());
|
|
747
|
-
v.setMonth(vv.getMonth());
|
|
748
|
-
v.setDate(vv.getDate());
|
|
749
|
-
value = v.valueOf();
|
|
750
|
-
break;
|
|
751
|
-
}
|
|
752
|
-
case 'day':
|
|
753
|
-
default:
|
|
754
|
-
value += 86400000 * amount;
|
|
755
|
-
}
|
|
756
|
-
return new AXDateTime(new Date(value), this.name());
|
|
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
|
+
});
|
|
757
656
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
case 'minute':
|
|
766
|
-
clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());
|
|
767
|
-
break;
|
|
768
|
-
case 'hour':
|
|
769
|
-
clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());
|
|
770
|
-
break;
|
|
771
|
-
default:
|
|
772
|
-
case 'day':
|
|
773
|
-
const gDate = this.toGregorian(jDate.year, jDate.month, value);
|
|
774
|
-
clone.setDate(gDate.getDate());
|
|
775
|
-
break;
|
|
776
|
-
case "week":
|
|
777
|
-
break;
|
|
778
|
-
case "month":
|
|
779
|
-
const gDate2 = this.toGregorian(jDate.year, value, jDate.day);
|
|
780
|
-
clone.setMonth(gDate2.getMonth());
|
|
781
|
-
break;
|
|
782
|
-
case "year":
|
|
783
|
-
const gDate3 = this.toGregorian(value, jDate.month, jDate.day);
|
|
784
|
-
clone.setFullYear(gDate3.getFullYear());
|
|
785
|
-
break;
|
|
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
|
+
});
|
|
786
664
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
case 'second':
|
|
793
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 0);
|
|
794
|
-
return new AXDateTime(clone, this.name());
|
|
795
|
-
case 'minute':
|
|
796
|
-
clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);
|
|
797
|
-
return new AXDateTime(clone, this.name());
|
|
798
|
-
case 'hour':
|
|
799
|
-
clone.setHours(clone.getHours(), 0, 0, 0);
|
|
800
|
-
return new AXDateTime(clone, this.name());
|
|
801
|
-
default:
|
|
802
|
-
case 'day':
|
|
803
|
-
clone.setHours(0, 0, 0, 0);
|
|
804
|
-
return new AXDateTime(clone, this.name());
|
|
805
|
-
case "week":
|
|
806
|
-
return new AXDateTime(clone, this.name()).add('day', -this.dayOfWeek(clone) + 1).startOf('day');
|
|
807
|
-
case "month":
|
|
808
|
-
{
|
|
809
|
-
const jy = this.year(date);
|
|
810
|
-
const jm = this.monthOfYear(date);
|
|
811
|
-
const gDate = this.toGregorian(jy, jm, 1);
|
|
812
|
-
return new AXDateTime(gDate, this.name()).startOf('day');
|
|
813
|
-
}
|
|
814
|
-
case "year":
|
|
815
|
-
{
|
|
816
|
-
const jy = this.year(date);
|
|
817
|
-
const gDate = this.toGregorian(jy, 1, 1);
|
|
818
|
-
return new AXDateTime(gDate, this.name()).startOf('day');
|
|
819
|
-
}
|
|
665
|
+
else {
|
|
666
|
+
//
|
|
667
|
+
if (result)
|
|
668
|
+
result(data);
|
|
669
|
+
this.handleComplete(complete, config);
|
|
820
670
|
}
|
|
821
671
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
return new AXDateTime(clone, this.name());
|
|
834
|
-
default:
|
|
835
|
-
case 'day':
|
|
836
|
-
clone.setHours(23, 59, 59, 999);
|
|
837
|
-
return new AXDateTime(clone, this.name());
|
|
838
|
-
case 'week':
|
|
839
|
-
{
|
|
840
|
-
return this.startOf(date, 'week').add('day', 6).endOf('day');
|
|
841
|
-
}
|
|
842
|
-
case 'month':
|
|
843
|
-
{
|
|
844
|
-
const jy = this.year(date);
|
|
845
|
-
const jm = this.monthOfYear(date);
|
|
846
|
-
const jd = this.monthLength(jy, jm);
|
|
847
|
-
const gDate = this.toGregorian(jy, jm, jd);
|
|
848
|
-
return new AXDateTime(gDate, this.name()).endOf('day');
|
|
849
|
-
}
|
|
850
|
-
case "year":
|
|
851
|
-
let jy = this.year(date);
|
|
852
|
-
const gDate = this.toGregorian(jy, 12, this.monthLength(jy, 12));
|
|
853
|
-
return new AXDateTime(gDate, this.name()).endOf('day');
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
toJalali(date) {
|
|
857
|
-
const gy = date.getFullYear();
|
|
858
|
-
const gm = date.getMonth() + 1;
|
|
859
|
-
const gd = date.getDate();
|
|
860
|
-
const r = this.d2j(this.g2d(gy, gm, gd));
|
|
861
|
-
return {
|
|
862
|
-
year: r.jy,
|
|
863
|
-
month: r.jm,
|
|
864
|
-
day: r.jd,
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
/*
|
|
868
|
-
Converts a Jalaali date to Gregorian.
|
|
869
|
-
*/
|
|
870
|
-
toGregorian(jy, jm, jd) {
|
|
871
|
-
const g = this.d2g(this.j2d(jy, jm, jd));
|
|
872
|
-
return new Date(g.gy, g.gm - 1, g.gd);
|
|
873
|
-
}
|
|
874
|
-
/*
|
|
875
|
-
Checks whether a Jalaali date is valid or not.
|
|
876
|
-
*/
|
|
877
|
-
isValid(jy, jm, jd) {
|
|
878
|
-
return jy >= -61 && jy <= 3177 &&
|
|
879
|
-
jm >= 1 && jm <= 12 &&
|
|
880
|
-
jd >= 1 && jd <= this.monthLength(jy, jm);
|
|
881
|
-
}
|
|
882
|
-
/*
|
|
883
|
-
Is this a leap year or not?
|
|
884
|
-
*/
|
|
885
|
-
isLeapYear(jy) {
|
|
886
|
-
return this.jalCal(jy).leap === 0;
|
|
887
|
-
}
|
|
888
|
-
/*
|
|
889
|
-
Number of days in a given month in a Jalaali year.
|
|
890
|
-
*/
|
|
891
|
-
monthLength(jy, jm) {
|
|
892
|
-
if (jm <= 6)
|
|
893
|
-
return 31;
|
|
894
|
-
if (jm <= 11)
|
|
895
|
-
return 30;
|
|
896
|
-
if (this.isLeapYear(jy))
|
|
897
|
-
return 30;
|
|
898
|
-
return 29;
|
|
899
|
-
}
|
|
900
|
-
jalCal(jy) {
|
|
901
|
-
// Jalaali years starting the 33-year rule.
|
|
902
|
-
let breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210,
|
|
903
|
-
1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178
|
|
904
|
-
], bl = breaks.length, gy = jy + 621, leapJ = -14, jp = breaks[0], jm, jump, leap, leapG, march, n, i;
|
|
905
|
-
if (jy < jp || jy >= breaks[bl - 1])
|
|
906
|
-
throw new Error('Invalid Jalaali year ' + jy);
|
|
907
|
-
// Find the limiting years for the Jalaali year jy.
|
|
908
|
-
for (i = 1; i < bl; i += 1) {
|
|
909
|
-
jm = breaks[i];
|
|
910
|
-
jump = jm - jp;
|
|
911
|
-
if (jy < jm)
|
|
912
|
-
break;
|
|
913
|
-
leapJ = leapJ + this.div(jump, 33) * 8 + this.div(this.mod(jump, 33), 4);
|
|
914
|
-
jp = jm;
|
|
915
|
-
}
|
|
916
|
-
n = jy - jp;
|
|
917
|
-
// Find the number of leap years from AD 621 to the beginning
|
|
918
|
-
// of the current Jalaali year in the Persian calendar.
|
|
919
|
-
leapJ = leapJ + this.div(n, 33) * 8 + this.div(this.mod(n, 33) + 3, 4);
|
|
920
|
-
if (this.mod(jump, 33) === 4 && jump - n === 4)
|
|
921
|
-
leapJ += 1;
|
|
922
|
-
// And the same in the Gregorian calendar (until the year gy).
|
|
923
|
-
leapG = this.div(gy, 4) - this.div((this.div(gy, 100) + 1) * 3, 4) - 150;
|
|
924
|
-
// Determine the Gregorian date of Farvardin the 1st.
|
|
925
|
-
march = 20 + leapJ - leapG;
|
|
926
|
-
// Find how many years have passed since the last leap year.
|
|
927
|
-
if (jump - n < 6)
|
|
928
|
-
n = n - jump + this.div(jump + 4, 33) * 33;
|
|
929
|
-
leap = this.mod(this.mod(n + 1, 33) - 1, 4);
|
|
930
|
-
if (leap === -1) {
|
|
931
|
-
leap = 4;
|
|
932
|
-
}
|
|
933
|
-
return {
|
|
934
|
-
leap: leap,
|
|
935
|
-
gy: gy,
|
|
936
|
-
march: march
|
|
937
|
-
};
|
|
938
|
-
}
|
|
939
|
-
/*
|
|
940
|
-
Converts a date of the Jalaali calendar to the Julian Day number.
|
|
941
|
-
@param jy Jalaali year (1 to 3100)
|
|
942
|
-
@param jm Jalaali month (1 to 12)
|
|
943
|
-
@param jd Jalaali day (1 to 29/31)
|
|
944
|
-
@return Julian Day number
|
|
945
|
-
*/
|
|
946
|
-
j2d(jy, jm, jd) {
|
|
947
|
-
let r = this.jalCal(jy);
|
|
948
|
-
return this.g2d(r.gy, 3, r.march) + (jm - 1) * 31 - this.div(jm, 7) * (jm - 7) + jd - 1;
|
|
949
|
-
}
|
|
950
|
-
/*
|
|
951
|
-
Converts the Julian Day number to a date in the Jalaali calendar.
|
|
952
|
-
@param jdn Julian Day number
|
|
953
|
-
@return
|
|
954
|
-
jy: Jalaali year (1 to 3100)
|
|
955
|
-
jm: Jalaali month (1 to 12)
|
|
956
|
-
jd: Jalaali day (1 to 29/31)
|
|
957
|
-
*/
|
|
958
|
-
d2j(jdn) {
|
|
959
|
-
let gy = this.d2g(jdn).gy // Calculate Gregorian year (gy).
|
|
960
|
-
, jy = gy - 621, r = this.jalCal(jy), jdn1f = this.g2d(gy, 3, r.march), jd, jm, k;
|
|
961
|
-
// Find number of days that passed since 1 Farvardin.
|
|
962
|
-
k = jdn - jdn1f;
|
|
963
|
-
if (k >= 0) {
|
|
964
|
-
if (k <= 185) {
|
|
965
|
-
// The first 6 months.
|
|
966
|
-
jm = 1 + this.div(k, 31);
|
|
967
|
-
jd = this.mod(k, 31) + 1;
|
|
968
|
-
return {
|
|
969
|
-
jy: jy,
|
|
970
|
-
jm: jm,
|
|
971
|
-
jd: jd
|
|
972
|
-
};
|
|
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
|
+
});
|
|
973
683
|
}
|
|
974
684
|
else {
|
|
975
|
-
|
|
976
|
-
k -= 186;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
else {
|
|
980
|
-
// Previous Jalaali year.
|
|
981
|
-
jy -= 1;
|
|
982
|
-
k += 179;
|
|
983
|
-
if (r.leap === 1)
|
|
984
|
-
k += 1;
|
|
985
|
-
}
|
|
986
|
-
jm = 7 + this.div(k, 30);
|
|
987
|
-
jd = this.mod(k, 30) + 1;
|
|
988
|
-
return {
|
|
989
|
-
jy: jy,
|
|
990
|
-
jm: jm,
|
|
991
|
-
jd: jd
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
g2d(gy, gm, gd) {
|
|
995
|
-
let d = this.div((gy + this.div(gm - 8, 6) + 100100) * 1461, 4)
|
|
996
|
-
+ this.div(153 * this.mod(gm + 9, 12) + 2, 5)
|
|
997
|
-
+ gd - 34840408;
|
|
998
|
-
d = d - this.div(this.div(gy + 100100 + this.div(gm - 8, 6), 100) * 3, 4) + 752;
|
|
999
|
-
return d;
|
|
1000
|
-
}
|
|
1001
|
-
d2g(jdn) {
|
|
1002
|
-
let j, i, gd, gm, gy;
|
|
1003
|
-
j = 4 * jdn + 139361631;
|
|
1004
|
-
j = j + this.div(this.div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;
|
|
1005
|
-
i = this.div(this.mod(j, 1461), 4) * 5 + 308;
|
|
1006
|
-
gd = this.div(this.mod(i, 153), 5) + 1;
|
|
1007
|
-
gm = this.mod(this.div(i, 153), 12) + 1;
|
|
1008
|
-
gy = this.div(j, 1461) - 100100 + this.div(8 - gm, 6);
|
|
1009
|
-
return {
|
|
1010
|
-
gy: gy,
|
|
1011
|
-
gm: gm,
|
|
1012
|
-
gd: gd
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
/*
|
|
1016
|
-
Utility helper functions.
|
|
1017
|
-
*/
|
|
1018
|
-
div(a, b) {
|
|
1019
|
-
return ~~(a / b);
|
|
1020
|
-
}
|
|
1021
|
-
mod(a, b) {
|
|
1022
|
-
return a - ~~(a / b) * b;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
class AXDateTimeModule {
|
|
1027
|
-
constructor() {
|
|
1028
|
-
AXConfig.set({
|
|
1029
|
-
dateTime: {
|
|
1030
|
-
calendars: {
|
|
1031
|
-
jalali: new JalaliCalendar(),
|
|
1032
|
-
gregorian: new GeorgianCalendar()
|
|
1033
|
-
},
|
|
1034
|
-
calendar: 'gregorian',
|
|
1035
|
-
shortDateFormat: 'DDDD, d MMM yyyy'
|
|
685
|
+
resolve(config);
|
|
1036
686
|
}
|
|
1037
687
|
});
|
|
1038
688
|
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
this.list = [];
|
|
1056
|
-
}
|
|
1057
|
-
broadcast(key, options) {
|
|
1058
|
-
const d = this.list.find(c => c.key === key);
|
|
1059
|
-
if (d) {
|
|
1060
|
-
d.events.forEach(c => {
|
|
1061
|
-
c(options);
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
on(key, callback) {
|
|
1066
|
-
let d = this.list.find(c => c.key === key);
|
|
1067
|
-
if (!d) {
|
|
1068
|
-
d = { key, events: [] };
|
|
1069
|
-
this.list.push(d);
|
|
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);
|
|
1070
705
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
const d = this.list.find(c => c.key === key);
|
|
1075
|
-
if (d) {
|
|
1076
|
-
d.events = [];
|
|
706
|
+
if (!r.handled) {
|
|
707
|
+
if (this.interceptor)
|
|
708
|
+
this.interceptor.error(config, r);
|
|
1077
709
|
}
|
|
1078
|
-
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
class AXHotkeysService {
|
|
1088
|
-
constructor(eventManager, document) {
|
|
1089
|
-
this.eventManager = eventManager;
|
|
1090
|
-
this.document = document;
|
|
1091
|
-
this.defaults = {
|
|
1092
|
-
element: this.document
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
addShortcut(options) {
|
|
1096
|
-
const merged = { ...this.defaults, ...options };
|
|
1097
|
-
const event = `keydown.${merged.keys}`;
|
|
1098
|
-
return new Observable(observer => {
|
|
1099
|
-
const handler = (e) => {
|
|
1100
|
-
e.preventDefault();
|
|
1101
|
-
observer.next(e);
|
|
1102
|
-
};
|
|
1103
|
-
const dispose = this.eventManager.addEventListener(merged.element, event, handler);
|
|
1104
|
-
return () => {
|
|
1105
|
-
dispose();
|
|
1106
|
-
};
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
AXHotkeysService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXHotkeysService, deps: [{ token: i1.EventManager }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1111
|
-
AXHotkeysService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXHotkeysService });
|
|
1112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXHotkeysService, decorators: [{
|
|
1113
|
-
type: Injectable
|
|
1114
|
-
}], ctorParameters: function () { return [{ type: i1.EventManager }, { type: Document, decorators: [{
|
|
1115
|
-
type: Inject,
|
|
1116
|
-
args: [DOCUMENT]
|
|
1117
|
-
}] }]; } });
|
|
1118
|
-
|
|
1119
|
-
// @dynamic
|
|
1120
|
-
class AXTranslator {
|
|
1121
|
-
static get onChange() {
|
|
1122
|
-
return AXTranslator.dataChangeSubject.asObservable();
|
|
1123
|
-
}
|
|
1124
|
-
static load(lang, value) {
|
|
1125
|
-
if (typeof value === 'object') {
|
|
1126
|
-
if (!AXTranslator[`__data__${lang}`]) {
|
|
1127
|
-
AXTranslator[`__data__${lang}`] = {};
|
|
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);
|
|
1128
718
|
}
|
|
1129
|
-
AXTranslator[`__data__${lang}`] = merge(AXTranslator[`__data__${lang}`], value);
|
|
1130
719
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
let result = _.get(AXTranslator[`__data__${lang}`], key, key);
|
|
1138
|
-
const vars = typeof (result) == 'string' ? result?.match(this._varsRegx) : [];
|
|
1139
|
-
if (vars?.length) {
|
|
1140
|
-
vars.forEach(v => {
|
|
1141
|
-
const varKey = v.match(this._varNameRegx)?.length ? v.match(this._varNameRegx)[0] : null;
|
|
1142
|
-
if (varKey) {
|
|
1143
|
-
const p = _.get(params, varKey) || this.get(varKey, lang);
|
|
1144
|
-
if (p) {
|
|
1145
|
-
result = result.replace(v, p);
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
});
|
|
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);
|
|
725
|
+
}
|
|
1149
726
|
}
|
|
1150
|
-
return
|
|
727
|
+
return {
|
|
728
|
+
headers: headers,
|
|
729
|
+
params: params,
|
|
730
|
+
body: options.body,
|
|
731
|
+
responseType: options.responseType || 'json'
|
|
732
|
+
};
|
|
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
|
+
// }
|
|
1151
746
|
}
|
|
1152
747
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
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: [{
|
|
751
|
+
type: Injectable
|
|
752
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i0.Injector }]; } });
|
|
1157
753
|
|
|
1158
|
-
class
|
|
1159
|
-
|
|
1160
|
-
return
|
|
754
|
+
class AXHttpModule {
|
|
755
|
+
static forRoot() {
|
|
756
|
+
return {
|
|
757
|
+
ngModule: AXHttpModule,
|
|
758
|
+
providers: [AXHttpService]
|
|
759
|
+
};
|
|
1161
760
|
}
|
|
1162
761
|
}
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
AXTranslationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXTranslationModule, declarations: [AXTranslatorPipe], exports: [AXTranslatorPipe] });
|
|
1174
|
-
AXTranslationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: AXTranslationModule, providers: [], imports: [[]] });
|
|
1175
|
-
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: [{
|
|
1176
772
|
type: NgModule,
|
|
1177
773
|
args: [{
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
774
|
+
declarations: [],
|
|
775
|
+
imports: [
|
|
776
|
+
CommonModule,
|
|
777
|
+
HttpClientModule
|
|
778
|
+
],
|
|
779
|
+
exports: [HttpClientModule],
|
|
780
|
+
providers: [
|
|
781
|
+
AXHttpService
|
|
782
|
+
]
|
|
1182
783
|
}]
|
|
1183
784
|
}] });
|
|
1184
785
|
|
|
@@ -1258,7 +859,7 @@ class AXPlatform {
|
|
|
1258
859
|
this.click = new Subject();
|
|
1259
860
|
this.scroll = new Subject();
|
|
1260
861
|
fromEvent(window, 'resize')
|
|
1261
|
-
.pipe(debounceTime(
|
|
862
|
+
.pipe(debounceTime(100))
|
|
1262
863
|
.pipe(distinctUntilChanged())
|
|
1263
864
|
.subscribe((e) => {
|
|
1264
865
|
this.resize.next({
|
|
@@ -1307,23 +908,1350 @@ class AXPlatform {
|
|
|
1307
908
|
document.querySelector(':root').style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
|
|
1308
909
|
}
|
|
1309
910
|
}
|
|
1310
|
-
AXPlatform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
1311
|
-
AXPlatform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.
|
|
1312
|
-
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: [{
|
|
1313
914
|
type: Injectable,
|
|
1314
915
|
args: [{
|
|
1315
916
|
providedIn: 'platform',
|
|
1316
917
|
}]
|
|
1317
918
|
}], ctorParameters: function () { return []; } });
|
|
1318
919
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
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
|
+
}] });
|
|
1323
2251
|
|
|
1324
2252
|
/**
|
|
1325
2253
|
* Generated bundle index. Do not edit.
|
|
1326
2254
|
*/
|
|
1327
2255
|
|
|
1328
|
-
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 };
|
|
1329
2257
|
//# sourceMappingURL=acorex-core.mjs.map
|