@acorex/core 3.0.1 → 5.0.1

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