@acorex/core 6.5.13 → 6.5.14

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