nira-falcon 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/core-date-picker/core-date-picker.component.mjs +1 -1
- package/esm2022/lib/core-input/core-input.component.mjs +81 -7
- package/esm2022/lib/core-table/core-column-selector/core-column-selector.component.mjs +2 -2
- package/esm2022/lib/core-table/core-table/core-table.component.mjs +3 -3
- package/esm2022/lib/core-table/core-table-card-manager/core-table-card-manager.component.mjs +2 -2
- package/esm2022/lib/core-table/core-table-column-manager/core-table-column-manager.component.mjs +2 -2
- package/esm2022/lib/core-table/core-table-no-content/core-table-no-content.label.mjs +1 -1
- package/esm2022/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.mjs +2 -2
- package/esm2022/utils/directives/detail-viewer-manager.directive.mjs +2 -2
- package/esm2022/utils/directives/table-detail-viewer-manager.directive.mjs +2 -2
- package/fesm2022/nira-falcon.mjs +376 -187
- package/fesm2022/nira-falcon.mjs.map +1 -1
- package/lib/core-input/core-input.component.d.ts +11 -2
- package/lib/core-table/core-column-selector/core-column-selector.component.d.ts +1 -1
- package/lib/core-table/core-table/core-table.component.d.ts +1 -1
- package/lib/core-table/core-table-card-manager/core-table-card-manager.component.d.ts +1 -1
- package/lib/core-table/core-table-column-manager/core-table-column-manager.component.d.ts +1 -1
- package/lib/core-table/core-table-no-content/core-table-no-content.label.d.ts +1 -1
- package/lib/core-table/core-table-shamsi-date/core-table-shamsi-date.component.d.ts +1 -1
- package/package.json +1 -1
- package/esm2022/utils/types.mjs +0 -2
- package/utils/types.d.ts +0 -10
package/fesm2022/nira-falcon.mjs
CHANGED
|
@@ -7,15 +7,12 @@ import * as i1$2 from '@angular/forms';
|
|
|
7
7
|
import { FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
8
8
|
import * as i1$3 from 'nira-date-picker';
|
|
9
9
|
import { NiraDatePickerModule } from 'nira-date-picker';
|
|
10
|
-
import { ACTIVE_OPTIONS, COLUMNS_TYPES } from 'projects/falcon-lib/src/utils/constants';
|
|
11
10
|
import { BehaviorSubject } from 'rxjs';
|
|
12
|
-
import { Util } from 'projects/falcon-lib/src/utils/util';
|
|
13
11
|
import { orderBy } from 'lodash';
|
|
12
|
+
import * as moment from 'jalali-moment';
|
|
14
13
|
import * as i1$5 from 'ngx-indexed-db';
|
|
15
14
|
import * as i1$4 from 'nira-snack-bar';
|
|
16
15
|
import { NiraSnackBarModule } from 'nira-snack-bar';
|
|
17
|
-
import { CaretUpIconComponent as CaretUpIconComponent$1 } from 'projects/falcon-lib/src/svg-icon/caret-up-icon/caret-up-icon.component';
|
|
18
|
-
import * as moment from 'jalali-moment';
|
|
19
16
|
|
|
20
17
|
class CoreCardComponent {
|
|
21
18
|
constructor() {
|
|
@@ -249,6 +246,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
249
246
|
type: Input
|
|
250
247
|
}] } });
|
|
251
248
|
|
|
249
|
+
function toEnglishDigits(num) {
|
|
250
|
+
if (num === null || num === undefined) {
|
|
251
|
+
return '';
|
|
252
|
+
}
|
|
253
|
+
if (typeof num !== 'string' || num.length === 0)
|
|
254
|
+
return num.toString();
|
|
255
|
+
const faDigits = '۰۱۲۳۴۵۶۷۸۹';
|
|
256
|
+
const arDigits = '٠١٢٣٤٥٦٧٨٩';
|
|
257
|
+
let output = '';
|
|
258
|
+
for (let ipos = 0; ipos < num.length; ipos++) {
|
|
259
|
+
let faIndex = faDigits.indexOf(num[ipos]);
|
|
260
|
+
if (faIndex >= 0) {
|
|
261
|
+
output += faIndex.toString();
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
let arIndex = arDigits.indexOf(num[ipos]);
|
|
265
|
+
if (arIndex >= 0) {
|
|
266
|
+
output += arIndex.toString();
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
output += num[ipos];
|
|
270
|
+
}
|
|
271
|
+
return output.replace(/,/g, '');
|
|
272
|
+
}
|
|
273
|
+
function WordifyFa(input, level = 0) {
|
|
274
|
+
if (input === null || input === undefined) {
|
|
275
|
+
return '';
|
|
276
|
+
}
|
|
277
|
+
let num = parseInt(toEnglishDigits(input));
|
|
278
|
+
// convert negative number to positive and get wordify value
|
|
279
|
+
if (num < 0) {
|
|
280
|
+
num = num * -1;
|
|
281
|
+
return 'منفی ' + WordifyFa(num, level);
|
|
282
|
+
}
|
|
283
|
+
if (num === 0) {
|
|
284
|
+
if (level === 0) {
|
|
285
|
+
return 'صفر';
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
return '';
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
let result = '';
|
|
292
|
+
const yekan = ['یک', 'دو', 'سه', 'چهار', 'پنج', 'شش', 'هفت', 'هشت', 'نه'], dahgan = ['بیست', 'سی', 'چهل', 'پنجاه', 'شصت', 'هفتاد', 'هشتاد', 'نود'], sadgan = [
|
|
293
|
+
'یکصد',
|
|
294
|
+
'دویست',
|
|
295
|
+
'سیصد',
|
|
296
|
+
'چهارصد',
|
|
297
|
+
'پانصد',
|
|
298
|
+
'ششصد',
|
|
299
|
+
'هفتصد',
|
|
300
|
+
'هشتصد',
|
|
301
|
+
'نهصد',
|
|
302
|
+
], dah = [
|
|
303
|
+
'ده',
|
|
304
|
+
'یازده',
|
|
305
|
+
'دوازده',
|
|
306
|
+
'سیزده',
|
|
307
|
+
'چهارده',
|
|
308
|
+
'پانزده',
|
|
309
|
+
'شانزده',
|
|
310
|
+
'هفده',
|
|
311
|
+
'هیجده',
|
|
312
|
+
'نوزده',
|
|
313
|
+
];
|
|
314
|
+
if (level > 0) {
|
|
315
|
+
result += ' و ';
|
|
316
|
+
level -= 1;
|
|
317
|
+
}
|
|
318
|
+
if (num < 10) {
|
|
319
|
+
result += yekan[num - 1];
|
|
320
|
+
}
|
|
321
|
+
else if (num < 20) {
|
|
322
|
+
result += dah[num - 10];
|
|
323
|
+
}
|
|
324
|
+
else if (num < 100) {
|
|
325
|
+
result += dahgan[Math.floor(num / 10) - 2] + WordifyFa(num % 10, level + 1);
|
|
326
|
+
}
|
|
327
|
+
else if (num < 1000) {
|
|
328
|
+
result +=
|
|
329
|
+
sadgan[Math.floor(num / 100) - 1] + WordifyFa(num % 100, level + 1);
|
|
330
|
+
}
|
|
331
|
+
else if (num < 1000000) {
|
|
332
|
+
result +=
|
|
333
|
+
WordifyFa(Math.floor(num / 1000), level) +
|
|
334
|
+
' هزار' +
|
|
335
|
+
WordifyFa(num % 1000, level + 1);
|
|
336
|
+
}
|
|
337
|
+
else if (num < 1000000000) {
|
|
338
|
+
result +=
|
|
339
|
+
WordifyFa(Math.floor(num / 1000000), level) +
|
|
340
|
+
' میلیون' +
|
|
341
|
+
WordifyFa(num % 1000000, level + 1);
|
|
342
|
+
}
|
|
343
|
+
else if (num < 1000000000000) {
|
|
344
|
+
result +=
|
|
345
|
+
WordifyFa(Math.floor(num / 1000000000), level) +
|
|
346
|
+
' میلیارد' +
|
|
347
|
+
WordifyFa(num % 1000000000, level + 1);
|
|
348
|
+
}
|
|
349
|
+
else if (num < 1000000000000000) {
|
|
350
|
+
result +=
|
|
351
|
+
WordifyFa(Math.floor(num / 1000000000000), level) +
|
|
352
|
+
' تریلیارد' +
|
|
353
|
+
WordifyFa(num % 1000000000000, level + 1);
|
|
354
|
+
}
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
|
|
252
358
|
class PersianDigitsPipe {
|
|
253
359
|
transform(el) {
|
|
254
360
|
const persian = {
|
|
@@ -287,12 +393,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
287
393
|
}]
|
|
288
394
|
}] });
|
|
289
395
|
|
|
396
|
+
class CoreNumberComponent {
|
|
397
|
+
constructor() {
|
|
398
|
+
this.number = '';
|
|
399
|
+
this.type = 'number';
|
|
400
|
+
this.canSplitNumbers = false;
|
|
401
|
+
this.canShowWordInToolTip = false;
|
|
402
|
+
this.canShowIRR = false;
|
|
403
|
+
}
|
|
404
|
+
wordifyFa(number) {
|
|
405
|
+
if (number === undefined) {
|
|
406
|
+
return '';
|
|
407
|
+
}
|
|
408
|
+
if (this.type === 'number') {
|
|
409
|
+
if (this.canSplitNumbers) {
|
|
410
|
+
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
return number;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
const newNumber = Number(number.toString().replaceAll(',', ''));
|
|
418
|
+
if (newNumber > 10) {
|
|
419
|
+
return WordifyFa(newNumber / 10) + ' تومان ';
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
return WordifyFa(number);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
toolTipText(number) {
|
|
427
|
+
if (this.number === undefined)
|
|
428
|
+
return '';
|
|
429
|
+
if (!this.canShowWordInToolTip)
|
|
430
|
+
return '';
|
|
431
|
+
if (number && +number > 10) {
|
|
432
|
+
return WordifyFa(+number / 10) + ' تومان ';
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
return WordifyFa(number);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
439
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CoreNumberComponent, selector: "app-core-number", inputs: { number: "number", type: "type", canSplitNumbers: "canSplitNumbers", canShowWordInToolTip: "canShowWordInToolTip", canShowIRR: "canShowIRR" }, ngImport: i0, template: "<span [title]=\"toolTipText(number)\"\r\n >{{ wordifyFa(number) | persianDigits }} {{ canShowIRR ? \"\u0631\u06CC\u0627\u0644\" : \"\" }}\r\n</span>\r\n", styles: [""], dependencies: [{ kind: "pipe", type: PersianDigitsPipe, name: "persianDigits" }] }); }
|
|
440
|
+
}
|
|
441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreNumberComponent, decorators: [{
|
|
442
|
+
type: Component,
|
|
443
|
+
args: [{ selector: 'app-core-number', template: "<span [title]=\"toolTipText(number)\"\r\n >{{ wordifyFa(number) | persianDigits }} {{ canShowIRR ? \"\u0631\u06CC\u0627\u0644\" : \"\" }}\r\n</span>\r\n" }]
|
|
444
|
+
}], propDecorators: { number: [{
|
|
445
|
+
type: Input
|
|
446
|
+
}], type: [{
|
|
447
|
+
type: Input
|
|
448
|
+
}], canSplitNumbers: [{
|
|
449
|
+
type: Input
|
|
450
|
+
}], canShowWordInToolTip: [{
|
|
451
|
+
type: Input
|
|
452
|
+
}], canShowIRR: [{
|
|
453
|
+
type: Input
|
|
454
|
+
}] } });
|
|
455
|
+
|
|
290
456
|
class CoreInputComponent {
|
|
291
457
|
constructor() {
|
|
292
458
|
this.isDisable = false;
|
|
459
|
+
this.canShowWordifyFa = false;
|
|
460
|
+
this.canSplitNumber = false;
|
|
461
|
+
this.canHighlightBackground = false;
|
|
462
|
+
this.maxLength = 2000;
|
|
293
463
|
this.inputFormControl = new FormControl('', []);
|
|
294
464
|
this.placeholder = '';
|
|
295
465
|
this.onChange = new EventEmitter();
|
|
466
|
+
this.onBlurEmit = new EventEmitter();
|
|
296
467
|
}
|
|
297
468
|
set type(value) {
|
|
298
469
|
this.inputType = value;
|
|
@@ -306,19 +477,85 @@ class CoreInputComponent {
|
|
|
306
477
|
this.inputFormControl.enable();
|
|
307
478
|
}
|
|
308
479
|
}
|
|
309
|
-
change() {
|
|
310
|
-
|
|
311
|
-
|
|
480
|
+
change(event) {
|
|
481
|
+
this.formatPrice(event.srcElement.value);
|
|
482
|
+
}
|
|
483
|
+
onPaste(event) {
|
|
484
|
+
setTimeout(() => {
|
|
485
|
+
const value = event.srcElement.value;
|
|
486
|
+
this.inputFormControl.markAsTouched();
|
|
487
|
+
this.inputFormControl.setValue(value);
|
|
488
|
+
if (this.inputType === 'number' && this.canSplitNumber) {
|
|
489
|
+
this.onChange.emit(value.replaceAll(',', ''));
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
if (!this.inputFormControl.errors) {
|
|
493
|
+
this.onChange.emit(value);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}, 10);
|
|
497
|
+
}
|
|
498
|
+
onBlur() {
|
|
499
|
+
if (this.inputType === 'number' && this.canSplitNumber) {
|
|
500
|
+
this.onChange.emit(this.inputFormControl.value.replaceAll(',', ''));
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
if (!this.inputFormControl.errors) {
|
|
504
|
+
this.onChange.emit(this.inputFormControl.value);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
this.onBlurEmit.emit(this.inputFormControl.value);
|
|
508
|
+
console.log(this.inputFormControl);
|
|
509
|
+
}
|
|
510
|
+
onKeyPress() {
|
|
511
|
+
if (this.inputFormControl.value.toString().length == this.maxLength) {
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
formatPrice(event) {
|
|
519
|
+
if (this.inputType === 'number' && this.canSplitNumber) {
|
|
520
|
+
setTimeout(() => {
|
|
521
|
+
let value = event;
|
|
522
|
+
value = Number(value.replaceAll(',', ''));
|
|
523
|
+
if (isNaN(value)) {
|
|
524
|
+
this.inputFormControl.setValue('');
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
const formatValue = value
|
|
528
|
+
.toString()
|
|
529
|
+
.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
530
|
+
this.inputFormControl.setValue(formatValue);
|
|
531
|
+
}
|
|
532
|
+
if (!this.inputFormControl.errors) {
|
|
533
|
+
this.onChange.emit(this.inputFormControl.value.replaceAll(',', ''));
|
|
534
|
+
}
|
|
535
|
+
}, 10);
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
if (!this.inputFormControl.errors) {
|
|
539
|
+
this.onChange.emit(this.inputFormControl.value);
|
|
540
|
+
}
|
|
312
541
|
}
|
|
313
542
|
}
|
|
314
543
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
315
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CoreInputComponent, selector: "core-input", inputs: { type: "type", inputFormControl: "inputFormControl", disable: "disable", placeholder: "placeholder" }, outputs: { onChange: "onChange" }, ngImport: i0, template: "<div>\r\n <div\r\n class=\"container-input\"\r\n [ngClass]=\"{\r\n error:\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors\r\n }\"\r\n >\r\n <input\r\n [type]=\"
|
|
544
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CoreInputComponent, selector: "core-input", inputs: { type: "type", canShowWordifyFa: "canShowWordifyFa", canSplitNumber: "canSplitNumber", canHighlightBackground: "canHighlightBackground", maxLength: "maxLength", inputFormControl: "inputFormControl", disable: "disable", placeholder: "placeholder" }, outputs: { onChange: "onChange", onBlurEmit: "onBlurEmit" }, ngImport: i0, template: "<div>\r\n <div\r\n class=\"container-input\"\r\n [ngClass]=\"{\r\n error:\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors\r\n }\"\r\n >\r\n <input\r\n [type]=\"'text'\"\r\n class=\"a-input-style\"\r\n [formControl]=\"inputFormControl\"\r\n (blur)=\"onBlur()\"\r\n (keyup)=\"change($event)\"\r\n (paste)=\"onPaste($event)\"\r\n [ngClass]=\"{\r\n 'have-value': inputFormControl.value.toString().length > 0,\r\n 'highlight-background':\r\n canHighlightBackground &&\r\n inputFormControl.value.toString().length === 0 &&\r\n !(\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors\r\n ),\r\n 'disable-input': isDisable\r\n }\"\r\n (keypress)=\"onKeyPress()\"\r\n />\r\n <label *ngIf=\"placeholder.length > 0\">{{ placeholder }} </label>\r\n <div class=\"label-error overflow-hidden\">\r\n <span\r\n class=\"label-number\"\r\n *ngIf=\"\r\n canShowWordifyFa &&\r\n inputFormControl.value.toString().length > 0 &&\r\n inputType === 'number'\r\n \"\r\n ><app-core-number\r\n [canShowWordInToolTip]=\"false\"\r\n [type]=\"'word'\"\r\n [number]=\"inputFormControl.value\"\r\n ></app-core-number\r\n ></span>\r\n\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['required']\r\n \"\r\n >\u0627\u06CC\u0646 \u0641\u06CC\u0644\u062F \u062E\u0627\u0644\u06CC \u0627\u0633\u062A</span\r\n >\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['prePayment']\r\n \"\r\n >\u0645\u0628\u0644\u063A \u0635\u062D\u06CC\u062D \u0646\u06CC\u0633\u062A</span\r\n >\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['minlength']\r\n \"\r\n >\r\n \u062D\u062F\u0627\u0642\u0644 \u062A\u0639\u062F\u0627\u062F \u06A9\u0627\u0631\u06A9\u062A\u0631\r\n {{inputFormControl.errors?.['minlength'].requiredLength|persianDigits}}\r\n \u0639\u062F\u062F \u0628\u0627\u0634\u062F\r\n </span>\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['maxlength']\r\n \"\r\n >\r\n \u062D\u062F\u0627\u06A9\u062B\u0631 \u062A\u0639\u062F\u0627\u062F \u06A9\u0627\u0631\u06A9\u062A\u0631\r\n {{inputFormControl.errors?.['maxlength'].requiredLength |persianDigits}}\r\n \u0639\u062F\u062F \u0628\u0627\u0634\u062F\r\n </span>\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['pattern']?.requiredPattern=='^09[0-9]{9}$'\r\n \"\r\n >\r\n \u0634\u0645\u0627\u0631\u0647 \u0647\u0645\u0631\u0627\u0647 \u0627\u0634\u062A\u0628\u0627\u0647 \u0647\u0633\u062A\r\n </span>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container{position:relative}input:focus{border:2px solid blue}input{border:1px solid #ced4da;border-radius:.25rem}.highlight-background{background-color:#dcf6ff!important}.icon-style{position:absolute;right:16px;top:16px;cursor:pointer;font-size:16px}.icon-style-email{position:absolute;right:16px;top:16px}.a-input-style{height:42px;width:100%;padding:16px;outline:none;caret-color:#020202b3;background-color:#f2f4f726;color:#000000b3;box-sizing:border-box}.a-input-style:focus{background-color:#f2f4f70d;border-radius:3px;border:1px solid rgba(19,92,175,.397)}.a-input-style::placeholder{height:15px;font-style:normal;font-weight:400;font-size:12px;line-height:15px;letter-spacing:-.03em;color:#c2c2c2b3}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-text-fill-color:rgba(255,255,255,0)}input:-webkit-autofill.have-value,input:-webkit-autofill:hover.have-value,input:-webkit-autofill:focus.have-value{-webkit-text-fill-color:#181818!important}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.label-error{color:red;font-size:13px;margin-block-start:4px;min-height:21px;width:100%;display:inline-block!important;text-align:start}.label-number{color:#6a6a6a}.error input{border:1px solid #fe5f5f}.container-input{background:#fff;position:relative}.container-input .disable-input{background-color:#f7f7f7;border:1px dashed #ced4da;pointer-events:none}.container-input label{position:absolute;right:20px;top:12px;color:gray;font-size:12px;padding:0 8px;border-radius:15px;pointer-events:none;transition:.2s}.container-input input:focus+label,.container-input input.have-value+label{top:-10px;font-size:10px;z-index:3}.container-input input:focus+label:after,.container-input input.have-value+label:after{content:\"\";display:block;background:#fff;position:absolute;width:100%;height:1px;top:10px;right:0;transition:.3s;z-index:-1}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: CoreNumberComponent, selector: "app-core-number", inputs: ["number", "type", "canSplitNumbers", "canShowWordInToolTip", "canShowIRR"] }, { kind: "pipe", type: PersianDigitsPipe, name: "persianDigits" }] }); }
|
|
316
545
|
}
|
|
317
546
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreInputComponent, decorators: [{
|
|
318
547
|
type: Component,
|
|
319
|
-
args: [{ selector: 'core-input', template: "<div>\r\n <div\r\n class=\"container-input\"\r\n [ngClass]=\"{\r\n error:\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors\r\n }\"\r\n >\r\n <input\r\n [type]=\"
|
|
548
|
+
args: [{ selector: 'core-input', template: "<div>\r\n <div\r\n class=\"container-input\"\r\n [ngClass]=\"{\r\n error:\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors\r\n }\"\r\n >\r\n <input\r\n [type]=\"'text'\"\r\n class=\"a-input-style\"\r\n [formControl]=\"inputFormControl\"\r\n (blur)=\"onBlur()\"\r\n (keyup)=\"change($event)\"\r\n (paste)=\"onPaste($event)\"\r\n [ngClass]=\"{\r\n 'have-value': inputFormControl.value.toString().length > 0,\r\n 'highlight-background':\r\n canHighlightBackground &&\r\n inputFormControl.value.toString().length === 0 &&\r\n !(\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors\r\n ),\r\n 'disable-input': isDisable\r\n }\"\r\n (keypress)=\"onKeyPress()\"\r\n />\r\n <label *ngIf=\"placeholder.length > 0\">{{ placeholder }} </label>\r\n <div class=\"label-error overflow-hidden\">\r\n <span\r\n class=\"label-number\"\r\n *ngIf=\"\r\n canShowWordifyFa &&\r\n inputFormControl.value.toString().length > 0 &&\r\n inputType === 'number'\r\n \"\r\n ><app-core-number\r\n [canShowWordInToolTip]=\"false\"\r\n [type]=\"'word'\"\r\n [number]=\"inputFormControl.value\"\r\n ></app-core-number\r\n ></span>\r\n\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['required']\r\n \"\r\n >\u0627\u06CC\u0646 \u0641\u06CC\u0644\u062F \u062E\u0627\u0644\u06CC \u0627\u0633\u062A</span\r\n >\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['prePayment']\r\n \"\r\n >\u0645\u0628\u0644\u063A \u0635\u062D\u06CC\u062D \u0646\u06CC\u0633\u062A</span\r\n >\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['minlength']\r\n \"\r\n >\r\n \u062D\u062F\u0627\u0642\u0644 \u062A\u0639\u062F\u0627\u062F \u06A9\u0627\u0631\u06A9\u062A\u0631\r\n {{inputFormControl.errors?.['minlength'].requiredLength|persianDigits}}\r\n \u0639\u062F\u062F \u0628\u0627\u0634\u062F\r\n </span>\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['maxlength']\r\n \"\r\n >\r\n \u062D\u062F\u0627\u06A9\u062B\u0631 \u062A\u0639\u062F\u0627\u062F \u06A9\u0627\u0631\u06A9\u062A\u0631\r\n {{inputFormControl.errors?.['maxlength'].requiredLength |persianDigits}}\r\n \u0639\u062F\u062F \u0628\u0627\u0634\u062F\r\n </span>\r\n <span\r\n *ngIf=\"\r\n (inputFormControl.touched || inputFormControl.dirty) &&\r\n inputFormControl.errors?.['pattern']?.requiredPattern=='^09[0-9]{9}$'\r\n \"\r\n >\r\n \u0634\u0645\u0627\u0631\u0647 \u0647\u0645\u0631\u0627\u0647 \u0627\u0634\u062A\u0628\u0627\u0647 \u0647\u0633\u062A\r\n </span>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".container{position:relative}input:focus{border:2px solid blue}input{border:1px solid #ced4da;border-radius:.25rem}.highlight-background{background-color:#dcf6ff!important}.icon-style{position:absolute;right:16px;top:16px;cursor:pointer;font-size:16px}.icon-style-email{position:absolute;right:16px;top:16px}.a-input-style{height:42px;width:100%;padding:16px;outline:none;caret-color:#020202b3;background-color:#f2f4f726;color:#000000b3;box-sizing:border-box}.a-input-style:focus{background-color:#f2f4f70d;border-radius:3px;border:1px solid rgba(19,92,175,.397)}.a-input-style::placeholder{height:15px;font-style:normal;font-weight:400;font-size:12px;line-height:15px;letter-spacing:-.03em;color:#c2c2c2b3}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{-webkit-text-fill-color:rgba(255,255,255,0)}input:-webkit-autofill.have-value,input:-webkit-autofill:hover.have-value,input:-webkit-autofill:focus.have-value{-webkit-text-fill-color:#181818!important}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.label-error{color:red;font-size:13px;margin-block-start:4px;min-height:21px;width:100%;display:inline-block!important;text-align:start}.label-number{color:#6a6a6a}.error input{border:1px solid #fe5f5f}.container-input{background:#fff;position:relative}.container-input .disable-input{background-color:#f7f7f7;border:1px dashed #ced4da;pointer-events:none}.container-input label{position:absolute;right:20px;top:12px;color:gray;font-size:12px;padding:0 8px;border-radius:15px;pointer-events:none;transition:.2s}.container-input input:focus+label,.container-input input.have-value+label{top:-10px;font-size:10px;z-index:3}.container-input input:focus+label:after,.container-input input.have-value+label:after{content:\"\";display:block;background:#fff;position:absolute;width:100%;height:1px;top:10px;right:0;transition:.3s;z-index:-1}\n"] }]
|
|
320
549
|
}], propDecorators: { type: [{
|
|
321
550
|
type: Input
|
|
551
|
+
}], canShowWordifyFa: [{
|
|
552
|
+
type: Input
|
|
553
|
+
}], canSplitNumber: [{
|
|
554
|
+
type: Input
|
|
555
|
+
}], canHighlightBackground: [{
|
|
556
|
+
type: Input
|
|
557
|
+
}], maxLength: [{
|
|
558
|
+
type: Input
|
|
322
559
|
}], inputFormControl: [{
|
|
323
560
|
type: Input
|
|
324
561
|
}], disable: [{
|
|
@@ -327,6 +564,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
327
564
|
type: Input
|
|
328
565
|
}], onChange: [{
|
|
329
566
|
type: Output
|
|
567
|
+
}], onBlurEmit: [{
|
|
568
|
+
type: Output
|
|
330
569
|
}] } });
|
|
331
570
|
|
|
332
571
|
class CoreDatePickerComponent {
|
|
@@ -361,7 +600,7 @@ class CoreDatePickerComponent {
|
|
|
361
600
|
});
|
|
362
601
|
}
|
|
363
602
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreDatePickerComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
364
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CoreDatePickerComponent, selector: "core-date-picker", inputs: { canSelectToday: "canSelectToday", defaultDate: "defaultDate", label: "label", inputFormControl: "inputFormControl" }, ngImport: i0, template: "<core-input\r\n [placeholder]=\"label\"\r\n [inputFormControl]=\"inputFormControl\"\r\n (click)=\"isOpenCalendar = true\"\r\n>\r\n</core-input>\r\n<lib-nira-date-picker\r\n [(isOpenCalendar)]=\"isOpenCalendar\"\r\n [defaultDate]=\"date ? date : defaultDate\"\r\n (datePickerResult)=\"onDatePickerResult($event)\"\r\n [selectToday]=\"canSelectToday\"\r\n (todayDate)=\"onTodayDate($event)\"\r\n>\r\n</lib-nira-date-picker>\r\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.NiraDatePickerComponent, selector: "lib-nira-date-picker", inputs: ["selectToday", "disable", "changableYears", "theme", "defaultDate", "isOpenCalendar"], outputs: ["isOpenCalendarChange", "todayDate", "datePickerResult"] }, { kind: "component", type: CoreInputComponent, selector: "core-input", inputs: ["type", "inputFormControl", "disable", "placeholder"], outputs: ["onChange"] }] }); }
|
|
603
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CoreDatePickerComponent, selector: "core-date-picker", inputs: { canSelectToday: "canSelectToday", defaultDate: "defaultDate", label: "label", inputFormControl: "inputFormControl" }, ngImport: i0, template: "<core-input\r\n [placeholder]=\"label\"\r\n [inputFormControl]=\"inputFormControl\"\r\n (click)=\"isOpenCalendar = true\"\r\n>\r\n</core-input>\r\n<lib-nira-date-picker\r\n [(isOpenCalendar)]=\"isOpenCalendar\"\r\n [defaultDate]=\"date ? date : defaultDate\"\r\n (datePickerResult)=\"onDatePickerResult($event)\"\r\n [selectToday]=\"canSelectToday\"\r\n (todayDate)=\"onTodayDate($event)\"\r\n>\r\n</lib-nira-date-picker>\r\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.NiraDatePickerComponent, selector: "lib-nira-date-picker", inputs: ["selectToday", "disable", "changableYears", "theme", "defaultDate", "isOpenCalendar"], outputs: ["isOpenCalendarChange", "todayDate", "datePickerResult"] }, { kind: "component", type: CoreInputComponent, selector: "core-input", inputs: ["type", "canShowWordifyFa", "canSplitNumber", "canHighlightBackground", "maxLength", "inputFormControl", "disable", "placeholder"], outputs: ["onChange", "onBlurEmit"] }] }); }
|
|
365
604
|
}
|
|
366
605
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreDatePickerComponent, decorators: [{
|
|
367
606
|
type: Component,
|
|
@@ -634,6 +873,125 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
634
873
|
type: Input
|
|
635
874
|
}] } });
|
|
636
875
|
|
|
876
|
+
var IconInput;
|
|
877
|
+
(function (IconInput) {
|
|
878
|
+
IconInput["Password"] = "Password";
|
|
879
|
+
IconInput["Text"] = "Text";
|
|
880
|
+
IconInput["EmailPhone"] = "EmailPhone";
|
|
881
|
+
IconInput["Phone"] = "Phone";
|
|
882
|
+
IconInput["Editable"] = "Editable";
|
|
883
|
+
IconInput["Verified"] = "Verified";
|
|
884
|
+
IconInput["NotVerified"] = "NotVerified";
|
|
885
|
+
IconInput["OwnerName"] = "OwnerName";
|
|
886
|
+
IconInput["totalAmount"] = "totalAmount";
|
|
887
|
+
IconInput["totalRows"] = "totalRows";
|
|
888
|
+
IconInput["Date"] = "Date";
|
|
889
|
+
})(IconInput || (IconInput = {}));
|
|
890
|
+
var UserLanguage;
|
|
891
|
+
(function (UserLanguage) {
|
|
892
|
+
UserLanguage["EN"] = "en";
|
|
893
|
+
UserLanguage["FA"] = "fa";
|
|
894
|
+
})(UserLanguage || (UserLanguage = {}));
|
|
895
|
+
var COLUMNS_TYPES;
|
|
896
|
+
(function (COLUMNS_TYPES) {
|
|
897
|
+
COLUMNS_TYPES["TEXT"] = "text";
|
|
898
|
+
COLUMNS_TYPES["NUMBER"] = "number";
|
|
899
|
+
COLUMNS_TYPES["SELECTOR"] = "selector";
|
|
900
|
+
COLUMNS_TYPES["ROW_SELECTOR"] = "row-selector";
|
|
901
|
+
COLUMNS_TYPES["STATUS"] = "status";
|
|
902
|
+
COLUMNS_TYPES["STATUS_ACTIVE"] = "status-active";
|
|
903
|
+
COLUMNS_TYPES["ACTION"] = "action";
|
|
904
|
+
COLUMNS_TYPES["ACTION_BUTTONS"] = "action-buttons";
|
|
905
|
+
COLUMNS_TYPES["SHAMSI_DATE"] = "shamsi-date";
|
|
906
|
+
COLUMNS_TYPES["MULTI_COLUMN"] = "multiColumn";
|
|
907
|
+
COLUMNS_TYPES["PELAK"] = "pelak";
|
|
908
|
+
COLUMNS_TYPES["DETAIL_VIEWER_FOR_REPORT"] = "detail-viewer-for-report";
|
|
909
|
+
})(COLUMNS_TYPES || (COLUMNS_TYPES = {}));
|
|
910
|
+
var TOAST_MESSAGES;
|
|
911
|
+
(function (TOAST_MESSAGES) {
|
|
912
|
+
TOAST_MESSAGES["SUCCESSFUL_CREATE"] = "\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u062B\u0628\u062A \u0634\u062F";
|
|
913
|
+
TOAST_MESSAGES["SUCCESSFUL_ADDED"] = "\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u0627\u0636\u0627\u0641\u0647 \u0634\u062F";
|
|
914
|
+
TOAST_MESSAGES["SUCCESSFUL_EDIT"] = "\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u0648\u06CC\u0631\u0627\u06CC\u0634 \u0634\u062F";
|
|
915
|
+
TOAST_MESSAGES["SUCCESSFUL_DELETED"] = "\u0628\u0627 \u0645\u0648\u0641\u0642\u06CC\u062A \u062D\u0630\u0641 \u0634\u062F ";
|
|
916
|
+
})(TOAST_MESSAGES || (TOAST_MESSAGES = {}));
|
|
917
|
+
const travelTypes = [
|
|
918
|
+
{
|
|
919
|
+
title: 'داخلی',
|
|
920
|
+
value: 'Domestic',
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
title: 'بین المللی',
|
|
924
|
+
value: 'International',
|
|
925
|
+
},
|
|
926
|
+
];
|
|
927
|
+
var DetailViewers$1;
|
|
928
|
+
(function (DetailViewers) {
|
|
929
|
+
DetailViewers["BILL"] = "bill";
|
|
930
|
+
DetailViewers["DRIVER"] = "driver";
|
|
931
|
+
DetailViewers["MANIFEST"] = "manifest";
|
|
932
|
+
DetailViewers["SERVICE"] = "service";
|
|
933
|
+
DetailViewers["VEHICLE"] = "vehicle";
|
|
934
|
+
})(DetailViewers$1 || (DetailViewers$1 = {}));
|
|
935
|
+
const countryCodes = [
|
|
936
|
+
{
|
|
937
|
+
countryId: 'IR',
|
|
938
|
+
countryNameFa: 'ايران',
|
|
939
|
+
countryNameEn: 'Iran',
|
|
940
|
+
},
|
|
941
|
+
];
|
|
942
|
+
const priceTypes = [
|
|
943
|
+
{
|
|
944
|
+
currencyId: 'IRR',
|
|
945
|
+
currencyNameEn: 'Iranian Rial',
|
|
946
|
+
currencyNameFa: 'ریال ایران',
|
|
947
|
+
},
|
|
948
|
+
];
|
|
949
|
+
const YES_NO_OPTIONS = [
|
|
950
|
+
{
|
|
951
|
+
title: 'بله',
|
|
952
|
+
value: true,
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
title: 'خیر',
|
|
956
|
+
value: false,
|
|
957
|
+
},
|
|
958
|
+
];
|
|
959
|
+
const ACTIVE_OPTIONS = [
|
|
960
|
+
{
|
|
961
|
+
title: 'فعال',
|
|
962
|
+
value: true,
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
title: 'غیر فعال',
|
|
966
|
+
value: false,
|
|
967
|
+
},
|
|
968
|
+
];
|
|
969
|
+
|
|
970
|
+
class Util {
|
|
971
|
+
static getMoneyFormat(data) {
|
|
972
|
+
return ('' + data).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
|
973
|
+
}
|
|
974
|
+
static isRunningOnSmallScreen() {
|
|
975
|
+
return window.innerWidth < 772;
|
|
976
|
+
}
|
|
977
|
+
static isRunningOnMobile() {
|
|
978
|
+
return !this.isRunningOnWindows;
|
|
979
|
+
}
|
|
980
|
+
static isRunningOnWindows() {
|
|
981
|
+
return navigator.platform.startsWith('Win');
|
|
982
|
+
}
|
|
983
|
+
static getRunningPlatform() {
|
|
984
|
+
return navigator.platform;
|
|
985
|
+
}
|
|
986
|
+
static getTotalFromArray(array, name) {
|
|
987
|
+
return array.map((item) => +item[name]).reduce((prev, next) => prev + next);
|
|
988
|
+
}
|
|
989
|
+
static shamsiToMiladi(value, format) {
|
|
990
|
+
const m = moment(value, 'jYYYY-jMM-jDD HH:mm');
|
|
991
|
+
return m.format(format);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
637
995
|
class CoreColumnInputComponent {
|
|
638
996
|
constructor() {
|
|
639
997
|
this.showRemoveIcon = true;
|
|
@@ -940,174 +1298,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
940
1298
|
args: [{ required: true }]
|
|
941
1299
|
}] } });
|
|
942
1300
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
if (typeof num !== 'string' || num.length === 0)
|
|
948
|
-
return num.toString();
|
|
949
|
-
const faDigits = '۰۱۲۳۴۵۶۷۸۹';
|
|
950
|
-
const arDigits = '٠١٢٣٤٥٦٧٨٩';
|
|
951
|
-
let output = '';
|
|
952
|
-
for (let ipos = 0; ipos < num.length; ipos++) {
|
|
953
|
-
let faIndex = faDigits.indexOf(num[ipos]);
|
|
954
|
-
if (faIndex >= 0) {
|
|
955
|
-
output += faIndex.toString();
|
|
956
|
-
continue;
|
|
957
|
-
}
|
|
958
|
-
let arIndex = arDigits.indexOf(num[ipos]);
|
|
959
|
-
if (arIndex >= 0) {
|
|
960
|
-
output += arIndex.toString();
|
|
961
|
-
continue;
|
|
962
|
-
}
|
|
963
|
-
output += num[ipos];
|
|
964
|
-
}
|
|
965
|
-
return output.replace(/,/g, '');
|
|
966
|
-
}
|
|
967
|
-
function WordifyFa(input, level = 0) {
|
|
968
|
-
if (input === null || input === undefined) {
|
|
969
|
-
return '';
|
|
970
|
-
}
|
|
971
|
-
let num = parseInt(toEnglishDigits(input));
|
|
972
|
-
// convert negative number to positive and get wordify value
|
|
973
|
-
if (num < 0) {
|
|
974
|
-
num = num * -1;
|
|
975
|
-
return 'منفی ' + WordifyFa(num, level);
|
|
976
|
-
}
|
|
977
|
-
if (num === 0) {
|
|
978
|
-
if (level === 0) {
|
|
979
|
-
return 'صفر';
|
|
980
|
-
}
|
|
981
|
-
else {
|
|
982
|
-
return '';
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
let result = '';
|
|
986
|
-
const yekan = ['یک', 'دو', 'سه', 'چهار', 'پنج', 'شش', 'هفت', 'هشت', 'نه'], dahgan = ['بیست', 'سی', 'چهل', 'پنجاه', 'شصت', 'هفتاد', 'هشتاد', 'نود'], sadgan = [
|
|
987
|
-
'یکصد',
|
|
988
|
-
'دویست',
|
|
989
|
-
'سیصد',
|
|
990
|
-
'چهارصد',
|
|
991
|
-
'پانصد',
|
|
992
|
-
'ششصد',
|
|
993
|
-
'هفتصد',
|
|
994
|
-
'هشتصد',
|
|
995
|
-
'نهصد',
|
|
996
|
-
], dah = [
|
|
997
|
-
'ده',
|
|
998
|
-
'یازده',
|
|
999
|
-
'دوازده',
|
|
1000
|
-
'سیزده',
|
|
1001
|
-
'چهارده',
|
|
1002
|
-
'پانزده',
|
|
1003
|
-
'شانزده',
|
|
1004
|
-
'هفده',
|
|
1005
|
-
'هیجده',
|
|
1006
|
-
'نوزده',
|
|
1007
|
-
];
|
|
1008
|
-
if (level > 0) {
|
|
1009
|
-
result += ' و ';
|
|
1010
|
-
level -= 1;
|
|
1011
|
-
}
|
|
1012
|
-
if (num < 10) {
|
|
1013
|
-
result += yekan[num - 1];
|
|
1014
|
-
}
|
|
1015
|
-
else if (num < 20) {
|
|
1016
|
-
result += dah[num - 10];
|
|
1017
|
-
}
|
|
1018
|
-
else if (num < 100) {
|
|
1019
|
-
result += dahgan[Math.floor(num / 10) - 2] + WordifyFa(num % 10, level + 1);
|
|
1020
|
-
}
|
|
1021
|
-
else if (num < 1000) {
|
|
1022
|
-
result +=
|
|
1023
|
-
sadgan[Math.floor(num / 100) - 1] + WordifyFa(num % 100, level + 1);
|
|
1024
|
-
}
|
|
1025
|
-
else if (num < 1000000) {
|
|
1026
|
-
result +=
|
|
1027
|
-
WordifyFa(Math.floor(num / 1000), level) +
|
|
1028
|
-
' هزار' +
|
|
1029
|
-
WordifyFa(num % 1000, level + 1);
|
|
1030
|
-
}
|
|
1031
|
-
else if (num < 1000000000) {
|
|
1032
|
-
result +=
|
|
1033
|
-
WordifyFa(Math.floor(num / 1000000), level) +
|
|
1034
|
-
' میلیون' +
|
|
1035
|
-
WordifyFa(num % 1000000, level + 1);
|
|
1036
|
-
}
|
|
1037
|
-
else if (num < 1000000000000) {
|
|
1038
|
-
result +=
|
|
1039
|
-
WordifyFa(Math.floor(num / 1000000000), level) +
|
|
1040
|
-
' میلیارد' +
|
|
1041
|
-
WordifyFa(num % 1000000000, level + 1);
|
|
1042
|
-
}
|
|
1043
|
-
else if (num < 1000000000000000) {
|
|
1044
|
-
result +=
|
|
1045
|
-
WordifyFa(Math.floor(num / 1000000000000), level) +
|
|
1046
|
-
' تریلیارد' +
|
|
1047
|
-
WordifyFa(num % 1000000000000, level + 1);
|
|
1048
|
-
}
|
|
1049
|
-
return result;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
class CoreNumberComponent {
|
|
1053
|
-
constructor() {
|
|
1054
|
-
this.number = '';
|
|
1055
|
-
this.type = 'number';
|
|
1056
|
-
this.canSplitNumbers = false;
|
|
1057
|
-
this.canShowWordInToolTip = false;
|
|
1058
|
-
this.canShowIRR = false;
|
|
1059
|
-
}
|
|
1060
|
-
wordifyFa(number) {
|
|
1061
|
-
if (number === undefined) {
|
|
1062
|
-
return '';
|
|
1063
|
-
}
|
|
1064
|
-
if (this.type === 'number') {
|
|
1065
|
-
if (this.canSplitNumbers) {
|
|
1066
|
-
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
1067
|
-
}
|
|
1068
|
-
else {
|
|
1069
|
-
return number;
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
else {
|
|
1073
|
-
const newNumber = Number(number.toString().replaceAll(',', ''));
|
|
1074
|
-
if (newNumber > 10) {
|
|
1075
|
-
return WordifyFa(newNumber / 10) + ' تومان ';
|
|
1076
|
-
}
|
|
1077
|
-
else {
|
|
1078
|
-
return WordifyFa(number);
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
toolTipText(number) {
|
|
1083
|
-
if (this.number === undefined)
|
|
1084
|
-
return '';
|
|
1085
|
-
if (!this.canShowWordInToolTip)
|
|
1086
|
-
return '';
|
|
1087
|
-
if (number && +number > 10) {
|
|
1088
|
-
return WordifyFa(+number / 10) + ' تومان ';
|
|
1089
|
-
}
|
|
1090
|
-
else {
|
|
1091
|
-
return WordifyFa(number);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CoreNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1095
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CoreNumberComponent, selector: "app-core-number", inputs: { number: "number", type: "type", canSplitNumbers: "canSplitNumbers", canShowWordInToolTip: "canShowWordInToolTip", canShowIRR: "canShowIRR" }, ngImport: i0, template: "<span [title]=\"toolTipText(number)\"\r\n >{{ wordifyFa(number) | persianDigits }} {{ canShowIRR ? \"\u0631\u06CC\u0627\u0644\" : \"\" }}\r\n</span>\r\n", styles: [""], dependencies: [{ kind: "pipe", type: PersianDigitsPipe, name: "persianDigits" }] }); }
|
|
1301
|
+
class CaretUpIconComponent {
|
|
1302
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CaretUpIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1303
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CaretUpIconComponent, selector: "app-caret-up-icon", ngImport: i0, template: "<svg\r\n class=\"svg-inline--fa fa-caret-up fa-w-10 me-1\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-prefix=\"fas\"\r\n data-icon=\"caret-up\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 320 512\"\r\n data-fa-i2svg=\"\"\r\n>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z\"\r\n ></path>\r\n</svg>\r\n", styles: [""] }); }
|
|
1096
1304
|
}
|
|
1097
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
1305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CaretUpIconComponent, decorators: [{
|
|
1098
1306
|
type: Component,
|
|
1099
|
-
args: [{ selector: 'app-
|
|
1100
|
-
}]
|
|
1101
|
-
type: Input
|
|
1102
|
-
}], type: [{
|
|
1103
|
-
type: Input
|
|
1104
|
-
}], canSplitNumbers: [{
|
|
1105
|
-
type: Input
|
|
1106
|
-
}], canShowWordInToolTip: [{
|
|
1107
|
-
type: Input
|
|
1108
|
-
}], canShowIRR: [{
|
|
1109
|
-
type: Input
|
|
1110
|
-
}] } });
|
|
1307
|
+
args: [{ selector: 'app-caret-up-icon', template: "<svg\r\n class=\"svg-inline--fa fa-caret-up fa-w-10 me-1\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-prefix=\"fas\"\r\n data-icon=\"caret-up\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 320 512\"\r\n data-fa-i2svg=\"\"\r\n>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z\"\r\n ></path>\r\n</svg>\r\n" }]
|
|
1308
|
+
}] });
|
|
1111
1309
|
|
|
1112
1310
|
class TableDetailViewerManagerDirective {
|
|
1113
1311
|
constructor(el, niraModalService, viewContainerRef, componentFactoryResolver) {
|
|
@@ -1127,7 +1325,7 @@ class TableDetailViewerManagerDirective {
|
|
|
1127
1325
|
this.el.nativeElement.style.borderRadius = '18px';
|
|
1128
1326
|
this.el.nativeElement.style.padding = '2px 8px ';
|
|
1129
1327
|
this.el.nativeElement.classList.add('detailViewer');
|
|
1130
|
-
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(CaretUpIconComponent
|
|
1328
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(CaretUpIconComponent);
|
|
1131
1329
|
const componentRef = this.viewContainerRef.createComponent(componentFactory);
|
|
1132
1330
|
const host = this.el.nativeElement;
|
|
1133
1331
|
host.insertBefore(componentRef.location.nativeElement, host.firstChild);
|
|
@@ -1286,7 +1484,7 @@ class DetailViewerManagerDirective {
|
|
|
1286
1484
|
this.el.nativeElement.style.borderRadius = '18px';
|
|
1287
1485
|
this.el.nativeElement.style.padding = '2px 8px ';
|
|
1288
1486
|
this.el.nativeElement.classList.add('detailViewer');
|
|
1289
|
-
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(CaretUpIconComponent
|
|
1487
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(CaretUpIconComponent);
|
|
1290
1488
|
const componentRef = this.viewContainerRef.createComponent(componentFactory);
|
|
1291
1489
|
const host = this.el.nativeElement;
|
|
1292
1490
|
host.insertBefore(componentRef.location.nativeElement, host.firstChild);
|
|
@@ -2154,15 +2352,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2154
2352
|
type: Input
|
|
2155
2353
|
}] } });
|
|
2156
2354
|
|
|
2157
|
-
class CaretUpIconComponent {
|
|
2158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CaretUpIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2159
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CaretUpIconComponent, selector: "app-caret-up-icon", ngImport: i0, template: "<svg\r\n class=\"svg-inline--fa fa-caret-up fa-w-10 me-1\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-prefix=\"fas\"\r\n data-icon=\"caret-up\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 320 512\"\r\n data-fa-i2svg=\"\"\r\n>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z\"\r\n ></path>\r\n</svg>\r\n", styles: [""] }); }
|
|
2160
|
-
}
|
|
2161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CaretUpIconComponent, decorators: [{
|
|
2162
|
-
type: Component,
|
|
2163
|
-
args: [{ selector: 'app-caret-up-icon', template: "<svg\r\n class=\"svg-inline--fa fa-caret-up fa-w-10 me-1\"\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-prefix=\"fas\"\r\n data-icon=\"caret-up\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 320 512\"\r\n data-fa-i2svg=\"\"\r\n>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z\"\r\n ></path>\r\n</svg>\r\n" }]
|
|
2164
|
-
}] });
|
|
2165
|
-
|
|
2166
2355
|
class FormControlPipe {
|
|
2167
2356
|
transform(value) {
|
|
2168
2357
|
return value;
|