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