@rangertechnologies/ngnxt 2.1.313-beta.1 → 2.1.313-beta.2
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/fesm2022/rangertechnologies-ngnxt.mjs +60 -32
- package/fesm2022/rangertechnologies-ngnxt.mjs.map +1 -1
- package/lib/pipe/NxtDate.pipe.d.ts +2 -1
- package/lib/services/pdf-designer/pdf-designer.service.d.ts +0 -1
- package/package.json +1 -1
- package/rangertechnologies-ngnxt-2.1.313-beta.2.tgz +0 -0
- package/rangertechnologies-ngnxt-2.1.313-beta.1.tgz +0 -0
|
@@ -9,7 +9,6 @@ import Quill from 'quill';
|
|
|
9
9
|
import { Mention } from 'quill-mention';
|
|
10
10
|
import ImageResizor from 'quill-image-resizor';
|
|
11
11
|
import moment from 'moment-hijri';
|
|
12
|
-
import 'moment/min/moment-with-locales';
|
|
13
12
|
import * as i1 from '@ng-bootstrap/ng-bootstrap';
|
|
14
13
|
import { NgbDatepickerI18n, NgbDatepickerModule, NgbCalendar, NgbCalendarIslamicUmalqura } from '@ng-bootstrap/ng-bootstrap';
|
|
15
14
|
import * as i1$1 from '@angular/common/http';
|
|
@@ -67,20 +66,26 @@ class ErrorWrapper {
|
|
|
67
66
|
errorDetails;
|
|
68
67
|
}
|
|
69
68
|
|
|
69
|
+
// import 'moment/locale/ar-sa';
|
|
70
|
+
// import 'moment/locale/en-gb';
|
|
70
71
|
class NxtDatePipe {
|
|
71
72
|
transform(value, typeOrFormat, languageCode = 'en', dateFormatType = 'gregorian') {
|
|
72
73
|
if (!value)
|
|
73
74
|
return '';
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const date = dateFormatType === 'hijri'
|
|
77
|
-
? moment(value, 'YYYY-MM-DDTHH:mm', true)
|
|
78
|
-
: moment(value);
|
|
79
|
-
if (!date.isValid())
|
|
75
|
+
const isDate = moment(value);
|
|
76
|
+
if (!isDate.isValid()) {
|
|
80
77
|
return '';
|
|
78
|
+
}
|
|
79
|
+
const locale = languageCode === 'ar' ? 'ar-SA' : 'en';
|
|
80
|
+
// SKS29OCT25 Parse input date depending on Hijri or Gregorian
|
|
81
|
+
const date = dateFormatType === 'hijri'
|
|
82
|
+
? moment(value, 'YYYY-MM-DDTHH:mm').locale(locale)
|
|
83
|
+
: moment(value).locale(locale);
|
|
84
|
+
// SKS29OCT25 Detect if first arg is a type or a format
|
|
81
85
|
const isKnownType = ['date', 'datetime', 'month', 'time'].includes(typeOrFormat || '');
|
|
82
86
|
const type = isKnownType ? typeOrFormat : undefined;
|
|
83
87
|
const formatArg = !isKnownType ? typeOrFormat : undefined;
|
|
88
|
+
// SKS29OCT25 Step 1: Default format based on type
|
|
84
89
|
let format = '';
|
|
85
90
|
switch (type) {
|
|
86
91
|
case 'date':
|
|
@@ -96,33 +101,50 @@ class NxtDatePipe {
|
|
|
96
101
|
format = 'HH:mm';
|
|
97
102
|
break;
|
|
98
103
|
default:
|
|
104
|
+
// SKS29OCT25 Step 2: Angular-like or custom format
|
|
99
105
|
format = this.mapAngularFormat(formatArg || 'medium', dateFormatType);
|
|
100
106
|
}
|
|
101
107
|
let output = date.format(format);
|
|
108
|
+
// SKS14AUG25 Convert to Arabic numerals if needed
|
|
102
109
|
if (languageCode === 'ar') {
|
|
103
110
|
output = this.toArabicNumbers(output);
|
|
104
111
|
}
|
|
105
112
|
return output;
|
|
106
113
|
}
|
|
114
|
+
/** SKS29OCT25 Map Angular-style date aliases to Moment formats */
|
|
107
115
|
mapAngularFormat(format, dateFormatType) {
|
|
108
116
|
const isHijri = dateFormatType === 'hijri';
|
|
109
117
|
switch (format) {
|
|
110
|
-
case 'short':
|
|
111
|
-
|
|
112
|
-
case '
|
|
113
|
-
|
|
114
|
-
case '
|
|
115
|
-
|
|
116
|
-
case '
|
|
117
|
-
|
|
118
|
-
case '
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
case 'short':
|
|
119
|
+
return isHijri ? 'iDD/iMM/iYYYY HH:mm' : 'DD/MM/YYYY HH:mm';
|
|
120
|
+
case 'medium':
|
|
121
|
+
return isHijri ? 'iMMM iDD, iYYYY, hh:mm:ss A' : 'MMM DD, YYYY, hh:mm:ss A';
|
|
122
|
+
case 'long':
|
|
123
|
+
return isHijri ? 'iMMMM iDD, iYYYY, hh:mm:ss A' : 'MMMM DD, YYYY, hh:mm:ss A';
|
|
124
|
+
case 'full':
|
|
125
|
+
return isHijri ? 'dddd, iMMMM iDD, iYYYY, hh:mm:ss A' : 'dddd, MMMM DD, YYYY, hh:mm:ss A';
|
|
126
|
+
case 'shortDate':
|
|
127
|
+
return isHijri ? 'iDD/iMM/iYYYY' : 'DD/MM/YYYY';
|
|
128
|
+
case 'mediumDate':
|
|
129
|
+
return isHijri ? 'iMMM iDD, iYYYY' : 'MMM DD, YYYY';
|
|
130
|
+
case 'longDate':
|
|
131
|
+
return isHijri ? 'iMMMM iDD, iYYYY' : 'MMMM DD, YYYY';
|
|
132
|
+
case 'fullDate':
|
|
133
|
+
return isHijri ? 'dddd, iMMMM iDD, iYYYY' : 'dddd, MMMM DD, YYYY';
|
|
134
|
+
case 'shortTime':
|
|
135
|
+
return 'hh:mm A';
|
|
136
|
+
case 'mediumTime':
|
|
137
|
+
return 'hh:mm:ss A';
|
|
138
|
+
case 'mm:ss':
|
|
139
|
+
return 'mm:ss';
|
|
140
|
+
default:
|
|
141
|
+
return format; // Custom Moment-style format
|
|
121
142
|
}
|
|
122
143
|
}
|
|
144
|
+
/** SKS29OCT25 Convert digits to Arabic numerals */
|
|
123
145
|
toArabicNumbers(input) {
|
|
124
|
-
const
|
|
125
|
-
return input.replace(/\d/g, d =>
|
|
146
|
+
const easternArabicNumerals = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
|
|
147
|
+
return input.replace(/\d/g, d => easternArabicNumerals[+d]);
|
|
126
148
|
}
|
|
127
149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NxtDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
128
150
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NxtDatePipe, isStandalone: true, name: "NxtDate" });
|
|
@@ -58429,7 +58451,7 @@ const VERSION = {
|
|
|
58429
58451
|
"semver": null,
|
|
58430
58452
|
"suffix": "68a4eb8b-dirty",
|
|
58431
58453
|
"semverString": null,
|
|
58432
|
-
"version": "2.1.313-beta.
|
|
58454
|
+
"version": "2.1.313-beta.2"
|
|
58433
58455
|
};
|
|
58434
58456
|
/* tslint:enable */
|
|
58435
58457
|
|
|
@@ -58720,7 +58742,7 @@ class PdfDesignerService {
|
|
|
58720
58742
|
}
|
|
58721
58743
|
}
|
|
58722
58744
|
intializeBook(pdf) {
|
|
58723
|
-
// - Get the unique id in the pdf
|
|
58745
|
+
// - Get the unique id in the pdf
|
|
58724
58746
|
this.unique_id = Object.keys(pdf)[0];
|
|
58725
58747
|
let tempbook = pdf[this.unique_id];
|
|
58726
58748
|
// SKS28MAR25 update nested pdf QuestionsMap
|
|
@@ -58760,7 +58782,7 @@ class PdfDesignerService {
|
|
|
58760
58782
|
'title': 'Untitled',
|
|
58761
58783
|
};
|
|
58762
58784
|
}
|
|
58763
|
-
// AP 26FEB25 - clear the form elements
|
|
58785
|
+
// AP 26FEB25 - clear the form elements
|
|
58764
58786
|
clearElements() {
|
|
58765
58787
|
this.pdfElements = [];
|
|
58766
58788
|
this.pdfElementsSubject.next([...this.pdfElements]);
|
|
@@ -59323,20 +59345,22 @@ class PdfDesignerService {
|
|
|
59323
59345
|
this.selectedElementSubject.next({ index: eleIndex });
|
|
59324
59346
|
}
|
|
59325
59347
|
}
|
|
59326
|
-
// SKS12SEP25 date translate function
|
|
59348
|
+
// SKS12SEP25 date translate function
|
|
59327
59349
|
dateTransform(value, type, languageCode, dateFormatType) {
|
|
59328
59350
|
if (!value)
|
|
59329
59351
|
return '';
|
|
59352
|
+
// SKS14AUG25 Case 1: Time only → just convert numbers if Arabic
|
|
59330
59353
|
if (type === 'time') {
|
|
59331
59354
|
return languageCode === 'ar' ? this.toArabicNumbers(value) : value;
|
|
59332
59355
|
}
|
|
59333
|
-
|
|
59334
|
-
|
|
59335
|
-
|
|
59336
|
-
|
|
59337
|
-
|
|
59338
|
-
|
|
59339
|
-
|
|
59356
|
+
// SKS14AUG25 Case 2: Other date types → parse and format
|
|
59357
|
+
let date;
|
|
59358
|
+
if (dateFormatType === 'hijri') {
|
|
59359
|
+
date = moment(value, 'YYYY-MM-DDTHH:mm').locale(languageCode === 'ar' ? 'ar-SA' : 'en');
|
|
59360
|
+
}
|
|
59361
|
+
else {
|
|
59362
|
+
date = moment(value).locale(languageCode === 'ar' ? 'ar-SA' : 'en');
|
|
59363
|
+
}
|
|
59340
59364
|
let format = '';
|
|
59341
59365
|
switch (type) {
|
|
59342
59366
|
case 'date':
|
|
@@ -59350,7 +59374,11 @@ class PdfDesignerService {
|
|
|
59350
59374
|
break;
|
|
59351
59375
|
}
|
|
59352
59376
|
let output = date.format(format);
|
|
59353
|
-
|
|
59377
|
+
// SKS14AUG25 Convert to Arabic numerals if needed
|
|
59378
|
+
if (languageCode === 'ar') {
|
|
59379
|
+
output = this.toArabicNumbers(output);
|
|
59380
|
+
}
|
|
59381
|
+
return output;
|
|
59354
59382
|
}
|
|
59355
59383
|
toArabicNumbers(input) {
|
|
59356
59384
|
const easternArabicNumerals = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
|